| @@ -229,17 +229,19 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { | |||||
| public void updateGroupStatus(WxOrderGroup wxOrderGroup) { | public void updateGroupStatus(WxOrderGroup wxOrderGroup) { | ||||
| Long id = wxOrderGroup.getId(); | Long id = wxOrderGroup.getId(); | ||||
| WxOrderGroup group = wxOrderGroupMapper.selectByPrimaryKey(id); | WxOrderGroup group = wxOrderGroupMapper.selectByPrimaryKey(id); | ||||
| WxCoupon wxCoupon = wxCouponMapper.selectByPrimaryKey(wxOrderGroup.getCouponId()); | |||||
| Integer status = wxCoupon.getStatus(); | |||||
| if (status.equals(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode())) { | |||||
| group.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||||
| returnMoney(group); | |||||
| } | |||||
| // 查看是否超时 | |||||
| Date expiredDate = group.getExpiredDate(); | |||||
| if (new Date().after(expiredDate)) { | |||||
| group.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()); | |||||
| returnMoney(group); | |||||
| if (group.getStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode())) { | |||||
| WxCoupon wxCoupon = wxCouponMapper.selectByPrimaryKey(wxOrderGroup.getCouponId()); | |||||
| Integer status = wxCoupon.getStatus(); | |||||
| if (status.equals(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode())) { | |||||
| group.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||||
| returnMoney(group); | |||||
| } | |||||
| // 查看是否超时 | |||||
| Date expiredDate = group.getExpiredDate(); | |||||
| if (new Date().after(expiredDate)) { | |||||
| group.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()); | |||||
| returnMoney(group); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||