fix:
1.装箱单效验 2.发运明细审核效验
This commit is contained in:
parent
67fec9f726
commit
39fa056aa4
@ -150,13 +150,23 @@ public class EncaseMentEdit extends AbstractBillPlugIn implements Plugin, Before
|
|||||||
deleteEntryRow();
|
deleteEntryRow();
|
||||||
break;
|
break;
|
||||||
case "statusconvertpjqr":
|
case "statusconvertpjqr":
|
||||||
lockAccessoriesPackaging(false);
|
String yemWeightconfirmed = (String) this.getModel().getValue("yem_weightconfirmed");
|
||||||
|
if (!yemWeightconfirmed.isEmpty()) {
|
||||||
|
lockAccessoriesPackaging(false);
|
||||||
|
} else {
|
||||||
|
this.getView().showMessage("锁定重量是否确认为空!!!");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "statusconvertpjfqr":
|
case "statusconvertpjfqr":
|
||||||
lockAccessoriesPackaging(true);
|
lockAccessoriesPackaging(true);
|
||||||
break;
|
break;
|
||||||
case "statusconvertqrzj":
|
case "statusconvertqrzj":
|
||||||
lockRemovable(false);
|
String yemWeightconfirmeds = (String) this.getModel().getValue("yem_weightconfirmed");
|
||||||
|
if (!yemWeightconfirmeds.isEmpty()) {
|
||||||
|
lockRemovable(false);
|
||||||
|
} else {
|
||||||
|
this.getView().showMessage("锁定重量是否确认为空!!!");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "statusconvertfqrzj":
|
case "statusconvertfqrzj":
|
||||||
lockRemovable(true);
|
lockRemovable(true);
|
||||||
@ -175,98 +185,102 @@ public class EncaseMentEdit extends AbstractBillPlugIn implements Plugin, Before
|
|||||||
IDataModel model = this.getModel();
|
IDataModel model = this.getModel();
|
||||||
DynamicObject dataEntity = model.getDataEntity(true);
|
DynamicObject dataEntity = model.getDataEntity(true);
|
||||||
if ("statusconvertpjqr".equals(operateKey) || "statusconvertqrzj".equals(operateKey)) {
|
if ("statusconvertpjqr".equals(operateKey) || "statusconvertqrzj".equals(operateKey)) {
|
||||||
|
String yemWeightconfirmed = (String) this.getModel().getValue("yem_weightconfirmed");
|
||||||
DynamicObjectCollection collection = dataEntity.getDynamicObjectCollection("yem_im_packinginfor_pi");
|
if (!yemWeightconfirmed.isEmpty()) {
|
||||||
StringBuilder sb = new StringBuilder();
|
DynamicObjectCollection collection = dataEntity.getDynamicObjectCollection("yem_im_packinginfor_pi");
|
||||||
for (DynamicObject dynamicObject : collection) {
|
StringBuilder sb = new StringBuilder();
|
||||||
int index = collection.indexOf(dynamicObject);
|
for (DynamicObject dynamicObject : collection) {
|
||||||
// 整柜重量
|
int index = collection.indexOf(dynamicObject);
|
||||||
BigDecimal wholew = dynamicObject.getBigDecimal("yem_wholew");
|
// 整柜重量
|
||||||
if (YEM.isNotEmpty(wholew) && wholew.compareTo(new BigDecimal(25000)) > 0) {
|
BigDecimal wholew = dynamicObject.getBigDecimal("yem_wholew");
|
||||||
sb.append(String.format("装柜信息第 [ %S ] 行的整柜重量超出25吨!", index + 1)).append("\r\n");
|
if (YEM.isNotEmpty(wholew) && wholew.compareTo(new BigDecimal(25000)) > 0) {
|
||||||
}
|
sb.append(String.format("装柜信息第 [ %S ] 行的整柜重量超出25吨!", index + 1)).append("\r\n");
|
||||||
}
|
|
||||||
|
|
||||||
if ("statusconvertqrzj".equals(operateKey)) {
|
|
||||||
auditValidator(dataEntity);
|
|
||||||
|
|
||||||
BigDecimal qty = BigDecimal.ZERO;
|
|
||||||
BigDecimal weight = BigDecimal.ZERO;
|
|
||||||
DynamicObjectCollection imMaterialinfoMi = dataEntity.getDynamicObjectCollection("yem_im_materialinfo_mi");
|
|
||||||
BigDecimal sumwholenum = dataEntity.getBigDecimal("yem_sumwholenum");
|
|
||||||
BigDecimal sumwholew = dataEntity.getBigDecimal("yem_sumwholew");
|
|
||||||
StringBuilder sbStr = new StringBuilder();
|
|
||||||
HashSet<Long> sourceIds = Sets.newHashSet();
|
|
||||||
|
|
||||||
for (DynamicObject dynamicObject : imMaterialinfoMi) {
|
|
||||||
int index = imMaterialinfoMi.indexOf(dynamicObject);
|
|
||||||
sourceIds.add(dynamicObject.getLong("yem_sourceentryid"));
|
|
||||||
BigDecimal totalqty = dynamicObject.getBigDecimal("yem_totalqty");
|
|
||||||
BigDecimal netweightsum = dynamicObject.getBigDecimal("yem_netweightsum");
|
|
||||||
qty = qty.add(totalqty);
|
|
||||||
weight = weight.add(netweightsum);
|
|
||||||
String businesssort = dynamicObject.getString("yem_businesssort");
|
|
||||||
BigDecimal singlestandardqty = dynamicObject.getBigDecimal("yem_singlestandardqty");
|
|
||||||
if ("Z".equals(businesssort) && singlestandardqty.compareTo(BigDecimal.ZERO) <= 0) {
|
|
||||||
sbStr.append(String.format("明细信息第 %s 行,单台标准件数必录,请检查!!", index + 1)).append("\r\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (qty.compareTo(sumwholenum) > 0) {
|
|
||||||
sbStr.append("明细信息总件数合计值不允许超过整机总件数,请检查!!\r\n");
|
if ("statusconvertqrzj".equals(operateKey)) {
|
||||||
|
auditValidator(dataEntity);
|
||||||
|
|
||||||
|
BigDecimal qty = BigDecimal.ZERO;
|
||||||
|
BigDecimal weight = BigDecimal.ZERO;
|
||||||
|
DynamicObjectCollection imMaterialinfoMi = dataEntity.getDynamicObjectCollection("yem_im_materialinfo_mi");
|
||||||
|
BigDecimal sumwholenum = dataEntity.getBigDecimal("yem_sumwholenum");
|
||||||
|
BigDecimal sumwholew = dataEntity.getBigDecimal("yem_sumwholew");
|
||||||
|
StringBuilder sbStr = new StringBuilder();
|
||||||
|
HashSet<Long> sourceIds = Sets.newHashSet();
|
||||||
|
|
||||||
|
for (DynamicObject dynamicObject : imMaterialinfoMi) {
|
||||||
|
int index = imMaterialinfoMi.indexOf(dynamicObject);
|
||||||
|
sourceIds.add(dynamicObject.getLong("yem_sourceentryid"));
|
||||||
|
BigDecimal totalqty = dynamicObject.getBigDecimal("yem_totalqty");
|
||||||
|
BigDecimal netweightsum = dynamicObject.getBigDecimal("yem_netweightsum");
|
||||||
|
qty = qty.add(totalqty);
|
||||||
|
weight = weight.add(netweightsum);
|
||||||
|
String businesssort = dynamicObject.getString("yem_businesssort");
|
||||||
|
BigDecimal singlestandardqty = dynamicObject.getBigDecimal("yem_singlestandardqty");
|
||||||
|
if ("Z".equals(businesssort) && singlestandardqty.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
sbStr.append(String.format("明细信息第 %s 行,单台标准件数必录,请检查!!", index + 1)).append("\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (qty.compareTo(sumwholenum) > 0) {
|
||||||
|
sbStr.append("明细信息总件数合计值不允许超过整机总件数,请检查!!\r\n");
|
||||||
// throw new KDBizException("明细信息总件数合计值不允许超过整机总件数,请检查!!");
|
// throw new KDBizException("明细信息总件数合计值不允许超过整机总件数,请检查!!");
|
||||||
}
|
}
|
||||||
if (weight.compareTo(sumwholew) > 0) {
|
if (weight.compareTo(sumwholew) > 0) {
|
||||||
sbStr.append("明细信息总净重合计值不允许超过整机总重量,请检查!!");
|
sbStr.append("明细信息总净重合计值不允许超过整机总重量,请检查!!");
|
||||||
// throw new KDBizException("明细信息总净重合计值不允许超过整机总重量,请检查!!");
|
// throw new KDBizException("明细信息总净重合计值不允许超过整机总重量,请检查!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sbStr.length() > 0) {
|
if (sbStr.length() > 0) {
|
||||||
throw new KDBizException(sbStr.toString());
|
throw new KDBizException(sbStr.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
String selectfields = DynamicObjectUtil.getSelectfields("yem_es_storagetrans");
|
String selectfields = DynamicObjectUtil.getSelectfields("yem_es_storagetrans");
|
||||||
String storagetransSelectfields = DynamicObjectUtil.getEntrySelectfields(selectfields, "yem_es_storagetrans", "yem_es_materialinfo");
|
String storagetransSelectfields = DynamicObjectUtil.getEntrySelectfields(selectfields, "yem_es_storagetrans", "yem_es_materialinfo");
|
||||||
DynamicObject[] load = BusinessDataServiceHelper.load("yem_es_storagetrans", storagetransSelectfields, new QFilter[]{new QFilter("yem_es_materialinfo.id", "in", sourceIds)});
|
DynamicObject[] load = BusinessDataServiceHelper.load("yem_es_storagetrans", storagetransSelectfields, new QFilter[]{new QFilter("yem_es_materialinfo.id", "in", sourceIds)});
|
||||||
for (DynamicObject dynamicObject : load) {
|
for (DynamicObject dynamicObject : load) {
|
||||||
DynamicObjectCollection sourceCollection = dynamicObject.getDynamicObjectCollection("yem_es_materialinfo");
|
DynamicObjectCollection sourceCollection = dynamicObject.getDynamicObjectCollection("yem_es_materialinfo");
|
||||||
for (DynamicObject source : sourceCollection) {
|
for (DynamicObject source : sourceCollection) {
|
||||||
long existId = source.getLong("id");
|
long existId = source.getLong("id");
|
||||||
for (DynamicObject target : imMaterialinfoMi) {
|
for (DynamicObject target : imMaterialinfoMi) {
|
||||||
long sourceentryid = target.getLong("yem_sourceentryid");
|
long sourceentryid = target.getLong("yem_sourceentryid");
|
||||||
if (existId == sourceentryid) {
|
if (existId == sourceentryid) {
|
||||||
BigDecimal totalqty = target.getBigDecimal("yem_totalqty");//总件数
|
BigDecimal totalqty = target.getBigDecimal("yem_totalqty");//总件数
|
||||||
BigDecimal netweightsum = target.getBigDecimal("yem_netweightsum");//总净重
|
BigDecimal netweightsum = target.getBigDecimal("yem_netweightsum");//总净重
|
||||||
BigDecimal grossweightsum = target.getBigDecimal("yem_grossweightsum");//总毛重
|
BigDecimal grossweightsum = target.getBigDecimal("yem_grossweightsum");//总毛重
|
||||||
|
|
||||||
if (totalqty.compareTo(BigDecimal.ZERO) > 0) {
|
if (totalqty.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
source.set("yem_piece", totalqty);
|
source.set("yem_piece", totalqty);
|
||||||
|
}
|
||||||
|
if (netweightsum.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
source.set("yem_netweightsum", netweightsum);
|
||||||
|
}
|
||||||
|
if (grossweightsum.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
source.set("yem_grossweightsum", grossweightsum);
|
||||||
|
}
|
||||||
|
BigDecimal piece = source.getBigDecimal("yem_piece");
|
||||||
|
netweightsum = source.getBigDecimal("yem_netweightsum");
|
||||||
|
grossweightsum = source.getBigDecimal("yem_grossweightsum");
|
||||||
|
source.set("yem_netweight", BigDecimalUtils.div(netweightsum, piece, 2));
|
||||||
|
source.set("yem_grossweight", BigDecimalUtils.div(grossweightsum, piece, 2));
|
||||||
}
|
}
|
||||||
if (netweightsum.compareTo(BigDecimal.ZERO) > 0) {
|
|
||||||
source.set("yem_netweightsum", netweightsum);
|
|
||||||
}
|
|
||||||
if (grossweightsum.compareTo(BigDecimal.ZERO) > 0) {
|
|
||||||
source.set("yem_grossweightsum", grossweightsum);
|
|
||||||
}
|
|
||||||
BigDecimal piece = source.getBigDecimal("yem_piece");
|
|
||||||
netweightsum = source.getBigDecimal("yem_netweightsum");
|
|
||||||
grossweightsum = source.getBigDecimal("yem_grossweightsum");
|
|
||||||
source.set("yem_netweight", BigDecimalUtils.div(netweightsum, piece, 2));
|
|
||||||
source.set("yem_grossweight", BigDecimalUtils.div(grossweightsum, piece, 2));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (load.length > 0) {
|
||||||
|
SaveServiceHelper.save(load);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (load.length > 0) {
|
|
||||||
SaveServiceHelper.save(load);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sb.length() > 0) {
|
if (sb.length() > 0) {
|
||||||
sb.append("请确认是否继续?");
|
sb.append("请确认是否继续?");
|
||||||
ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener(operateKey, this);
|
ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener(operateKey, this);
|
||||||
this.getView().showConfirm(sb.toString(), MessageBoxOptions.YesNo, confirmCallBackListener);
|
this.getView().showConfirm(sb.toString(), MessageBoxOptions.YesNo, confirmCallBackListener);
|
||||||
|
} else {
|
||||||
|
doConfirm(operateKey);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
doConfirm(operateKey);
|
this.getView().showMessage("锁定重量是否确认为空!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,19 +358,24 @@ public class EncaseMentEdit extends AbstractBillPlugIn implements Plugin, Before
|
|||||||
SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
|
SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
|
||||||
long currentUserId = YEM.getCurrentUserId();
|
long currentUserId = YEM.getCurrentUserId();
|
||||||
DynamicObject user = BusinessDataServiceHelper.loadSingle(currentUserId, "bos_user");
|
DynamicObject user = BusinessDataServiceHelper.loadSingle(currentUserId, "bos_user");
|
||||||
if ("statusconvertpjqr".equals(operateKey)) {
|
String yemWeightconfirmed = (String) this.getModel().getValue("yem_weightconfirmed");
|
||||||
|
if (!yemWeightconfirmed.isEmpty()) {
|
||||||
|
if ("statusconvertpjqr".equals(operateKey)) {
|
||||||
|
|
||||||
dataEntity.set("yem_completionstatuspj", "B");
|
dataEntity.set("yem_completionstatuspj", "B");
|
||||||
dataEntity.set("yem_affirmmanpj", user);
|
dataEntity.set("yem_affirmmanpj", user);
|
||||||
dataEntity.set("yem_affirmdatepj", new Date());
|
dataEntity.set("yem_affirmdatepj", new Date());
|
||||||
|
}
|
||||||
|
if ("statusconvertqrzj".equals(operateKey)) {
|
||||||
|
|
||||||
|
dataEntity.set("yem_completionstatuszj", "B");
|
||||||
|
dataEntity.set("yem_affirmmanzj", user);
|
||||||
|
dataEntity.set("yem_affirmdatezj", new Date());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.getView().showMessage("锁定重量是否确认为空!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("statusconvertqrzj".equals(operateKey)) {
|
|
||||||
|
|
||||||
dataEntity.set("yem_completionstatuszj", "B");
|
|
||||||
dataEntity.set("yem_affirmmanzj", user);
|
|
||||||
dataEntity.set("yem_affirmdatezj", new Date());
|
|
||||||
}
|
|
||||||
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||||
this.getView().invokeOperation("refresh");
|
this.getView().invokeOperation("refresh");
|
||||||
this.getView().showSuccessNotification("确认完成");
|
this.getView().showSuccessNotification("确认完成");
|
||||||
@ -413,7 +432,12 @@ public class EncaseMentEdit extends AbstractBillPlugIn implements Plugin, Before
|
|||||||
if (MessageBoxResult.Yes.equals(result)) {
|
if (MessageBoxResult.Yes.equals(result)) {
|
||||||
|
|
||||||
if ("statusconvertpjqr".equals(callBackId) || "statusconvertqrzj".equals(callBackId)) {
|
if ("statusconvertpjqr".equals(callBackId) || "statusconvertqrzj".equals(callBackId)) {
|
||||||
doConfirm(callBackId);
|
String yemWeightconfirmed = (String) this.getModel().getValue("yem_weightconfirmed");
|
||||||
|
if (!yemWeightconfirmed.isEmpty()) {
|
||||||
|
doConfirm(callBackId);
|
||||||
|
} else {
|
||||||
|
this.getView().showMessage("锁定重量是否确认为空!!!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,22 +45,24 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn {
|
|||||||
dataEntitie = BusinessDataServiceHelper.loadSingle(dataEntitie.getPkValue(), dataEntitie.getDynamicObjectType().getName());
|
dataEntitie = BusinessDataServiceHelper.loadSingle(dataEntitie.getPkValue(), dataEntitie.getDynamicObjectType().getName());
|
||||||
collect(dataEntitie);
|
collect(dataEntitie);
|
||||||
arrearsAmt(dataEntitie);
|
arrearsAmt(dataEntitie);
|
||||||
if (dataEntitie.getDynamicObjectType().getName().equals("yem_xshippingdetails")) {
|
// if (dataEntitie.getDynamicObjectType().getName().equals("yem_xshippingdetails")) {
|
||||||
DynamicObjectCollection yemEsSalesorderTotal = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_total");
|
// DynamicObjectCollection yemEsSalesorderTotal = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_total");
|
||||||
if (!yemEsSalesorderTotal.isEmpty()) {
|
// if (!yemEsSalesorderTotal.isEmpty()) {
|
||||||
for (DynamicObject dynamicObject : yemEsSalesorderTotal) {
|
// for (DynamicObject dynamicObject : yemEsSalesorderTotal) {
|
||||||
BigDecimal yemQtyTl = dynamicObject.getBigDecimal("yem_qty_tl");
|
// BigDecimal yemQtyTl = dynamicObject.getBigDecimal("yem_qty_tl");
|
||||||
BigDecimal yemAllocateqtyTl = dynamicObject.getBigDecimal("yem_allocateqty_tl");
|
// BigDecimal yemAllocateqtyTl = dynamicObject.getBigDecimal("yem_allocateqty_tl");
|
||||||
int i = dynamicObject.getInt("seq");
|
// int i = dynamicObject.getInt("seq");
|
||||||
String yemAccesmaterial = dynamicObject.getString("yem_accesmaterial_tl.name");
|
// String yemAccesmaterial = dynamicObject.getString("yem_accesmaterial_tl.name");
|
||||||
if (yemQtyTl.compareTo(yemAllocateqtyTl) < 0) {
|
// boolean yemIsgifitTl = dynamicObject.getBoolean("yem_isgifit_tl");
|
||||||
this.getOperationResult().setSuccess(true);
|
//
|
||||||
this.getOperationResult().setMessage("出运汇总页签,第" + i + "行物料" + yemAccesmaterial + ",已调数量" + yemQtyTl + ",出运数量" + yemAllocateqtyTl + ",不允许审核,请修改调拨后处理!"); // 提示内容
|
// if (yemQtyTl.compareTo(yemAllocateqtyTl) < 0&&!yemIsgifitTl&&) {
|
||||||
this.getOperationResult().setShowMessage(true); // 是否显示提示消息
|
// this.getOperationResult().setSuccess(true);
|
||||||
}
|
// this.getOperationResult().setMessage("出运汇总页签,第" + i + "行物料" + yemAccesmaterial + ",已调数量" + yemQtyTl + ",出运数量" + yemAllocateqtyTl + ",不允许审核,请修改调拨后处理!"); // 提示内容
|
||||||
}
|
// this.getOperationResult().setShowMessage(true); // 是否显示提示消息
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
SaveServiceHelper.save(new DynamicObject[]{dataEntitie});
|
SaveServiceHelper.save(new DynamicObject[]{dataEntitie});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user