diff --git a/order/src/main/resources/prod/logback.xml b/order/src/main/resources/prod/logback.xml index 7fbb9df..6fbcb1a 100644 --- a/order/src/main/resources/prod/logback.xml +++ b/order/src/main/resources/prod/logback.xml @@ -183,7 +183,7 @@ - log/petroLog.log + log/PcytCNPCCouponLog.log log/PcytCNPC/PcytCNPCCouponLog.log.%d.%i diff --git a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java index 7bf0ce0..ccdcac4 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java @@ -78,6 +78,10 @@ public class OrderCreateService { if (goodsSpecs == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商品规格"); } + JSONObject businessObj = orderChild.getBusiness()==null? new JSONObject(): new JSONObject((Map) orderChild.getBusiness()); + if (businessObj.getLong("shopCartId") != null) { + shoppingCartService.delete(businessObj.getLong("shopCartId")); + } orderChild.setMerId(goodsMsg.getMerId()); orderChild.setProductName(goodsMsg.getTitle()); orderChild.setProductImg(goodsMsg.getListImg()); @@ -112,7 +116,7 @@ public class OrderCreateService { orderCoupon.setStatus(OrderChildStatusEnum.status1.getCode()); orderCouponService.editData(orderCoupon); - for (int i = 0; i <= orderCoupon.getGoodsCount(); i++) { + for (int i = 0; i < orderCoupon.getGoodsCount(); i++) { // 卡券订单卡密 BsOrderCouponNo orderCouponNo = new BsOrderCouponNo(); orderCouponNo.setCouponOrderId(orderCoupon.getId()); diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 207e548..e0ec7fa 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -217,12 +217,12 @@ public class BsOrderServiceImpl implements BsOrderService { childOrder.setSurplusRefundIntegral(0L); } - childOrder.setCouponDiscountPrice(childOrder.getProductPrice().subtract(childOrder.getSurplusRefundPrice())); + childOrder.setCouponDiscountPrice(childOrder.getProductTotalPrice().subtract(childOrder.getSurplusRefundPrice())); childOrder.setIntegralDiscountPrice(childOrder.getSurplusRefundIntegral()); childOrder.setTotalDeductionPrice( childOrder.getCouponDiscountPrice().add(new BigDecimal(childOrder.getIntegralDiscountPrice().toString()).multiply(new BigDecimal("100"))) ); - childOrder.setProductActualPrice(childOrder.getProductPrice().subtract(childOrder.getTotalDeductionPrice())); + childOrder.setProductActualPrice(childOrder.getProductTotalPrice().subtract(childOrder.getTotalDeductionPrice())); orderChildService.editData(childOrder); }