update bpm获取工艺路线、方案作废

master
yinq 2 years ago
parent 45ac479b7e
commit cb11d08417

@ -379,7 +379,7 @@ public class AbnormalBillController {
List<AbnormalRouterDto> abnormalRouterDtoList = routerService.selectAllDisRouter(abnormalRouterDto); List<AbnormalRouterDto> abnormalRouterDtoList = routerService.selectAllDisRouter(abnormalRouterDto);
ArrayList<RouterBpmVO> routerBpmVOs = new ArrayList<>(); ArrayList<RouterBpmVO> routerBpmVOs = new ArrayList<>();
for (AbnormalRouterDto routerDto : abnormalRouterDtoList) { for (AbnormalRouterDto routerDto : abnormalRouterDtoList) {
Boolean isStepUsed = false; Boolean isStepUsed = true;
RouterBpmVO bpmVO = new RouterBpmVO(); RouterBpmVO bpmVO = new RouterBpmVO();
bpmVO.setAbnormalNo(routerDto.getAbnormalNo()); bpmVO.setAbnormalNo(routerDto.getAbnormalNo());
bpmVO.setRouter(routerDto.getRouter()); bpmVO.setRouter(routerDto.getRouter());
@ -401,10 +401,10 @@ public class AbnormalBillController {
List<SfcDispatch> sfcDispatchList = SpringUtil.getBean(SfcDispatchService.class).findSfcDispatch(site, routerBpmVO.getSfc(), null, null); List<SfcDispatch> sfcDispatchList = SpringUtil.getBean(SfcDispatchService.class).findSfcDispatch(site, routerBpmVO.getSfc(), null, null);
List<String> sfcDispatchStepList = sfcDispatchList.stream().map(SfcDispatch::getStepId).collect(Collectors.toList()); List<String> sfcDispatchStepList = sfcDispatchList.stream().map(SfcDispatch::getStepId).collect(Collectors.toList());
List<String> routerStepList = routerOperationByRouterBo.stream().map(RouterStepDto::getStepId).collect(Collectors.toList()); List<String> routerStepList = routerOperationByRouterBo.stream().map(RouterStepDto::getStepId).collect(Collectors.toList());
isStepUsed = IntStream.range(0, Math.min(sfcDispatchStepList.size(), routerStepList.size())) //当两个集合没有共同的元素时该方法返回true
.anyMatch(i -> sfcDispatchStepList.get(i).equals(routerStepList.get(i))); isStepUsed = Collections.disjoint(sfcDispatchStepList, routerStepList);
} }
if (!isStepUsed){ if (isStepUsed){
bpmVO.setRouterStep(routerOperationByRouterBo); bpmVO.setRouterStep(routerOperationByRouterBo);
routerBpmVOs.add(bpmVO); routerBpmVOs.add(bpmVO);
}else { }else {

@ -599,11 +599,11 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
String local = LocaleContextHolder.getLocale().getLanguage(); String local = LocaleContextHolder.getLocale().getLanguage();
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
AbnormalBillDisposeDto abnormalDto = abnormalBillDisposeMapper.findAllByAbnormalNo(abnormalBill, local); AbnormalBillDisposeDto abnormalDto = abnormalBillDisposeMapper.findAllByAbnormalNo(abnormalBill, local);
if (!abnormalDto.getStatus().equals("F")){ // if (!abnormalDto.getStatus().equals("F")){
throw BusinessException.build("该异常单不是方案确认状态,不能进行方案作废"); // throw BusinessException.build("该异常单不是方案确认状态,不能进行方案作废");
} // }
if ((Constants.REPAIR.equals(abnormalDto.getAbnormalMethod()) || Constants.REPAIR_MATCH.equals(abnormalDto.getAbnormalMethod()))){ if ((Constants.REPAIR.equals(abnormalDto.getAbnormalMethod()) || Constants.REPAIR_MATCH.equals(abnormalDto.getAbnormalMethod()))){
//异常单是否已生成新的订单号 /*//异常单是否已生成新的订单号
ShopOrderDto shopOrderBo = SpringUtil.getBean(ShopOrderService.class).findByShopOrderBo(abnormalBill.getAbnormalNo()); ShopOrderDto shopOrderBo = SpringUtil.getBean(ShopOrderService.class).findByShopOrderBo(abnormalBill.getAbnormalNo());
if (Optional.ofNullable(shopOrderBo).isPresent()){ if (Optional.ofNullable(shopOrderBo).isPresent()){
throw BusinessException.build("该异常单已生成新的订单号:" + abnormalBill.getAbnormalNo() + ",无法方案作废"); throw BusinessException.build("该异常单已生成新的订单号:" + abnormalBill.getAbnormalNo() + ",无法方案作废");
@ -612,8 +612,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
AbnormalPlan abnormalPlan = SpringUtil.getBean(AbnormalPlanService.class).getById(HandleEnum.ABNORMAL_PLAN.getHandle(site, abnormalBill.getAbnormalNo())); AbnormalPlan abnormalPlan = SpringUtil.getBean(AbnormalPlanService.class).getById(HandleEnum.ABNORMAL_PLAN.getHandle(site, abnormalBill.getAbnormalNo()));
if (Optional.ofNullable(abnormalPlan).isPresent() && abnormalPlan.getStatus().equals("PR")){ if (Optional.ofNullable(abnormalPlan).isPresent() && abnormalPlan.getStatus().equals("PR")){
throw BusinessException.build("该异常单计划已处理:" + abnormalBill.getAbnormalNo() + ",无法方案作废"); throw BusinessException.build("该异常单计划已处理:" + abnormalBill.getAbnormalNo() + ",无法方案作废");
} }*/
if (StringUtil.notBlank(abnormalDto.getRouterBo()) && StringUtil.notBlank(abnormalDto.getSfc())){ if (StringUtil.notBlank(abnormalDto.getRouterBo()) && StringUtil.notBlank(abnormalDto.getSfc())){
HashMap<String, String> paramMap=new HashMap(); HashMap<String, String> paramMap=new HashMap();
paramMap.put("routerBo",abnormalDto.getRouterBo()); paramMap.put("routerBo",abnormalDto.getRouterBo());
@ -621,8 +620,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
List<Map<String, Object>> mapList = routerStepcontentMapper.selectDisRouterInfo(paramMap); List<Map<String, Object>> mapList = routerStepcontentMapper.selectDisRouterInfo(paramMap);
for (Map<String, Object> map : mapList) { for (Map<String, Object> map : mapList) {
String dispatchNo = abnormalDto.getSfc() + "-" + map.get("STEP_ID"); String dispatchNo = abnormalDto.getSfc() + "-" + map.get("STEP_ID");
buffer.append(dispatchNo + ",");
sfcDispatchCommonService.updateSfcDispatchStatus(site,abnormalBill.getCancelUser(),dispatchNo,DispatchStatusEnum.CANCEL.getCode(),null); sfcDispatchCommonService.updateSfcDispatchStatus(site,abnormalBill.getCancelUser(),dispatchNo,DispatchStatusEnum.CANCEL.getCode(),null);
buffer.append(dispatchNo + ",");
} }
}else if (StringUtil.notBlank(abnormalDto.getRouterBo()) && StringUtil.isBlank(abnormalDto.getSfc())){ }else if (StringUtil.notBlank(abnormalDto.getRouterBo()) && StringUtil.isBlank(abnormalDto.getSfc())){
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
@ -630,8 +629,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
map.put("shopOrder",abnormalBill.getAbnormalNo()); map.put("shopOrder",abnormalBill.getAbnormalNo());
List<SfcDispatchDto> sfcDispatchList = SpringUtil.getBean(SfcDispatchMapper.class).findSfcDispatchList(map); List<SfcDispatchDto> sfcDispatchList = SpringUtil.getBean(SfcDispatchMapper.class).findSfcDispatchList(map);
for (SfcDispatchDto dispatchDto : sfcDispatchList) { for (SfcDispatchDto dispatchDto : sfcDispatchList) {
buffer.append(dispatchDto.getDispatchNo() + ",");
sfcDispatchCommonService.updateSfcDispatchStatus(site,abnormalBill.getCancelUser(),dispatchDto.getDispatchNo(),DispatchStatusEnum.CANCEL.getCode(),null); sfcDispatchCommonService.updateSfcDispatchStatus(site,abnormalBill.getCancelUser(),dispatchDto.getDispatchNo(),DispatchStatusEnum.CANCEL.getCode(),null);
buffer.append(dispatchDto.getDispatchNo() + ",");
} }
} }
} }
@ -777,9 +776,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
this.saveOrUpdate(abnormalBill); this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose); abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
if (!StringUtil.isBlank(abnormalBill.getBpmSubmit()) && abnormalBill.getBpmSubmit().equals("false")) { /*if (!StringUtil.isBlank(abnormalBill.getBpmSubmit()) && abnormalBill.getBpmSubmit().equals("false")) {
this.anomalyCreatedAndSendMessage(abnormalBillMapper.selectById(abnormalBill.getHandle()), abnormalBillDispose); this.anomalyCreatedAndSendMessage(abnormalBillMapper.selectById(abnormalBill.getHandle()), abnormalBillDispose);
} }*/
} }
@Override @Override

Loading…
Cancel
Save