|
|
|
@ -1029,38 +1029,46 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
|
|
|
|
|
//响应中,设置响应超时的用户的发送的用户组为提报时要升级的用户组
|
|
|
|
|
case Constants.RESPONSE:
|
|
|
|
|
|
|
|
|
|
Message abnormalMessage1 = new Message();
|
|
|
|
|
abnormalMessage1.setSite(site);
|
|
|
|
|
abnormalMessage1.setObjectBo(abnormalBill.getHandle());
|
|
|
|
|
abnormalMessage1.setNode(Constants.ABNORMAL_MESSAGE_REPORT);
|
|
|
|
|
abnormalMessage1.setGrade(Double.parseDouble("1"));
|
|
|
|
|
// QueryWrapper<Message> wrapper = new QueryWrapper<>();
|
|
|
|
|
// wrapper.setEntity(abnormalMessage1);
|
|
|
|
|
List<Message> messages = messageService.selectList(abnormalMessage1);
|
|
|
|
|
// Message _abnormalMessage = messageMapper.selectOne(wrapper);
|
|
|
|
|
if(messages.size() > 0) {
|
|
|
|
|
abnormalMessage.setUpUserGroup(messages.get(0).getUpUserGroup());
|
|
|
|
|
abnormalMessage.setUpMessageType(messages.get(0).getUpMessageType());
|
|
|
|
|
abnormalMessage.setGrade(messages.get(0).getGrade());
|
|
|
|
|
abnormalMessage.setUpDateTime(messages.get(0).getUpDateTime());
|
|
|
|
|
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_RESPONSE);
|
|
|
|
|
}
|
|
|
|
|
// }else{
|
|
|
|
|
// throw new BaseException("发送消息时,异常响应报错");
|
|
|
|
|
// }
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
//纠纷确认
|
|
|
|
|
case Constants.CORRECTION_CONFIRM:
|
|
|
|
|
abnormalMessage.setSendUserGroup(abnormalBillDispose.getDutySendUserGroup());
|
|
|
|
|
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM);
|
|
|
|
|
//找到责任划分超时的,并关闭
|
|
|
|
|
UpdateWrapper<Message> dutyWrapper = new UpdateWrapper<>();
|
|
|
|
|
Message dutyMessage = new Message();
|
|
|
|
|
dutyMessage.setStatus("Y");
|
|
|
|
|
dutyWrapper.eq("STATUS","N");
|
|
|
|
|
dutyWrapper.eq("OBJECT_BO",abnormalMessage.getObjectBo());
|
|
|
|
|
dutyWrapper.eq("NODE",Constants.ABNORMAL_MESSAGE_RESPONSE_DUTY);
|
|
|
|
|
messageService.update(dutyMessage,dutyWrapper);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
//方案确认
|
|
|
|
|
case Constants.PROGRAM_CONFIRM:
|
|
|
|
|
abnormalMessage.setSendUserGroup(abnormalBillDispose.getResolveSendUserGroup());
|
|
|
|
|
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM);
|
|
|
|
|
//找到方案确认超时的,并关闭
|
|
|
|
|
UpdateWrapper<Message> resolveWrapper = new UpdateWrapper<>();
|
|
|
|
|
Message resolveMessage = new Message();
|
|
|
|
|
resolveMessage.setStatus("Y");
|
|
|
|
|
resolveWrapper.eq("STATUS","N");
|
|
|
|
|
resolveWrapper.eq("OBJECT_BO",abnormalMessage.getObjectBo());
|
|
|
|
|
resolveWrapper.eq("NODE",Constants.ABNORMAL_MESSAGE_RESPONSE_RESOLVE);
|
|
|
|
|
messageService.update(resolveMessage,resolveWrapper);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
//取消
|
|
|
|
@ -1081,14 +1089,14 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置状态,新建是N,响应为N,纠防确认是N,方案确认是Y,取消是Y,N为可以升级,Y为不可以升级
|
|
|
|
|
if(Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode()) ||
|
|
|
|
|
Constants.ABNORMAL_MESSAGE_REPORT.equals(abnormalMessage.getNode())){
|
|
|
|
|
//设置状态,新建是N,响应比较特殊,在下面设置
|
|
|
|
|
if(Constants.ABNORMAL_MESSAGE_REPORT.equals(abnormalMessage.getNode())){
|
|
|
|
|
abnormalMessage.setStatus("N");
|
|
|
|
|
}else{
|
|
|
|
|
abnormalMessage.setStatus("Y");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//得到升级的用户组、升级的时间和等级、升级的消息
|
|
|
|
|
//新建有、响应没有、纠防确认没有、方案确认没有、取消没有、关闭没有
|
|
|
|
|
if(Constants.NEW.equals(abnormalBill.getStatus()) ){
|
|
|
|
@ -1116,6 +1124,12 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
abnormalMessage.setModifiedUser(user);
|
|
|
|
|
abnormalMessage.setModifiedDateTime(now);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果是响应状态的话,,并且要设置其超时时间和节点和状态,并关闭新建状态的消息
|
|
|
|
|
if (Constants.RESPONSE.equals(abnormalBill.getStatus())) {
|
|
|
|
|
this.saveDutyMessageAndResolveMessageByNodeIsResponse(abnormalMessage);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
//发送消息
|
|
|
|
|
if(!Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode())){
|
|
|
|
|
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site,abnormalMessage.getSendUserGroup());
|
|
|
|
@ -1136,6 +1150,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
messageService.saveOrUpdate(abnormalMessage);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -1291,6 +1306,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
//查询质量异常记录数量 处置工艺路线及不良代码
|
|
|
|
|
SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo);
|
|
|
|
|
if(splitSfcDto == null){
|
|
|
|
|
throw new BaseException("没有找到报废的信息");
|
|
|
|
|
}
|
|
|
|
|
String routerBo = splitSfcDto.getRouterBo();
|
|
|
|
|
String ncCode = splitSfcDto.getNcCode();
|
|
|
|
|
|
|
|
|
@ -1380,7 +1398,50 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveDutyMessageAndResolveMessageByNodeIsResponse(Message paramMessage) {
|
|
|
|
|
Message message = new Message();
|
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
|
|
|
message.setHandle(uuid);
|
|
|
|
|
message.setSite(paramMessage.getSite());
|
|
|
|
|
message.setObjectBo(paramMessage.getObjectBo());
|
|
|
|
|
message.setType(paramMessage.getType());
|
|
|
|
|
message.setMessageType(paramMessage.getMessageType());
|
|
|
|
|
message.setSendUserGroup(paramMessage.getSendUserGroup());
|
|
|
|
|
message.setSendUser(paramMessage.getSendUser());
|
|
|
|
|
message.setContent(paramMessage.getContent());
|
|
|
|
|
message.setUpUserGroup(paramMessage.getUpUserGroup());
|
|
|
|
|
message.setUpUser(paramMessage.getUpUser());
|
|
|
|
|
message.setUpMessageType(paramMessage.getUpMessageType());
|
|
|
|
|
message.setResponseDateTime(paramMessage.getResponseDateTime());
|
|
|
|
|
message.setGrade(paramMessage.getGrade());
|
|
|
|
|
message.setCreatedUser(paramMessage.getCreatedUser());
|
|
|
|
|
message.setCreatedDateTime(paramMessage.getCreatedDateTime());
|
|
|
|
|
message.setModifiedUser(paramMessage.getModifiedUser());
|
|
|
|
|
message.setModifiedDateTime(paramMessage.getModifiedDateTime());
|
|
|
|
|
UserGroup customFieldByGroup = userGroupMapper.getCustomFieldByGroup(message.getSite(), message.getUpUserGroup());
|
|
|
|
|
message.setUpDateTime(message.getResponseDateTime().plusMinutes(Integer.parseInt(customFieldByGroup.getMessageDutyTime())));
|
|
|
|
|
paramMessage.setUpDateTime(message.getResponseDateTime().plusMinutes(Integer.parseInt(customFieldByGroup.getMessageResolveTime())));
|
|
|
|
|
message.setNode(Constants.ABNORMAL_MESSAGE_RESPONSE_DUTY);
|
|
|
|
|
paramMessage.setNode(Constants.ABNORMAL_MESSAGE_RESPONSE_RESOLVE);
|
|
|
|
|
paramMessage.setStatus("N");
|
|
|
|
|
message.setStatus("N");
|
|
|
|
|
List<Message> messages = new ArrayList<>();
|
|
|
|
|
messages.add(message);
|
|
|
|
|
messages.add(paramMessage);
|
|
|
|
|
//关闭新建状态的消息
|
|
|
|
|
|
|
|
|
|
//找到新建状态的,并关闭
|
|
|
|
|
UpdateWrapper<Message> resolveWrapper = new UpdateWrapper<>();
|
|
|
|
|
Message resolveMessage = new Message();
|
|
|
|
|
resolveMessage.setStatus("Y");
|
|
|
|
|
resolveWrapper.eq("STATUS","N");
|
|
|
|
|
resolveWrapper.eq("OBJECT_BO",paramMessage.getObjectBo());
|
|
|
|
|
resolveWrapper.eq("NODE",Constants.ABNORMAL_MESSAGE_REPORT);
|
|
|
|
|
messageService.update(resolveMessage,resolveWrapper);
|
|
|
|
|
|
|
|
|
|
messageService.saveOrUpdateBatch(messages);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, String> jgProductionIsScrap(String abnormalNo, String site, String sfc) {
|
|
|
|
@ -1513,5 +1574,4 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
inspectionTaskService.save(newInspectionTask);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|