From 02f572883cb0e121f8b901859bad750725a020f9 Mon Sep 17 00:00:00 2001 From: XiangLingFeng <1518871916@qq.com> Date: Fri, 28 Nov 2025 16:45:17 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=A5=A8=E6=8D=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=81=E7=94=A8=E4=BF=A1=E7=AE=A1=E7=90=86=E3=80=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=BF=87=E6=BB=A4=E3=80=81=E8=A1=A8=E5=8D=95=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=202=E3=80=81=E5=90=88=E4=BD=9C=E9=87=91=E8=9E=8D?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E5=9C=A8=E7=94=A8=E4=BF=A1=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=81=E7=A5=A8=E6=8D=AE=E7=AE=A1=E7=90=86=E3=80=81=E6=8B=85?= =?UTF-8?q?=E4=BF=9D=E7=AE=A1=E7=90=86=E3=80=81=E6=8E=88=E4=BF=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=BA=94=E7=94=A8=E6=A8=A1=E5=9D=97=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kdsz/zyf25/tmc/cfm/plugin/form/.gitkeep | 0 .../form/FinOrgInfoFiltrationListPlugin.java | 59 ++++++++++++++ .../form/cdm/CdmBillTypeBillPlugin.java | 80 +++++++++++++++++++ .../form/cdm/CdmBillTypeFilterListPlugin.java | 34 ++++++++ .../form/cfm/BankLoanFilterListPlugin.java | 39 +++++++++ .../form/cfm/BankLoanFinancingBillPlugin.java | 68 ++++++++++++++++ .../form/finOrgInfoFiltrationListPlugin.java | 11 --- 7 files changed, 280 insertions(+), 11 deletions(-) delete mode 100644 code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/.gitkeep create mode 100644 code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/FinOrgInfoFiltrationListPlugin.java create mode 100644 code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cdm/CdmBillTypeBillPlugin.java create mode 100644 code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cdm/CdmBillTypeFilterListPlugin.java create mode 100644 code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cfm/BankLoanFilterListPlugin.java create mode 100644 code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cfm/BankLoanFinancingBillPlugin.java delete mode 100644 code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/finOrgInfoFiltrationListPlugin.java diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/.gitkeep b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/FinOrgInfoFiltrationListPlugin.java b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/FinOrgInfoFiltrationListPlugin.java new file mode 100644 index 0000000..274c353 --- /dev/null +++ b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/FinOrgInfoFiltrationListPlugin.java @@ -0,0 +1,59 @@ +package kdsz.zyf25.tmc.cfm.plugin.form; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.form.FormShowParameter; +import kd.bos.form.events.SetFilterEvent; +import kd.bos.form.plugin.AbstractFormPlugin; +import kd.bos.list.plugin.AbstractListPlugin; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.sdk.plugin.Plugin; + +import java.util.HashSet; + +/** + * 用信管理、票据管理、担保管理、授信管理合作金融机构过滤插件 + */ +public class FinOrgInfoFiltrationListPlugin extends AbstractListPlugin implements Plugin { + private static final String CONFIG_KEY = "kdsz_finorginfoconfig"; + private static HashSet appFilterArea = new HashSet<>(); + static { + appFilterArea.add("kdsz_factoringm");//保理管理(用信管理) + appFilterArea.add("kdsz_guaranteem");//保函管理(担保管理) + appFilterArea.add("kdsz_lcm");//信用证管理(票据管理) + appFilterArea.add("kdsz_scmf");//供应链金融(票据管理) + appFilterArea.add("cfm");//用信管理 + appFilterArea.add("cdm");//票据管理 + appFilterArea.add("creditm");//授信管理 + appFilterArea.add("gm");//担保管理 + } + @Override + public void setFilter(SetFilterEvent e) { + super.setFilter(e); + FormShowParameter showParameter = this.getView().getFormShowParameter(); + String appId = showParameter.getAppId(); + if (appFilterArea.contains(appId)){ + //读取最新可用配置 + QFilter filter = new QFilter("enable", QCP.equals, "1"); + DynamicObject[] configs = BusinessDataServiceHelper.load(CONFIG_KEY, "id,createtime,kdsz_entryentity.kdsz_finorginfo", + new QFilter[]{filter}, "createtime desc", 1); + if (configs != null && configs.length > 0){ + DynamicObject config = configs[0]; + DynamicObjectCollection entries = config.getDynamicObjectCollection("kdsz_entryentity"); + HashSet finOrgInfoIds = new HashSet<>(); + for (DynamicObject entry : entries) { + DynamicObject finOrgInfo = entry.getDynamicObject("kdsz_finorginfo"); + if (finOrgInfo == null){ + continue; + } + finOrgInfoIds.add(finOrgInfo.getPkValue()); + } + if (finOrgInfoIds.size() > 0){ + e.getQFilters().add(new QFilter("id", QCP.in,finOrgInfoIds)); + } + } + } + } +} \ No newline at end of file diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cdm/CdmBillTypeBillPlugin.java b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cdm/CdmBillTypeBillPlugin.java new file mode 100644 index 0000000..af7f6a4 --- /dev/null +++ b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cdm/CdmBillTypeBillPlugin.java @@ -0,0 +1,80 @@ +package kdsz.zyf25.tmc.cfm.plugin.form.cdm; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.form.FormShowParameter; +import kd.bos.form.field.BasedataEdit; +import kd.bos.form.field.events.BeforeF7SelectEvent; +import kd.bos.form.field.events.BeforeF7SelectListener; +import kd.bos.list.ListShowParameter; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.sdk.plugin.Plugin; +import org.apache.commons.lang3.StringUtils; + +import java.util.EventObject; + +/** + * 票据管理:开票/收票登记、开票申请,票据类型根据单据发布应用决定票据类型过滤、默认票据类型 + */ +public class CdmBillTypeBillPlugin extends AbstractBillPlugIn implements Plugin, BeforeF7SelectListener { + private static final String XZY_NUM = "CDMT-8D5DCE08";//票据类型:信用证编码 + private static final String GYL_NUM = "CDMT-25826125";//票据类型:供应链金融编码 + @Override + public void afterCreateNewData(EventObject e) { + super.afterCreateNewData(e); + FormShowParameter showParameter = this.getView().getFormShowParameter(); + String appId = showParameter.getAppId(); + //信用证、供应链金融 票据类型赋默认值 + String billTypeNum = ""; + switch (appId){ + //信用证 + case "kdsz_lcm": + billTypeNum = XZY_NUM; + break; + //供应链金融 + case "kdsz_scmf": + billTypeNum = GYL_NUM; + break; + } + if (StringUtils.isNotBlank(billTypeNum)){ + DynamicObject billType = BusinessDataServiceHelper.loadSingle("cdm_billtype", "id", + new QFilter[]{new QFilter("number", QCP.equals, billTypeNum)}); + if (billType != null) { + this.getModel().setValue("draftbilltype", billType); + }else { + this.getView().showMessage("编码为:"+billTypeNum+"的票据类型不存在"); + } + } + } + + @Override + public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) { + FormShowParameter showParameter = this.getView().getFormShowParameter(); + String appId = showParameter.getAppId(); + String propertyName = beforeF7SelectEvent.getProperty().getName(); + if ("draftbilltype".equals(propertyName)) { + QFilter filter = null; + if ("kdsz_lcm".equals(appId)){ + filter = new QFilter("number", QCP.equals, XZY_NUM); + } else if ("kdsz_scmf".equals(appId)) { + filter = new QFilter("number", QCP.equals, GYL_NUM); + } else if ("cdm".equals(appId)) { + filter = new QFilter("number", QCP.not_equals, GYL_NUM) + .and("number", QCP.not_equals, XZY_NUM); + } + if (filter != null){ + ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter(); + formShowParameter.getListFilterParameter().getQFilters().add(filter); + } + } + } + @Override + public void registerListener(EventObject e) { + super.registerListener(e); + // 侦听票据类型 + BasedataEdit fieldEdit = this.getView().getControl("draftbilltype"); + fieldEdit.addBeforeF7SelectListener(this); + } +} \ No newline at end of file diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cdm/CdmBillTypeFilterListPlugin.java b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cdm/CdmBillTypeFilterListPlugin.java new file mode 100644 index 0000000..d3e9b8b --- /dev/null +++ b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cdm/CdmBillTypeFilterListPlugin.java @@ -0,0 +1,34 @@ +package kdsz.zyf25.tmc.cfm.plugin.form.cdm; + +import kd.bos.form.FormShowParameter; +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 kd.sdk.plugin.Plugin; + +/** + * 票据管理:开票/收票登记、开票申请,票据类型根据单据发布应用决定票据类型过滤、默认票据类型 + */ +public class CdmBillTypeFilterListPlugin extends AbstractListPlugin implements Plugin { + private static final String XZY_NUM = "CDMT-8D5DCE08";//票据类型:信用证编码 + private static final String GYL_NUM = "CDMT-25826125";//票据类型:供应链金融编码 + @Override + public void setFilter(SetFilterEvent e) { + super.setFilter(e); + FormShowParameter showParameter = this.getView().getFormShowParameter(); + String appId = showParameter.getAppId(); + QFilter filter = null; + if ("kdsz_lcm".equals(appId)){ + filter = new QFilter("draftbilltype.number", QCP.equals, XZY_NUM); + } else if ("kdsz_scmf".equals(appId)) { + filter = new QFilter("draftbilltype.number", QCP.equals, GYL_NUM); + } else if ("cdm".equals(appId)) { + filter = new QFilter("draftbilltype.number", QCP.not_equals, GYL_NUM) + .and("draftbilltype.number", QCP.not_equals, XZY_NUM); + } + if (filter != null){ + e.getQFilters().add(filter); + } + } +} \ No newline at end of file diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cfm/BankLoanFilterListPlugin.java b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cfm/BankLoanFilterListPlugin.java new file mode 100644 index 0000000..ff47477 --- /dev/null +++ b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cfm/BankLoanFilterListPlugin.java @@ -0,0 +1,39 @@ +package kdsz.zyf25.tmc.cfm.plugin.form.cfm; + +import kd.bos.form.FormShowParameter; +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 kd.sdk.plugin.Plugin; + +/** + * 用信管理—银行借款下涉及融资品种的进行非银保理过滤 + */ +public class BankLoanFilterListPlugin extends AbstractListPlugin implements Plugin { + private static final String FYBL_NUM= "RZPZ-031";//非银保理编码 + + @Override + public void setFilter(SetFilterEvent e) { + super.setFilter(e); + FormShowParameter showParameter = this.getView().getFormShowParameter(); + String appId = showParameter.getAppId(); + String formId = showParameter.getFormId(); + String financingKey = "";//融资品种过滤key + if ("cfm_rateadjustbill".equals(formId)){ + financingKey = "loancontractbill.finproduct.number"; + }else { + financingKey = "finproduct.number"; + } + QFilter filter = null; + //非银保理管理 + if ("kdsz_factoringm".equals(appId)){ + filter = new QFilter(financingKey, QCP.equals, FYBL_NUM); + } else if ("cfm".equals(appId)) { + filter = new QFilter(financingKey, QCP.not_equals, FYBL_NUM); + } + if (filter != null){ + e.getQFilters().add(filter); + } + } +} \ No newline at end of file diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cfm/BankLoanFinancingBillPlugin.java b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cfm/BankLoanFinancingBillPlugin.java new file mode 100644 index 0000000..06369e6 --- /dev/null +++ b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/cfm/BankLoanFinancingBillPlugin.java @@ -0,0 +1,68 @@ +package kdsz.zyf25.tmc.cfm.plugin.form.cfm; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.form.FormShowParameter; +import kd.bos.form.field.BasedataEdit; +import kd.bos.form.field.events.BeforeF7SelectEvent; +import kd.bos.form.field.events.BeforeF7SelectListener; +import kd.bos.list.ListShowParameter; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.sdk.plugin.Plugin; + +import java.util.EventObject; + +/** + * 用信申请表单插件(控制融资品种、债权人类型) + */ +public class BankLoanFinancingBillPlugin extends AbstractBillPlugIn implements Plugin, BeforeF7SelectListener { + private static final String FYBL_NUM= "RZPZ-031";//非银保理编码 + @Override + public void afterCreateNewData(EventObject e) { + super.afterCreateNewData(e); + FormShowParameter showParameter = this.getView().getFormShowParameter(); + String appId = showParameter.getAppId(); + QFilter filter = null; + //非银保理管理 + if ("kdsz_factoringm".equals(appId)){ + filter = new QFilter("number", QCP.not_equals, FYBL_NUM).and("enable", QCP.equals, "1"); + DynamicObject fybl = BusinessDataServiceHelper.loadSingle("cfm_financingvarieties", "id", new QFilter[]{filter}); + if (fybl != null) { + this.getModel().setValue("finproduct", fybl); + }else { + this.getView().showMessage("编码为:"+ FYBL_NUM +"且状态为:可用的融资品种不存在"); + } + this.getModel().setValue("creditortype","finorg");//债权人类型默认:非银金融机构 + } + } + + @Override + public void registerListener(EventObject e) { + super.registerListener(e); + // 侦听票据类型 + BasedataEdit fieldEdit = this.getView().getControl("finproduct"); + fieldEdit.addBeforeF7SelectListener(this); + } + + @Override + public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) { + FormShowParameter showParameter = this.getView().getFormShowParameter(); + String appId = showParameter.getAppId(); + String propertyName = beforeF7SelectEvent.getProperty().getName(); + QFilter filter = null; + if ("finproduct".equals(propertyName)){ + //非银保理管理 + if ("kdsz_factoringm".equals(appId)){ + filter = new QFilter("number", QCP.equals, FYBL_NUM); + } else if ("cfm".equals(appId)) { + filter = new QFilter("number", QCP.not_equals, FYBL_NUM); + } + if (filter != null){ + ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter(); + formShowParameter.getListFilterParameter().getQFilters().add(filter); + } + } + } +} \ No newline at end of file diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/finOrgInfoFiltrationListPlugin.java b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/finOrgInfoFiltrationListPlugin.java deleted file mode 100644 index 2adad91..0000000 --- a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/form/finOrgInfoFiltrationListPlugin.java +++ /dev/null @@ -1,11 +0,0 @@ -package kdsz.zyf25.tmc.cfm.plugin.form; - -import kd.bos.form.plugin.AbstractFormPlugin; -import kd.sdk.plugin.Plugin; - -/** - * 动态表单插件 - */ -public class finOrgInfoFiltrationListPlugin extends AbstractFormPlugin implements Plugin { - -} \ No newline at end of file