提交代码

master
胡锐 6 months ago committed by yuanye
parent 0647a3737d
commit 204a0d2733
  1. 2
      order/src/main/resources/prod/logback.xml
  2. 6
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  3. 4
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java

@ -183,7 +183,7 @@
<!-- 中油优途中石油卡券 -->
<appender name="PcytCNPCCouponLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/petroLog.log</File>
<File>log/PcytCNPCCouponLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/PcytCNPC/PcytCNPCCouponLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">

@ -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<String, Object>) 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());

@ -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);
}

Loading…
Cancel
Save