diff --git a/ic/src/private/nccloud/api/impl/ic/m45/APIPurchaseInMaitainImpl.java b/ic/src/private/nccloud/api/impl/ic/m45/APIPurchaseInMaitainImpl.java index f370ac8..3c82d50 100644 --- a/ic/src/private/nccloud/api/impl/ic/m45/APIPurchaseInMaitainImpl.java +++ b/ic/src/private/nccloud/api/impl/ic/m45/APIPurchaseInMaitainImpl.java @@ -38,12 +38,10 @@ import nccloud.openapi.scmpub.pub.TransferCodeToPKTool; import nccloud.openapi.scmpub.pub.TransferMapToVOTool; /** - * - * @Description: 库存采购入库单维护接口实现类 - * - * @author: 刘伟 - * @date: 2019-5-7 下午3:22:00 * @version NCC1909 + * @Description: 库存采购入库单维护接口实现类 + * @author: 刘伟 + * @date: 2019-5-7 下午3:22:00 */ public class APIPurchaseInMaitainImpl implements IAPIPurchaseInMaitain { @@ -59,7 +57,22 @@ public class APIPurchaseInMaitainImpl implements IAPIPurchaseInMaitain { // 1、传入数据基本非空校验 BillVOsCheckRule checker = new BillVOsCheckRule(new CheckPurchaseInSaveValidator()); + //2025年4月23日15点10分 采购入库单接口项目字段为波浪则清空 sdlizheng --start + for (PurchaseInVO vo : vos) { + PurchaseInBodyVO[] bodys = vo.getBodys(); + if (bodys != null && bodys.length > 0) { + String[] attributeNames = bodys[0].getAttributeNames(); + for (PurchaseInBodyVO body : bodys) { + for (String fildName : attributeNames) { + if (body.getAttributeValue(fildName) != null && "~".equals(body.getAttributeValue(fildName))) { + body.setAttributeValue(fildName, null); + } + } + } + } + } + //2025年4月23日15点10分 采购入库单接口项目字段为波浪则清空 sdlizheng --end //添加供应商和交易类型为空赋值 fillHeadDataBeforeCheck(vos); checker.check(vos); @@ -69,8 +82,8 @@ public class APIPurchaseInMaitainImpl implements IAPIPurchaseInMaitain { ICAPILocationVOUtils.translate(vos); //begin没取到财务组织导致的报错,在这里给财务组织赋值为库存组织 - for(PurchaseInVO vo : vos ) { - if(vo.getHead().getCfanaceorgoid()!=null) { + for (PurchaseInVO vo : vos) { + if (vo.getHead().getCfanaceorgoid() != null) { continue; } String cfinanceoid = (new OrgInfoQuery()).getFinanceOrgIDByCalBodyID(vo.getHead().getPk_org()); @@ -89,20 +102,20 @@ public class APIPurchaseInMaitainImpl implements IAPIPurchaseInMaitain { } private void fillHeadDataBeforeCheck(PurchaseInVO[] vos) { - for(PurchaseInVO vo : vos) { - if(StringUtils.isEmpty(vo.getHead().getVtrantypecode())){ + for (PurchaseInVO vo : vos) { + if (StringUtils.isEmpty(vo.getHead().getVtrantypecode())) { //设置默认交易类型 vo.getHead().setVtrantypecode("45-01"); } - if(StringUtils.isEmpty(vo.getHead().getCvendorid())){ + if (StringUtils.isEmpty(vo.getHead().getCvendorid())) { //根据上游获取数据 PurchaseInBodyVO[] bodys = vo.getBodys(); String csourcetype = bodys[0].getCsourcetype(); String csourcebillhid = bodys[0].getCsourcebillhid(); - if("23".equals(csourcetype)&&StringUtils.isNotEmpty(csourcebillhid)){ + if ("23".equals(csourcetype) && StringUtils.isNotEmpty(csourcebillhid)) { //上游到货单 ArriveHeaderVO[] srcHVOs = new VOQuery<>(ArriveHeaderVO.class).query(new String[]{csourcebillhid}); - if(ArrayUtils.isNotEmpty(srcHVOs)){ + if (ArrayUtils.isNotEmpty(srcHVOs)) { vo.getHead().setCvendorid(srcHVOs[0].getPk_supplier()); } } @@ -129,13 +142,13 @@ public class APIPurchaseInMaitainImpl implements IAPIPurchaseInMaitain { } SCMBillQuery queryTool = new SCMBillQuery(PurchaseInVO.class); - PurchaseInVO[] purInVOs = queryTool.queryVOByIDs(new String[] { + PurchaseInVO[] purInVOs = queryTool.queryVOByIDs(new String[]{ cgeneralhid }); Map deleteLoc = new HashMap(); // 加载原始单据和货位信息 - PurchaseInVO[] originBills = queryTool.queryVOByIDs(new String[] { + PurchaseInVO[] originBills = queryTool.queryVOByIDs(new String[]{ cgeneralhid }); ICLocationUtil.loadLocationVOs(originBills); @@ -143,8 +156,7 @@ public class APIPurchaseInMaitainImpl implements IAPIPurchaseInMaitain { throw new BusinessException( nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0381")/* @res "没找到要修改的入库单信息,请检查数据的表头主键cgeneralhid。" */); - } - else { + } else { List headProFields = CheckProhibitUpdateFields.getHeadProhibitFields("45"); List bodyProFields = @@ -170,7 +182,7 @@ public class APIPurchaseInMaitainImpl implements IAPIPurchaseInMaitain { nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID( "4008027_0", "04008027-0363")/* @res "表头字段:" */ + attr + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID( - "4008027_0", "04008027-0364")/* @res "不允许修改。" */ ); + "4008027_0", "04008027-0364")/* @res "不允许修改。" */); } origVO.setAttributeValue(attr, newVO.getAttributeValue(attr)); } @@ -210,21 +222,21 @@ public class APIPurchaseInMaitainImpl implements IAPIPurchaseInMaitain { nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID( "4008027_0", "04008027-0366")/* @res "表体字段:" */ + battr + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID( - "4008027_0", "04008027-0364")/* @res "不允许修改。" */ ); + "4008027_0", "04008027-0364")/* @res "不允许修改。" */); } roigBvo.setAttributeValue(battr, newBvo.getAttributeValue(battr)); bfields.add(battr); } //设置货位序列号孙表,把原来的孙表删除,修改的货位置为新增 - if(null != newBvo.getLocationVOs()) { + if (null != newBvo.getLocationVOs()) { List allloc = new ArrayList(); - if(null != deleteLoc && null != deleteLoc.get(roigBvo.getCgeneralbid())) { - for(ICLocationVO delloc : deleteLoc.get(roigBvo.getCgeneralbid())) { + if (null != deleteLoc && null != deleteLoc.get(roigBvo.getCgeneralbid())) { + for (ICLocationVO delloc : deleteLoc.get(roigBvo.getCgeneralbid())) { delloc.setStatus(VOStatus.DELETED); allloc.add(delloc); } } - for(ICLocationVO loc : newBvo.getLocationVOs()) { + for (ICLocationVO loc : newBvo.getLocationVOs()) { loc.setStatus(VOStatus.NEW); allloc.add(loc); }