From b1733c9d397bbf091b5a96e1a2a98fb03f815a6f Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Wed, 3 Aug 2022 11:31:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=9D=E8=B4=B9=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cweb/controller/HighOrderController.java | 11 ++++++++--- .../main/java/com/hai/config/HuiLianTongConfig.java | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) 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);