From cfc41e41da1932d6ab37b3882260533772e01788 Mon Sep 17 00:00:00 2001 From: ptt <2403326863@qq.com> Date: Wed, 16 Apr 2025 11:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BD=9C=E5=9C=A8=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E3=80=82=E5=A4=96=E7=BD=91=E6=B3=A8=E5=86=8C=E8=A7=A3=E9=94=81?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TycQzSupplierUSAFormPlugin.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 main/java/shkd/repc/resm/formplugin/TycQzSupplierUSAFormPlugin.java diff --git a/main/java/shkd/repc/resm/formplugin/TycQzSupplierUSAFormPlugin.java b/main/java/shkd/repc/resm/formplugin/TycQzSupplierUSAFormPlugin.java new file mode 100644 index 0000000..0964239 --- /dev/null +++ b/main/java/shkd/repc/resm/formplugin/TycQzSupplierUSAFormPlugin.java @@ -0,0 +1,42 @@ +package shkd.repc.resm.formplugin; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.repc.resm.formplugin.supplier.RegSupplierEdit; + +import java.util.List; +import java.util.stream.Collectors; + +public class TycQzSupplierUSAFormPlugin extends RegSupplierEdit { + + @Override + protected void lockServiceAreaAndGroupEntry(DynamicObject dataEntity) { + DynamicObjectCollection serviceOrgColl = dataEntity.getDynamicObjectCollection("entry_serviceorg"); + boolean isregsupplier = dataEntity.getBoolean("isregsupplier"); + + for(int i = 0; i < serviceOrgColl.size(); ++i) { + this.getView().setEnable(true, i, new String[]{"orgarea"}); + } + + boolean sameOrgFlag = this.checkIsImportOffSupplier(dataEntity); + if (sameOrgFlag) { + DynamicObject offSupplier = dataEntity.getDynamicObject("officesupplier"); + DynamicObjectCollection offServiceOrgEntry = offSupplier.getDynamicObjectCollection("entry_serviceorg"); + List offOrgAreaIdList = (List)offServiceOrgEntry.stream().map((item) -> { + return item.getDynamicObject("orgarea").getPkValue().toString(); + }).collect(Collectors.toList()); + + for(int i = 0; i < serviceOrgColl.size(); ++i) { + String pkValue = ((DynamicObject)serviceOrgColl.get(i)).getDynamicObject("orgarea").getPkValue().toString(); + if (offOrgAreaIdList.contains(pkValue)) { + this.getView().setEnable(!sameOrgFlag, i, new String[]{"orgarea", "supgroup"}); + } else { + this.getView().setEnable(Boolean.FALSE, i, new String[]{"orgarea"}); + } + } + + this.getView().setEnable(Boolean.FALSE, new String[]{"recommender"}); + } + + } +}