|
|
|
@ -309,11 +309,17 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
//异常代码
|
|
|
|
|
|
|
|
|
|
//通过设备找到异常车间
|
|
|
|
|
Resrce resrce = new Resrce();
|
|
|
|
|
resrce.setSite(site);
|
|
|
|
|
resrce.setResrce(abnormalBill.getResrce());
|
|
|
|
|
WorkCenter workCenterByResrce = workCenterMapper.findWorkCenterByResrce(resrce);
|
|
|
|
|
abnormalBill.setWorkCenter(workCenterByResrce.getWorkCenter());
|
|
|
|
|
try{
|
|
|
|
|
Resrce resrce = new Resrce();
|
|
|
|
|
resrce.setSite(site);
|
|
|
|
|
resrce.setResrce(abnormalBill.getResrce());
|
|
|
|
|
WorkCenter workCenterByResrce = workCenterMapper.findWorkCenterByResrce(resrce);
|
|
|
|
|
abnormalBill.setWorkCenter(workCenterByResrce.getWorkCenter());
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
throw new BaseException("根据资源(设备)查找异常车间报错,请查看工作中心维护。报错信息:"+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<NcCodeDto> ncCodesAndNcGroups = ncCodeService.findNcCodeDescriptionByNcCode(abnormalBill.getNcCode());
|
|
|
|
|
List<AbnormalNcCode> abnormalNcCodes = new LinkedList<>();
|
|
|
|
|
for(int i = 0; i < ncCodesAndNcGroups.size(); i ++){
|
|
|
|
@ -451,7 +457,13 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
if(StringUtil.isEmpty(abnormalBill.getAbnormalNo())){
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return abnormalBillMapper.findAllByAbnormalNoDevice(abnormalBill,local);
|
|
|
|
|
DataField dataField = new DataField();
|
|
|
|
|
dataField.setSite(site);
|
|
|
|
|
dataField.setDataField("RERR_CANCEL_REASON");
|
|
|
|
|
List<DataFieldList> dataFieldList = dataFieldListMapper.findDataFieldList(dataField);
|
|
|
|
|
AbnormalBillDto abnormalBillDto = abnormalBillMapper.findAllByAbnormalNoDevice(abnormalBill, local);
|
|
|
|
|
abnormalBillDto.setCancelCodeList(dataFieldList);
|
|
|
|
|
return abnormalBillDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -480,10 +492,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
abnormalBillDispose.setHandle(HandleEnum.ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
|
|
|
|
|
|
|
|
|
|
AbnormalBill abnormalBill1 = abnormalBillMapper.selectById(HandleEnum.ABNORMAL_BILL.getHandle(site, abnormalBill.getAbnormalNo()));
|
|
|
|
|
if("true".equals(abnormalBill1.getProgram())){
|
|
|
|
|
throw BusinessException.build("该异常单已经方案确认");
|
|
|
|
|
}
|
|
|
|
|
// AbnormalBill abnormalBill1 = abnormalBillMapper.selectById(HandleEnum.ABNORMAL_BILL.getHandle(site, abnormalBill.getAbnormalNo()));
|
|
|
|
|
// if("true".equals(abnormalBill1.getProgram())){
|
|
|
|
|
// throw BusinessException.build("该异常单已经方案确认");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if(!StringUtil.isBlank(abnormalBillDispose.getRouterBo())){
|
|
|
|
|
//分割该工艺路线
|
|
|
|
@ -531,18 +543,23 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
AbnormalBillDispose abnormalBillDispose1 = abnormalBillDisposeMapper.selectById(abnormalBillDispose.getHandle());
|
|
|
|
|
abnormalPlanService.saveAbnormalPlan(abnormalBill2,abnormalBillDispose1,now);
|
|
|
|
|
}
|
|
|
|
|
//判断该异常解决方案是否是让步放行、配作、线下换料、试装,并且关联来源不是空,如果是,就调用孙豪的方法
|
|
|
|
|
//判断该异常解决方案是否是让步放行、配作、线下换料、试装,并且关联来源不是空,如果是,就调用孙豪的方法,并且sfc不能为空
|
|
|
|
|
if((Constants.CONCESSION.equals(abnormalBillDispose.getAbnormalMethod()) ||
|
|
|
|
|
Constants.MATCH.equals(abnormalBillDispose.getAbnormalMethod()) ||
|
|
|
|
|
Constants.OFFLINE_REFUELING.equals(abnormalBillDispose.getAbnormalMethod()) ||
|
|
|
|
|
Constants.TEST_EQUIPMENT.equals(abnormalBillDispose.getAbnormalMethod()))
|
|
|
|
|
&& !StringUtil.isBlank(abnormalBill2.getObjectBo())){
|
|
|
|
|
&& !StringUtil.isBlank(abnormalBill2.getObjectBo())
|
|
|
|
|
&& StringUtil.notBlank(abnormalBill2.getSfc())){
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
this.creatInspectionTask(site,abnormalBill2.getObjectBo(),abnormalBill2.getSfc(),abnormalBill2.getStepId(),AnomalyConstant.AnomalyMethod.msg(abnormalBillDispose.getAbnormalMethod()));
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
throw new BaseException("createInspectionTask方法报错,"+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}else if(Constants.REPAIR.equals(abnormalBillDispose.getAbnormalMethod()) && StringUtil.isBlank(abnormalBillDispose.getResolveShopOrder())){
|
|
|
|
|
|
|
|
|
|
}else if(Constants.REPAIR.equals(abnormalBillDispose.getAbnormalMethod()) &&
|
|
|
|
|
StringUtil.isBlank(abnormalBillDispose.getResolveShopOrder()) &&
|
|
|
|
|
StringUtil.notBlank(abnormalBill2.getSfc())){
|
|
|
|
|
Sfc sfc = sfcMapper.selectById(HandleEnum.SFC.getHandle(site, abnormalBill2.getSfc()));
|
|
|
|
|
if(sfc.getQty() > Double.parseDouble(abnormalBill2.getNcQty())){
|
|
|
|
|
//跳过啥都不做
|
|
|
|
@ -558,10 +575,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
sfcDto.setStepId((String) map.get("STEP_ID"));
|
|
|
|
|
this.batchRepair(sfcDto);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.anomalyCreatedAndSendMessage(abnormalBill2,abnormalBillDispose);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|