1.根据组织携带项目的逻辑(缺省值:虚拟项目)

S
This commit is contained in:
weiyunlong 2024-12-17 15:59:24 +08:00
parent 81df7a6c44
commit ab8d79b3d5
5 changed files with 3 additions and 31 deletions

View File

@ -51,16 +51,10 @@ public class ImportPurchaseApplyBillPlugin extends AbstractBillPlugIn implements
private void updateRenovationProject() {
DynamicObject org = (DynamicObject) this.getModel().getValue("org");
DynamicObject qeugRenovationProj = (DynamicObject) this.getModel().getValue("qeug_renovation_proj");
// 只有在需求组织不为空的情况下才进行查询
if (org != null) {
if (qeugRenovationProj == null) {
setRenovationProjectByOrg(org);
} else {
// 如果已存在项目字段且组织发生了变化需更新
setRenovationProjectByOrg(org);
}
setRenovationProjectByOrg(org);
} else {
// 组织为空清空项目
this.getModel().setValue("qeug_renovation_proj", null);

View File

@ -70,16 +70,10 @@ public class PurDemandFormPlugin extends AbstractFormPlugin {
private void updateRenovationProject() {
DynamicObject org = (DynamicObject) this.getModel().getValue("org");
DynamicObject qeugRenovationProj = (DynamicObject) this.getModel().getValue("qeug_renovation_proj");
// 只有在需求组织不为空的情况下才进行查询
if (org != null) {
if (qeugRenovationProj == null) {
setRenovationProjectByOrg(org);
} else {
// 如果已存在项目字段且组织发生了变化需更新
setRenovationProjectByOrg(org);
}
setRenovationProjectByOrg(org);
} else {
// 组织为空清空项目
this.getModel().setValue("qeug_renovation_proj", null);

View File

@ -75,16 +75,10 @@ public class PurPlanFormPlugin extends AbstractBillPlugIn implements HyperLinkCl
private void updateRenovationProject() {
DynamicObject org = (DynamicObject) this.getModel().getValue("org");
DynamicObject purproject = (DynamicObject) this.getModel().getValue("purproject");
// 只有在需求组织不为空的情况下才进行查询
if (org != null) {
if (purproject == null) {
setRenovationProjectByOrg(org);
} else {
// 如果已存在项目字段且组织发生了变化需更新
setRenovationProjectByOrg(org);
}
setRenovationProjectByOrg(org);
} else {
// 组织为空清空项目
this.getModel().setValue("purproject", null);

View File

@ -42,11 +42,6 @@ public class ContractProjectFormPlugin extends AbstractBillPlugIn {
}
private void setRenovationProjectByOrg(DynamicObject org) {
// 检查 org 是否为 null
if (org == null) {
return; // 如果为 null直接返回
}
// 采购项目
DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id",
new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())});

View File

@ -42,11 +42,6 @@ public class ReconPayreqProjectFormPlugin extends AbstractBillPlugIn {
}
private void setRenovationProjectByOrg(DynamicObject org) {
// 检查 org 是否为 null
if (org == null) {
return; // 如果为 null直接返回
}
// 采购项目
DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id",
new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())});