From a17157d7b8ea4853f927ec3a670c2146b623c7e9 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Mon, 3 Nov 2025 13:47:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E5=8F=B0=E8=B4=A6=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8F=92=E4=BB=B6=E6=B7=BB=E5=8A=A0=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E4=B8=8B=E6=8E=A8=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fs/plugin/form/ContractBillListExt.java | 78 ++++++++++++++++--- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/ContractBillListExt.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/ContractBillListExt.java index 11206ee..9a0a0d1 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/ContractBillListExt.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/ContractBillListExt.java @@ -6,15 +6,7 @@ package zcgj.zcdev.zcdev.fs.plugin.form; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.EventObject; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import kd.bos.dataentity.entity.DynamicObject; @@ -40,7 +32,9 @@ import kd.bos.list.plugin.AbstractListPlugin; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; import kd.bos.mvc.list.ListView; +import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; import kd.fi.er.business.isc.IscHelper; import kd.fi.er.business.pub.ContractUtil; @@ -50,6 +44,10 @@ import kd.fi.er.formplugin.publicbiz.bill.contract.ContractBillList; import kd.fi.er.model.EntityInfo; import org.apache.commons.lang.StringUtils; +/* + * 合同台账列表插件 + * 说明:添加跳过下推校验逻辑 + */ public class ContractBillListExt extends AbstractListPlugin { private static final String BAR_CHANGEA = "bar_changea"; private static final String BAR_CHANGEB = "bar_changeb"; @@ -268,15 +266,43 @@ public class ContractBillListExt extends AbstractListPlugin { args.setCancel(true); return; } + // 获取需要跳过校验的单据列表 + Set skipDocIds = new HashSet<>(); + QFilter[] qFilter1 = new QFilter[]{new QFilter("number", QCP.equals, "er_contractbill")}; + DynamicObject zcgj_bypass_push_validate = BusinessDataServiceHelper.loadSingle("zcgj_bypass_push_validate", qFilter1); + if (zcgj_bypass_push_validate != null) { + String zcgj_skip_doc_check = zcgj_bypass_push_validate.getString("zcgj_skip_doc_check"); + if (zcgj_skip_doc_check != null) { + QFilter[] qFilter2 = new QFilter[]{new QFilter("billno", QCP.equals, zcgj_skip_doc_check)}; + DynamicObject er_contractbill = BusinessDataServiceHelper.loadSingle("er_contractbill", "id", qFilter2); + if (er_contractbill != null) { + // 将需要跳过的单据ID添加到集合中 + skipDocIds.add(er_contractbill.getPkValue()); + } + } + } + + // 从rows中过滤掉需要跳过的单据 + ListSelectedRowCollection filteredRows = new ListSelectedRowCollection(); + for (ListSelectedRow row1 : rows) { + if (!skipDocIds.contains(row1.getPrimaryKeyValue())) { + filteredRows.add(row1); + } + } + if (filteredRows.size() == 0){ + return; + } OnWayStatus = OnWayStatus + ",F"; - List listpub = ContractUtil.checkDownBills(rows, operateKey); + List listpub = ContractUtil.checkDownBills(filteredRows, operateKey);//二开替换 +// List listpub = ContractUtil.checkDownBills(rows, operateKey);//源码 if (listpub.size() > 0) { this.getView().showTipNotification(String.format(String.format(ResManager.loadKDString("已存在未完成的下游单据,请完成流程后再发起%1$s。", "ContractBillList_9", "fi-er-formplugin", new Object[0]), opName))); args.setCancel(true); } - if (!ContractUtil.checkMultiPublicReim(rows, this.getView())) { + if (!ContractUtil.checkMultiPublicReim(filteredRows, this.getView())) {//二开替换 +// if (!ContractUtil.checkMultiPublicReim(rows, this.getView())) {//源码 args.setCancel(true); } break; @@ -284,8 +310,36 @@ public class ContractBillListExt extends AbstractListPlugin { if (!ContractUtil.checkRelationContract(this.getView(), rows, ResManager.loadKDString("预付单", "ErHomeAddNewDialogPlugin_5", "fi-er-formplugin", new Object[0]))) { args.setCancel(true); } else { + // 获取需要跳过校验的单据列表 + Set skipDocIds1 = new HashSet<>(); + QFilter[] qFilter11 = new QFilter[]{new QFilter("number", QCP.equals, "er_contractbill")}; + DynamicObject zcgj_bypass_push_validate1 = BusinessDataServiceHelper.loadSingle("zcgj_bypass_push_validate", qFilter11); + if (zcgj_bypass_push_validate1 != null) { + String zcgj_skip_doc_check = zcgj_bypass_push_validate1.getString("zcgj_skip_doc_check"); + if (zcgj_skip_doc_check != null) { + QFilter[] qFilter2 = new QFilter[]{new QFilter("billno", QCP.equals, zcgj_skip_doc_check)}; + DynamicObject er_contractbill = BusinessDataServiceHelper.loadSingle("er_contractbill", "id", qFilter2); + if (er_contractbill != null) { + // 将需要跳过的单据ID添加到集合中 + skipDocIds1.add(er_contractbill.getPkValue()); + } + } + } + + // 从rows中过滤掉需要跳过的单据 + ListSelectedRowCollection filteredRows1 = new ListSelectedRowCollection(); + for (ListSelectedRow row1 : rows) { + if (!skipDocIds1.contains(row1.getPrimaryKeyValue())) { + filteredRows1.add(row1); + } + } + if (filteredRows1.size() == 0){ + return; + } + OnWayStatus = OnWayStatus + ",F"; - List listpre = ContractUtil.checkDownBills(rows, operateKey); + List listpre = ContractUtil.checkDownBills(filteredRows1, operateKey);//二开替代 +// List listpre = ContractUtil.checkDownBills(rows, operateKey);//源码 if (listpre.size() > 0) { this.getView().showTipNotification(String.format(String.format(ResManager.loadKDString("已存在未完成的下游单据,请完成流程后再发起%1$s。", "ContractBillList_9", "fi-er-formplugin", new Object[0]), opName))); args.setCancel(true);