解决MPR运算回写备料计划报错问题-张鑫0514

This commit is contained in:
zhangxinah@yonyou.com 2025-05-14 18:24:18 +08:00
parent 1492a58adb
commit 803f6ba915
1 changed files with 117 additions and 123 deletions

View File

@ -47,22 +47,20 @@ public class PloProdDeptRule implements IRule<AggregatedPoVO> {
String prodDeptid = plo.getCproddeptid();
String prodDeptvid = plo.getCproddeptvid();
Integer posource = plo.getFposource();
if (PoSourceEnum.COMPUT == posource && MMValueCheck.isEmpty(prodDeptid)
&& MMValueCheck.isEmpty(prodDeptvid) && MMValueCheck.isNotEmpty(stockorgid)
&& MMValueCheck.isNotEmpty(stockorgvid)) {
if (PoSourceEnum.COMPUT == posource && MMValueCheck.isEmpty(prodDeptid) && MMValueCheck.isEmpty(prodDeptvid)
&& MMValueCheck.isNotEmpty(stockorgid) && MMValueCheck.isNotEmpty(stockorgvid)) {
List<String> vids = map.get(stockorgid);
if (null == vids) {
List<String> list = new ArrayList<String>();
list.add(vid);
map.put(stockorgid, list);
}
else {
} else {
vids.add(vid);
}
}
String vsrcbid = plo.getVsrcbid();// À´Ô´µ¥¾Ý±íÌåÖ÷¼ü
int fdemandbill = plo.getFdemandbill();//ÐèÇóÀ´Ô´
if (PoSourceEnum.COMPUT == posource && fdemandbill == 1) {
// 需求来源为备料计划的才回写
if (PoSourceEnum.COMPUT == posource && plo.getFdemandbill() != null && plo.getFdemandbill() == 1) {
vsrcbidList.add(vsrcbid);
}
}
@ -70,8 +68,7 @@ public class PloProdDeptRule implements IRule<AggregatedPoVO> {
String[] vsrcbids = vsrcbidList.toArray(new String[vsrcbidList.size()]);
Map<String, AggPickmVO> pickmVOMap;
try {
pickmVOMap = NCLocator.getInstance().lookup(IPickmPubQueryService.class)
.queryPickm4Issue(vsrcbids);
pickmVOMap = NCLocator.getInstance().lookup(IPickmPubQueryService.class).queryPickm4Issue(vsrcbids);
} catch (BusinessException e) {
throw new RuntimeException(e);
}
@ -103,10 +100,8 @@ public class PloProdDeptRule implements IRule<AggregatedPoVO> {
while (i.hasNext()) {
String key = i.next();
List<String> vids = map.get(key);
Map<String, MaterialProdVO> results =
MaterialPubService.queryMaterialProduceInfoByPks(vids.toArray(new String[0]), key, new String[] {
MaterialProdVO.PK_PRODEPTDOC
});
Map<String, MaterialProdVO> results = MaterialPubService.queryMaterialProduceInfoByPks(
vids.toArray(new String[0]), key, new String[] { MaterialProdVO.PK_PRODEPTDOC });
for (AggregatedPoVO agg : vos) {
PoVO plo = agg.getParentVO();
String vid = plo.getCmaterialvid();
@ -147,8 +142,7 @@ public class PloProdDeptRule implements IRule<AggregatedPoVO> {
}
}
}
}
catch (BusinessException e) {
} catch (BusinessException e) {
ExceptionUtils.wrappException(e);
}