|
@@ -0,0 +1,28 @@
|
|
|
+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.datamodel.events.ChangeData;
|
|
|
+import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
|
|
+import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
+import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
+
|
|
|
+//实物卡片关联e管家实物卡片清单插件
|
|
|
+public class RealCardF7OpPlugin extends AbstractFormPlugin {
|
|
|
+ @Override
|
|
|
+ public void propertyChanged(PropertyChangedArgs e) {
|
|
|
+ String fieldKey = e.getProperty().getName();
|
|
|
+ if (StringUtils.equals("nckd_real_card", fieldKey)) {
|
|
|
+ ChangeData changeData = e.getChangeSet()[0];
|
|
|
+ DynamicObjectCollection dynamicObjectCollection = (DynamicObjectCollection) changeData.getNewValue();
|
|
|
+ this.getModel().deleteEntryData("nckd_realcard_list");
|
|
|
+ for (DynamicObject object : dynamicObjectCollection) {
|
|
|
+ DynamicObject cardInfo = BusinessDataServiceHelper.loadSingle(object.get(2), "nckd_fa_card_real_list");
|
|
|
+ int rowIndex = this.getModel().createNewEntryRow("nckd_realcard_list");
|
|
|
+ this.getModel().setValue("nckd_card_code21", cardInfo, rowIndex);
|
|
|
+ }
|
|
|
+ this.getView().updateView("nckd_realcard_list");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|