关闭拦截

This commit is contained in:
sez 2025-11-27 16:59:17 +08:00
parent 1781ae1913
commit 8fe054087c
11 changed files with 38 additions and 58 deletions

View File

@ -48,19 +48,23 @@ public class CloneBill extends AbstractOperationServicePlugIn {
} }
} }
dynamicObject = BusinessDataServiceHelper.loadSingle(entityNumber, new QFilter[]{new QFilter("id", QCP.equals, dynamicObject.getLong("id"))}); dynamicObject = BusinessDataServiceHelper.loadSingle(entityNumber, new QFilter[]{new QFilter("id", QCP.equals, dynamicObject.getLong("id"))});
DynamicObject newData = (DynamicObject) new CloneUtils(false, true).clone(dynamicObject);
newData.set("billno", dynamicObject.getString("billno"));
newData.set("billstatus", "C");
newData.set("tqq9_sourcebillno", billnoSet);
SaveServiceHelper.save(new DynamicObject[]{newData});
StringBuilder message = new StringBuilder(); StringBuilder message = new StringBuilder();
OperationResult unauditResult = OperationServiceHelper.executeOperate("unaudit", entityNumber, new DynamicObject[]{dynamicObject}, OperateOption.create()); OperationResult unauditResult = OperationServiceHelper.executeOperate("unaudit", entityNumber, new DynamicObject[]{dynamicObject}, OperateOption.create());
if (unauditResult.isSuccess()) { if (unauditResult.isSuccess()) {
OperationResult deleteResult = OperationServiceHelper.executeOperate("delete", entityNumber, new DynamicObject[]{dynamicObject}, OperateOption.create()); OperationResult deleteResult = OperationServiceHelper.executeOperate("delete", entityNumber, new DynamicObject[]{dynamicObject}, OperateOption.create());
if (!deleteResult.isSuccess()) {
deleteResult.getAllErrorOrValidateInfo().forEach((error) -> { deleteResult.getAllErrorOrValidateInfo().forEach((error) -> {
message.append(error.getMessage()); message.append(error.getMessage());
}); });
}else {
DynamicObject newData = (DynamicObject) new CloneUtils(false, true).clone(dynamicObject);
newData.set("billno", dynamicObject.getString("billno"));
newData.set("billstatus", "C");
newData.set("tqq9_sourcebillno", billnoSet);
SaveServiceHelper.save(new DynamicObject[]{newData});
}
logger.info(entityName + dynamicObject.getString("billno") + "删除失败:" + message); logger.info(entityName + dynamicObject.getString("billno") + "删除失败:" + message);
} else { } else {

View File

@ -60,9 +60,7 @@ public class OtherInApplyFormPlugin extends AbstractBillPlugIn {
if ("tqq9_close".equals(itemKey)) { if ("tqq9_close".equals(itemKey)) {
String billNo = (String) this.getModel().getValue("billno"); String billNo = (String) this.getModel().getValue("billno");
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
"id,billno,org,billentry.warehouse,biztype",
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "tqq9_otherinapply"; String entityType = "tqq9_otherinapply";
String entityName; String entityName;

View File

@ -49,8 +49,7 @@ public class OtherInApplyListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (tqq9_isclose) { if (tqq9_isclose) {
@ -70,8 +69,7 @@ public class OtherInApplyListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (!tqq9_isclose) { if (!tqq9_isclose) {
@ -92,8 +90,7 @@ public class OtherInApplyListPlugin extends AbstractListPlugin {
List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList());
for (String billNo : billnoList) { for (String billNo : billnoList) {
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", "id,billno,org,billentry.warehouse,biztype", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "tqq9_otherinapply"; String entityType = "tqq9_otherinapply";
String entityName; String entityName;

View File

@ -68,9 +68,7 @@ public class OtherOutApplyFormPlugin extends AbstractBillPlugIn {
if ("tqq9_close".equals(itemKey)) { if ("tqq9_close".equals(itemKey)) {
String billNo = (String) this.getModel().getValue("billno"); String billNo = (String) this.getModel().getValue("billno");
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
"id,billno,org,tqq9_biztype,tqq9_ckck,tqq9_bsckfl",
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "tqq9_otheroutapply"; String entityType = "tqq9_otheroutapply";
String entityName; String entityName;

View File

@ -48,8 +48,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (tqq9_isclose) { if (tqq9_isclose) {
@ -75,8 +74,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (!tqq9_isclose) { if (!tqq9_isclose) {
@ -97,8 +95,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin {
List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList());
for (String billNo : billnoList) { for (String billNo : billnoList) {
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", "id,billno,org,tqq9_biztype,tqq9_ckck,tqq9_bsckfl", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "tqq9_otheroutapply"; String entityType = "tqq9_otheroutapply";
String entityName; String entityName;

View File

@ -66,8 +66,7 @@ public class PmPurRefundApplyBillPlugin extends AbstractBillPlugIn {
if ("tqq9_close".equals(itemKey)) { if ("tqq9_close".equals(itemKey)) {
String billNo = (String) this.getModel().getValue("billno"); String billNo = (String) this.getModel().getValue("billno");
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", "id,billno,org,billentry.tqq9_thck", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "pm_purrefundapplybill"; String entityType = "pm_purrefundapplybill";
String entityName; String entityName;

View File

@ -49,8 +49,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (tqq9_isclose) { if (tqq9_isclose) {
@ -76,8 +75,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (!tqq9_isclose) { if (!tqq9_isclose) {
@ -98,8 +96,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin {
List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList());
for (String billNo : billnoList) { for (String billNo : billnoList) {
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", "id,billno,org,billentry.tqq9_thck", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "pm_purrefundapplybill"; String entityType = "pm_purrefundapplybill";
String entityName; String entityName;

View File

@ -65,8 +65,7 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn {
if ("tqq9_close".equals(itemKey)) { if ("tqq9_close".equals(itemKey)) {
String billNo = (String) this.getModel().getValue("billno"); String billNo = (String) this.getModel().getValue("billno");
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "pm_receiptnotice"; String entityType = "pm_receiptnotice";
String entityName; String entityName;
@ -128,8 +127,7 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn {
} else if ("tqq9_partclose".equals(itemKey)) { } else if ("tqq9_partclose".equals(itemKey)) {
String billNo = (String) this.getModel().getValue("billno"); String billNo = (String) this.getModel().getValue("billno");
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "pm_receiptnotice"; String entityType = "pm_receiptnotice";
String entityName; String entityName;

View File

@ -55,8 +55,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (tqq9_isclose) { if (tqq9_isclose) {
@ -76,8 +75,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (!tqq9_isclose) { if (!tqq9_isclose) {
@ -98,8 +96,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin {
List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList());
for (String billNo : billnoList) { for (String billNo : billnoList) {
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "pm_receiptnotice"; String entityType = "pm_receiptnotice";
String entityName; String entityName;
@ -166,8 +163,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin {
List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList());
for (String billNo : billnoList) { for (String billNo : billnoList) {
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "pm_receiptnotice"; String entityType = "pm_receiptnotice";
String entityName; String entityName;

View File

@ -65,8 +65,7 @@ public class SmDeliverNoticeBillPlugin extends AbstractBillPlugIn {
if ("tqq9_close".equals(itemKey)) { if ("tqq9_close".equals(itemKey)) {
String billNo = (String) this.getModel().getValue("billno"); String billNo = (String) this.getModel().getValue("billno");
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", "id,billno,org,tqq9_ck", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "sm_delivernotice"; String entityType = "sm_delivernotice";
String entityName; String entityName;

View File

@ -48,8 +48,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (tqq9_isclose) { if (tqq9_isclose) {
@ -75,8 +74,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin {
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", "id,billno,tqq9_isclose", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
new QFilter[]{new QFilter("billno", QCP.in, billnoList)});
if (null != dataEntity) { if (null != dataEntity) {
boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose");
if (!tqq9_isclose) { if (!tqq9_isclose) {
@ -97,8 +95,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin {
List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); List<String> billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList());
for (String billNo : billnoList) { for (String billNo : billnoList) {
String message = null; String message = null;
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", "id,billno,org,tqq9_ck", DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
new QFilter[]{new QFilter("billno", QCP.equals, billNo)});
String entityType = "sm_delivernotice"; String entityType = "sm_delivernotice";
String entityName; String entityName;