fix:整机合同分离下推内审预算单

This commit is contained in:
zzs 2025-02-08 11:19:17 +08:00
parent a9e6e8cab0
commit 1f852a0931

View File

@ -56,7 +56,24 @@ public class IABudgetCommon {
ListSelectedRow srcBillRows = new ListSelectedRow(id);
srcBillRows.setEntryPrimaryKeyValue(object.getPkValue());
srcBillRows.setEntryEntityKey(entryKey);
selectedRows.add(srcBillRows);
List<ListSelectedRow> 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<ListSelectedRow> 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<ListSelectedRow> selectedRows, DynamicObject dataEntity, String entryKey, int[] selectRows, String billtype) {
PushArgs pushArgs = new PushArgs();
pushArgs.setSourceEntityNumber(from); // 必选源单标识
pushArgs.setTargetEntityNumber(to); // 必选目标单标识