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 c5d0f279..687894ca 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 @@ -1169,10 +1169,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { saleorderRequestChildrenDto.setVdef7("0"); } saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto); - + //判断是否增加邮费这个存货,accumulatedPostage BigDecimal accumulatedPostage = checkPostageFee(oldValue); - if (accumulatedPostage.compareTo(BigDecimal.ZERO) > 0) { + if (accumulatedPostage.compareTo(BigDecimal.ZERO) != 0) { //获取「平台运维」对应的税率 // String tax2 = new BigDecimal(bdTaxitemsEntity.getTaxratio()).divide(new BigDecimal(100), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); // BigDecimal noriginalcurprice2 = null;//无税单价 @@ -1237,7 +1237,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //平台优惠 if (sonDetailsDto.getVdef4() != null && !"".equals(sonDetailsDto.getVdef4())) { BigDecimal bigDecimalVdef4 = new BigDecimal(sonDetailsDto.getVdef4()); - if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01"); //存货管理档案 @@ -1251,7 +1251,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //达人优惠 if (sonDetailsDto.getVdef6() != null && !"".equals(sonDetailsDto.getVdef6())) { BigDecimal bigDecimalVdef6 = new BigDecimal(sonDetailsDto.getVdef6()); - if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02"); //存货管理档案 @@ -1265,7 +1265,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //支付优惠 if (sonDetailsDto.getVdef5() != null && !"".equals(sonDetailsDto.getVdef5())) { BigDecimal bigDecimalVdef5 = new BigDecimal(sonDetailsDto.getVdef5()); - if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04"); //存货管理档案 @@ -2361,7 +2361,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //判断是否增加邮费这个存货,accumulatedPostage BigDecimal accumulatedPostage = checkPostageFee(oldValue); - if (accumulatedPostage.compareTo(BigDecimal.ZERO) > 0) { + if (accumulatedPostage.compareTo(BigDecimal.ZERO) != 0) { //获取「平台运费」对应的税率 // String tax2 = "0." + new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString(); // BigDecimal noriginalcurprice2 = null;//无税单价 @@ -2428,7 +2428,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //平台优惠 if (sonDetailsDto.getVdef4() != null && !"".equals(sonDetailsDto.getVdef4())) { BigDecimal bigDecimalVdef4 = new BigDecimal(sonDetailsDto.getVdef4()); - if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01"); //存货管理档案 @@ -2444,7 +2444,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //达人优惠 if (sonDetailsDto.getVdef6() != null && !"".equals(sonDetailsDto.getVdef6())) { BigDecimal bigDecimalVdef6 = new BigDecimal(sonDetailsDto.getVdef6()); - if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02"); //存货管理档案 @@ -2460,7 +2460,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //支付优惠 if (sonDetailsDto.getVdef5() != null && !"".equals(sonDetailsDto.getVdef5())) { BigDecimal bigDecimalVdef5 = new BigDecimal(sonDetailsDto.getVdef5()); - if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04"); //存货管理档案 @@ -2705,7 +2705,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //平台优惠 if (sonDetailsDto.getVdef4() != null && !"".equals(sonDetailsDto.getVdef4())) { BigDecimal bigDecimalVdef4 = new BigDecimal(sonDetailsDto.getVdef4()); - if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01"); //存货管理档案 @@ -2719,7 +2719,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //达人优惠 if (sonDetailsDto.getVdef6() != null && !"".equals(sonDetailsDto.getVdef6())) { BigDecimal bigDecimalVdef6 = new BigDecimal(sonDetailsDto.getVdef6()); - if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02"); //存货管理档案 @@ -2733,7 +2733,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //支付优惠 if (sonDetailsDto.getVdef5() != null && !"".equals(sonDetailsDto.getVdef5())) { BigDecimal bigDecimalVdef5 = new BigDecimal(sonDetailsDto.getVdef5()); - if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) > 0) { + if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) != 0) { //发货运费-存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04"); //存货管理档案 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/QueryAdditionUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/QueryAdditionUtil.java index 42ee0911..b1df9175 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/QueryAdditionUtil.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/QueryAdditionUtil.java @@ -140,7 +140,9 @@ public class QueryAdditionUtil { saleorderRequestChildrenDto1.setCinventorycode(bdInvbasdocEntity1.getInvcode()); //价税合计 - saleorderRequestChildrenDto1.setNoriginalcursummny(noriginalcursummny.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString()); + BigDecimal noriginalcursummnyRounding2 = noriginalcursummny.setScale(2, BigDecimal.ROUND_HALF_UP); + String noriginalcursummnyStr = noriginalcursummnyRounding2.stripTrailingZeros().toPlainString(); + saleorderRequestChildrenDto1.setNoriginalcursummny(noriginalcursummnyStr); //数量 saleorderRequestChildrenDto1.setNnumber(nnumber); @@ -157,7 +159,11 @@ public class QueryAdditionUtil { //是否赠品 saleorderRequestChildrenDto1.setBlargessflag(false); - saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto1); + //2025年2月17日 10:37:37 如果四舍五入保留2位后,如果为0,则不推送U8C,处理0.0033保留2位为0的问题 + //和李佳妮、还有丽知-山海沟通确定的 + if (noriginalcursummnyRounding2.compareTo(BigDecimal.ZERO) != 0) { + saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto1); + } } } } 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 4bd49ce4..30b99f41 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 @@ -107,8 +107,8 @@ class SoSaleOutPluginInitializerToCTest { // ofsStandardUtil.getOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoArrayList, 1L); // System.out.println(headerDetailsDtoArrayList.get(0).getHeader().getDepartmentType()); -// String s = "LETS-SH2024101700000270"; -// soSaleOutPluginInitializerToC.startImplementStockByCode(s, "stock"); + String s = "LETS-SH2024101000026031"; + soSaleOutPluginInitializerToC.startImplementStockByCode(s, "tran"); try { // soSaleOutPluginInitializerToC.startImplementStockByTime("2024-10-18 00:00:00", "2024-10-18 23:59:59"); @@ -146,29 +146,29 @@ class SoSaleOutPluginInitializerToCTest { e.printStackTrace(); } - Thread thread = new Thread(new Runnable() { - @Override - public void run() { - Thread currentThread = Thread.currentThread(); - try { - while (true) { - Thread.currentThread().sleep(1000); - - long start = System.currentTimeMillis(); - currentThread.setName("线程名称:" + UUID.fastUUID()); - long end = System.currentTimeMillis(); - System.out.println("耗时:" + (end - start)); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - }, "线程1"); - thread.start(); - - while (true) { - Thread.currentThread().sleep(1000); - System.out.println(thread.getName()); - } +// Thread thread = new Thread(new Runnable() { +// @Override +// public void run() { +// Thread currentThread = Thread.currentThread(); +// try { +// while (true) { +// Thread.currentThread().sleep(1000); +// +// long start = System.currentTimeMillis(); +// currentThread.setName("线程名称:" + UUID.fastUUID()); +// long end = System.currentTimeMillis(); +// System.out.println("耗时:" + (end - start)); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// }, "线程1"); +// thread.start(); +// +// while (true) { +// Thread.currentThread().sleep(1000); +// System.out.println(thread.getName()); +// } } } \ No newline at end of file