|
|
@ -186,12 +186,32 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
public String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
|
|
|
|
public String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
|
|
|
|
String message = this.generateAbnormalBill(abnormalBill, abnormalBillDispose, null, null);
|
|
|
|
String message = this.generateAbnormalBill(abnormalBill, abnormalBillDispose, null, null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// List<NcCode> ncByNG = ncCodeService.findNcByNG(abnormalBill.getMessageType(), abnormalBill.getNcCode());
|
|
|
|
// List<NcCode> ncByNG = ncCodeService.findNcByNG(abnormalBill.getMessageType(), abnormalBill.getNcCode());
|
|
|
|
// if(ncByNG == null || ncByNG.size() <= 0){
|
|
|
|
// if(ncByNG == null || ncByNG.size() <= 0){
|
|
|
|
// throw BusinessException.build("该消息类型下没有该不良代码");
|
|
|
|
// throw BusinessException.build("该消息类型下没有该不良代码");
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
this.saveOrUpdate(abnormalBill);
|
|
|
|
this.saveOrUpdate(abnormalBill);
|
|
|
|
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
|
|
|
|
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
|
|
|
|
|
|
|
|
if(!StringUtil.isBlank(abnormalBill.getSfc()) ){
|
|
|
|
|
|
|
|
List<String> status = new ArrayList<>();
|
|
|
|
|
|
|
|
status.add(Constants.PROGRAM_CONFIRM);
|
|
|
|
|
|
|
|
status.add(Constants.CANCEL);
|
|
|
|
|
|
|
|
status.add(Constants.SHUT_DOWN);
|
|
|
|
|
|
|
|
List<AbnormalBill> abnormalBillList = abnormalBillMapper.findCountBySfc(abnormalBill.getSite(), abnormalBill.getType(), abnormalBill.getSfc(), status);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(abnormalBillList.size() > 1 && !"更新成功".equals(message)){
|
|
|
|
|
|
|
|
throw BusinessException.build("设备异常有未处理完成的sfc");
|
|
|
|
|
|
|
|
}else if(abnormalBillList.size() > 1 ){
|
|
|
|
|
|
|
|
throw BusinessException.build("设备异常有未处理完成的sfc");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return message;
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -488,6 +508,18 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
if(StringUtil.isBlank(abnormalBill.getSfc()) && !Constants.ABNORMAL_RESRCE.equals(abnormalBill.getType())) {
|
|
|
|
if(StringUtil.isBlank(abnormalBill.getSfc()) && !Constants.ABNORMAL_RESRCE.equals(abnormalBill.getType())) {
|
|
|
|
throw BusinessException.build("产品条码不能为空");
|
|
|
|
throw BusinessException.build("产品条码不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// }else if(!StringUtil.isBlank(abnormalBill.getSfc()) && Constants.ABNORMAL_RESRCE.equals(abnormalBill.getType())){
|
|
|
|
|
|
|
|
// AbnormalBill abnormalBill2 = new AbnormalBill();
|
|
|
|
|
|
|
|
// abnormalBill2.setType(abnormalBill.getType());
|
|
|
|
|
|
|
|
// abnormalBill2.setSfc(abnormalBill.getSfc());
|
|
|
|
|
|
|
|
// abnormalBill2.setStatus(Constants.NEW);
|
|
|
|
|
|
|
|
// List<AbnormalBill> abnormalBills = this.selectList(abnormalBill2);
|
|
|
|
|
|
|
|
// if(abnormalBills.size() > 0 && !"更新成功".equals(message)){
|
|
|
|
|
|
|
|
// throw BusinessException.build("设备异常有未处理完成的sfc");
|
|
|
|
|
|
|
|
// }else if(abnormalBills.size() > 1){
|
|
|
|
|
|
|
|
// throw BusinessException.build("设备异常有未处理完成的sfc");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
// if(StringUtil.isBlank(abnormalBill.getResrce())){
|
|
|
|
// if(StringUtil.isBlank(abnormalBill.getResrce())){
|
|
|
|
// throw BusinessException.build("设备编号不能为空");
|
|
|
|
// throw BusinessException.build("设备编号不能为空");
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|