From 1f852a09311ae200ae6a46e03d395b5881587a3c Mon Sep 17 00:00:00 2001 From: zzs Date: Sat, 8 Feb 2025 11:19:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=95=B4=E6=9C=BA=E5=90=88=E5=90=8C?= =?UTF-8?q?=E5=88=86=E7=A6=BB=E4=B8=8B=E6=8E=A8=E5=86=85=E5=AE=A1=E9=A2=84?= =?UTF-8?q?=E7=AE=97=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yem/wm/utils/IABudgetCommon.java | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/yem/wm/utils/IABudgetCommon.java b/src/main/java/com/yem/wm/utils/IABudgetCommon.java index 4f842873..e3b03645 100644 --- a/src/main/java/com/yem/wm/utils/IABudgetCommon.java +++ b/src/main/java/com/yem/wm/utils/IABudgetCommon.java @@ -56,7 +56,24 @@ public class IABudgetCommon { ListSelectedRow srcBillRows = new ListSelectedRow(id); srcBillRows.setEntryPrimaryKeyValue(object.getPkValue()); srcBillRows.setEntryEntityKey(entryKey); - selectedRows.add(srcBillRows); + List comp_selectedRows = new ArrayList<>(); + comp_selectedRows.add(srcBillRows); + doPushGenerate(from, to, ruleId, comp_selectedRows, dataEntity, entryKey, new int[]{selectRowId}, billtype); + } + } + + // 外贸客户需求单-整机 || 内贸客户需求单-整机 + if ("yem_im_inclientdeman_zj".equals(billtype) || "yem_im_clientdeman_zj".equals(billtype)) { + ruleId = "1936312822665345024"; + DynamicObjectCollection materialinfo = dataEntity.getDynamicObjectCollection(entryKey); + for (int selectRowId : selectRows) { + DynamicObject object = materialinfo.get(selectRowId); + ListSelectedRow srcBillRows = new ListSelectedRow(id); + srcBillRows.setEntryPrimaryKeyValue(object.getPkValue()); + srcBillRows.setEntryEntityKey(entryKey); + List comp_selectedRows = new ArrayList<>(); + comp_selectedRows.add(srcBillRows); + doPushGenerate(from, to, ruleId, comp_selectedRows, dataEntity, entryKey, new int[]{selectRowId}, billtype); } } @@ -69,6 +86,7 @@ public class IABudgetCommon { } ListSelectedRow srcBillRows = new ListSelectedRow(id); selectedRows.add(srcBillRows); + doPushGenerate(from, to, ruleId, selectedRows, dataEntity, entryKey, selectRows, billtype); } // 外贸客户需求单-配件 || 内贸客户需求单-配件 @@ -76,21 +94,11 @@ public class IABudgetCommon { ruleId = "1936311988980316160"; ListSelectedRow srcBillRows = new ListSelectedRow(id); selectedRows.add(srcBillRows); + doPushGenerate(from, to, ruleId, selectedRows, dataEntity, entryKey, selectRows, billtype); } + } - // 外贸客户需求单-整机 || 内贸客户需求单-整机 - if ("yem_im_inclientdeman_zj".equals(billtype) || "yem_im_clientdeman_zj".equals(billtype)) { - ruleId = "1936312822665345024"; - DynamicObjectCollection materialinfo = dataEntity.getDynamicObjectCollection(entryKey); - for (int selectRowId : selectRows) { - DynamicObject object = materialinfo.get(selectRowId); - ListSelectedRow srcBillRows = new ListSelectedRow(id); - srcBillRows.setEntryPrimaryKeyValue(object.getPkValue()); - srcBillRows.setEntryEntityKey(entryKey); - selectedRows.add(srcBillRows); - } - } - + private static void doPushGenerate(String from, String to, String ruleId, List selectedRows, DynamicObject dataEntity, String entryKey, int[] selectRows, String billtype) { PushArgs pushArgs = new PushArgs(); pushArgs.setSourceEntityNumber(from); // 必选,源单标识 pushArgs.setTargetEntityNumber(to); // 必选,目标单标识