| @@ -806,15 +806,18 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| OrderAdapterService orderAdapterService = orderFactory.getOrderAdapterService(record.getComposeOrder()); | |||
| WxComposeOrder composeOrder = orderAdapterService.getComposeOrder(record.getOrderId(), record.getTenantId()); | |||
| List<WxOrder> orderList = orderAdapterService.getChildOrders(composeOrder, record.getTenantId()); | |||
| proxy.handler(record,composeOrder,orderList,transactionId,null); | |||
| //组合支付的订单,循环所有子订单 | |||
| for (WxOrder o : orderList) { | |||
| proxy.handleOrderPaySingleOrderSuccess(o,record, transactionId, false); | |||
| } | |||
| boolean hasCompleted = proxy.handler(record,composeOrder,orderList,transactionId,null); | |||
| //如果未处理结束,则继续进行后续处理 | |||
| if (!hasCompleted) { | |||
| //组合支付的订单,循环所有子订单 | |||
| for (WxOrder o : orderList) { | |||
| proxy.handleOrderPaySingleOrderSuccess(o,record, transactionId, false); | |||
| } | |||
| } | |||
| } | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| public void handler(WxPayOrder record,WxComposeOrder composeOrder,List<WxOrder> composeChildOrders, String transactionId,Long cUserId) { | |||
| public boolean handler(WxPayOrder record,WxComposeOrder composeOrder,List<WxOrder> composeChildOrders, String transactionId,Long cUserId) { | |||
| Date currentDate = new Date(); | |||
| EnumPayStatus payStatus = EnumPayStatus.getEnum(record.getPayOrderStatus()); | |||
| // 判断支付状态 | |||
| @@ -832,12 +835,12 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| logger.error(e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL); | |||
| } | |||
| return ; | |||
| return true; | |||
| } | |||
| if (payStatus != EnumPayStatus.PAY_STATUS_WAIT) { | |||
| logger.info("pay success handle, payOrder " + record.getPayOrderNo() + | |||
| "is paid success , orderId : " + record.getOrderId()); | |||
| return; | |||
| return true; | |||
| } | |||
| if (null != cUserId) { | |||
| orderFactory.getOrderAdapterService(composeOrder.getComposeOrderType()).updateChildOrdersCUserId(composeOrder, composeChildOrders, cUserId); | |||
| @@ -860,6 +863,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| logger.error("支付订单数据库更新失败: " + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "支付订单数据库更新失败: " + e.getMessage()); | |||
| } | |||
| return false; | |||
| } | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| @@ -947,7 +951,11 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| OrderAdapterService orderAdapterService = orderFactory.getOrderAdapterService(record.getComposeOrder()); | |||
| WxComposeOrder composeOrder = orderAdapterService.getComposeOrder(record.getOrderId(), record.getTenantId()); | |||
| List<WxOrder> orderList = orderAdapterService.getChildOrders(composeOrder, record.getTenantId()); | |||
| proxy.handler(record, composeOrder,orderList, transcationId, basicUserId); | |||
| boolean hasCompleted = proxy.handler(record, composeOrder,orderList, transcationId, basicUserId); | |||
| //如果已经处理结束,则不再进行 | |||
| if (hasCompleted) { | |||
| return; | |||
| } | |||
| // B端收银台核销券处理, 收银台支付和券支付可能不是同一个人 | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.setOrderId(composeOrder.getMainOrderId()); | |||