diff --git a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRecalUpdateBuyingreqRule.java b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRecalUpdateBuyingreqRule.java index fa720a0c..e5c9973b 100644 --- a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRecalUpdateBuyingreqRule.java +++ b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRecalUpdateBuyingreqRule.java @@ -125,7 +125,7 @@ public class AfterPickmRecalUpdateBuyingreqRule implements IRule { } private void buyingreqRowClose(List pmobids, List pmoids) throws BusinessException { - String reason = "负计划"; + String reason = "运算BOM变更失败"; IBuyingReqQueryCardInfoService query = NCLocator.getInstance().lookup(IBuyingReqQueryCardInfoService.class); PraybillVO[] rvo = query.queryVOs(pmoids.toArray(new String[0])); if (null == rvo || rvo.length == 0) { @@ -135,23 +135,26 @@ public class AfterPickmRecalUpdateBuyingreqRule implements IRule { for (PraybillVO vo : rvo) { ClientBillToServer tool = new ClientBillToServer(); PraybillVO[] lightVOs = (PraybillVO[])tool.construct(new PraybillVO[]{vo}, new PraybillVO[]{vo}); - + // 过滤需要关闭的请购单行 for(PraybillVO storeReqAppVO : lightVOs) { PraybillItemVO[] bvos = storeReqAppVO.getBVO(); + List newItemVo = new ArrayList<>(lightVOs.length); if (bvos != null && bvos.length > 0) { - for(PraybillItemVO bvo : bvos) { - bvo.setAttributeValue("vclosereason", reason); + for(int i = 0; i < bvos.length; ++i) { + if (pmobids.contains(bvos[i].getPk_praybill_b()) ) { + bvos[i].setAttributeValue("vclosereason", reason); + newItemVo.add(bvos[i]); + } } } + storeReqAppVO.setBVO(newItemVo.toArray(new PraybillItemVO[0])); } - IPraybillMaintain orderCloseService =NCLocator.getInstance().lookup(IPraybillMaintain.class); - // lightVOs[0].getParent().setAttributeValue("ts", info.getTs()); - // lightVOs[0].getBVO()[0].setAttributeValue("ts", info.getBts()); - PraybillVO[] returnVos = orderCloseService.closeBillRow(lightVOs); + orderCloseService.closeBillRow(lightVOs); } + } /**