|
|
|
@ -74,6 +74,12 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
@Resource |
|
|
|
|
private HighDiscountAgentCodeService highDiscountAgentCodeService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighDiscountPackageService discountPackageService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighDiscountPackageRecordService discountPackageRecordService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighMerchantStoreService highMerchantStoreService; |
|
|
|
|
|
|
|
|
@ -179,6 +185,7 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
if (list == null || list.size() == 0) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); |
|
|
|
|
} |
|
|
|
|
list.get(0).setUserId(highOrder.getMemId().intValue()); |
|
|
|
|
list.get(0).setChildOrderId(childOrder.getId()); |
|
|
|
|
list.get(0).setStatus(2); // 状态: 1: 待分配 2:预分配(售卖)3:已分配
|
|
|
|
|
discountPackageActualService.updateHighDiscountPackageActual(list.get(0)); |
|
|
|
@ -339,7 +346,22 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
for (HighDiscountPackageDiscountActual discount : discountList) { |
|
|
|
|
highDiscountUserRelService.receiveDiscount(highOrder.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(highOrder.getId().intValue()); |
|
|
|
|
record.setChildOrderId(highChildOrder.getId().intValue()); |
|
|
|
|
record.setRecordNo(System.currentTimeMillis()+""); |
|
|
|
|
record.setSalesType(1); |
|
|
|
|
record.setPrice(highOrder.getPayPrice()); |
|
|
|
|
record.setUserId(highOrder.getMemId().intValue()); |
|
|
|
|
discountPackageRecordService.insertRecord(record); |
|
|
|
|
actual.setAllocationTime(new Date()); |
|
|
|
|
actual.setStatus(3); // 状态: 1: 待分配 2:预分配(售卖)3:已分配
|
|
|
|
|
discountPackageActualService.updateHighDiscountPackageActual(actual); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -617,7 +639,22 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -976,6 +1013,17 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
highCouponCodeService.updateCouponCode(couponCode); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (highChildOrder.getGoodsType() == 7) { |
|
|
|
|
HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderId(highChildOrder.getId()); |
|
|
|
|
if (actual != null) { |
|
|
|
|
actual.setChildOrderId(null); |
|
|
|
|
actual.setUserId(null); |
|
|
|
|
actual.setStatus(1); |
|
|
|
|
discountPackageActualService.updateHighDiscountPackageActual(actual); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
highChildOrder.setChildOrdeStatus(5); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|