负计划备料重算优化关闭最终需求数量为0请购单备注

This commit is contained in:
lihao 2025-11-14 09:21:20 +08:00
parent 48bb70f9e8
commit f3744b0b7b
1 changed files with 11 additions and 8 deletions

View File

@ -125,7 +125,7 @@ public class AfterPickmRecalUpdateBuyingreqRule implements IRule<PMOAggVO> {
} }
private void buyingreqRowClose(List<String> pmobids, List<String> pmoids) throws BusinessException { private void buyingreqRowClose(List<String> pmobids, List<String> pmoids) throws BusinessException {
String reason = "¸º¼Æ»®"; String reason = "运算BOM变更失败";
IBuyingReqQueryCardInfoService query = NCLocator.getInstance().lookup(IBuyingReqQueryCardInfoService.class); IBuyingReqQueryCardInfoService query = NCLocator.getInstance().lookup(IBuyingReqQueryCardInfoService.class);
PraybillVO[] rvo = query.queryVOs(pmoids.toArray(new String[0])); PraybillVO[] rvo = query.queryVOs(pmoids.toArray(new String[0]));
if (null == rvo || rvo.length == 0) { if (null == rvo || rvo.length == 0) {
@ -135,21 +135,24 @@ public class AfterPickmRecalUpdateBuyingreqRule implements IRule<PMOAggVO> {
for (PraybillVO vo : rvo) { for (PraybillVO vo : rvo) {
ClientBillToServer<PraybillVO> tool = new ClientBillToServer<PraybillVO>(); ClientBillToServer<PraybillVO> tool = new ClientBillToServer<PraybillVO>();
PraybillVO[] lightVOs = (PraybillVO[])tool.construct(new PraybillVO[]{vo}, new PraybillVO[]{vo}); PraybillVO[] lightVOs = (PraybillVO[])tool.construct(new PraybillVO[]{vo}, new PraybillVO[]{vo});
// 过滤需要关闭的请购单行
for(PraybillVO storeReqAppVO : lightVOs) { for(PraybillVO storeReqAppVO : lightVOs) {
PraybillItemVO[] bvos = storeReqAppVO.getBVO(); PraybillItemVO[] bvos = storeReqAppVO.getBVO();
List<PraybillItemVO> newItemVo = new ArrayList<>(lightVOs.length);
if (bvos != null && bvos.length > 0) { if (bvos != null && bvos.length > 0) {
for(PraybillItemVO bvo : bvos) { for(int i = 0; i < bvos.length; ++i) {
bvo.setAttributeValue("vclosereason", reason); 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);
orderCloseService.closeBillRow(lightVOs);
}
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);
}
} }