From 8fe054087ce115420881d268e068795c2a7b951e Mon Sep 17 00:00:00 2001 From: sez Date: Thu, 27 Nov 2025 16:59:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/plugin/form/result/CloneBill.java | 22 +++++++++++-------- .../form/result/OtherInApplyFormPlugin.java | 4 +--- .../form/result/OtherInApplyListPlugin.java | 9 +++----- .../form/result/OtherOutApplyFormPlugin.java | 6 ++--- .../form/result/OtherOutApplyListPlugin.java | 9 +++----- .../result/PmPurRefundApplyBillPlugin.java | 3 +-- .../result/PmPurRefundApplyListPlugin.java | 11 ++++------ .../result/PmReceiptNoticeFormPlugin.java | 6 ++--- .../result/PmReceiptNoticeListPlugin.java | 12 ++++------ .../result/SmDeliverNoticeBillPlugin.java | 3 +-- .../result/SmDeliverNoticeListPlugin.java | 11 ++++------ 11 files changed, 38 insertions(+), 58 deletions(-) diff --git a/lc123/cloud/app/plugin/form/result/CloneBill.java b/lc123/cloud/app/plugin/form/result/CloneBill.java index 1922f0d..c975512 100644 --- a/lc123/cloud/app/plugin/form/result/CloneBill.java +++ b/lc123/cloud/app/plugin/form/result/CloneBill.java @@ -22,7 +22,7 @@ public class CloneBill extends AbstractOperationServicePlugIn { private final static Log logger = LogFactory.getLog(CloneBill.class); - public static String cloneOperation(DynamicObject dynamicObject, String entityName,String sourceEntityNumber) { + public static String cloneOperation(DynamicObject dynamicObject, String entityName, String sourceEntityNumber) { String entityNumber = dynamicObject.getDataEntityType().getName(); StringBuilder billnoSet = new StringBuilder(); //找直接上游单据,将上游单据编号存在复制的单据上面 @@ -48,19 +48,23 @@ public class CloneBill extends AbstractOperationServicePlugIn { } } 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(); OperationResult unauditResult = OperationServiceHelper.executeOperate("unaudit", entityNumber, new DynamicObject[]{dynamicObject}, OperateOption.create()); if (unauditResult.isSuccess()) { OperationResult deleteResult = OperationServiceHelper.executeOperate("delete", entityNumber, new DynamicObject[]{dynamicObject}, OperateOption.create()); - deleteResult.getAllErrorOrValidateInfo().forEach((error) -> { - message.append(error.getMessage()); - }); + if (!deleteResult.isSuccess()) { + deleteResult.getAllErrorOrValidateInfo().forEach((error) -> { + 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); } else { diff --git a/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java b/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java index 5be5b24..e73acad 100644 --- a/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java @@ -60,9 +60,7 @@ public class OtherInApplyFormPlugin extends AbstractBillPlugIn { if ("tqq9_close".equals(itemKey)) { String billNo = (String) this.getModel().getValue("billno"); String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", - "id,billno,org,billentry.warehouse,biztype", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "tqq9_otherinapply"; String entityName; diff --git a/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java b/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java index 3e0f9b9..e2b184f 100644 --- a/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java @@ -49,8 +49,7 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (tqq9_isclose) { @@ -70,8 +69,7 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (!tqq9_isclose) { @@ -92,8 +90,7 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); for (String billNo : billnoList) { String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", "id,billno,org,billentry.warehouse,biztype", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "tqq9_otherinapply"; String entityName; diff --git a/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java b/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java index f05a862..67f0b70 100644 --- a/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java @@ -68,9 +68,7 @@ public class OtherOutApplyFormPlugin extends AbstractBillPlugIn { if ("tqq9_close".equals(itemKey)) { String billNo = (String) this.getModel().getValue("billno"); String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", - "id,billno,org,tqq9_biztype,tqq9_ckck,tqq9_bsckfl", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "tqq9_otheroutapply"; String entityName; @@ -123,7 +121,7 @@ public class OtherOutApplyFormPlugin extends AbstractBillPlugIn { message = BillCloseCancelUtils.BGCloseOtherVouchOut(billNo, GZURL, entityType, entityName, label, orderType); } if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) { - cloneOperation(dataEntity, "其他出库申请单","pm_purrefundapplybill"); + cloneOperation(dataEntity, "其他出库申请单", "pm_purrefundapplybill"); } if (StringUtils.isNotEmpty(message)) { this.getView().showMessage(String.valueOf(message)); diff --git a/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java b/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java index 9248e94..4daecbf 100644 --- a/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java @@ -48,8 +48,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (tqq9_isclose) { @@ -75,8 +74,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (!tqq9_isclose) { @@ -97,8 +95,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); for (String billNo : billnoList) { String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", "id,billno,org,tqq9_biztype,tqq9_ckck,tqq9_bsckfl", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "tqq9_otheroutapply"; String entityName; diff --git a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java index eeef23f..7d619d0 100644 --- a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java @@ -66,8 +66,7 @@ public class PmPurRefundApplyBillPlugin extends AbstractBillPlugIn { if ("tqq9_close".equals(itemKey)) { String billNo = (String) this.getModel().getValue("billno"); String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", "id,billno,org,billentry.tqq9_thck", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "pm_purrefundapplybill"; String entityName; diff --git a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java index 8fe900d..30d6889 100644 --- a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java @@ -49,8 +49,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (tqq9_isclose) { @@ -76,8 +75,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (!tqq9_isclose) { @@ -98,8 +96,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); for (String billNo : billnoList) { String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", "id,billno,org,billentry.tqq9_thck", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "pm_purrefundapplybill"; String entityName; @@ -131,7 +128,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { } if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) { - cloneOperation(dataEntity,"采购退货申请单","pm_purorderbill"); + cloneOperation(dataEntity, "采购退货申请单", "pm_purorderbill"); } if (StringUtils.isNotEmpty(message)) { this.getView().showMessage(String.valueOf(message)); diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java index 13ce31c..a32351f 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java @@ -65,8 +65,7 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn { if ("tqq9_close".equals(itemKey)) { String billNo = (String) this.getModel().getValue("billno"); String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "pm_receiptnotice"; String entityName; @@ -128,8 +127,7 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn { } else if ("tqq9_partclose".equals(itemKey)) { String billNo = (String) this.getModel().getValue("billno"); String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "pm_receiptnotice"; String entityName; diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java index b9494a5..3f24b8e 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java @@ -55,8 +55,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (tqq9_isclose) { @@ -76,8 +75,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (!tqq9_isclose) { @@ -98,8 +96,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); for (String billNo : billnoList) { String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "pm_receiptnotice"; String entityName; @@ -166,8 +163,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); for (String billNo : billnoList) { String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", "id,billno,receiveorg,billentry.warehouse", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "pm_receiptnotice"; String entityName; diff --git a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java index 8bc17ce..9c0acfe 100644 --- a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java +++ b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java @@ -65,8 +65,7 @@ public class SmDeliverNoticeBillPlugin extends AbstractBillPlugIn { if ("tqq9_close".equals(itemKey)) { String billNo = (String) this.getModel().getValue("billno"); String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", "id,billno,org,tqq9_ck", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "sm_delivernotice"; String entityName; diff --git a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java index a1433f6..595ee55 100644 --- a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java @@ -48,8 +48,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (tqq9_isclose) { @@ -75,8 +74,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { evt.setCancel(true); return; } - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", "id,billno,tqq9_isclose", - new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.in, billnoList)}); if (null != dataEntity) { boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); if (!tqq9_isclose) { @@ -97,8 +95,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); for (String billNo : billnoList) { String message = null; - DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", "id,billno,org,tqq9_ck", - new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); String entityType = "sm_delivernotice"; String entityName; @@ -126,7 +123,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { message = BillCloseCancelUtils.BGSaCancelSalesOrder(billNo, GZURL, entityType, entityName, label); } if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) { - cloneOperation(dataEntity, "发货通知单","sm_salorder"); + cloneOperation(dataEntity, "发货通知单", "sm_salorder"); } if (StringUtils.isNotEmpty(message)) { this.getView().showMessage(String.valueOf(message));