反审核前校验要点击关闭操作,反审核后将关闭标识设为false

This commit is contained in:
sez 2025-11-11 17:19:11 +08:00
parent f05ff85823
commit 0f2f54efd9
11 changed files with 170 additions and 0 deletions

View File

@ -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

View File

@ -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<String> 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) {

View File

@ -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

View File

@ -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<String> 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

View File

@ -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

View File

@ -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<String> 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

View File

@ -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

View File

@ -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<String> 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

View File

@ -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

View File

@ -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<String> 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

View File

@ -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);
}
}
}