|
@@ -0,0 +1,31 @@
|
|
|
|
+package fi.fa.opplugin;
|
|
|
|
+
|
|
|
|
+import com.alibaba.nacos.common.utils.StringUtils;
|
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
|
+import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
|
+import kd.bos.form.operate.FormOperate;
|
|
|
|
+import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
|
+
|
|
|
|
+public class FaLeaseContractOpPlugin extends AbstractFormPlugin {
|
|
|
|
+ @Override
|
|
|
|
+ public void afterDoOperation(AfterDoOperationEventArgs args) {
|
|
|
|
+ super.afterDoOperation(args);
|
|
|
|
+ FormOperate formOperate = (FormOperate)args.getSource();
|
|
|
|
+ if (StringUtils.equals("", formOperate.getOperateKey())
|
|
|
|
+ && args.getOperationResult() != null
|
|
|
|
+ && args.getOperationResult().isSuccess()){
|
|
|
|
+ DynamicObject assetcat = (DynamicObject) this.getModel().getValue("assetcat");
|
|
|
|
+ Long id = null;
|
|
|
|
+ if (assetcat != null) {
|
|
|
|
+ id = assetcat.getLong("id");
|
|
|
|
+ }
|
|
|
|
+ Boolean isexempt = (Boolean) this.getModel().getValue("isexempt");
|
|
|
|
+ DynamicObjectCollection payplanentryentitys = this.getModel().getEntryEntity("payplanentryentity");
|
|
|
|
+ for (DynamicObject payplanentryentity : payplanentryentitys) {
|
|
|
|
+ payplanentryentity.set("nckd_basedatafield", id);
|
|
|
|
+ payplanentryentity.set("nckd_checkboxfield", isexempt);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|