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 1b9420b7..c9db9a6b 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 @@ -1160,7 +1160,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { pk_corp = soSaleResultRootDto.getParentvo().getPk_corp(); csaleid = soSaleResultRootDto.getParentvo().getCsaleid(); } - logger.info("销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp); + logger.info("TOC出库-销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp); //记录成功 //日志推送的详情,两种方法,是推送U8C成功之后记录,还是整理推送完毕后再记录? //护童项目之前是整体推送之前记录,后来抛出链接失效的异常,而且只有程序执行完毕后,才能体现结果,执行过程中无法发现结果 @@ -1272,19 +1272,19 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //查询对应的OFS销售订单 List headerDetailsDtos = queryOfsOrder(headerDetailsDtoList); findMatchingOfsOrder(headerDetailsDtos, headerDetailsDtoList); - - //TODO 测试 - for (int i = 0; i < headerDetailsDtos.size(); i++) { - com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto = headerDetailsDtos.get(i); - List details = headerDetailsDto.getDetails(); - for (int j = 0; j < details.size(); j++) { - com.hzya.frame.ttxofs.dto.ofssalesordersearch.DetailsDto detailsDto = details.get(j); - detailsDto.setPlatformDiscounts("1"); - detailsDto.setPayDiscounts("1"); - detailsDto.setExpertDiscounts("1"); - detailsDto.setMerchantDiscounts("1"); - } - } + + //测试 +// for (int i = 0; i < headerDetailsDtos.size(); i++) { +// com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto = headerDetailsDtos.get(i); +// List details = headerDetailsDto.getDetails(); +// for (int j = 0; j < details.size(); j++) { +// com.hzya.frame.ttxofs.dto.ofssalesordersearch.DetailsDto detailsDto = details.get(j); +// detailsDto.setPlatformDiscounts("1"); +// detailsDto.setPayDiscounts("1"); +// detailsDto.setExpertDiscounts("1"); +// detailsDto.setMerchantDiscounts("1"); +// } +// } //计算OFS销售订单优惠金额分摊到明细行 // ofsOrderSaleAmountAllocationUtil.batchTocSalesAmountAllocation(headerDetailsDtos); @@ -2264,7 +2264,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //补充:平台运费-存货 //accumulatedPostage应该是负数 BigDecimal absAccumulatedPostage = accumulatedPostage.abs(); - additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, absAccumulatedPostage, "-1", bdTaxitemsEntity); + BigDecimal negativeValue = absAccumulatedPostage.negate(); + additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, "-1", bdTaxitemsEntity); } //平台优惠 if (sonDetailsDto.getVdef4() != null && !"".equals(sonDetailsDto.getVdef4())) { @@ -2278,7 +2279,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY01"); //补充:平台优惠-存货 BigDecimal absBigDecimalVdef4 = bigDecimalVdef4.abs(); - additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, absBigDecimalVdef4, "-1", bdTaxitemsEntity); + BigDecimal negativeValue = absBigDecimalVdef4.negate(); + additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, "-1", bdTaxitemsEntity); } } //达人优惠 @@ -2293,7 +2295,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY02"); //补充:达人优惠-存货 BigDecimal absBigDecimalVdef6 = bigDecimalVdef6.abs(); - additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, absBigDecimalVdef6, "-1", bdTaxitemsEntity); + BigDecimal negativeValue = absBigDecimalVdef6.negate(); + additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, "-1", bdTaxitemsEntity); } } //支付优惠 @@ -2308,7 +2311,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY04"); //补充:支付优惠-存货 BigDecimal absBigDecimalVdef5 = bigDecimalVdef5.abs(); - additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, absBigDecimalVdef5, "-1", bdTaxitemsEntity); + BigDecimal negativeValue = absBigDecimalVdef5.negate(); + additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, "-1", bdTaxitemsEntity); } } @@ -3861,7 +3865,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { saleorderRequestChildrenDto1.setVdef5("0"); saleorderRequestChildrenDto1.setVdef6("0"); saleorderRequestChildrenDto1.setVdef7("0"); - + //是否赠品 saleorderRequestChildrenDto1.setBlargessflag(false); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/OfsOrderSalePostageFeeAllocationUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/OfsOrderSalePostageFeeAllocationUtil.java index c2b4aefe..d5ba85f8 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/OfsOrderSalePostageFeeAllocationUtil.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/OfsOrderSalePostageFeeAllocationUtil.java @@ -73,8 +73,8 @@ public class OfsOrderSalePostageFeeAllocationUtil { //销售订单运费 String postageAmount = header.getPostageAmount(); - // TODO 测试 - postageAmount = "10"; + //测试 +// postageAmount = "10"; //运费可能没有,也有可能为0! BigDecimal postageAmountDiscounts = null; 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 184f5106..2e2dff85 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 @@ -120,7 +120,7 @@ class SoSaleOutPluginInitializerToCTest { // soSaleOutPluginInitializerToC.sendU8CTOCOrder("123446"); try { - soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024120300016549", "stock"); + soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024120300016549", "tran"); // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110500013375", "tran"); // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024111700013756", "tran");