|
|
|
@@ -740,6 +740,7 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
|
|
|
|
statusS.add(EnumOrderStatus.ORDER_STATUS_COOPERATING_SCHEDU_REFUND.getCode()); |
|
|
|
statusS.add(EnumOrderStatus.ORDER_STATUS_COOPERATING_COMPLETE_REFUND.getCode()); |
|
|
|
statusS.add(EnumOrderStatus.ORDER_STATUS_OVERTIME_PAID_REFUND.getCode()); |
|
|
|
|
|
|
|
orderQ.setStatusS(statusS); |
|
|
|
WxCoupon couponQ = new WxCoupon(); |
|
|
|
@@ -2021,33 +2022,44 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
logger.error("用户不存在, userId: " + updateOrder.getCUserId()); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
// 已支付,更新支付时间 |
|
|
|
WxOrder updateT = new WxOrder(); |
|
|
|
updateT.setId(updateOrder.getId()); |
|
|
|
updateT.setPaymentTime(currentDate); |
|
|
|
updateT.updateTenantInfo(updateOrder); |
|
|
|
//拼团到此处为已完成状态 |
|
|
|
if (updateOrder.getOrderGroupId().equals(0L)) { |
|
|
|
updateT.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); |
|
|
|
} else { |
|
|
|
// 拼团设为已完成状态 |
|
|
|
updateT.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_COMPLETE.getCode()); |
|
|
|
} |
|
|
|
updateT.setUpdateDate(currentDate); |
|
|
|
int ret = 0; |
|
|
|
try { |
|
|
|
ret = wxOrderMapper.updateById(updateT); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("订单更新失败:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_UPDATE_ERR); |
|
|
|
} |
|
|
|
|
|
|
|
// 创建couponOrder |
|
|
|
try { |
|
|
|
return createCouponOrder(currentDate,updateOrder, user, coupon, null,null,null,null,null,null); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("创建券包:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR); |
|
|
|
// 如果订单状态此时已经被超时取消 |
|
|
|
WxOrder order = wxOrderMapper.selectById(updateOrder.getId(), updateOrder.getTenantId()); |
|
|
|
if (order.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL.getCode()) || order.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_PRESS_OVERTIME.getCode()) |
|
|
|
|| order.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING_BREAK.getCode())) { |
|
|
|
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_OVERTIME_PAID_REFUND.getCode()); |
|
|
|
order.setUpdateDate(currentDate); |
|
|
|
wxOrderMapper.updateById(order); |
|
|
|
return null; |
|
|
|
}else { |
|
|
|
|
|
|
|
// 已支付,更新支付时间 |
|
|
|
WxOrder updateT = new WxOrder(); |
|
|
|
updateT.setId(updateOrder.getId()); |
|
|
|
updateT.setPaymentTime(currentDate); |
|
|
|
updateT.updateTenantInfo(updateOrder); |
|
|
|
//拼团到此处为已完成状态 |
|
|
|
if (updateOrder.getOrderGroupId().equals(0L)) { |
|
|
|
updateT.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); |
|
|
|
} else { |
|
|
|
// 拼团设为已完成状态 |
|
|
|
updateT.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_COMPLETE.getCode()); |
|
|
|
} |
|
|
|
updateT.setUpdateDate(currentDate); |
|
|
|
int ret = 0; |
|
|
|
try { |
|
|
|
ret = wxOrderMapper.updateById(updateT); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("订单更新失败:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_UPDATE_ERR); |
|
|
|
} |
|
|
|
|
|
|
|
// 创建couponOrder |
|
|
|
try { |
|
|
|
return createCouponOrder(currentDate,updateOrder, user, coupon, null,null,null,null,null,null); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("创建券包:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|