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

master
yinq 2 years ago
parent 45ac479b7e
commit cb11d08417

@ -379,7 +379,7 @@ public class AbnormalBillController {
List<AbnormalRouterDto> abnormalRouterDtoList = routerService.selectAllDisRouter(abnormalRouterDto);
ArrayList<RouterBpmVO> routerBpmVOs = new ArrayList<>();
for (AbnormalRouterDto routerDto : abnormalRouterDtoList) {
Boolean isStepUsed = false;
Boolean isStepUsed = true;
RouterBpmVO bpmVO = new RouterBpmVO();
bpmVO.setAbnormalNo(routerDto.getAbnormalNo());
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<String> sfcDispatchStepList = sfcDispatchList.stream().map(SfcDispatch::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()))
.anyMatch(i -> sfcDispatchStepList.get(i).equals(routerStepList.get(i)));
//当两个集合没有共同的元素时该方法返回true
isStepUsed = Collections.disjoint(sfcDispatchStepList, routerStepList);
}
if (!isStepUsed){
if (isStepUsed){
bpmVO.setRouterStep(routerOperationByRouterBo);
routerBpmVOs.add(bpmVO);
}else {

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

Loading…
Cancel
Save