diff --git a/ic/src/private/nccloud/api/impl/ic/m4d/APIMaterialOutMaintainImpl.java b/ic/src/private/nccloud/api/impl/ic/m4d/APIMaterialOutMaintainImpl.java index f94c1450..ae57dd7a 100644 --- a/ic/src/private/nccloud/api/impl/ic/m4d/APIMaterialOutMaintainImpl.java +++ b/ic/src/private/nccloud/api/impl/ic/m4d/APIMaterialOutMaintainImpl.java @@ -24,7 +24,6 @@ import nc.vo.ic.m4d.entity.MaterialOutBodyVO; import nc.vo.ic.m4d.entity.MaterialOutHeadVO; import nc.vo.ic.m4d.entity.MaterialOutVO; import nc.vo.ic.pub.define.ICPubMetaNameConst; -import nc.vo.ml.NCLangRes4VoTransl; import nc.vo.mmpac.pickm.entity.AggPickmVO; import nc.vo.mmpac.pickm.entity.PickmItemVO; import nc.vo.pub.BusinessException; @@ -181,7 +180,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { MaterialOutHeadVO newVO = vos[0].getHead(); String cgeneralhid = newVO.getCgeneralhid(); if (StringUtils.isEmpty(cgeneralhid)) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0391")/*@res "修改材料出库单请指定表头主键cgeneralhid值。"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0391")/*@res "修改材料出库单请指定表头主键cgeneralhid值。"*/); } SCMBillQuery queryTool = new SCMBillQuery(MaterialOutVO.class); @@ -194,7 +193,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { }); ICLocationUtil.loadLocationVOs(originBills); if (ArrayUtils.isEmpty(materialOutVOs)) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0360")/*@res "没找到要修改的出库单信息,请检查数据的表头主键cgeneralhid。"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0360")/*@res "没找到要修改的出库单信息,请检查数据的表头主键cgeneralhid。"*/); } else { List headProFields = CheckProhibitUpdateFields.getHeadProhibitFields("4D"); List bodyProFields = CheckProhibitUpdateFields.getBodyProhibitFields("4D"); @@ -202,7 +201,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { if (origVO.getFbillflag() == null || 0 != ((Integer) ICBillFlag.FREE.value()) .compareTo((Integer) origVO.getFbillflag())) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + origVO.getVbillcode() + NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0362")/*@res "不是自由状态,不能修改"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + origVO.getVbillcode() + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0362")/*@res "不是自由状态,不能修改"*/); } origVO.setStatus(VOStatus.UPDATED); for (String attr : newVO.getAttributeNames()) { @@ -211,7 +210,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { } if (headProFields.contains(attr) && !newVO.getAttributeValue(attr).equals(origVO.getAttributeValue(attr))) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0363")/*@res "表头字段:"*/ + attr + NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0364")/*@res "不允许修改。"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0363")/*@res "表头字段:"*/ + attr + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0364")/*@res "不允许修改。"*/); } origVO.setAttributeValue(attr, newVO.getAttributeValue(attr)); } @@ -233,7 +232,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { for (MaterialOutBodyVO newBvo : vos[0].getBodys()) { MaterialOutBodyVO roigBvo = pkbs.get(newBvo.getCgeneralbid()); if (newBvo.getCgeneralbid() == null || roigBvo == null) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0365")/*@res "没有匹配到原始出库单表体信息,请检查数据的表体主键cgeneralbid。"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0365")/*@res "没有匹配到原始出库单表体信息,请检查数据的表体主键cgeneralbid。"*/); } Set bfields = new HashSet(); for (String battr : newBvo.getAttributeNames()) { @@ -242,7 +241,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { } if (bodyProFields.contains(battr) && !newBvo.getAttributeValue(battr).equals(roigBvo.getAttributeValue(battr))) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0366")/*@res "表体字段:"*/ + battr + NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0364")/*@res "不允许修改。"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0366")/*@res "表体字段:"*/ + battr + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0364")/*@res "不允许修改。"*/); } roigBvo.setAttributeValue(battr, newBvo.getAttributeValue(battr)); bfields.add(battr); @@ -279,11 +278,13 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { if (utils != null && utils.isWMS()) { // 获取originBill里表体的主键和项目字段形成Map,再遍历materialOutVOs去替换明细的项目 Map originProjectMap = new HashMap<>(); + Map originCproductMap = new HashMap<>(); for (MaterialOutVO originBill : originBills) { MaterialOutBodyVO[] originBodys = originBill.getBodys(); if (originBodys != null) { for (MaterialOutBodyVO originBody : originBodys) { originProjectMap.put(originBody.getCgeneralbid(), originBody.getCprojectid()); + originCproductMap.put(originBody.getCgeneralbid(), originBody.getCproductorid()); } } } @@ -293,9 +294,13 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { if (bodyVOs != null) { for (MaterialOutBodyVO bodyVO : bodyVOs) { String projectId = originProjectMap.get(bodyVO.getCgeneralbid()); + String cproductId = originCproductMap.get(bodyVO.getCgeneralbid()); if (projectId != null) { bodyVO.setCprojectid(projectId); } + if (cproductId != null) { + bodyVO.setCproductorid(cproductId); + } } } } @@ -320,7 +325,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { if (parentVO.getFbillflag() == null || 0 != ((Integer) ICBillFlag.FREE.value()) .compareTo((Integer) parentVO.getFbillflag())) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + parentVO.getVbillcode() + NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0367")/*@res "不是自由状态,不能删除"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + parentVO.getVbillcode() + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0367")/*@res "不是自由状态,不能删除"*/); } } return (MaterialOutVO[]) PfServiceScmUtil.processBatch("DELETE", "4D", vos, null, null); @@ -336,11 +341,11 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { if (parentVO.getFbillflag() == null || 0 != ((Integer) ICBillFlag.FREE.value()) .compareTo((Integer) parentVO.getFbillflag())) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + parentVO.getVbillcode() + NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0330")/*@res "不是自由状态,不能签字"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + parentVO.getVbillcode() + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0330")/*@res "不是自由状态,不能签字"*/); } if (aggvo.getChildrenVO() != null && aggvo.getChildrenVO().length > 0) { if (aggvo.getChildrenVO()[0].getAttributeValue(ICPubMetaNameConst.NNUM) == null) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + parentVO.getVbillcode() + NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0392")/*@res "总数量为空,不能签字"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + parentVO.getVbillcode() + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0392")/*@res "总数量为空,不能签字"*/); } } @@ -359,7 +364,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { if (parentVO.getFbillflag() == null || 0 != ((Integer) ICBillFlag.SIGN.value()) .compareTo((Integer) parentVO.getFbillflag())) { - throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + parentVO.getVbillcode() + NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0332")/*@res "不是签字状态,不能取消签字"*/); + throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0361")/*@res "当前出库单编号:"*/ + parentVO.getVbillcode() + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0332")/*@res "不是签字状态,不能取消签字"*/); } } return (MaterialOutVO[]) PfServiceScmUtil.processBatch("CANCELSIGN", "4D", vos, null, null);