From 7e73d41fd8ab653d418ae51660bf42148d92bda1 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Thu, 2 Jan 2025 16:29:53 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BE=9B=E5=BA=94=E5=95=86=E7=94=BB=E5=83=8F?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96=202.=E7=AB=8B=E9=A1=B9?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=87=87=E8=B4=AD=E9=9C=80=E6=B1=82=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E7=BB=84=E7=BB=87=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S --- .../rebm/listplugin/PurDemandListPlugin.java | 50 +++++++++++++++++++ .../formplugin/PortraitBasicsFormPlugin.java | 29 ++++++++++- .../formplugin/SupplierChangeFormPlugin.java | 2 + .../resm/formplugin/TycSupplieFormPlugin.java | 23 +++++---- 4 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 main/java/shkd/repc/rebm/listplugin/PurDemandListPlugin.java diff --git a/main/java/shkd/repc/rebm/listplugin/PurDemandListPlugin.java b/main/java/shkd/repc/rebm/listplugin/PurDemandListPlugin.java new file mode 100644 index 0000000..664965c --- /dev/null +++ b/main/java/shkd/repc/rebm/listplugin/PurDemandListPlugin.java @@ -0,0 +1,50 @@ +package shkd.repc.rebm.listplugin; + +import com.alibaba.nacos.shaded.com.google.common.collect.Lists; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.metadata.IDataEntityType; +import kd.bos.entity.MainEntityType; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.form.IFormView; +import kd.bos.form.events.SetFilterEvent; +import kd.bos.list.plugin.AbstractListPlugin; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; + +import java.util.EventObject; +import java.util.List; + +public class PurDemandListPlugin extends AbstractListPlugin { + + @Override + public void afterBindData(EventObject e) { + super.afterBindData(e); + + IFormView parentView = this.getView().getParentView(); + MainEntityType dataEntityType = parentView.getModel().getDataEntityType(); + + } + + @Override + public void setFilter(SetFilterEvent e) { + super.setFilter(e); + + IFormView parentView = this.getView().getParentView(); + IDataModel model = parentView.getModel(); + DynamicObject dataEntity = model.getDataEntity(); + IDataEntityType dataEntityType = dataEntity.getDataEntityType(); + String name = dataEntityType.getName(); + if ("rebm_project".equals(name)) { + DynamicObject org = dataEntity.getDynamicObject("org"); + if (null != org) { + List qFilters = e.getQFilters(); + QFilter q1 = new QFilter("org.name", QCP.equals, org.getString("name")); + QFilter q2 = new QFilter("billstatus", QCP.equals, "C"); + List listQF = Lists.newArrayList(); + listQF.add(q1.and(q2)); + qFilters.addAll(listQF); + } + } + + } +} diff --git a/main/java/shkd/repc/resm/formplugin/PortraitBasicsFormPlugin.java b/main/java/shkd/repc/resm/formplugin/PortraitBasicsFormPlugin.java index 7494a89..95fb295 100644 --- a/main/java/shkd/repc/resm/formplugin/PortraitBasicsFormPlugin.java +++ b/main/java/shkd/repc/resm/formplugin/PortraitBasicsFormPlugin.java @@ -1,6 +1,9 @@ package shkd.repc.resm.formplugin; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.form.container.Tab; +import kd.bos.form.control.events.TabSelectEvent; +import kd.bos.form.control.events.TabSelectListener; import kd.bos.form.plugin.AbstractFormPlugin; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; @@ -13,7 +16,7 @@ import java.util.EventObject; * 页签-工商信息 * qeug_resm_portrait_ba_ext */ -public class PortraitBasicsFormPlugin extends AbstractFormPlugin { +public class PortraitBasicsFormPlugin extends AbstractFormPlugin implements TabSelectListener { @Override public void afterBindData(EventObject e) { @@ -69,4 +72,28 @@ public class PortraitBasicsFormPlugin extends AbstractFormPlugin { // this.getView().updateView(); } + + + public void registerListener (EventObject e){ +// // 页签添加监听事件* +// Tab tab = this.getView().getControl("tabap"); +// tab.addTabSelectListener(this); + } + @Override + public void tabSelected(TabSelectEvent tabSelectEvent) { + +// DynamicObject dataEntity = this.getView().getModel().getDataEntity(); +// DynamicObject supplier = dataEntity.getDynamicObject("supplier"); +// Long supplierid = supplier.getLong("id"); +// QFilter q1 = new QFilter("id", QCP.equals, supplierid); +// DynamicObject supplier1 = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1}); +// +// if (null != supplier1) { +// // 页签切换时触发 +// String tabKey = tabSelectEvent.getTabKey(); +// if ("tab_bigdata".equals(tabKey)) { +//// this.getModel().getEntryEntity(""); +// } +// } + } } diff --git a/main/java/shkd/repc/resm/formplugin/SupplierChangeFormPlugin.java b/main/java/shkd/repc/resm/formplugin/SupplierChangeFormPlugin.java index 854921b..2115b51 100644 --- a/main/java/shkd/repc/resm/formplugin/SupplierChangeFormPlugin.java +++ b/main/java/shkd/repc/resm/formplugin/SupplierChangeFormPlugin.java @@ -33,6 +33,8 @@ public class SupplierChangeFormPlugin extends AbstractFormPlugin { } + //todo:审核后,将天眼查查到的数据同步到正式供应商 + @Override public void afterBindData(EventObject e) { super.afterBindData(e); diff --git a/main/java/shkd/repc/resm/formplugin/TycSupplieFormPlugin.java b/main/java/shkd/repc/resm/formplugin/TycSupplieFormPlugin.java index 54808fe..8eac2c3 100644 --- a/main/java/shkd/repc/resm/formplugin/TycSupplieFormPlugin.java +++ b/main/java/shkd/repc/resm/formplugin/TycSupplieFormPlugin.java @@ -29,19 +29,22 @@ public class TycSupplieFormPlugin extends AbstractFormPlugin { QFilter q1 = new QFilter("id", QCP.equals, supplierid); DynamicObject supplier = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1}); DynamicObject supplier_t = null; - //正式供应商 - if (null != supplier) { - boolean qeugIstyccheck = supplier.getBoolean("qeug_istyccheck");//是否查询天眼查(正式供应商) - if (qeugIstyccheck) { - supplier_t = supplier; - } else { - //潜在供应商 - QFilter q2 = new QFilter("officesupplier.id", QCP.equals, supplier.getLong("id")); - supplier_t = BusinessDataServiceHelper.loadSingle("resm_regsupplier", new QFilter[]{q2}); - } + if (supplier != null) { + boolean qeugIstyccheck = supplier.getBoolean("qeug_istyccheck"); // 是否查询天眼查(正式供应商) + supplier_t = qeugIstyccheck ? supplier : + BusinessDataServiceHelper.loadSingle("resm_regsupplier", new QFilter[]{new QFilter("officesupplier.id", QCP.equals, supplierid)}); + } + + if (supplier_t == null) { + supplier_t = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1}); + } + + if (supplier_t != null) { + showPreaudits(supplier_t); } if (null != supplier_t) { + /** * 基本信息核对 qeug_infocheckentry */