|
@@ -2,6 +2,7 @@ package fi.fa.opplugin;
|
|
|
|
|
|
import com.alibaba.druid.util.StringUtils;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
|
|
import kd.bos.orm.query.QCP;
|
|
@@ -34,6 +35,28 @@ public class BusProcessBillOpPlugin extends AbstractOperationServicePlugIn {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //获取租赁合同分录
|
|
|
+ DynamicObjectCollection nckd_entryentity3 = info.getDynamicObjectCollection("nckd_entryentity3");
|
|
|
+ for (DynamicObject object : nckd_entryentity3) {
|
|
|
+ long org = object.getDynamicObject("nckd_pzhtorg").getLong("id");
|
|
|
+ String nckd_pzhthth = object.getString("nckd_pzhthth");
|
|
|
+ String nckd_combofield = object.getString("nckd_combofield");
|
|
|
+
|
|
|
+ //查询租赁合同反写
|
|
|
+ QFilter htfilter = new QFilter("number", QCP.equals,nckd_pzhthth);
|
|
|
+ htfilter.and("org.id", QCP.equals,org);
|
|
|
+ DynamicObject[] contract = BusinessDataServiceHelper.load("fa_lease_contract","id",new QFilter[] {htfilter});
|
|
|
+ for (int j = 0; j < contract.length; j++) {
|
|
|
+ DynamicObject contractInfo = BusinessDataServiceHelper.loadSingle(contract[j].getPkValue(), contract[j].getDynamicObjectType().getName());
|
|
|
+ //收款/付款计划明细分录
|
|
|
+ DynamicObjectCollection payplanentryentity = contractInfo.getDynamicObjectCollection("payplanentryentity");
|
|
|
+ for (DynamicObject detail : payplanentryentity) {
|
|
|
+ detail.set("nckd_combofield1", nckd_combofield);
|
|
|
+ }
|
|
|
+ SaveServiceHelper.save(new DynamicObject[]{contractInfo});
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else if (StringUtils.equals(e.getOperationKey(),"unaudit")) {
|
|
|
DynamicObject info = BusinessDataServiceHelper.loadSingle(dynamicObjects[i].getPkValue(), dynamicObjects[i].getDynamicObjectType().getName());
|
|
@@ -54,6 +77,26 @@ public class BusProcessBillOpPlugin extends AbstractOperationServicePlugIn {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //获取租赁合同分录
|
|
|
+ DynamicObjectCollection nckd_entryentity3 = info.getDynamicObjectCollection("nckd_entryentity3");
|
|
|
+ for (DynamicObject object : nckd_entryentity3) {
|
|
|
+ long org = object.getDynamicObject("nckd_pzhtorg").getLong("id");
|
|
|
+ String nckd_pzhthth = object.getString("nckd_pzhthth");
|
|
|
+ //查询租赁合同反写
|
|
|
+ QFilter htfilter = new QFilter("number", QCP.equals,nckd_pzhthth);
|
|
|
+ htfilter.and("org.id", QCP.equals,org);
|
|
|
+ DynamicObject[] contract = BusinessDataServiceHelper.load("fa_lease_contract","id",new QFilter[] {htfilter});
|
|
|
+ for (int j = 0; j < contract.length; j++) {
|
|
|
+ DynamicObject contractInfo = BusinessDataServiceHelper.loadSingle(contract[j].getPkValue(), contract[j].getDynamicObjectType().getName());
|
|
|
+ //收款/付款计划明细分录
|
|
|
+ DynamicObjectCollection payplanentryentity = contractInfo.getDynamicObjectCollection("payplanentryentity");
|
|
|
+ for (DynamicObject detail : payplanentryentity) {
|
|
|
+ detail.set("nckd_combofield1", null);
|
|
|
+ }
|
|
|
+ SaveServiceHelper.save(new DynamicObject[]{contractInfo});
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|