|
|
|
@ -1079,9 +1079,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
abnormalMessage.setType(abnormalBill.getMessageType());
|
|
|
|
|
|
|
|
|
|
//找到对应的消息类型
|
|
|
|
|
MessageType messageType = this.findMessageTypeByStatusAndUserGroup(abnormalMessage, abnormalBill, abnormalBillDispose);
|
|
|
|
|
String messageType = this.findMessageTypeByStatusAndUserGroup(abnormalMessage, abnormalBill, abnormalBillDispose);
|
|
|
|
|
//设置消息类型
|
|
|
|
|
abnormalMessage.setMessageType(messageType.getMessageType());
|
|
|
|
|
abnormalMessage.setMessageType(messageType);
|
|
|
|
|
//格式化消息
|
|
|
|
|
String message = this.formatMessage(abnormalBill, abnormalMessage.getMessageType(), site);
|
|
|
|
|
//得到消息触发的时间
|
|
|
|
@ -1439,9 +1439,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MessageType findMessageTypeByStatusAndUserGroup(Message message, AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose) {
|
|
|
|
|
public String findMessageTypeByStatusAndUserGroup(Message message, AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose) {
|
|
|
|
|
String status = abnormalBill.getStatus();
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
|
ArrayList<String> typeList = new ArrayList<>();
|
|
|
|
|
String userGroup = null;
|
|
|
|
|
//根据异常单的状态找到对应的用户组
|
|
|
|
|
switch (status){
|
|
|
|
@ -1467,17 +1468,29 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
if(StringUtils.isBlank(userGroup)){
|
|
|
|
|
throw new BaseException("消息发送失败,找不到对应的用户组");
|
|
|
|
|
}else{
|
|
|
|
|
MessageType type = null;
|
|
|
|
|
try{
|
|
|
|
|
type = messageTypeMapper.findMessageTypeByUserGroup(site, userGroup);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
throw new BaseException("根据发送的用户组找到有可能找到多个对应的消息类型,请检查。"+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
if(type == null){
|
|
|
|
|
throw new BaseException("根据发送的用户组找不到对应的消息类型,请维护。");
|
|
|
|
|
}else{
|
|
|
|
|
return type;
|
|
|
|
|
//可能为多个用户组
|
|
|
|
|
String[] splitUserGroup = userGroup.split(",");
|
|
|
|
|
for (String spUserGroup: splitUserGroup) {
|
|
|
|
|
MessageType thisType;
|
|
|
|
|
try{
|
|
|
|
|
thisType = messageTypeMapper.findMessageTypeByUserGroup(site, spUserGroup);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
throw new BaseException("根据发送的用户组找到"+spUserGroup+"找到多个对应的消息类型,请检查。"+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
if(thisType == null){
|
|
|
|
|
throw new BaseException("根据发送的用户组"+spUserGroup+"找不到对应的消息类型,请维护。");
|
|
|
|
|
}
|
|
|
|
|
String messageType = thisType.getMessageType();
|
|
|
|
|
if (typeList.isEmpty()){
|
|
|
|
|
typeList.add(messageType);
|
|
|
|
|
}else {
|
|
|
|
|
if (!typeList.contains(messageType)){
|
|
|
|
|
throw new BaseException("根据发送的用户组找到多个对应的消息类型,请检查。");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return typeList.get(0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|