1.更改成本中心默认值取数逻辑

This commit is contained in:
zhangzhiguo 2025-06-23 17:46:57 +08:00
parent 831a11990c
commit 4e42698434
1 changed files with 12 additions and 10 deletions

View File

@ -58,7 +58,7 @@ public class TriprCostcompanyDefaultPlugin extends AbstractBillPlugIn implements
DynamicObject companyObj = (DynamicObject)company; DynamicObject companyObj = (DynamicObject)company;
Long companyId = companyObj.getLong("id"); Long companyId = companyObj.getLong("id");
String companyNumber = companyObj.getString("number"); String companyNumber = companyObj.getString("number");
if(OrgCheckUtils.isKS(currentOrgId) && OrgCheckUtils.isKS(companyId)){ // if(OrgCheckUtils.isKS(currentOrgId) && OrgCheckUtils.isKS(companyId)){
//costcompany 费用承担公司 //costcompany 费用承担公司
//costdept 费用承担部门 //costdept 费用承担部门
//费用明细分录 expenseentryentity //费用明细分录 expenseentryentity
@ -72,18 +72,20 @@ public class TriprCostcompanyDefaultPlugin extends AbstractBillPlugIn implements
//费用承担公司带入到成本中心 //费用承担公司带入到成本中心
costcompanyObj= (DynamicObject)this.getModel().getValue("costcompany"); costcompanyObj= (DynamicObject)this.getModel().getValue("costcompany");
} }
if(costcompanyObj!=null){ if(costcompanyObj!=null){
QFilter numberFilter = new QFilter("number",QCP.equals,costcompanyObj.getString("number")); if(OrgCheckUtils.isKS(costcompanyObj.getLong("id")) && OrgCheckUtils.isKS(costcompanyObj.getLong("id"))){
DynamicObject[] dynamicObjectAccItem = BusinessDataServiceHelper.load("bos_costcenter", "number,name", new QFilter[]{numberFilter}); QFilter numberFilter = new QFilter("number",QCP.equals,costcompanyObj.getString("number"));
if(dynamicObjectAccItem != null && dynamicObjectAccItem.length>0){ DynamicObject[] dynamicObjectAccItem = BusinessDataServiceHelper.load("bos_costcenter", "number,name", new QFilter[]{numberFilter});
this.getModel().setValue("std_costcenter",dynamicObjectAccItem[0]); if(dynamicObjectAccItem != null && dynamicObjectAccItem.length>0){
}else{ this.getModel().setValue("std_costcenter",dynamicObjectAccItem[0]);
this.getModel().setValue("std_costcenter",null); }else{
this.getModel().setValue("std_costcenter",null);
}
getView().updateView("std_costcenter");
} }
getView().updateView("std_costcenter");
} }
}
//}
} }
} }