|
|
|
@ -143,6 +143,15 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
|
|
|
|
|
this.generateAbnormalBill(abnormalBill,abnormalBillDispose,null,null);
|
|
|
|
|
this.saveOrUpdate(abnormalBill);
|
|
|
|
|
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
|
|
|
|
|
return abnormalBill.getAbnormalNo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType,List<String> dutyType) {
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
@ -174,7 +183,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
|
|
|
|
|
ArrayList<AbnormalCause> causeTypes = new ArrayList<>();
|
|
|
|
|
//判断原因分类是否为空
|
|
|
|
|
if(dutyCauseType.size() >= 1){
|
|
|
|
|
if(dutyCauseType != null && dutyCauseType.size() >= 1){
|
|
|
|
|
for(String cause:dutyCauseType){
|
|
|
|
|
AbnormalCause abnormalCause = new AbnormalCause();
|
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
|
|
@ -198,7 +207,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
ArrayList<AbnormalDuty> dutyTypes = new ArrayList<>();
|
|
|
|
|
//判断责任分类是否为空
|
|
|
|
|
if(dutyType.size() >= 1){
|
|
|
|
|
if(dutyType != null && dutyType.size() >= 1){
|
|
|
|
|
for(String duty:dutyType){
|
|
|
|
|
AbnormalDuty abnormalDuty = new AbnormalDuty();
|
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
|
|
@ -234,7 +243,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
abnormalBillDispose.setModifiedUser(user);
|
|
|
|
|
|
|
|
|
|
//判断SFC、设备编号、消息类型是否不正确或为空
|
|
|
|
|
if(StringUtil.isBlank(abnormalBill.getSfc())){
|
|
|
|
|
if(StringUtil.isBlank(abnormalBill.getSfc()) && "S".equals(abnormalBill.getType())){
|
|
|
|
|
throw BusinessException.build("产品条码不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isBlank(abnormalBill.getResrce())){
|
|
|
|
@ -252,10 +261,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
//判断不良品数量和问题数量是否为正整数
|
|
|
|
|
try {
|
|
|
|
|
if(Integer.parseInt(abnormalBill.getNcQty()) < 0) {
|
|
|
|
|
if(!StringUtil.isBlank(abnormalBill.getNcQty()) && Integer.parseInt(abnormalBill.getNcQty()) < 0) {
|
|
|
|
|
throw BusinessException.build("不良品数量必须大于0");
|
|
|
|
|
}
|
|
|
|
|
if(Integer.parseInt(abnormalBill.getPbQty()) < 0){
|
|
|
|
|
if(!StringUtil.isBlank(abnormalBill.getPbQty()) && Integer.parseInt(abnormalBill.getPbQty()) < 0){
|
|
|
|
|
throw BusinessException.build("问题数量必须大于0");
|
|
|
|
|
}
|
|
|
|
|
}catch (NumberFormatException num){
|
|
|
|
|