From 08b74914be97172aff7560717ae1b7add280b2f5 Mon Sep 17 00:00:00 2001 From: liuy <37787198+LiuyCodes@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:27:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(sales):=20=E4=BF=AE=E5=A4=8D=20ToC=20?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93=E5=8D=95=E5=AE=9E=E4=BB=98?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加测试用的 TODO 注释 - 修正应收金额的计算逻辑 - 更新错误提示信息 - 调整优惠金额的赋值逻辑- 更新测试用例中的订单编号 --- .../sales/SoSaleOutPluginInitializerToC.java | 17 +++++++++++------ .../SoSaleOutPluginInitializerToCTest.java | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java index cebdb7e6..e92832e4 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java @@ -1094,6 +1094,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { List saleorderRequestDtoList = new ArrayList<>(); saleorderRequestDtoList.add(saleorderRequestDto); + //TODO 测试 + if (true) { + continue; + } + Map> stringStringMap = new HashMap<>(); stringStringMap.put("saleorder", saleorderRequestDtoList); SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap)); @@ -1701,9 +1706,9 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { BigDecimal totalPayAmountBigDecimal = new BigDecimal(totalPayAmount); totalPayAmount = totalPayAmountBigDecimal.multiply(new BigDecimal(sonDetailsDto.getShipQty())).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); } - Assert.notNull(totalPayAmount, "实发数量不能为空 销售出库单编码:{} 出库单明细主键:{}", header.getCode(), sonDetailsDto.getId()); + Assert.notNull(totalPayAmount, "应收金额不能为空(应收金额=实付金额+达人优惠+支付优惠+平台优惠) 销售出库单编码:{} 出库单明细主键:{}", header.getCode(), sonDetailsDto.getId()); Assert.notNull(sonDetailsDto.getShipQty(), "实发数量不能为空 销售出库单编码:{} 出库单明细主键:{}", header.getCode(), sonDetailsDto.getId()); - BigDecimal totalPayAmountBigDecimal = new BigDecimal(sonDetailsDto.getTotalPayAmount()); + BigDecimal totalPayAmountBigDecimal = new BigDecimal(totalPayAmount); BigDecimal shipQtyBigDecimal = new BigDecimal(sonDetailsDto.getShipQty()); groupTotalPayAmount = groupTotalPayAmount.add(totalPayAmountBigDecimal); @@ -3409,10 +3414,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { } } - sonDetailsDtoList.get(0).setVdef4(platformDiscountsBigDecimal.stripTrailingZeros().toPlainString()); - sonDetailsDtoList.get(0).setVdef5(payDiscountsBigDecimal.stripTrailingZeros().toPlainString()); - sonDetailsDtoList.get(0).setVdef6(expertDiscountsBigDecimal.stripTrailingZeros().toPlainString()); - sonDetailsDtoList.get(0).setVdef7(merchantDiscountsBigDecimal.stripTrailingZeros().toPlainString()); + sonDetailsDtoList.get(0).setVdef4(platformDiscountsBigDecimal.stripTrailingZeros().toPlainString());//平台 + sonDetailsDtoList.get(0).setVdef5(payDiscountsBigDecimal.stripTrailingZeros().toPlainString());//支付 + sonDetailsDtoList.get(0).setVdef6(expertDiscountsBigDecimal.stripTrailingZeros().toPlainString());//达人 + sonDetailsDtoList.get(0).setVdef7(merchantDiscountsBigDecimal.stripTrailingZeros().toPlainString());//商家 } } } \ No newline at end of file diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java index 46f8992b..3f69cb0b 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java @@ -121,7 +121,7 @@ class SoSaleOutPluginInitializerToCTest { try { // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024091900002878", "stock"); - soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110500013375", "stock"); + soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024102600009446", "stock"); } catch (Exception e) { e.printStackTrace(); }