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 7f6ff2be..cafb332c 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 @@ -737,6 +737,13 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { String keyGroup = entry.getKey(); List oldValue = entry.getValue(); + //如果oldValue存在实入数量=0的明细行则过滤掉 + //2025年5月6日10:12:21 和丽知闫旭、妮姐沟通,如果oldValue存在实入数量=0的明细行则过滤掉 + filterReceivedQtyZero(oldValue); + if (oldValue == null || oldValue.size() == 0) { + continue; + } + StockinOrderSearchResponse.StockinOrder.StockinH header = oldValue.get(0).getHeader(); BdCorpEntity bdCorpEntity = oldValue.get(0).getBdCorpEntity();//表头销售公司 BdCorpEntity deliverGoodsCorp = oldValue.get(0).getDeliverGoodsCorp();//发货公司 @@ -3469,10 +3476,19 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { return JSON.parseObject(resultData, ArapDjzb.class); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("解析返回参数失败的错误", e); //如果解析失败,记录原因,但是不能影响结果的记录 } return null; } + + /** + * 过滤掉实入数量为0的List + * + * @author liuyang + */ + private void filterReceivedQtyZero(List goodsRertunSonDetailsDtoList) { + goodsRertunSonDetailsDtoList.removeIf(dto -> dto != null && ("0".equals(dto.getReceivedQty()) || dto.getReceivedQty() == null)); + } } \ No newline at end of file diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToCTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToCTest.java index ba817cff..ede326db 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToCTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToCTest.java @@ -43,20 +43,20 @@ public class SoSaleReturnPluginInitializerToCTest { // soSaleReturnPluginInitializerToC.startImplement(null, null); try { //带优惠金额场景 -// String code = "LETS-RE2025030100000112"; -// soSaleReturnPluginInitializerToC.startImplementByCode(code, "tran"); + String code = "LETS-RE2025042100000200"; + soSaleReturnPluginInitializerToC.startImplementByCode(code, "stock"); //无优惠金额场景 // String code = "LETS-RE2025031900000002"; // soSaleReturnPluginInitializerToC.startImplementByCode(code, "tran"); - List headerDetailsDtoArrayList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); - queryOfsSoSaleOutVo.setCode("LETS-SO2025040100000698"); - ofsStandardUtil.getOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoArrayList, 1L); - if (headerDetailsDtoArrayList.size() > 0) { - System.out.println(headerDetailsDtoArrayList.get(0)); - } +// List headerDetailsDtoArrayList = new ArrayList<>(); +// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); +// queryOfsSoSaleOutVo.setCode("LETS-SO2025040100000698"); +// ofsStandardUtil.getOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoArrayList, 1L); +// if (headerDetailsDtoArrayList.size() > 0) { +// System.out.println(headerDetailsDtoArrayList.get(0)); +// } } catch (Exception e) { e.printStackTrace(); }