From 9169a5cb9acfb76195a86eb37c462249fb2a4b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=AD=A3=40=E7=94=A8=E5=8F=8B?= Date: Wed, 23 Apr 2025 15:18:14 +0800 Subject: [PATCH] =?UTF-8?q?ic=5F=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3=E6=B8=85=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=B8=BA~=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ic/m45/APIPurchaseInMaitainImpl.java | 56 +++++++++++-------- 1 file changed, 34 insertions(+), 22 deletions(-) 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); }