生产报告自动移交报错信息优化

This commit is contained in:
lihao 2025-11-20 10:58:06 +08:00
parent d1d78484ac
commit 979959d07f
1 changed files with 25 additions and 20 deletions

View File

@ -78,8 +78,8 @@ public class HandOverRule implements IRule<AggWrVO> {
continue; continue;
} }
if(queryService.isAuditToProdInBPTransType(new String[]{vo.getParentVO().getVtrantypeid()}).get(vo.getParentVO().getVtrantypeid())){ if(queryService.isAuditToProdInBPTransType(new String[]{vo.getParentVO().getVtrantypeid()}).get(vo.getParentVO().getVtrantypeid())){
throw new BusinessException("交易类型不能是审批即入库"); // throw new BusinessException("交易类型不能是审批即入库");
continue;
} }
WrItemVO[] itemVOS= vo.getChildrenVO(); WrItemVO[] itemVOS= vo.getChildrenVO();
List<WrItemVO> itemlist = new ArrayList<WrItemVO>(); List<WrItemVO> itemlist = new ArrayList<WrItemVO>();
@ -88,13 +88,12 @@ public class HandOverRule implements IRule<AggWrVO> {
Map<String, MaterialProdVO> map = serv.queryMaterialProduceInfoByPks(new String[]{itemVO.getCbmaterialvid()},pkOrg Map<String, MaterialProdVO> map = serv.queryMaterialProduceInfoByPks(new String[]{itemVO.getCbmaterialvid()},pkOrg
,new String[]{"wghxcl","iscreatesonprodorder"}); ,new String[]{"wghxcl","iscreatesonprodorder"});
if(map.isEmpty()) { if(map.isEmpty()) {
throw new BusinessException("请检查工位半产品是否维护配套子件和完工后续处理生产页签参数"); // throw new BusinessException("请检查工位半产品是否维护配套子件和完工后续处理生产页签参数");
// continue;
}else{ }else{
MaterialProdVO materialProdVO=map.get(itemVO.getCbmaterialvid()); MaterialProdVO materialProdVO=map.get(itemVO.getCbmaterialvid());
if(materialProdVO == null) { if(materialProdVO == null) {
throw new BusinessException("请检查工位半产品是否维护配套子件和完工后续处理生产页签参数"); // throw new BusinessException("请检查工位半产品是否维护配套子件和完工后续处理生产页签参数");
// continue; continue;
} }
if(materialProdVO.getWghxcl().equals(1)&& materialProdVO.getIscreatesonprodorder().booleanValue()) { if(materialProdVO.getWghxcl().equals(1)&& materialProdVO.getIscreatesonprodorder().booleanValue()) {
AggWrVO vo1 = new AggWrVO(); AggWrVO vo1 = new AggWrVO();
@ -102,12 +101,15 @@ public class HandOverRule implements IRule<AggWrVO> {
vo1.setChildrenVO(new WrItemVO[]{itemVO}); vo1.setChildrenVO(new WrItemVO[]{itemVO});
list.add(vo1); list.add(vo1);
}else{ }else{
throw new BusinessException("请检查工位半产品是否维护配套子件和完工后续处理生产页签参数"); // throw new BusinessException("请检查工位半产品是否维护配套子件和完工后续处理生产页签参数");
} }
} }
} }
} }
List<AggHandTakeVO> aggHandTakeVOS= new ArrayList<>(); List<AggHandTakeVO> aggHandTakeVOS= new ArrayList<>();
if(list.isEmpty()) {
return;
}
for (AggWrVO vo : list) { for (AggWrVO vo : list) {
try { try {
this.loadWrQualityVO(vo); this.loadWrQualityVO(vo);
@ -144,10 +146,12 @@ public class HandOverRule implements IRule<AggWrVO> {
for (HandTakeBVO handTakeBVO:(HandTakeBVO[])takeVO.getChildrenVO()){ for (HandTakeBVO handTakeBVO:(HandTakeBVO[])takeVO.getChildrenVO()){
if(handTakeBVO.getVrcvmocode().isEmpty() || handTakeBVO.getVrcvpickmcode().isEmpty()){ if(handTakeBVO.getVrcvmocode().isEmpty() || handTakeBVO.getVrcvpickmcode().isEmpty()){
throw new BusinessException("没有接受备料计划单号和接受生产订单号,请检查工位半产品是否维护配套子件和完工后续处理生产页签参数"); continue;
// throw new BusinessException("没有接受备料计划单号和接受生产订单号,请检查工位半产品是否维护配套子件和完工后续处理生产页签参数");
} }
if(takeVO.getParentVO().getNhandoverastnum().compareTo(UFDouble.ZERO_DBL) ==0){ if(takeVO.getParentVO().getNhandoverastnum().compareTo(UFDouble.ZERO_DBL) ==0){
throw new BusinessException("完工数量不能为0"); continue;
// throw new BusinessException("完工数量不能为0");
} }
@ -175,17 +179,18 @@ public class HandOverRule implements IRule<AggWrVO> {
} }
aggHandTakeVOS.add(takeVO); aggHandTakeVOS.add(takeVO);
} }
if(!aggHandTakeVOS.isEmpty()){
// handTakeMaintainService.insert(aggHandTakeVOS.toArray(new AggHandTakeVO[aggHandTakeVOS.size()])); // handTakeMaintainService.insert(aggHandTakeVOS.toArray(new AggHandTakeVO[aggHandTakeVOS.size()]));
try { try {
this.validate(aggHandTakeVOS.get(0)); this.validate(aggHandTakeVOS.get(0));
} catch (ValidationException e) { } catch (ValidationException e) {
ExceptionUtils.wrappException(e); ExceptionUtils.wrappException(e);
} }
try { try {
this.process(aggHandTakeVOS.get(0)); this.process(aggHandTakeVOS.get(0));
} catch (BusinessException e) { } catch (BusinessException e) {
ExceptionUtils.wrappException(e); ExceptionUtils.wrappException(e);
}
} }
} catch (BusinessException e) { } catch (BusinessException e) {
throw new RuntimeException(e); throw new RuntimeException(e);