From 6a7a8c2ffb7a475a37614c80a22ea4d4fb7dd4d1 Mon Sep 17 00:00:00 2001 From: sez Date: Wed, 5 Nov 2025 16:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=87=BA=E5=BA=93=E3=80=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E3=80=81=E6=94=B6=E8=B4=A7=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/result/OtherInApplyFormPlugin.java | 13 ++++++++++ .../form/result/OtherInApplyListPlugin.java | 25 ++++++++++++++++++ .../form/result/OtherOutApplyFormPlugin.java | 14 ++++++++++ .../form/result/OtherOutApplyListPlugin.java | 26 +++++++++++++++++++ .../result/PmReceiptNoticeFormPlugin.java | 13 ++++++++++ .../result/PmReceiptNoticeListPlugin.java | 25 ++++++++++++++++++ .../plugin/utils/BillCloseCancelUtils.java | 2 +- 7 files changed, 117 insertions(+), 1 deletion(-) diff --git a/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java b/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java index 70e6551..9bc300c 100644 --- a/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java @@ -3,6 +3,7 @@ package tqq9.lc123.cloud.app.plugin.form.result; import kd.bos.bill.AbstractBillPlugIn; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.form.control.events.BeforeItemClickEvent; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; @@ -25,6 +26,18 @@ public class OtherInApplyFormPlugin extends AbstractBillPlugIn { } + @Override + public void beforeItemClick(BeforeItemClickEvent evt) { + super.beforeItemClick(evt); + String itemKey = evt.getItemKey(); + if ("tqq9_close".equals(itemKey)) { + boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose"); + if (tqq9_isclose) { + this.getView().showMessage("该单据已关闭"); + evt.setCancel(true); + } + } + } @Override public void itemClick(ItemClickEvent evt) { diff --git a/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java b/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java index 619b454..fd32916 100644 --- a/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java @@ -4,6 +4,7 @@ import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.entity.datamodel.ListSelectedRow; import kd.bos.entity.datamodel.ListSelectedRowCollection; +import kd.bos.form.control.events.BeforeItemClickEvent; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.list.BillList; import kd.bos.list.plugin.AbstractListPlugin; @@ -30,7 +31,31 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { // 列表插件继承AbstractListPlugin时,底层已默认注册工具栏监听,无需重复注册 } + @Override + public void beforeItemClick(BeforeItemClickEvent evt) { + super.beforeItemClick(evt); + String itemKey = evt.getItemKey(); + if ("tqq9_close".equals(itemKey)) { + BillList billList = this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + if (billnoList.size() > 1) { + this.getView().showMessage("请选择一张单据"); + evt.setCancel(true); + return; + } + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", "id,billno,tqq9_isclose", + new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + if (null != dataEntity) { + boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); + if (tqq9_isclose) { + this.getView().showMessage("该单据已关闭"); + evt.setCancel(true); + } + } + } + } @Override public void itemClick(ItemClickEvent evt) { super.itemClick(evt); diff --git a/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java b/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java index b5f1db2..9fd51fa 100644 --- a/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java @@ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.form.result; import kd.bos.bill.AbstractBillPlugIn; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.form.control.events.BeforeItemClickEvent; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; @@ -25,6 +26,19 @@ public class OtherOutApplyFormPlugin extends AbstractBillPlugIn { } + @Override + public void beforeItemClick(BeforeItemClickEvent evt) { + super.beforeItemClick(evt); + String itemKey = evt.getItemKey(); + if ("tqq9_close".equals(itemKey)) { + boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose"); + if (tqq9_isclose) { + this.getView().showMessage("该单据已关闭"); + evt.setCancel(true); + } + } + } + @Override public void itemClick(ItemClickEvent evt) { super.itemClick(evt); diff --git a/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java b/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java index 782c7ab..2ac8273 100644 --- a/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java @@ -3,6 +3,7 @@ package tqq9.lc123.cloud.app.plugin.form.result; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.entity.datamodel.ListSelectedRow; import kd.bos.entity.datamodel.ListSelectedRowCollection; +import kd.bos.form.control.events.BeforeItemClickEvent; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.list.BillList; import kd.bos.list.plugin.AbstractListPlugin; @@ -29,6 +30,31 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { // 列表插件继承AbstractListPlugin时,底层已默认注册工具栏监听,无需重复注册 } + @Override + public void beforeItemClick(BeforeItemClickEvent evt) { + super.beforeItemClick(evt); + String itemKey = evt.getItemKey(); + if ("tqq9_close".equals(itemKey)) { + BillList billList = this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + if (billnoList.size() > 1) { + this.getView().showMessage("请选择一张单据"); + evt.setCancel(true); + return; + } + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", "id,billno,tqq9_isclose", + new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + if (null != dataEntity) { + boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); + if (tqq9_isclose) { + this.getView().showMessage("该单据已关闭"); + evt.setCancel(true); + } + } + + } + } @Override public void itemClick(ItemClickEvent evt) { diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java index ed4193d..6ae8623 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java @@ -3,6 +3,7 @@ package tqq9.lc123.cloud.app.plugin.form.result; import kd.bos.bill.AbstractBillPlugIn; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.form.control.events.BeforeItemClickEvent; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; @@ -25,6 +26,18 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn { } + @Override + public void beforeItemClick(BeforeItemClickEvent evt) { + super.beforeItemClick(evt); + String itemKey = evt.getItemKey(); + if ("tqq9_close".equals(itemKey)) { + boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose"); + if (tqq9_isclose) { + this.getView().showMessage("该单据已关闭"); + evt.setCancel(true); + } + } + } @Override public void itemClick(ItemClickEvent evt) { diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java index 50bca97..432ac2e 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java @@ -4,6 +4,7 @@ import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.entity.datamodel.ListSelectedRow; import kd.bos.entity.datamodel.ListSelectedRowCollection; +import kd.bos.form.control.events.BeforeItemClickEvent; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.list.BillList; import kd.bos.list.plugin.AbstractListPlugin; @@ -29,7 +30,31 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { //标准单据列表模板为bos_list,需使用该模板中的控件标识(如工具栏标识toolbarap)进行监听。 // 列表插件继承AbstractListPlugin时,底层已默认注册工具栏监听,无需重复注册 } + @Override + public void beforeItemClick(BeforeItemClickEvent evt) { + super.beforeItemClick(evt); + String itemKey = evt.getItemKey(); + if ("tqq9_close".equals(itemKey)) { + BillList billList = this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + if (billnoList.size() > 1) { + this.getView().showMessage("请选择一张单据"); + evt.setCancel(true); + return; + } + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,tqq9_isclose", + new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + if (null != dataEntity) { + boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); + if (tqq9_isclose) { + this.getView().showMessage("该单据已关闭"); + evt.setCancel(true); + } + } + } + } @Override public void itemClick(ItemClickEvent evt) { diff --git a/lc123/cloud/app/plugin/utils/BillCloseCancelUtils.java b/lc123/cloud/app/plugin/utils/BillCloseCancelUtils.java index 41a41cd..4be2c75 100644 --- a/lc123/cloud/app/plugin/utils/BillCloseCancelUtils.java +++ b/lc123/cloud/app/plugin/utils/BillCloseCancelUtils.java @@ -156,7 +156,7 @@ public class BillCloseCancelUtils { Map bj_map = new HashMap<>(); String method;//其他出库撤销 if ("DBCK".equals(orderType)) { - method = "/api/WMS/Cancel_TransVouch ";//调拨出库撤销 + method = "/api/WMS/Cancel_TransVouch";//调拨出库撤销 bj_map.put("cTVCode",billNo); }else { method = "/api/WMS/Cancel_OtherVouchOut";