diff --git a/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java b/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java index e73acad..91cfcac 100644 --- a/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherInApplyFormPlugin.java @@ -43,14 +43,14 @@ public class OtherInApplyFormPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } - String operationKey = evt.getOperationKey(); + /*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 e2b184f..8ca9a4d 100644 --- a/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherInApplyListPlugin.java @@ -39,7 +39,7 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { @Override public void beforeItemClick(BeforeItemClickEvent evt) { super.beforeItemClick(evt); - String itemKey = evt.getItemKey(); + /*String itemKey = evt.getItemKey(); if ("tqq9_close".equals(itemKey)) { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); @@ -77,7 +77,8 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); } } - } + }*/ + } @Override @@ -88,10 +89,18 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); for (String billNo : billnoList) { String message = null; DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otherinapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); + if (tqq9_isclose) { + String billno = dataEntity.getString("billno"); + stringBuilder.append(billno).append(":该单据已关闭").append(","); + continue; + } + String entityType = "tqq9_otherinapply"; String entityName; String label = "tqq9_isclose"; @@ -146,7 +155,8 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { } if (StringUtils.isNotEmpty(message)) { - this.getView().showMessage(String.valueOf(message)); + stringBuilder.append(dataEntity.getString("billno")).append(":").append(message).append(","); +// this.getView().showMessage(String.valueOf(message)); } if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) { @@ -160,6 +170,10 @@ public class OtherInApplyListPlugin extends AbstractListPlugin { } + if (stringBuilder.length() > 0 && stringBuilder.charAt(stringBuilder.length() - 1) == ',') { + StringBuilder tip = stringBuilder.deleteCharAt(stringBuilder.length() - 1); + this.getView().showMessage(tip.toString()); + } } } } diff --git a/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java b/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java index 67f0b70..0c1e9f1 100644 --- a/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherOutApplyFormPlugin.java @@ -51,14 +51,14 @@ public class OtherOutApplyFormPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } - String operationKey = evt.getOperationKey(); + /*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 4daecbf..b4bf08f 100644 --- a/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/OtherOutApplyListPlugin.java @@ -38,7 +38,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { @Override public void beforeItemClick(BeforeItemClickEvent evt) { super.beforeItemClick(evt); - String itemKey = evt.getItemKey(); + /*String itemKey = evt.getItemKey(); if ("tqq9_close".equals(itemKey)) { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); @@ -82,7 +82,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); } } - } + }*/ } @Override @@ -93,10 +93,26 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); for (String billNo : billnoList) { String message = null; DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("tqq9_otheroutapply", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); + if (tqq9_isclose) { + String billno = dataEntity.getString("billno"); + stringBuilder.append(billno).append(":该单据已关闭").append(","); + continue; + } + + Map> targetBills = BFTrackerServiceHelper.findTargetBills("tqq9_otheroutapply", new Long[]{dataEntity.getLong("id")}); + //下游存在系统进行提示不允许后续操作 + if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_otheroutbill")) { + String billno = dataEntity.getString("billno"); + stringBuilder.append(billno).append(":存在下游单据,不允许拦截").append(","); + continue; + } + String entityType = "tqq9_otheroutapply"; String entityName; String label = "tqq9_isclose"; @@ -151,13 +167,19 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin { cloneOperation(dataEntity, "其他出库申请单","pm_purrefundapplybill"); } if (StringUtils.isNotEmpty(message)) { - this.getView().showMessage(String.valueOf(message)); + stringBuilder.append(dataEntity.getString("billno")).append(":").append(message).append(","); +// this.getView().showMessage(String.valueOf(message)); } } } + if (stringBuilder.length() > 0 && stringBuilder.charAt(stringBuilder.length() - 1) == ',') { + StringBuilder tip = stringBuilder.deleteCharAt(stringBuilder.length() - 1); + this.getView().showMessage(tip.toString()); + } + } } } diff --git a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java index 7d619d0..48d4b0f 100644 --- a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyBillPlugin.java @@ -49,14 +49,14 @@ public class PmPurRefundApplyBillPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } - String operationKey = evt.getOperationKey(); + /*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 30d6889..ec7cc94 100644 --- a/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmPurRefundApplyListPlugin.java @@ -39,7 +39,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { @Override public void beforeItemClick(BeforeItemClickEvent evt) { super.beforeItemClick(evt); - String itemKey = evt.getItemKey(); + /*String itemKey = evt.getItemKey(); if ("tqq9_close".equals(itemKey)) { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); @@ -83,7 +83,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { evt.setCancel(true); } } - } + }*/ } @Override @@ -94,10 +94,24 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); for (String billNo : billnoList) { String message = null; DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_purrefundapplybill", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); + if (tqq9_isclose) { + String billno = dataEntity.getString("billno"); + stringBuilder.append(billno).append(":该单据已关闭").append(","); + continue; + } + Map> targetBills = BFTrackerServiceHelper.findTargetBills("pm_purrefundapplybill", new Long[]{dataEntity.getLong("id")}); + //下游存在系统进行提示不允许后续操作 + if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_purinbill")) { + String billno = dataEntity.getString("billno"); + stringBuilder.append(billno).append(":存在下游单据,不允许拦截").append(","); + continue; + } String entityType = "pm_purrefundapplybill"; String entityName; String label = "tqq9_isclose"; @@ -131,14 +145,19 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin { cloneOperation(dataEntity, "采购退货申请单", "pm_purorderbill"); } if (StringUtils.isNotEmpty(message)) { - this.getView().showMessage(String.valueOf(message)); - + stringBuilder.append(dataEntity.getString("billno")).append(":").append(message).append(","); +// this.getView().showMessage(String.valueOf(message)); } } } + if (stringBuilder.length() > 0 && stringBuilder.charAt(stringBuilder.length() - 1) == ',') { + StringBuilder tip = stringBuilder.deleteCharAt(stringBuilder.length() - 1); + this.getView().showMessage(tip.toString()); + } + } } } diff --git a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java index a32351f..e248b29 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeFormPlugin.java @@ -48,14 +48,14 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } - String operationKey = evt.getOperationKey(); + /*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 3f24b8e..c53ccc7 100644 --- a/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/PmReceiptNoticeListPlugin.java @@ -45,7 +45,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { @Override public void beforeItemClick(BeforeItemClickEvent evt) { super.beforeItemClick(evt); - String itemKey = evt.getItemKey(); + /*String itemKey = evt.getItemKey(); if ("tqq9_close".equals(itemKey)) { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); @@ -83,7 +83,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { evt.setCancel(true); } } - } + }*/ } @Override @@ -94,10 +94,17 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); for (String billNo : billnoList) { String message = null; DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("pm_receiptnotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); + if (tqq9_isclose) { + String billno = dataEntity.getString("billno"); + stringBuilder.append(billno).append(":该单据已关闭").append(","); + continue; + } String entityType = "pm_receiptnotice"; String entityName; String label = "tqq9_isclose"; @@ -129,8 +136,8 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { } if (StringUtils.isNotEmpty(message)) { - this.getView().showMessage(String.valueOf(message)); - + stringBuilder.append(dataEntity.getString("billno")).append(":").append(message).append(","); +// this.getView().showMessage(String.valueOf(message)); } if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) { Map> targetBills = BFTrackerServiceHelper.findTargetBills("pm_receiptnotice", new Long[]{dataEntity.getLong("id")}); @@ -138,7 +145,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { if (null == targetBills || targetBills.size() == 0) { cloneOperation(dataEntity, "收货通知单", "pm_purorderbill"); } - StringBuilder stringBuilder = new StringBuilder(); +// StringBuilder stringBuilder = new StringBuilder(); //下游存在采购入库单,调用系统标准关闭 if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_purinbill")) { OperationResult bizcloseResult = OperationServiceHelper.executeOperate("bizclose", "pm_receiptnotice", new DynamicObject[]{dataEntity}, OperateOption.create()); @@ -156,6 +163,10 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin { } } + if (stringBuilder.length() > 0 && stringBuilder.charAt(stringBuilder.length() - 1) == ',') { + StringBuilder tip = stringBuilder.deleteCharAt(stringBuilder.length() - 1); + this.getView().showMessage(tip.toString()); + } } else if ("tqq9_partclose".equals(itemKey)) { BillList billList = this.getControl("billlistap"); diff --git a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java index 9c0acfe..f06fe0c 100644 --- a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java +++ b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeBillPlugin.java @@ -48,14 +48,14 @@ public class SmDeliverNoticeBillPlugin extends AbstractBillPlugIn { evt.setCancel(true); } } - String operationKey = evt.getOperationKey(); + /*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 595ee55..ebb5b9b 100644 --- a/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java +++ b/lc123/cloud/app/plugin/form/result/SmDeliverNoticeListPlugin.java @@ -38,7 +38,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { @Override public void beforeItemClick(BeforeItemClickEvent evt) { super.beforeItemClick(evt); - String itemKey = evt.getItemKey(); + /*String itemKey = evt.getItemKey(); if ("tqq9_close".equals(itemKey)) { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); @@ -82,7 +82,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { evt.setCancel(true); } } - } + }*/ } @Override @@ -93,10 +93,24 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); List billnoList = selectedRows.stream().map(ListSelectedRow::getBillNo).distinct().collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); for (String billNo : billnoList) { String message = null; DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle("sm_delivernotice", new QFilter[]{new QFilter("billno", QCP.equals, billNo)}); + boolean tqq9_isclose = dataEntity.getBoolean("tqq9_isclose"); + if (tqq9_isclose) { + String billno = dataEntity.getString("billno"); + stringBuilder.append(billno).append(":该单据已关闭").append(","); + continue; + } + Map> targetBills = BFTrackerServiceHelper.findTargetBills("sm_delivernotice", new Long[]{dataEntity.getLong("id")}); + //下游存在系统进行提示不允许后续操作 + if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_saloutbill")) { + String billno = dataEntity.getString("billno"); + stringBuilder.append(billno).append(":存在下游单据,不允许拦截").append(","); + continue; + } String entityType = "sm_delivernotice"; String entityName; String label = "tqq9_isclose"; @@ -126,13 +140,17 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin { cloneOperation(dataEntity, "发货通知单", "sm_salorder"); } if (StringUtils.isNotEmpty(message)) { - this.getView().showMessage(String.valueOf(message)); - + stringBuilder.append(dataEntity.getString("billno")).append(":").append(message).append(","); +// this.getView().showMessage(String.valueOf(message)); } } } + if (stringBuilder.length() > 0 && stringBuilder.charAt(stringBuilder.length() - 1) == ',') { + StringBuilder tip = stringBuilder.deleteCharAt(stringBuilder.length() - 1); + this.getView().showMessage(tip.toString()); + } } } diff --git a/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java b/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java index 41ca469..5216640 100644 --- a/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java +++ b/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java @@ -321,7 +321,7 @@ public class MaterialBillPlugin extends AbstractBillPlugIn { // String copySrcBillNumber = this.getPageCache().get("copySrcBillNumber"); DynamicObject dataEntity = this.getModel().getDataEntity(true); dataEntity.set("number", copySrcBillNumber + "_copy"); - dataEntity.set("name", copySrcBillName); + dataEntity.set("name", copySrcBillName + "_copy"); dataEntity.set("tqq9_srcnumber", copySrcBillNumber); this.getView().invokeOperation("save"); }