diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index f1ac8ffe..e6362783 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -426,8 +426,7 @@ public class HighOrderController { highOrder.setMerchId(request.getHeader("mchId")); highOrder.setTotalPrice(totalPrice); - highOrder.setPayPrice(totalActualPrice.subtract(integralDeductionPrice)); - highOrder.setDeductionPrice(highOrder.getTotalPrice().subtract(totalActualPrice)); + // 是否使用了优惠券 if (highDiscountUserRel != null) { @@ -464,7 +463,7 @@ public class HighOrderController { highOrder.setDeductionPrice(highDiscountUserRel.getHighDiscount().getDiscountPrice()); // 如果总额小于0 - if (payPrice.compareTo(new BigDecimal("0")) == -1) { + if (payPrice.compareTo(new BigDecimal("0")) < 0) { highOrder.setPayPrice(new BigDecimal("0")); } else { highOrder.setPayPrice(payPrice); @@ -496,6 +495,10 @@ public class HighOrderController { } } + if (highOrder.getPayPrice() == null) { + highOrder.setPayPrice(totalActualPrice); + } + highOrder.setOrderNo("HF" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5)); highOrder.setMemId(userInfoModel.getHighUser().getId()); highOrder.setMemName(userInfoModel.getHighUser().getName()); @@ -504,6 +507,8 @@ public class HighOrderController { highOrder.setOrderStatus(1); highOrder.setPrintStatus(false); highOrder.setPrintNum(0); + highOrder.setPayPrice(highOrder.getPayPrice().subtract(integralDeductionPrice)); + highOrder.setDeductionPrice(highOrder.getTotalPrice().subtract(highOrder.getPayPrice())); highOrderService.insertOrder(highOrder); diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java index 693bc632..898fa70f 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java @@ -212,8 +212,8 @@ public class HuiLianTongConfig { mapPost.put("couNo" , dataObject.getString("couNo")); mapPost.put("status" , "20"); mapPost.put("couTypeCode" , dataObject.getString("couTypeCode")); - mapPost.put("validStartDate" , dataObject.getDate("validStartDate")); - mapPost.put("validEndDate" , dataObject.getDate("validEndDate")); + mapPost.put("validStartDate" , dataObject.getString("validStartDate")); + mapPost.put("validEndDate" , dataObject.getString("validEndDate")); JSONObject o = HuiLianTongUnionCardConfig.syncPayOrder(mapPost); System.out.println("订单同步请求参数---------" + mapPost); System.out.println("订单同步请求结果---------" + o);