设备调令单添加调入调出项目赋值逻辑

This commit is contained in:
xuhaihui 2025-09-03 13:56:14 +08:00
parent 05d3bada73
commit 3737a2e9e2
1 changed files with 27 additions and 21 deletions

View File

@ -98,6 +98,26 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
this.getModel().setValue("zcgj_inproject", null);//清空调入项目
}
}
if (newValue != null) {
DynamicObject newValueDy = (DynamicObject) newValue;
QFilter filter = new QFilter("fiaccountorg.id", "=", newValueDy.get("id"));
DynamicObject[] projectF7s = BusinessDataServiceHelper.load("ec_ecbd_projectf7", "id", new QFilter[]{filter});//工程项目
if (projectF7s == null || projectF7s.length == 0) {
if (StringUtil.equals(key, "zcgj_outorg")) {
//调出组织
this.getModel().setValue("zcgj_outproject", null);
} else {
this.getModel().setValue("zcgj_inproject", null);
}
return;
}
if (StringUtil.equals(key, "zcgj_outorg")) {
//调出组织
this.getModel().setValue("zcgj_outproject", projectF7s[0]);
} else {
this.getModel().setValue("zcgj_inproject", projectF7s[0]);
}
}
} else if (StringUtil.equals(key, "zcgj_outproject") || StringUtil.equals(key, "zcgj_inproject")) {
//调出项目调入项目
ChangeData[] changeSet = e.getChangeSet();
@ -117,7 +137,7 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
this.getModel().setValue("zcgj_inorg", ec_project.get("fiaccountorg"));//调入组织
}
}
} else {
}/* else {
if (StringUtil.equals(key, "zcgj_outproject")) {
//调出项目
this.getModel().setValue("zcgj_outuser", null);//调出负责人
@ -126,7 +146,7 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
this.getModel().setValue("zcgj_inuser", null);//调入负责人
this.getModel().setValue("zcgj_inorg", null);//调入组织
}
}
}*/
} else if (StringUtil.equals(key, "zcgj_department")) {
//部门
DynamicObject costDept = (DynamicObject) this.getModel().getValue("zcgj_department");//部门
@ -159,8 +179,8 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
// 调出项目
Object outOrg = this.getModel().getValue("zcgj_outorg");//调出组织
if (outOrg == null) {
// this.getView().showErrorNotification("请先填写调出组织!");
// beforeF7SelectEvent.setCancel(true);
this.getView().showErrorNotification("请先填写调出组织!");
beforeF7SelectEvent.setCancel(true);
return;
}
DynamicObject outOrgDy = (DynamicObject) outOrg;//调出组织
@ -168,19 +188,12 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
DynamicObject[] projectF7s = BusinessDataServiceHelper.load("ec_ecbd_projectf7", "id", new QFilter[]{filter});//工程项目
List<Long> projectF7Ids = getIdsFromDynamicObjects(projectF7s);
qFilters.add(new QFilter("id", QCP.in, projectF7Ids));
// beforeF7SelectEvent.setCancel(true);
// ListShowParameter ec_ecbd_projectf7 = ShowFormHelper.createShowListForm("ec_ecbd_projectf7", true);
// ec_ecbd_projectf7.setCloseCallBack(new CloseCallBack(this, "zcgj_outproject"));
// ec_ecbd_projectf7.setMultiSelect(false);
// ec_ecbd_projectf7.setIsolationOrg(true);
// ec_ecbd_projectf7.getListFilterParameter().setQFilters(qFilters);
// this.getView().showForm(ec_ecbd_projectf7);
} else if (StringUtil.equals(propertyName, "zcgj_inproject")) {
//调入项目
Object inOrg = this.getModel().getValue("zcgj_inorg");//调入组织
if (inOrg == null) {
// this.getView().showErrorNotification("请先填写调入组织!");
// beforeF7SelectEvent.setCancel(true);
this.getView().showErrorNotification("请先填写调入组织!");
beforeF7SelectEvent.setCancel(true);
return;
}
DynamicObject inOrgDy = (DynamicObject) inOrg;
@ -188,13 +201,6 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
DynamicObject[] projectF7s = BusinessDataServiceHelper.load("ec_ecbd_projectf7", "id", new QFilter[]{filter});//工程项目
List<Long> projectF7Ids = getIdsFromDynamicObjects(projectF7s);
qFilters.add(new QFilter("id", QCP.in, projectF7Ids));
// beforeF7SelectEvent.setCancel(true);
// ListShowParameter ec_ecbd_projectf7 = ShowFormHelper.createShowListForm("ec_ecbd_projectf7", true);
// ec_ecbd_projectf7.setCloseCallBack(new CloseCallBack(this, "zcgj_inproject"));
// ec_ecbd_projectf7.setMultiSelect(false);
// ec_ecbd_projectf7.setIsolationOrg(true);
// ec_ecbd_projectf7.getListFilterParameter().setQFilters(qFilters);
// this.getView().showForm(ec_ecbd_projectf7);
} else if (propertyName.equals("zcgj_department")) {
// 部门
DynamicObject creator = this.getModel().getDataEntity().getDynamicObject("creator");//创建人