出库单关联领料申请单二开添加使用设备赋值,领料申请物料列表动态表单添加使用设备赋值

This commit is contained in:
xuhaihui 2025-06-18 10:34:28 +08:00
parent e9458c36d9
commit 71d3d99d6d
2 changed files with 15 additions and 9 deletions

View File

@ -26,7 +26,7 @@ import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.servicehelper.BusinessDataServiceHelper;
/**
* 领料申请单物料列表动态表单
* 领料申请单物料列表动态表单出库单中新增行获取领料申请单的分录
*/
public class MaterialApplyEntryUIPluginExt extends AbstractFormPlugin implements SearchEnterListener {
public MaterialApplyEntryUIPluginExt() {
@ -76,8 +76,8 @@ public class MaterialApplyEntryUIPluginExt extends AbstractFormPlugin implements
private void refreshEntryEntity(String searchText) {
Map<String, Object> params = this.getView().getFormShowParameter().getCustomParams();
Object applyBillIdObject = params.get("applyBillId");
Object selectedEntryIdObject = params.get("selectedEntryId");
Object applyBillIdObject = params.get("applyBillId");//出库单 领料申请单ID
Object selectedEntryIdObject = params.get("selectedEntryId");//出库单 申请单分录id
if (applyBillIdObject != null) {
Long applyBillId = (Long)applyBillIdObject;
List<Long> selectedApplyEntryIdList = new ArrayList();
@ -95,8 +95,8 @@ public class MaterialApplyEntryUIPluginExt extends AbstractFormPlugin implements
}
}
DynamicObject applyBill = BusinessDataServiceHelper.loadSingle(applyBillId, "ecma_materialapplybill");
this.getModel().setValue("currency", applyBill.getDynamicObject("currency"));
DynamicObject applyBill = BusinessDataServiceHelper.loadSingle(applyBillId, "ecma_materialapplybill");//领料申请单
this.getModel().setValue("currency", applyBill.getDynamicObject("currency"));//领料申请单 签约币别
DynamicObjectCollection applyEntries = applyBill.getDynamicObjectCollection("entryentity");
DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("entryentity");
entryEntity.clear();
@ -132,6 +132,7 @@ public class MaterialApplyEntryUIPluginExt extends AbstractFormPlugin implements
newEntry.set("applyentryid", id);
newEntry.set("material", entry.get("material"));
newEntry.set("modelnum", entry.get("modelnum"));
newEntry.set("zcgj_shebei", entry.get("zcgj_shebei"));//使用设备二开添加
newEntry.set("lotid", entry.get("lotid"));
newEntry.set("realoutqty", entry.get("realoutqty"));
newEntry.set("price", entry.get("price"));

View File

@ -32,6 +32,9 @@ import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.ec.basedata.common.utils.OpenPageUtils;
/**
* 出库单领料出库与领料申请关联逻辑
*/
public class MaterialOutApplyPluginExt extends AbstractBillPlugIn implements BeforeF7SelectListener {
private static final String APPLYBILL = "applybill";
private static final String MATERIAL_APPLY_ENTRY_FORM = "ecma_materialapplyentry";
@ -133,6 +136,7 @@ public class MaterialOutApplyPluginExt extends AbstractBillPlugIn implements Bef
newEntry.set("applyentryid", applyEntry.getLong("id"));
newEntry.set("material", applyEntry.get("material"));
newEntry.set("modelnum", applyEntry.get("modelnum"));
newEntry.set("zcgj_shebei", applyEntry.get("zcgj_shebei"));//使用设备二开添加
newEntry.set("lotid", applyEntry.get("lotid"));
newEntry.set("lot", applyEntry.get("lot"));
newEntry.set("assmeasureunit", applyEntry.get("assmeasureunit"));
@ -170,6 +174,7 @@ public class MaterialOutApplyPluginExt extends AbstractBillPlugIn implements Bef
newEntry.set("applyentryid", applyEntry.getLong("id"));
newEntry.set("material", applyEntry.get("material"));
newEntry.set("modelnum", applyEntry.get("modelnum"));
newEntry.set("zcgj_shebei", applyEntry.get("zcgj_shebei"));//使用设备二开添加
newEntry.set("lotid", applyEntry.get("lotid"));
newEntry.set("lot", applyEntry.get("lot"));
newEntry.set("assmeasureunit", applyEntry.get("assmeasureunit"));
@ -252,7 +257,7 @@ public class MaterialOutApplyPluginExt extends AbstractBillPlugIn implements Bef
}
private void openApplyEntryForm() {
DynamicObject applyBill = (DynamicObject)this.getModel().getValue("applybill");
DynamicObject applyBill = (DynamicObject)this.getModel().getValue("applybill");//领料申请单
DynamicObjectCollection entries = this.getModel().getEntryEntity("entryentity");
StringBuffer selectedEntryIdBuff = new StringBuffer();
Iterator var4 = entries.iterator();
@ -264,9 +269,9 @@ public class MaterialOutApplyPluginExt extends AbstractBillPlugIn implements Bef
String selectedEntryId = selectedEntryIdBuff.toString();
HashMap<String, Object> map = new HashMap();
map.put("formId", "ecma_materialapplyentry");
map.put("applyBillId", applyBill.getPkValue());
map.put("selectedEntryId", selectedEntryId);
map.put("formId", "ecma_materialapplyentry");//领料申请单物料列表动态表单标识
map.put("applyBillId", applyBill.getPkValue());//领料申请单ID
map.put("selectedEntryId", selectedEntryId);//申请单分录id
FormShowParameter showParameter = FormShowParameter.createFormShowParameter(map);
showParameter.getOpenStyle().setShowType(ShowType.Modal);
showParameter.setStatus(OperationStatus.ADDNEW);