|
@@ -37,6 +37,8 @@ import com.zd.laboratory.api.entity.LabMessageContent;
|
|
|
import com.zd.laboratory.api.feign.RemoteLabHardwareService;
|
|
import com.zd.laboratory.api.feign.RemoteLabHardwareService;
|
|
|
import com.zd.laboratory.api.feign.RemoteLaboratoryService;
|
|
import com.zd.laboratory.api.feign.RemoteLaboratoryService;
|
|
|
import com.zd.laboratory.api.feign.RemoteMessageContentService;
|
|
import com.zd.laboratory.api.feign.RemoteMessageContentService;
|
|
|
|
|
+import com.zd.laboratory.api.feign.RemoteSmsService;
|
|
|
|
|
+import com.zd.laboratory.api.vo.TextMessageVo;
|
|
|
import com.zd.model.constant.HttpStatus;
|
|
import com.zd.model.constant.HttpStatus;
|
|
|
import com.zd.model.constant.SecurityConstants;
|
|
import com.zd.model.constant.SecurityConstants;
|
|
|
import com.zd.model.domain.AjaxResult;
|
|
import com.zd.model.domain.AjaxResult;
|
|
@@ -138,6 +140,9 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RemoteUserService remoteUserService;
|
|
private RemoteUserService remoteUserService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RemoteSmsService remoteSmsService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询库存管理
|
|
* 查询库存管理
|
|
|
*
|
|
*
|
|
@@ -887,8 +892,12 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
}
|
|
}
|
|
|
Long logId = (Long) result.getData();
|
|
Long logId = (Long) result.getData();
|
|
|
String text = "【实验室安全系统】" + warningNoticeLogDto.getSubName() + "-" + warningNoticeLogDto.getName() + "即将过期,发生时间:" + LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy-MM-dd HH:mm:ss") + ",请尽快确认。";
|
|
String text = "【实验室安全系统】" + warningNoticeLogDto.getSubName() + "-" + warningNoticeLogDto.getName() + "即将过期,发生时间:" + LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy-MM-dd HH:mm:ss") + ",请尽快确认。";
|
|
|
|
|
+ List<String> paramList=new ArrayList<>();
|
|
|
|
|
+ paramList.add(warningNoticeLogDto.getSubName());
|
|
|
|
|
+ paramList.add(warningNoticeLogDto.getName());
|
|
|
|
|
+ paramList.add(LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
//发送通知
|
|
//发送通知
|
|
|
- sendNotice(hxpStock, userIdStr, phones, warningConfigDto.getUnexpired(),text,logId);
|
|
|
|
|
|
|
+ sendNotice(hxpStock, userIdStr, phones, warningConfigDto.getUnexpired(),text,logId,paramList);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -943,8 +952,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
}
|
|
}
|
|
|
Long logId = (Long)result.getData();
|
|
Long logId = (Long)result.getData();
|
|
|
String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getName()+"已过期,请尽快确认。";
|
|
String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getName()+"已过期,请尽快确认。";
|
|
|
|
|
+ List<String> parmList=new ArrayList<>();
|
|
|
|
|
+ parmList.add(warningNoticeLogDto.getSubName());
|
|
|
|
|
+ parmList.add(warningNoticeLogDto.getName());
|
|
|
//发送通知
|
|
//发送通知
|
|
|
- sendNotice(hxpStock, userIdStr, phones, warningConfigDto.getExpired(), text, logId);
|
|
|
|
|
|
|
+ sendNotice(hxpStock, userIdStr, phones, warningConfigDto.getExpired(), text, logId,parmList);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
List<Long> stockIds = expiredStock.stream().filter(i -> 1 == i.getStatus()).map(HxpStockVO::getId).collect(Collectors.toList());
|
|
List<Long> stockIds = expiredStock.stream().filter(i -> 1 == i.getStatus()).map(HxpStockVO::getId).collect(Collectors.toList());
|
|
@@ -957,7 +969,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void sendNotice(HxpStockVO hxpStock, StringBuffer userIdStr, StringBuffer phones, String expired,String text,Long logId) {
|
|
|
|
|
|
|
+ private void sendNotice(HxpStockVO hxpStock, StringBuffer userIdStr, StringBuffer phones, String expired,String text,Long logId,List<String> paramList) {
|
|
|
if (expired.contains("1")) {
|
|
if (expired.contains("1")) {
|
|
|
//系统通知
|
|
//系统通知
|
|
|
LabMessageContent labMessageContent = new LabMessageContent();
|
|
LabMessageContent labMessageContent = new LabMessageContent();
|
|
@@ -980,10 +992,19 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
logger.info("获取实验室管理员和安全员信息失败!{}",JSON.toJSONString(listResultData));
|
|
logger.info("获取实验室管理员和安全员信息失败!{}",JSON.toJSONString(listResultData));
|
|
|
}
|
|
}
|
|
|
List<UserPhoneInfo> userPhoneInfoList = listResultData.getData();
|
|
List<UserPhoneInfo> userPhoneInfoList = listResultData.getData();
|
|
|
- AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.toString(), text);
|
|
|
|
|
- alarmEntrty.setLogId(logId);
|
|
|
|
|
- alarmEntrty.setUserPhoneInfo(userPhoneInfoList);
|
|
|
|
|
- remoteAlarmService.send(alarmEntrty);
|
|
|
|
|
|
|
+ //AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.toString(), text);
|
|
|
|
|
+// alarmEntrty.setLogId(logId);
|
|
|
|
|
+// alarmEntrty.setUserPhoneInfo(userPhoneInfoList);
|
|
|
|
|
+// remoteAlarmService.send(alarmEntrty);
|
|
|
|
|
+ List<String> phoneList=new ArrayList<>();
|
|
|
|
|
+ userPhoneInfoList.forEach(a->{
|
|
|
|
|
+ phoneList.add(a.getPhone());
|
|
|
|
|
+ });
|
|
|
|
|
+ TextMessageVo textMessageVo=new TextMessageVo();
|
|
|
|
|
+ textMessageVo.setPhoneList(phoneList);
|
|
|
|
|
+ textMessageVo.setTempContent(text);
|
|
|
|
|
+ textMessageVo.setVariableList(paramList);
|
|
|
|
|
+ remoteSmsService.sendTemplateMessage(textMessageVo);
|
|
|
logger.info("化学品已过期发送短信打电话消息推送完成!");
|
|
logger.info("化学品已过期发送短信打电话消息推送完成!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1077,6 +1098,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
remoteMessageContentService.sendMessage(labMessageContent);
|
|
remoteMessageContentService.sendMessage(labMessageContent);
|
|
|
}
|
|
}
|
|
|
if (timeout.contains("2")) {
|
|
if (timeout.contains("2")) {
|
|
|
|
|
+ List<String> paramList=new ArrayList<>();
|
|
|
|
|
+ paramList.add(warningNoticeLogDto.getSubName());
|
|
|
|
|
+ paramList.add(warningNoticeLogDto.getApplyUser());
|
|
|
|
|
+ paramList.add(warningNoticeLogDto.getName());
|
|
|
|
|
+ paramList.add(LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
//短信通知
|
|
//短信通知
|
|
|
String[] strings = Stream.of(phones.toString().split(",")).filter(a -> StrUtil.isNotBlank(a)).collect(Collectors.joining(",")).split(",");
|
|
String[] strings = Stream.of(phones.toString().split(",")).filter(a -> StrUtil.isNotBlank(a)).collect(Collectors.joining(",")).split(",");
|
|
|
if (strings != null) {
|
|
if (strings != null) {
|
|
@@ -1086,10 +1112,20 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
logger.info("获取实验室管理员和安全员信息失败!{}",JSON.toJSONString(listResultData));
|
|
logger.info("获取实验室管理员和安全员信息失败!{}",JSON.toJSONString(listResultData));
|
|
|
}
|
|
}
|
|
|
List<UserPhoneInfo> userPhoneInfoList = listResultData.getData();
|
|
List<UserPhoneInfo> userPhoneInfoList = listResultData.getData();
|
|
|
- AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.name(), text);
|
|
|
|
|
- alarmEntrty.setLogId(logId);
|
|
|
|
|
- alarmEntrty.setUserPhoneInfo(userPhoneInfoList);
|
|
|
|
|
- remoteAlarmService.send(alarmEntrty);
|
|
|
|
|
|
|
+// AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.name(), text);
|
|
|
|
|
+// alarmEntrty.setLogId(logId);
|
|
|
|
|
+// alarmEntrty.setUserPhoneInfo(userPhoneInfoList);
|
|
|
|
|
+// remoteAlarmService.send(alarmEntrty);
|
|
|
|
|
+ //此处改成发短信模式
|
|
|
|
|
+ List<String> phoneList=new ArrayList<>();
|
|
|
|
|
+ userPhoneInfoList.forEach(a->{
|
|
|
|
|
+ phoneList.add(a.getPhone());
|
|
|
|
|
+ });
|
|
|
|
|
+ TextMessageVo textMessageVo=new TextMessageVo();
|
|
|
|
|
+ textMessageVo.setPhoneList(phoneList);
|
|
|
|
|
+ textMessageVo.setTempContent(text);
|
|
|
|
|
+ textMessageVo.setVariableList(paramList);
|
|
|
|
|
+ remoteSmsService.sendTemplateMessage(textMessageVo);
|
|
|
logger.info("化学品超时未归还发送短信打电话消息推送完成!");
|
|
logger.info("化学品超时未归还发送短信打电话消息推送完成!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1103,10 +1139,18 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
logger.info("获取实验室管理员和安全员信息失败!{}",JSON.toJSONString(listResultData));
|
|
logger.info("获取实验室管理员和安全员信息失败!{}",JSON.toJSONString(listResultData));
|
|
|
}
|
|
}
|
|
|
List<UserPhoneInfo> userPhoneInfoList = listResultData.getData();
|
|
List<UserPhoneInfo> userPhoneInfoList = listResultData.getData();
|
|
|
- AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.Call.name(), text);
|
|
|
|
|
- alarmEntrty.setLogId(logId);
|
|
|
|
|
- alarmEntrty.setUserPhoneInfo(userPhoneInfoList);
|
|
|
|
|
- remoteAlarmService.send(alarmEntrty);
|
|
|
|
|
|
|
+// AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.Call.name(), text);
|
|
|
|
|
+// alarmEntrty.setLogId(logId);
|
|
|
|
|
+// alarmEntrty.setUserPhoneInfo(userPhoneInfoList);
|
|
|
|
|
+// remoteAlarmService.send(alarmEntrty);
|
|
|
|
|
+ List<String> phoneList=new ArrayList<>();
|
|
|
|
|
+ userPhoneInfoList.forEach(a->{
|
|
|
|
|
+ phoneList.add(a.getPhone());
|
|
|
|
|
+ });
|
|
|
|
|
+ TextMessageVo textMessageVo=new TextMessageVo();
|
|
|
|
|
+ textMessageVo.setPhoneList(phoneList);
|
|
|
|
|
+ textMessageVo.setTempContent(text);
|
|
|
|
|
+ remoteSmsService.sendVoiceMessage(textMessageVo);
|
|
|
logger.info("化学品超时未归还打电话消息推送完成!");
|
|
logger.info("化学品超时未归还打电话消息推送完成!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|