diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponOrderReservationController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponOrderReservationController.java index b12ad693b..959fd62e6 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponOrderReservationController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponOrderReservationController.java @@ -61,15 +61,20 @@ public class WxCouponOrderReservationController extends BaseController { if(reservation.getId() == null || reservation.getStatus() == null) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } + WxCouponOrderReservation sortReservation = wxCouponOrderReservationService.getSortByCouponOrder(reservation.getId(), getTenantInfo().getTenantId()); + if(sortReservation == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"id is error"); + } if(EnumCouponOrderReservationStatus.reservation_dispatch.getCode().equals(reservation.getStatus())){ - WxCouponOrderReservation sortReservation = wxCouponOrderReservationService.getSortByCouponOrder(reservation.getId(), getTenantInfo().getTenantId()); - if(sortReservation == null){ - return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"id is error"); - } if(!EnumCouponOrderReservationStatus.reservation.getCode().equals(sortReservation.getStatus())){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"预约单状态不支持派单"); } } + if(EnumCouponOrderReservationStatus.reservation.getCode().equals(reservation.getStatus())){ + if(!EnumCouponOrderReservationStatus.reservation_dispatch.getCode().equals(sortReservation.getStatus())){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"预约单状态不支持取消"); + } + } WxCouponOrderReservation updReservation = new WxCouponOrderReservation(); updReservation.updateTenantInfo(getTenantInfo()); diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderReservationController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderReservationController.java index bb7c56866..ab6ba9b22 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderReservationController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderReservationController.java @@ -100,7 +100,7 @@ public class WxCouponOrderReservationController extends BaseController { if(reservation.getId() == null) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } - WxCouponOrderReservation sortReservation = wxCouponOrderReservationService.getSortByCouponOrder(reservation.getId(), reservation.getTenantId()); + WxCouponOrderReservation sortReservation = wxCouponOrderReservationService.getSortByCouponOrder(reservation.getId(), getTenantInfo().getTenantId()); if(sortReservation == null){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"id is error"); }