合同打开报错修复

This commit is contained in:
ptt 2025-04-25 11:58:22 +08:00
parent b9def6b44d
commit fe424557f5
1 changed files with 23 additions and 19 deletions

View File

@ -102,33 +102,37 @@ public class ContractProjectFormPlugin extends AbstractBillPlugIn {
} }
private void setRenovationProjectByOrg(DynamicObject org) { private void setRenovationProjectByOrg(DynamicObject org) {
// 采购项目 try {
DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id", // 采购项目
new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())}); DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id",
new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())});
DynamicObject projectbill = null; DynamicObject projectbill = null;
if (projectbills.length > 0) { if (projectbills.length > 0) {
DynamicObject projectbill1 = projectbills[0]; DynamicObject projectbill1 = projectbills[0];
if (projectbill1 != null) { if (projectbill1 != null) {
//项目建立F7 //项目建立F7
DynamicObject add = BusinessDataServiceHelper.loadSingle("repmd_project_f7",
new QFilter[]{new QFilter("number", QCP.equals, projectbill1.getString("number"))});
if (add != null) {
projectbill = add;
}
}
} else {
DynamicObject add = BusinessDataServiceHelper.loadSingle("repmd_project_f7", DynamicObject add = BusinessDataServiceHelper.loadSingle("repmd_project_f7",
new QFilter[]{new QFilter("number", QCP.equals, projectbill1.getString("number"))}); new QFilter[]{new QFilter("number", QCP.equals, "XM-202412-008")});
if (add != null) { if (add != null) {
projectbill = add; projectbill = add;
} }
} }
} else {
DynamicObject add = BusinessDataServiceHelper.loadSingle("repmd_project_f7",
new QFilter[]{new QFilter("number", QCP.equals, "XM-202412-008")});
if (add != null) {
projectbill = add;
}
}
// 设置项目并更新视图 // 设置项目并更新视图
this.getModel().setValue("project", projectbill); this.getModel().setValue("project", projectbill);
this.getView().updateView("project"); this.getView().updateView("project");
}catch (Exception e){
}
} }
} }