From 0f2f54efd90da4feed902a93d9a443e3c15f201b Mon Sep 17 00:00:00 2001 From: sez Date: Tue, 11 Nov 2025 17:19:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=8D=E5=AE=A1=E6=A0=B8=E5=89=8D=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E8=A6=81=E7=82=B9=E5=87=BB=E5=85=B3=E9=97=AD=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=EF=BC=8C=E5=8F=8D=E5=AE=A1=E6=A0=B8=E5=90=8E=E5=B0=86?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=A0=87=E8=AF=86=E8=AE=BE=E4=B8=BAfalse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/result/OtherInApplyFormPlugin.java | 8 ++++++ .../form/result/OtherInApplyListPlugin.java | 20 +++++++++++++ .../form/result/OtherOutApplyFormPlugin.java | 8 ++++++ .../form/result/OtherOutApplyListPlugin.java | 20 +++++++++++++ .../result/PmPurRefundApplyBillPlugin.java | 8 ++++++ .../result/PmPurRefundApplyListPlugin.java | 20 +++++++++++++ .../result/PmReceiptNoticeFormPlugin.java | 8 ++++++ .../result/PmReceiptNoticeListPlugin.java | 22 +++++++++++++++ .../result/SmDeliverNoticeBillPlugin.java | 8 ++++++ .../result/SmDeliverNoticeListPlugin.java | 20 +++++++++++++ .../UnAuditUpdateCloseStatusOpPlugin.java | 28 +++++++++++++++++++ 11 files changed, 170 insertions(+) create mode 100644 lc123/cloud/app/plugin/form/result/UnAuditUpdateCloseStatusOpPlugin.java diff --git a/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java b/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java index 9bc300c..3f9d19c 100644 --- a/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java @@ -37,6 +37,14 @@ public class OtherInApplyFormPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)){ + boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose"); + if (!tqq9_isclose) { + this.getView().showMessage("请先关闭该单据,然后进行反审核"); + evt.setCancel(true); + } + } } @Override diff --git a/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java b/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java index fd32916..1435300 100644 --- a/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java @@ -55,6 +55,26 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)) { + 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) { diff --git a/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java b/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java index 9fd51fa..5840a6c 100644 --- a/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java @@ -37,6 +37,14 @@ public class OtherOutApplyFormPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)){ + boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose"); + if (!tqq9_isclose) { + this.getView().showMessage("请先关闭该单据,然后进行反审核"); + evt.setCancel(true); + } + } } @Override diff --git a/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java b/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java index 2ac8273..a7253cb 100644 --- a/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java @@ -54,6 +54,26 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)) { + 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 diff --git a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java index aab4f4e..0f521b2 100644 --- a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java @@ -37,6 +37,14 @@ public class PmPurRefundApplyBillPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)){ + boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose"); + if (!tqq9_isclose) { + this.getView().showMessage("请先关闭该单据,然后进行反审核"); + evt.setCancel(true); + } + } } @Override diff --git a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java index 4c03a1f..728f8d8 100644 --- a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java @@ -55,6 +55,26 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)) { + 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_purrefundapplybill", "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 diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java index fe874af..956ac52 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java @@ -37,6 +37,14 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)){ + boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose"); + if (!tqq9_isclose) { + this.getView().showMessage("请先关闭该单据,然后进行反审核"); + evt.setCancel(true); + } + } } @Override diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java index 16246c9..32bfe13 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java @@ -6,11 +6,13 @@ 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.form.events.BeforeDoOperationEventArgs; import kd.bos.list.BillList; 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.bos.servicehelper.operation.SaveServiceHelper; import kd.bos.util.StringUtils; import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils; import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils; @@ -54,6 +56,26 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)) { + 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 diff --git a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java index 9efd197..71f392d 100644 --- a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java +++ b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java @@ -36,6 +36,14 @@ public class SmDeliverNoticeBillPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)){ + boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose"); + if (!tqq9_isclose) { + this.getView().showMessage("请先关闭该单据,然后进行反审核"); + evt.setCancel(true); + } + } } @Override diff --git a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java index c2f2886..8b782d0 100644 --- a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java @@ -54,6 +54,26 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { } } + String operationKey = evt.getOperationKey(); + if ("unaudit".equals(operationKey)) { + 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("sm_delivernotice", "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 diff --git a/lc123/cloud/app/plugin/form/result/UnAuditUpdateCloseStatusOpPlugin.java b/lc123/cloud/app/plugin/form/result/UnAuditUpdateCloseStatusOpPlugin.java new file mode 100644 index 0000000..1176fa8 --- /dev/null +++ b/lc123/cloud/app/plugin/form/result/UnAuditUpdateCloseStatusOpPlugin.java @@ -0,0 +1,28 @@ +package tqq9.lc123.cloud.app.plugin.form.result; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.PreparePropertysEventArgs; +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.servicehelper.operation.SaveServiceHelper; +//反审核后将是否关闭成功设置为false +public class UnAuditUpdateCloseStatusOpPlugin extends AbstractOperationServicePlugIn { + + @Override + public void onPreparePropertys(PreparePropertysEventArgs e) { + super.onPreparePropertys(e); + e.getFieldKeys().add("tqq9_isclose"); + } + + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + DynamicObject[] dataEntities1 = e.getDataEntities(); + if (null != dataEntities1 && dataEntities1.length > 0) { + for (DynamicObject dynamicObject : dataEntities1) { + dynamicObject.set("tqq9_isclose", false); + } + SaveServiceHelper.save(dataEntities1); + } + } +}