|
|
@@ -5,6 +5,10 @@ import kd.bos.dataentity.entity.DynamicObject;
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.entity.datamodel.events.BizDataEventArgs;
|
|
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
|
|
+import kd.bos.orm.query.QCP;
|
|
|
+import kd.bos.orm.query.QFilter;
|
|
|
+import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
+import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import java.util.EventObject;
|
|
|
|
|
|
/**
|
|
|
@@ -40,6 +44,7 @@ public class DailyReimburseCusEditPlugin extends AbstractBillPlugIn {
|
|
|
|
|
|
if("expenseitem".equals(propertyName)){
|
|
|
setFeildVisibleByExpenseItem();
|
|
|
+ setEntryAccountValue();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -61,4 +66,48 @@ public class DailyReimburseCusEditPlugin extends AbstractBillPlugIn {
|
|
|
|
|
|
this.getView().setVisible(isShowBookClass, "nckd_bookclass");
|
|
|
}
|
|
|
+
|
|
|
+ private void setEntryAccountValue(){
|
|
|
+ //费用承担部门
|
|
|
+ DynamicObject costDept = (DynamicObject) this.getModel().getValue("costdept");
|
|
|
+
|
|
|
+ if(costDept == null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //部门属性
|
|
|
+ QFilter qFilter = new QFilter("org.id", QCP.equals, costDept.getLong("id"));
|
|
|
+ DynamicObject deptDuty = BusinessDataServiceHelper.loadSingle("bos_org_dutyrelation", qFilter.toArray());
|
|
|
+ if(deptDuty == null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ int rowIndex = -1;
|
|
|
+ DynamicObjectCollection expenseentryentity = (DynamicObjectCollection)this.getModel().getValue("expenseentryentity");
|
|
|
+
|
|
|
+ for(DynamicObject entry : expenseentryentity){
|
|
|
+ rowIndex++;
|
|
|
+ DynamicObject expenseitem = entry.getDynamicObject("expenseitem");
|
|
|
+
|
|
|
+ if(expenseitem == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ String expentItemCode = expenseitem.getString("number");
|
|
|
+ String deptDutyCode = deptDuty.getDynamicObject("orgduty").getString("number");
|
|
|
+ String bdinfoimport = "er_expenseitemedit:" + expentItemCode + ",bos_org_duty:" + deptDutyCode;
|
|
|
+
|
|
|
+ //科目影响因素ai_accountmaptype
|
|
|
+ qFilter = new QFilter("number", QCP.equals, "FY01");
|
|
|
+ qFilter.and(new QFilter("entryentity.bdinfoimport", QCP.equals, bdinfoimport));
|
|
|
+
|
|
|
+ DynamicObject accountMapType = QueryServiceHelper.queryOne("ai_accountmaptype", "entryentity.accfield", qFilter.toArray());
|
|
|
+ if(accountMapType != null){
|
|
|
+ Long accountViewId = accountMapType.getLong("entryentity.accfield");
|
|
|
+ qFilter = new QFilter("id", QCP.equals, accountViewId);
|
|
|
+ DynamicObject accountViewInfo = BusinessDataServiceHelper.loadSingle("bd_accountview", qFilter.toArray());
|
|
|
+ this.getModel().setValue("nckd_account", accountViewInfo, rowIndex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|