diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java index 67707609..85e1b559 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java @@ -370,6 +370,32 @@ public class UnionPayController { if (highChildOrder.getGoodsType() == 4 || highChildOrder.getGoodsType() == 9) { highChildOrder.setChildOrdeStatus(2); } + if (highChildOrder.getGoodsType() == 7) { + highChildOrder.setChildOrdeStatus(2); + HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderId(highChildOrder.getId()); + if (actual != null) { + List discountList = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(actual.getId()); + for (HighDiscountPackageDiscountActual discount : discountList) { + highDiscountUserRelService.receiveDiscount(order.getMemId(), discount.getAgentDiscountCodeId()); + } + HighDiscountPackage discountPackage = discountPackageService.findDiscountPackageById(actual.getDiscountPackageId()); + HighDiscountPackageRecord record = new HighDiscountPackageRecord(); + record.setDiscountPackageId(discountPackage.getId()); + record.setDiscountPackageTitle(discountPackage.getTitle()); + record.setUsingAttribution(discountPackage.getUsingAttribution()); + record.setCompanyId(discountPackage.getCompanyId()); + record.setOrderId(order.getId().intValue()); + record.setChildOrderId(highChildOrder.getId().intValue()); + record.setRecordNo(System.currentTimeMillis()+""); + record.setSalesType(1); + record.setPrice(order.getPayPrice()); + record.setUserId(order.getMemId().intValue()); + discountPackageRecordService.insertRecord(record); + actual.setAllocationTime(new Date()); + actual.setStatus(3); // 状态: 1: 待分配 2:预分配(售卖)3:已分配 + discountPackageActualService.updateHighDiscountPackageActual(actual); + } + } } HighGasOrderPush orderPush = new HighGasOrderPush();