材料出库代码同步-用友李正
This commit is contained in:
		
							parent
							
								
									3c913ba2a2
								
							
						
					
					
						commit
						1e33573e5e
					
				|  | @ -27,7 +27,6 @@ import nc.vo.ic.pub.define.ICPubMetaNameConst; | |||
| import nc.vo.mmpac.pickm.entity.AggPickmVO; | ||||
| import nc.vo.mmpac.pickm.entity.PickmItemVO; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.ISuperVO; | ||||
| import nc.vo.pub.VOStatus; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| import nc.vo.scmpub.check.billvalidate.BillVOsCheckRule; | ||||
|  | @ -39,7 +38,6 @@ import nccloud.api.impl.ic.m4d.fill.MaterialOutSaveFillValue; | |||
| import nccloud.api.impl.ic.m4d.fill.MaterialOutUpdateFillValue; | ||||
| import nccloud.api.impl.ic.pub.check.CheckProhibitUpdateFields; | ||||
| import nccloud.api.uapbd.wms.utils.IWmsSyncUtils; | ||||
| import nccloud.baseapp.core.log.NCCForUAPLogger; | ||||
| import nccloud.openapi.ic.util.ICAPILocationVOUtils; | ||||
| import nccloud.openapi.scmpub.pub.TransferCodeToPKTool; | ||||
| import nccloud.openapi.scmpub.pub.TransferMapToVOTool; | ||||
|  | @ -91,7 +89,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { | |||
| //        if (isSpecialCase) { | ||||
| //            processPickingPlanSpecialLogic(vos); | ||||
| //        } | ||||
|         // 其他数据填充 | ||||
|         //其他数据填充 | ||||
|         new MaterialOutSaveFillValue().setDefaultValue(vos); | ||||
| 
 | ||||
|         IMaterialOutMaintainAPI materialOut = NCLocator.getInstance().lookup(IMaterialOutMaintainAPI.class); | ||||
|  | @ -123,7 +121,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { | |||
| //        if (isSpecialCase) { | ||||
| //            processPickingPlanSpecialLogic(vos); | ||||
| //        } | ||||
|         // 其他数据填充 | ||||
|         //其他数据填充 | ||||
|         new MaterialOutSaveFillValue().setDefaultValue(vos); | ||||
| 
 | ||||
|         IMaterialOutMaintainAPI materialOut = NCLocator.getInstance().lookup(IMaterialOutMaintainAPI.class); | ||||
|  | @ -247,7 +245,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { | |||
|                         roigBvo.setAttributeValue(battr, newBvo.getAttributeValue(battr)); | ||||
|                         bfields.add(battr); | ||||
|                     } | ||||
|                     // 设置货位序列号孙表,把原来的孙表删除,修改的货位置为新增 | ||||
|                     //设置货位序列号孙表,把原来的孙表删除,修改的货位置为新增 | ||||
|                     if (null != newBvo.getLocationVOs()) { | ||||
|                         List<ICLocationVO> allloc = new ArrayList<ICLocationVO>(); | ||||
|                         if (null != deleteLoc && null != deleteLoc.get(roigBvo.getCgeneralbid())) { | ||||
|  | @ -264,7 +262,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { | |||
|                     } | ||||
|                     // 翻译货位 | ||||
|                     ICAPILocationVOUtils.translate(materialOutVOs); | ||||
|                     // 其他数据填充 | ||||
|                     //其他数据填充 | ||||
|                     new MaterialOutUpdateFillValue().setDefaultValue(materialOutVOs, bfields); | ||||
|                 } | ||||
|             } | ||||
|  | @ -274,8 +272,34 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { | |||
|                         ICBillType.MaterialOut.getCode()); | ||||
|         tool.doBeforeInsert(materialOutVOs); | ||||
| 
 | ||||
|         MaterialOutVO[] updateVOS = NCLocator.getInstance().lookup(IMaterialOutMaintain.class).update(materialOutVOs, originBills); | ||||
|         IWmsSyncUtils utils = NCLocator.getInstance().lookup(IWmsSyncUtils.class); | ||||
|         //2025年10月15日14点25分--重新覆盖单据转换规则转换的项目字段--wms对接公司存在备料计划与材料出库明细项目字段不一致情况--star | ||||
|         if (utils != null && utils.isWMS()) { | ||||
|             //获取originBill里表体的主键和项目字段形成Map,再遍历materialOutVOs去替换明细的项目 | ||||
|             Map<String, String> originProjectMap = new HashMap<>(); | ||||
|             for (MaterialOutVO originBill : originBills) { | ||||
|                 MaterialOutBodyVO[] originBodys = originBill.getBodys(); | ||||
|                 if (originBodys != null) { | ||||
|                     for (MaterialOutBodyVO originBody : originBodys) { | ||||
|                         originProjectMap.put(originBody.getCgeneralbid(), originBody.getCprojectid()); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             for (MaterialOutVO materialOutVO : materialOutVOs) { | ||||
|                 MaterialOutBodyVO[] bodyVOs = materialOutVO.getBodys(); | ||||
|                 if (bodyVOs != null) { | ||||
|                     for (MaterialOutBodyVO bodyVO : bodyVOs) { | ||||
|                         String projectId = originProjectMap.get(bodyVO.getCgeneralbid()); | ||||
|                         if (projectId != null) { | ||||
|                             bodyVO.setCprojectid(projectId); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         //2025年10月15日14点25分--重新覆盖单据转换规则转换的项目字段--wms对接公司存在备料计划与材料出库明细项目字段不一致情况--end | ||||
|         MaterialOutVO[] updateVOS = NCLocator.getInstance().lookup(IMaterialOutMaintain.class).update(materialOutVOs, originBills); | ||||
|         // 如果是WMS系统 则自动签字 | ||||
|         if (utils != null && utils.isWMS()) { | ||||
|             log.info("当前是WMS系统用户,自动签字"); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue