关闭拦截
This commit is contained in:
parent
da59c5bf48
commit
95d84bd3e2
|
|
@ -22,7 +22,7 @@ public class CloneBill extends AbstractOperationServicePlugIn {
|
|||
private final static Log logger = LogFactory.getLog(CloneBill.class);
|
||||
|
||||
|
||||
public static void cloneOperation(DynamicObject dynamicObject) {
|
||||
public static void cloneOperation(DynamicObject dynamicObject, String entityName,String sourceEntityNumber) {
|
||||
String entityNumber = dynamicObject.getDataEntityType().getName();
|
||||
StringBuilder billnoSet = new StringBuilder();
|
||||
//找直接上游单据,将上游单据编号存在复制的单据上面
|
||||
|
|
@ -32,7 +32,7 @@ public class CloneBill extends AbstractOperationServicePlugIn {
|
|||
if (null != bfRows) {
|
||||
for (BFRow bfRow : bfRows) {
|
||||
Long billId = bfRow.getSId().getBillId();//获取到采购退货申请id
|
||||
DynamicObject[] pm_purrefundapplybill = BusinessDataServiceHelper.load("pm_purrefundapplybill", "billno",
|
||||
DynamicObject[] pm_purrefundapplybill = BusinessDataServiceHelper.load(sourceEntityNumber, "billno",
|
||||
new QFilter[]{new QFilter("id", "=", billId)});
|
||||
|
||||
for (int i = 0; i < pm_purrefundapplybill.length; i++) {
|
||||
|
|
@ -62,12 +62,12 @@ public class CloneBill extends AbstractOperationServicePlugIn {
|
|||
message.append(error.getMessage());
|
||||
});
|
||||
|
||||
logger.info(dynamicObject.getString("billno") + "删除失败:" + message);
|
||||
logger.info(entityName + dynamicObject.getString("billno") + "删除失败:" + message);
|
||||
} else {
|
||||
unauditResult.getAllErrorOrValidateInfo().forEach((error) -> {
|
||||
message.append(error.getMessage());
|
||||
});
|
||||
logger.info(dynamicObject.getString("billno") + "反审核失败:" + message);
|
||||
logger.info(entityName + dynamicObject.getString("billno") + "反审核失败:" + message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,14 @@ import kd.bos.form.control.events.ItemClickEvent;
|
|||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
||||
|
|
@ -41,7 +44,7 @@ public class OtherInApplyFormPlugin extends AbstractBillPlugIn {
|
|||
}
|
||||
}
|
||||
String operationKey = evt.getOperationKey();
|
||||
if ("unaudit".equals(operationKey)){
|
||||
if ("unaudit".equals(operationKey)) {
|
||||
boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose");
|
||||
if (!tqq9_isclose) {
|
||||
this.getView().showMessage("请先关闭该单据,然后进行反审核");
|
||||
|
|
@ -109,13 +112,16 @@ public class OtherInApplyFormPlugin extends AbstractBillPlugIn {
|
|||
message = BillCloseCancelUtils.BGCloseOtherVouchIn(billNo, GZURL, entityType, entityName, label);
|
||||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("tqq9_otherinapply", new Long[]{dataEntity.getLong("id")});
|
||||
//如果下游没有其他入库单,就克隆单据原单删除
|
||||
if (null == targetBills || targetBills.size() == 0) {
|
||||
cloneOperation(dataEntity, "其他入库申请单", "im_otheroutbill");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,12 +11,15 @@ 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.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
|
@ -78,6 +81,7 @@ public class OtherInApplyListPlugin extends AbstractListPlugin {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void itemClick(ItemClickEvent evt) {
|
||||
super.itemClick(evt);
|
||||
|
|
@ -143,14 +147,18 @@ public class OtherInApplyListPlugin extends AbstractListPlugin {
|
|||
message = BillCloseCancelUtils.BGCloseOtherVouchIn(billNo, GZURL, entityType, entityName, label);
|
||||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("tqq9_otherinapply", new Long[]{dataEntity.getLong("id")});
|
||||
//如果下游没有其他入库单,就克隆单据原单删除
|
||||
if (null == targetBills || targetBills.size() == 0) {
|
||||
cloneOperation(dataEntity, "其他入库申请单", "im_otheroutbill");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,19 @@ import kd.bos.bill.AbstractBillPlugIn;
|
|||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.form.control.events.BeforeItemClickEvent;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
||||
|
|
@ -19,6 +24,7 @@ import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
|||
|
||||
public class OtherOutApplyFormPlugin extends AbstractBillPlugIn {
|
||||
|
||||
private final static Log logger = LogFactory.getLog(OtherOutApplyFormPlugin.class);
|
||||
|
||||
@Override
|
||||
public void registerListener(EventObject e) {
|
||||
|
|
@ -37,9 +43,16 @@ public class OtherOutApplyFormPlugin extends AbstractBillPlugIn {
|
|||
this.getView().showMessage("该单据已关闭");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("tqq9_otheroutapply", new Long[]{dataEntity.getLong("id")});
|
||||
//下游存在系统进行提示不允许后续操作
|
||||
if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_otheroutbill")) {
|
||||
this.getView().showMessage("存在下游单据,不允许拦截");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
}
|
||||
String operationKey = evt.getOperationKey();
|
||||
if ("unaudit".equals(operationKey)){
|
||||
if ("unaudit".equals(operationKey)) {
|
||||
boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose");
|
||||
if (!tqq9_isclose) {
|
||||
this.getView().showMessage("请先关闭该单据,然后进行反审核");
|
||||
|
|
@ -110,7 +123,7 @@ public class OtherOutApplyFormPlugin extends AbstractBillPlugIn {
|
|||
message = BillCloseCancelUtils.BGCloseOtherVouchOut(billNo, GZURL, entityType, entityName, label, orderType);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
cloneOperation(dataEntity, "其他出库申请单","pm_purrefundapplybill");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
|
|
|||
|
|
@ -10,12 +10,15 @@ 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.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
|
@ -53,6 +56,12 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin {
|
|||
this.getView().showMessage("该单据已关闭");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("tqq9_otheroutapply", new Long[]{dataEntity.getLong("id")});
|
||||
//下游存在系统进行提示不允许后续操作
|
||||
if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_otheroutbill")) {
|
||||
this.getView().showMessage("存在下游单据,不允许拦截");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -142,7 +151,7 @@ public class OtherOutApplyListPlugin extends AbstractListPlugin {
|
|||
message = BillCloseCancelUtils.BGCloseOtherVouchOut(billNo, GZURL, entityType, entityName, label, orderType);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
cloneOperation(dataEntity, "其他出库申请单","pm_purrefundapplybill");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
|
|
|||
|
|
@ -8,11 +8,14 @@ import kd.bos.form.control.events.ItemClickEvent;
|
|||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
||||
|
|
@ -38,6 +41,13 @@ public class PmPurRefundApplyBillPlugin extends AbstractBillPlugIn {
|
|||
this.getView().showMessage("该单据已关闭");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("pm_purrefundapplybill", new Long[]{dataEntity.getLong("id")});
|
||||
//下游存在系统进行提示不允许后续操作
|
||||
if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_purinbill")) {
|
||||
this.getView().showMessage("存在下游单据,不允许拦截");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
}
|
||||
String operationKey = evt.getOperationKey();
|
||||
if ("unaudit".equals(operationKey)){
|
||||
|
|
@ -75,21 +85,21 @@ public class PmPurRefundApplyBillPlugin extends AbstractBillPlugIn {
|
|||
}
|
||||
}
|
||||
String orderType = "CGTH";
|
||||
entityName = "WMS-SH-收货通知单取消";
|
||||
entityName = "WMS-SH-采购退货申请单取消";
|
||||
message = BillCloseCancelUtils.wmsCancel(orderType, warehouseCode, billNo, entityType, entityName, label);
|
||||
} else if ("BJLC".equals(number)) {
|
||||
String BJ_URL = ConfigUtils.getThirdConfigByNumber("BJ_POSTURL");
|
||||
entityName = "WMS-BJ-收货通知单取消";
|
||||
entityName = "WMS-BJ-采购退货申请单取消";
|
||||
message = BillCloseCancelUtils.BGPuCancelPurReturn(billNo, BJ_URL, entityType, entityName, label);
|
||||
|
||||
} else if ("GZLC".equals(number)) {
|
||||
String GZURL = ConfigUtils.getThirdConfigByNumber("GZ_POSTURL");
|
||||
entityName = "WMS-GZ-收货通知单取消";
|
||||
entityName = "WMS-GZ-采购退货申请单取消";
|
||||
message = BillCloseCancelUtils.BGPuCancelPurReturn(billNo, GZURL, entityType, entityName, label);
|
||||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
cloneOperation(dataEntity,"采购退货申请单","pm_purorderbill");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
|
|
|||
|
|
@ -11,12 +11,15 @@ 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.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
|
@ -54,6 +57,12 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin {
|
|||
this.getView().showMessage("该单据已关闭");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("pm_purrefundapplybill", new Long[]{dataEntity.getLong("id")});
|
||||
//下游存在系统进行提示不允许后续操作
|
||||
if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_purinbill")) {
|
||||
this.getView().showMessage("存在下游单据,不允许拦截");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -122,7 +131,7 @@ public class PmPurRefundApplyListPlugin extends AbstractListPlugin {
|
|||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
cloneOperation(dataEntity,"采购退货申请单","pm_purorderbill");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
|
|
|||
|
|
@ -1,18 +1,26 @@
|
|||
package tqq9.lc123.cloud.app.plugin.form.result;
|
||||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.OperateOption;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.form.control.events.BeforeItemClickEvent;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
||||
|
|
@ -20,6 +28,7 @@ import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
|||
|
||||
public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn {
|
||||
|
||||
private final static Log logger = LogFactory.getLog(PmReceiptNoticeFormPlugin.class);
|
||||
|
||||
@Override
|
||||
public void registerListener(EventObject e) {
|
||||
|
|
@ -40,7 +49,7 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn {
|
|||
}
|
||||
}
|
||||
String operationKey = evt.getOperationKey();
|
||||
if ("unaudit".equals(operationKey)){
|
||||
if ("unaudit".equals(operationKey)) {
|
||||
boolean tqq9_isclose = (boolean) this.getModel().getValue("tqq9_isclose");
|
||||
if (!tqq9_isclose) {
|
||||
this.getView().showMessage("请先关闭该单据,然后进行反审核");
|
||||
|
|
@ -88,18 +97,35 @@ public class PmReceiptNoticeFormPlugin extends AbstractBillPlugIn {
|
|||
message = BillCloseCancelUtils.BGPurOrderCancel(billNo, GZURL, entityType, entityName, label);
|
||||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("pm_receiptnotice", new Long[]{dataEntity.getLong("id")});
|
||||
//如果下游没有采购入库单,就克隆单据原单删除
|
||||
if (null == targetBills || targetBills.size() == 0) {
|
||||
cloneOperation(dataEntity, "收货通知单", "pm_purorderbill");
|
||||
}
|
||||
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());
|
||||
if (!bizcloseResult.isSuccess()) {
|
||||
|
||||
bizcloseResult.getAllErrorOrValidateInfo().forEach((error) -> {
|
||||
stringBuilder.append(error.getMessage());
|
||||
});
|
||||
if (stringBuilder.length() > 0) {
|
||||
logger.info("收货通知单:" + dataEntity.getString("billno") + "调用bizclose失败:" + stringBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if ("tqq9_partclose".equals(itemKey)) {
|
||||
} 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",
|
||||
|
|
|
|||
|
|
@ -1,24 +1,30 @@
|
|||
package tqq9.lc123.cloud.app.plugin.form.result;
|
||||
|
||||
import kd.bos.dataentity.OperateOption;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.datamodel.ListSelectedRow;
|
||||
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
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.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
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.servicehelper.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
|
@ -27,6 +33,7 @@ import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
|||
|
||||
public class PmReceiptNoticeListPlugin extends AbstractListPlugin {
|
||||
|
||||
private final static Log logger = LogFactory.getLog(PmReceiptNoticeListPlugin.class);
|
||||
|
||||
@Override
|
||||
public void registerListener(EventObject e) {
|
||||
|
|
@ -34,6 +41,7 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin {
|
|||
//标准单据列表模板为bos_list,需使用该模板中的控件标识(如工具栏标识toolbarap)进行监听。
|
||||
// 列表插件继承AbstractListPlugin时,底层已默认注册工具栏监听,无需重复注册
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeItemClick(BeforeItemClickEvent evt) {
|
||||
super.beforeItemClick(evt);
|
||||
|
|
@ -122,14 +130,32 @@ public class PmReceiptNoticeListPlugin extends AbstractListPlugin {
|
|||
message = BillCloseCancelUtils.BGPurOrderCancel(billNo, GZURL, entityType, entityName, label);
|
||||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("pm_receiptnotice", new Long[]{dataEntity.getLong("id")});
|
||||
//如果下游没有采购入库单,就克隆单据原单删除
|
||||
if (null == targetBills || targetBills.size() == 0) {
|
||||
cloneOperation(dataEntity, "收货通知单", "pm_purorderbill");
|
||||
}
|
||||
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());
|
||||
if (!bizcloseResult.isSuccess()) {
|
||||
|
||||
bizcloseResult.getAllErrorOrValidateInfo().forEach((error) -> {
|
||||
stringBuilder.append(error.getMessage());
|
||||
});
|
||||
if (stringBuilder.length() > 0) {
|
||||
logger.info("收货通知单:" + dataEntity.getString("billno") + "调用bizclose失败:" + stringBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,14 @@ import kd.bos.form.control.events.ItemClickEvent;
|
|||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
||||
|
|
@ -37,6 +40,13 @@ public class SmDeliverNoticeBillPlugin extends AbstractBillPlugIn {
|
|||
this.getView().showMessage("该单据已关闭");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("sm_delivernotice", new Long[]{dataEntity.getLong("id")});
|
||||
//下游存在系统进行提示不允许后续操作
|
||||
if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_saloutbill")) {
|
||||
this.getView().showMessage("存在下游单据,不允许拦截");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
}
|
||||
String operationKey = evt.getOperationKey();
|
||||
if ("unaudit".equals(operationKey)){
|
||||
|
|
@ -71,21 +81,21 @@ public class SmDeliverNoticeBillPlugin extends AbstractBillPlugIn {
|
|||
warehouseCode = warehouse.getString("number");
|
||||
}
|
||||
String orderType = "PTCK";
|
||||
entityName = "WMS-SH-收货通知单取消";
|
||||
entityName = "WMS-SH-发货通知单取消";
|
||||
message = BillCloseCancelUtils.wmsCancel(orderType, warehouseCode, billNo, entityType, entityName, label);
|
||||
} else if ("BJLC".equals(number)) {
|
||||
String BJ_URL = ConfigUtils.getThirdConfigByNumber("BJ_POSTURL");
|
||||
entityName = "WMS-BJ-收货通知单取消";
|
||||
entityName = "WMS-BJ-发货通知单取消";
|
||||
message = BillCloseCancelUtils.BGSaCancelSalesOrder(billNo, BJ_URL, entityType, entityName, label);
|
||||
|
||||
} else if ("GZLC".equals(number)) {
|
||||
String GZURL = ConfigUtils.getThirdConfigByNumber("GZ_POSTURL");
|
||||
entityName = "WMS-GZ-收货通知单取消";
|
||||
entityName = "WMS-GZ-发货通知单取消";
|
||||
message = BillCloseCancelUtils.BGSaCancelSalesOrder(billNo, GZURL, entityType, entityName, label);
|
||||
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
cloneOperation(dataEntity,"发货通知单","sm_salorder");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
|
|
|||
|
|
@ -10,12 +10,15 @@ 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.botp.BFTrackerServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.BillCloseCancelUtils;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static tqq9.lc123.cloud.app.plugin.form.result.CloneBill.cloneOperation;
|
||||
|
|
@ -53,6 +56,12 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin {
|
|||
this.getView().showMessage("该单据已关闭");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
Map<String, HashSet<Long>> targetBills = BFTrackerServiceHelper.findTargetBills("sm_delivernotice", new Long[]{dataEntity.getLong("id")});
|
||||
//下游存在系统进行提示不允许后续操作
|
||||
if (null != targetBills && targetBills.size() > 0 && targetBills.containsKey("im_saloutbill")) {
|
||||
this.getView().showMessage("存在下游单据,不允许拦截");
|
||||
evt.setCancel(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -117,7 +126,7 @@ public class SmDeliverNoticeListPlugin extends AbstractListPlugin {
|
|||
message = BillCloseCancelUtils.BGSaCancelSalesOrder(billNo, GZURL, entityType, entityName, label);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message) && message.contains("关闭成功")) {
|
||||
cloneOperation(dataEntity);
|
||||
cloneOperation(dataEntity, "发货通知单","sm_salorder");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
this.getView().showMessage(String.valueOf(message));
|
||||
|
|
|
|||
Loading…
Reference in New Issue