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 95580e93..3b887ea0 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 @@ -856,7 +856,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { // 查询销售收发类别 // BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("202"); //初始化所有存货管理档案对应的结存价+采购价 - List mapList = initAllBalancePricePurchasePrice(); +// List mapList = initAllBalancePricePurchasePrice(); //查询「平台运费」存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = queryStockBasicArchives(); //查询「平台运费」对应的税率 @@ -938,7 +938,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode()); //把汇总好的出库单明细行合并成一行 - SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose, mapList); + SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose); //存货管理档案:取发货公司的存货管理档案 // BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(sonDetailsDto, bdCalbodyEntity.getPkCorp()); @@ -1666,14 +1666,15 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { * 单价计算公式:sum(实付金额/实发数量) 最后除以条数 * * @param sonDetailsDtoList 销售出库单明细行集合 + * @param isCheckShopChoose true取参考售价、false取O应收 * @author liuyang */ - private SonDetailsDto groupMergeDetailedRows(List sonDetailsDtoList, Boolean isCheckShopChoose, List mapList) throws Exception { + private SonDetailsDto groupMergeDetailedRows(List sonDetailsDtoList, Boolean isCheckShopChoose) throws Exception { Assert.notNull(sonDetailsDtoList, "sonDetailsDtoList不能为空"); Assert.notNull(isCheckShopChoose, "isCheckShopChoose不能为空"); - Assert.notNull(mapList, "mapLists不能为空"); - StringBuffer aaa = new StringBuffer(); +// Assert.notNull(mapList, "mapLists不能为空"); +// StringBuffer aaa = new StringBuffer(); if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) { BigDecimal groupTotalPayAmount = new BigDecimal("0"); BigDecimal groupShipQty = new BigDecimal("0"); @@ -1682,6 +1683,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i); HeaderDto header = sonDetailsDto.getHeader();//销售出库单表头 BdInvmandocEntity bdInvmandocEntity = sonDetailsDto.getBdInvmandocEntity();//存货管理档案 + BdInvbasdocEntity bdInvbasdocEntity = sonDetailsDto.getBdInvbasdocEntity();//存货基本档案 com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto = sonDetailsDto.getHeaderDetailsDto();//OFS销售订单 com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header1 = headerDetailsDto.getHeader(); List details = headerDetailsDto.getDetails(); @@ -1702,9 +1704,13 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //OFS销售订单实付金额:totalPayAmount //OFS销售出库单实付金额:totalPayAmount //是一样的字段,目前暂时取销售出库单对应的totalPayAmount + String totalPayAmount = null; StringBuffer calculationFormulaStr = new StringBuffer(); - String totalPayAmount = getFloorPrice(isCheckShopChoose, bdInvmandocEntity, header, sonDetailsDto, mapList, calculationFormulaStr); - if (totalPayAmount == null) { + if (isCheckShopChoose) { + //取《U8C存货基本档案-参考售价》 + totalPayAmount = getRefsaleprice(bdInvmandocEntity, bdInvbasdocEntity, calculationFormulaStr, sonDetailsDto, header); + } else { + //取《O实付》 calculationFormulaStr.append("取O应收金额:"); //触发取实付金额的逻辑,因此需要累加:O实付金额+O达人优惠+O支付优惠+O平台优惠 //取O实付金额 @@ -1724,19 +1730,47 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { BigDecimal detailedLineUnitPrice = new BigDecimal(targetDetails.getPayableAmount()).divide(new BigDecimal(targetDetails.getRequestQty()), 20, BigDecimal.ROUND_HALF_UP); BigDecimal totalPayAmountBigDecimal = detailedLineUnitPrice.multiply(new BigDecimal(sonDetailsDto.getShipQty())).setScale(2, BigDecimal.ROUND_HALF_UP); totalPayAmount = totalPayAmountBigDecimal.stripTrailingZeros().toPlainString(); - aaa.append(totalPayAmount); - aaa.append(","); +// aaa.append(totalPayAmount); +// aaa.append(","); String format = StrUtil.format("{}/{}*{}", targetDetails.getPayableAmount(), targetDetails.getRequestQty(), sonDetailsDto.getShipQty()); calculationFormulaStr.append(format); - } else { - //取结存单价、或者采购单价 - //和李佳妮确认取采购价、结存价的情况下,不需要累加优惠金额 - BigDecimal totalPayAmountBigDecimal = new BigDecimal(totalPayAmount); -// totalPayAmount = totalPayAmountBigDecimal.multiply(new BigDecimal(sonDetailsDto.getShipQty())).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); - totalPayAmount = totalPayAmountBigDecimal.stripTrailingZeros().toPlainString(); } Assert.notNull(totalPayAmount, "应收金额不能为空(应收金额=实付金额+达人优惠+支付优惠+平台优惠) 销售出库单编码:{} 出库单明细主键:{}", header.getCode(), sonDetailsDto.getId()); + +// String totalPayAmount = getFloorPrice(isCheckShopChoose, bdInvmandocEntity, header, sonDetailsDto, mapList, calculationFormulaStr); +// if (totalPayAmount == null) { +// calculationFormulaStr.append("取O应收金额:"); +// //触发取实付金额的逻辑,因此需要累加:O实付金额+O达人优惠+O支付优惠+O平台优惠 +// //取O实付金额 +//// totalPayAmount = sonDetailsDto.getTotalPayAmount(); +//// totalPayAmount = accumulatedDiscounts(sonDetailsDto, headerDetailsDto, targetDetails); +// //和万万确认,O销售出库单明细行应收金额=O销售订单明细行应收金额/O销售订单明细行请求数量*O销售出库单明细行实发数量 +// //这里做好必要的参数验证抛出异常 +// Assert.notNull(targetDetails.getPayableAmount(), "O应收金额不能为空 O销售订单编码:{} O明细行主键:{}", header1.getCode(), targetDetails.getId()); +// Assert.state(!"".equals(targetDetails.getPayableAmount()), "O应收金额不能为空 O销售订单编码:{} O明细行主键:{}", header1.getCode(), targetDetails.getId()); +// +// Assert.notNull(targetDetails.getRequestQty(), "O请求数量不能为空 O销售订单编码:{} O明细行主键:{}", header1.getCode(), targetDetails.getId()); +// Assert.state(!"".equals(targetDetails.getRequestQty()), "O请求数量不能为空 O销售订单编码:{} O明细行主键:{}", header1.getCode(), targetDetails.getId()); +// +// Assert.notNull(sonDetailsDto.getShipQty(), "O实发数量不能为空 O销售出库单编码:{} O明细行主键:{}", header.getCode(), sonDetailsDto.getId()); +// Assert.state(!"".equals(sonDetailsDto.getShipQty()), "O实发数量不能为空 O销售出库单编码:{} O明细行主键:{}", header.getCode(), sonDetailsDto.getId()); +// +// BigDecimal detailedLineUnitPrice = new BigDecimal(targetDetails.getPayableAmount()).divide(new BigDecimal(targetDetails.getRequestQty()), 20, BigDecimal.ROUND_HALF_UP); +// BigDecimal totalPayAmountBigDecimal = detailedLineUnitPrice.multiply(new BigDecimal(sonDetailsDto.getShipQty())).setScale(2, BigDecimal.ROUND_HALF_UP); +// totalPayAmount = totalPayAmountBigDecimal.stripTrailingZeros().toPlainString(); +//// aaa.append(totalPayAmount); +//// aaa.append(","); +// +// String format = StrUtil.format("{}/{}*{}", targetDetails.getPayableAmount(), targetDetails.getRequestQty(), sonDetailsDto.getShipQty()); +// calculationFormulaStr.append(format); +// } else { +// //取结存单价、或者采购单价 +// //和李佳妮确认取采购价、结存价的情况下,不需要累加优惠金额 +// BigDecimal totalPayAmountBigDecimal = new BigDecimal(totalPayAmount); +//// totalPayAmount = totalPayAmountBigDecimal.multiply(new BigDecimal(sonDetailsDto.getShipQty())).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); +// totalPayAmount = totalPayAmountBigDecimal.stripTrailingZeros().toPlainString(); +// } // Assert.notNull(sonDetailsDto.getShipQty(), "实发数量不能为空 销售出库单编码:{} 出库单明细主键:{}", header.getCode(), sonDetailsDto.getId()); // BigDecimal totalPayAmountBigDecimal = new BigDecimal("0"); @@ -1780,7 +1814,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //累加各类优惠 // logger.info("{}个明细行发生了合并!", sonDetailsDtoList.size()); - System.out.println(aaa.toString()); +// System.out.println(aaa.toString()); return sonDetailsDto; } else { logger.error("sonDetailsDtoList集合是空的!"); @@ -1923,7 +1957,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //查询销售收发类别 // BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("202"); //初始化所有存货管理档案对应的结存价+采购价 - List mapList = initAllBalancePricePurchasePrice(); +// List mapList = initAllBalancePricePurchasePrice(); //查询「平台运费」存货基本档案 BdInvbasdocEntity bdInvbasdocEntity1 = queryStockBasicArchives(); //查询「平台运费」对应的税率 @@ -1965,7 +1999,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //如果这个汇总集合,已经全部推送成功,那么就不需要推送红字销售订单,把isOneSuccess标识修改为true即可 if (!"Y".equals(newState2)) { //合并成一行 - SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose, mapList);//把汇总好的出库单明细行合并成一行 + SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose);//把汇总好的出库单明细行合并成一行 BdInvmandocEntity bdInvmandocEntity = sonDetailsDto.getBdInvmandocEntity();//存货管理档案:取发货公司的存货管理档案 BdInvbasdocEntity bdInvbasdocEntity = sonDetailsDto.getBdInvbasdocEntity();//存货基础档案 BdTaxitemsEntity bdTaxitemsEntity1 = sonDetailsDto.getBdTaxitemsEntity();//根据存货基础档案编码,查询当前存货的税率 @@ -2186,7 +2220,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { logger.info("开始第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票"); try { //合并成一行 - SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose, mapList);//把汇总好的出库单明细行合并成一行 + SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose);//把汇总好的出库单明细行合并成一行 BdInvmandocEntity bdInvmandocEntity = sonDetailsDto.getBdInvmandocEntity();//存货管理档案:取发货公司的存货管理档案 BdInvbasdocEntity bdInvbasdocEntity = sonDetailsDto.getBdInvbasdocEntity();//存货基础档案 BdTaxitemsEntity bdTaxitemsEntity1 = sonDetailsDto.getBdTaxitemsEntity();//根据存货基础档案编码,查询当前存货的税率 @@ -3518,4 +3552,38 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { sonDetailsDtoList.get(0).setVdef7(merchantDiscountsBigDecimal.stripTrailingZeros().toPlainString());//商家 } } + + /** + * 获取参考售价 + * + * @param bdInvmandocEntity 存货管理档案 + * @param bdInvbasdocEntity 存货基本档案 + * @param calculationFormulaStr 计算公式 + * @param sonDetailsDto O销售出库单明细行 + * @param header O销售出库单表头 + * @author liuyang + */ + private String getRefsaleprice(BdInvmandocEntity bdInvmandocEntity, BdInvbasdocEntity bdInvbasdocEntity, StringBuffer calculationFormulaStr, SonDetailsDto sonDetailsDto, HeaderDto header) throws Exception { + Assert.notNull(bdInvmandocEntity, "bdInvmandocEntity不能为空!"); + Assert.notNull(bdInvbasdocEntity, "bdInvbasdocEntity不能为空!"); + Assert.notNull(calculationFormulaStr, "calculationFormulaStr不能为空!"); + Assert.notNull(sonDetailsDto, "sonDetailsDto不能为空!"); + Assert.notNull(header, "header不能为空"); + + //U参考售价 + String refsaleprice = bdInvmandocEntity.getRefsaleprice(); + Assert.notNull(refsaleprice, "存货:{} 公司:{} 不存在参考售价,请维护!", bdInvbasdocEntity.getInvname(), bdInvmandocEntity.getPkCorp()); + Assert.state(!"".equals(refsaleprice.trim()), "存货:{} 公司:{} 不存在参考售价,请维护!", bdInvbasdocEntity.getInvname(), bdInvmandocEntity.getPkCorp()); + + //O实发数量 + String shipQty = sonDetailsDto.getShipQty(); + Assert.notNull(shipQty, "O实发数量不能为空 O销售出库单编码:{} O明细行主键:{}", header.getCode(), sonDetailsDto.getId()); + Assert.state(!"".equals(shipQty.trim()), "O实发数量不能为空 O销售出库单编码:{} O明细行主键:{}", header.getCode(), sonDetailsDto.getId()); + + BigDecimal amountOfMoney = new BigDecimal(refsaleprice).multiply(new BigDecimal(shipQty)); + + String format = StrUtil.format("取U参考售价:{}*{}", refsaleprice, shipQty); + calculationFormulaStr.append(format); + return amountOfMoney.stripTrailingZeros().toPlainString(); + } } \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java index c8d79ca5..f217b62a 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java @@ -617,7 +617,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { // 查询销售收发类别 // BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("202"); //初始化所有存货管理档案对应的结存价+采购价 - List mapList = initAllBalancePricePurchasePrice(); +// List mapList = initAllBalancePricePurchasePrice(); if (bdBusitypeEntity != null && summaryDimensionMap != null) { Iterator>> iterator = summaryDimensionMap.entrySet().iterator(); @@ -692,7 +692,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode()); //把汇总好的出库单明细行合并成一行 - GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose, mapList); + GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose); //存货管理档案:取发货公司的存货管理档案 BdInvmandocEntity bdInvmandocEntity = oldValue.get(0).getBdInvmandocEntity(); //存货基础档案 @@ -830,7 +830,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { // 查询U8C业务流程 BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV2(); //初始化所有存货管理档案对应的结存价+采购价 - List mapList = initAllBalancePricePurchasePrice(); +// List mapList = initAllBalancePricePurchasePrice(); if (bdBusitypeEntity != null && summaryDimensionMap != null) { Iterator>> iterator = summaryDimensionMap.entrySet().iterator(); @@ -904,7 +904,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { //验证是否为指定的店铺,如果为true,则取结存价 Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode()); //把汇总好的出库单明细行合并成一行 - GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose, mapList); + GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose); //存货管理档案:取发货公司的存货管理档案 BdInvmandocEntity bdInvmandocEntity = oldValue.get(0).getBdInvmandocEntity(); @@ -1489,10 +1489,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * @param sonDetailsDtoList 汇总过后的售后入库单明细 * @author liuyang */ - private GoodsRertunSonDetailsDto groupMergeDetailedRows(List sonDetailsDtoList, Boolean isCheckShopChoose, List mapList) throws Exception { + private GoodsRertunSonDetailsDto groupMergeDetailedRows(List sonDetailsDtoList, Boolean isCheckShopChoose) throws Exception { Assert.notNull(sonDetailsDtoList, "sonDetailsDtoList不能为空"); Assert.notNull(isCheckShopChoose, "isCheckShopChoose不能为空"); - Assert.notNull(mapList, "mapLists不能为空"); +// Assert.notNull(mapList, "mapLists不能为空"); if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) { BigDecimal groupTotalPayAmount = new BigDecimal("0"); @@ -1506,23 +1506,34 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { RerturnGoodsOrderSearchHeader header1 = rerturnGoodsOrderSearchData.getHeader();//OFS售后订单表头对象 List details = rerturnGoodsOrderSearchData.getDetails();//OFS售后订单表体对象 - //存货管理档案 - BdInvmandocEntity bdInvmandocEntity = goodsRertunSonDetailsDto.getBdInvmandocEntity(); +// BdInvmandocEntity bdInvmandocEntity1 = goodsRertunSonDetailsDto.getBdInvmandocEntity();//存货管理档案 + BdInvbasdocEntity bdInvbasdocEntity = goodsRertunSonDetailsDto.getBdInvbasdocEntity();//存货基本档案 + BdInvmandocEntity bdInvmandocEntity = goodsRertunSonDetailsDto.getBdInvmandocEntity();//存货管理档案 + //根据OFS售后入库单明细行,查找匹配OFS售后订单明细行 RerturnGoodsOrderSearchDetails ofsOrderDetail = findOfsOrderDetail(details, goodsRertunSonDetailsDto); - //取对应的售后订单明细,主要是取这个价格 + String totalAmount = null; StringBuffer calculationFormulaStr = new StringBuffer(); - String totalAmount = getFloorPrice(isCheckShopChoose, bdInvmandocEntity, header, goodsRertunSonDetailsDto, mapList, calculationFormulaStr); - if (totalAmount == null) { - calculationFormulaStr.append("取O实退金额:"); - //取O实退金额 -// RerturnGoodsOrderSearchDetails afterSalesOrder = findAfterSalesOrderV2(goodsRertunSonDetailsDto, rerturnGoodsOrderSearchData); -// totalAmount = afterSalesOrder.getTotalAmount(); - //测试 -// goodsRertunSonDetailsDto.setReceivedQty("1"); + if (isCheckShopChoose) { + //取《U8C存货基本档案-参考售价》 + totalAmount = getRefsaleprice(bdInvmandocEntity, bdInvbasdocEntity, calculationFormulaStr, goodsRertunSonDetailsDto, header); + } else { + //取《O实退》 totalAmount = accumulatedDiscounts(goodsRertunSonDetailsDto, rerturnGoodsOrderSearchData, calculationFormulaStr); } + + //取对应的售后订单明细,主要是取这个价格 +// String totalAmount = getFloorPrice(isCheckShopChoose, bdInvmandocEntity, header, goodsRertunSonDetailsDto, mapList, calculationFormulaStr); +// if (totalAmount == null) { +// calculationFormulaStr.append("取O实退金额:"); +// //取O实退金额 +//// RerturnGoodsOrderSearchDetails afterSalesOrder = findAfterSalesOrderV2(goodsRertunSonDetailsDto, rerturnGoodsOrderSearchData); +//// totalAmount = afterSalesOrder.getTotalAmount(); +// //测试 +//// goodsRertunSonDetailsDto.setReceivedQty("1"); +// totalAmount = accumulatedDiscounts(goodsRertunSonDetailsDto, rerturnGoodsOrderSearchData, calculationFormulaStr); +// } Assert.notNull(totalAmount, "实退金额不能为空 明细行主键:{}", goodsRertunSonDetailsDto.getId()); Assert.notNull(goodsRertunSonDetailsDto.getReceivedQty(), "实收数量不能为空 明细行主键:{}", goodsRertunSonDetailsDto.getId()); @@ -2770,11 +2781,42 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { } } } - sonDetailsDtoList.get(0).setVdef4(platformDiscountsBigDecimal);//平台 sonDetailsDtoList.get(0).setVdef5(payDiscountsBigDecimal);//支付 sonDetailsDtoList.get(0).setVdef6(expertDiscountsBigDecimal);//达人 sonDetailsDtoList.get(0).setVdef7(merchantDiscountsBigDecimal);//商家 } } + + /** + * 获取参考售价 + * + * @param bdInvmandocEntity 存货管理档案 + * @param bdInvbasdocEntity 存货基本档案 + * @param calculationFormulaStr 计算公式 + * @param goodsRertunSonDetailsDto O售后入库单明细行 + * @param header O售后入库单表头 + * @author liuyang + */ + private String getRefsaleprice(BdInvmandocEntity bdInvmandocEntity, BdInvbasdocEntity bdInvbasdocEntity, StringBuffer calculationFormulaStr, GoodsRertunSonDetailsDto goodsRertunSonDetailsDto, StockinOrderSearchResponse.StockinOrder.StockinH header) throws Exception { + Assert.notNull(bdInvmandocEntity, "bdInvmandocEntity不能为空!"); + Assert.notNull(bdInvbasdocEntity, "bdInvbasdocEntity不能为空!"); + Assert.notNull(calculationFormulaStr, "calculationFormulaStr不能为空!"); + Assert.notNull(goodsRertunSonDetailsDto, "goodsRertunSonDetailsDto不能为空!"); + Assert.notNull(header, "header不能为空"); + + //U参考售价 + String refsaleprice = bdInvmandocEntity.getRefsaleprice(); + Assert.notNull(refsaleprice, "存货:{} 公司:{} 不存在参考售价,请维护!", bdInvbasdocEntity.getInvname(), bdInvmandocEntity.getPkCorp()); + + //O实收数量 + String receivedQty = goodsRertunSonDetailsDto.getReceivedQty(); + Assert.notNull(receivedQty, "O实收数量不能为空 O售后入库单编码:{} O明细行主键:{}", header.getCode(), goodsRertunSonDetailsDto.getId()); + Assert.state(!"".equals(receivedQty), "O实收数量不能为空 O售后入库单编码:{} O明细行主键:{}", header.getCode(), goodsRertunSonDetailsDto.getId()); + + BigDecimal amountOfMoney = new BigDecimal(refsaleprice).multiply(new BigDecimal(receivedQty)); + String format = StrUtil.format("取U参考售价:{}*{}", refsaleprice, receivedQty); + calculationFormulaStr.append(format); + return amountOfMoney.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 3bc24cd9..382c5424 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 @@ -110,7 +110,7 @@ class SoSaleOutPluginInitializerToCTest { // soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "tran"); // String aaa = "LETS-SH2024102800021196"; - soSaleOutPluginInitializerToC.startImplementTranByTime("2024-11-23 11:24:33", "2024-11-23 11:24:33"); +// soSaleOutPluginInitializerToC.startImplementTranByTime("2024-11-23 11:24:33", "2024-11-23 11:24:33"); // soSaleOutPluginInitializerToC.startImplementStockByTime("2024-11-15 00:00:00", "2024-11-15 23:59:59"); } catch (Exception e) { @@ -120,7 +120,7 @@ class SoSaleOutPluginInitializerToCTest { // soSaleOutPluginInitializerToC.sendU8CTOCOrder("123446"); try { -// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024103100030329", "stock"); + soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110100000024", "stock"); // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110500013375", "tran"); // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024111700013756", "tran");