|
|
@@ -13,6 +13,7 @@ import com.zd.algorithm.api.alarm.feign.RemoteAlarmService;
|
|
|
import com.zd.algorithm.api.camera.feign.RemoteCameraService;
|
|
|
import com.zd.algorithm.api.forward.feign.RemoteForwardService;
|
|
|
import com.zd.algorithm.api.rfid.feign.RemoteRfidService;
|
|
|
+import com.zd.base.api.feign.RemoteMessageService;
|
|
|
import com.zd.chemical.controller.HxpAIOController;
|
|
|
import com.zd.chemical.domain.*;
|
|
|
import com.zd.chemical.domain.vo.*;
|
|
|
@@ -136,6 +137,9 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
@Autowired
|
|
|
private IHxpChemicalService hxpChemicalService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RemoteMessageService remoteMessageService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询库存管理
|
|
|
*
|
|
|
@@ -422,7 +426,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
}
|
|
|
Long logId = (Long)resultData.getData();
|
|
|
if(illegalRemoval != null){
|
|
|
- String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-实验人员违规携带"+warningNoticeLogDto.getName()+"离开房间,发生时间:"+LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy-MM-dd HH:mm:ss")+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+logId;
|
|
|
+ ResultData urlScheme = remoteMessageService.getUrlScheme(logId);
|
|
|
+ if(urlScheme.getCode() != HttpStatus.SUCCESS){
|
|
|
+ logger.error("获取urlScheme失败!");
|
|
|
+ }
|
|
|
+ String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-实验人员违规携带"+warningNoticeLogDto.getName()+"离开房间,发生时间:"+LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy-MM-dd HH:mm:ss")+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+logId +"&urlScheme="+urlScheme.getData();
|
|
|
if (illegalRemoval.contains("1")) {
|
|
|
//系统通知
|
|
|
LabMessageContent labMessageContent = new LabMessageContent();
|
|
|
@@ -933,6 +941,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
warningNoticeLogDto.setWarningType(2);
|
|
|
warningNoticeLogDto.setWarningSubType(1);
|
|
|
warningNoticeLogDto.setWarningTime(LocalDateTime.now());
|
|
|
+ warningNoticeLogDto.setExpirationTime(LocalDateTimeUtil.of(hxpStock.getExpirationTime()));
|
|
|
warningNoticeLogDto.setWarningWay(warningConfigDto.getTimeout());
|
|
|
warningNoticeLogDto.setMargin(hxpStock.getOutUsages());
|
|
|
warningNoticeLogDto.setDeposit(hxpStock.getCabinetName());
|
|
|
@@ -964,7 +973,12 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
if (HttpStatus.SUCCESS == result.getCode()) {
|
|
|
logger.info("即将过期保存日志成功!");
|
|
|
}
|
|
|
- String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getName()+"即将过期,发生时间:" + LocalDateTime.now() + ",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData();
|
|
|
+ ResultData urlScheme = remoteMessageService.getUrlScheme(Long.valueOf(String.valueOf(result.getData())));
|
|
|
+ if(urlScheme.getCode() != HttpStatus.SUCCESS){
|
|
|
+ logger.error("获取urlScheme失败!");
|
|
|
+ }
|
|
|
+ String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getName()+"即将过期,发生时间:" + LocalDateTime.now() + ",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData()+"&urlScheme="+urlScheme.getData();
|
|
|
+ ;
|
|
|
if (unexpired.contains("1")) {
|
|
|
//系统通知
|
|
|
LabMessageContent labMessageContent = new LabMessageContent();
|
|
|
@@ -998,7 +1012,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
if (HttpStatus.SUCCESS == result.getCode()) {
|
|
|
logger.info("已过期保存日志成功!");
|
|
|
}
|
|
|
- String text2 = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getName()+"已过期,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData();
|
|
|
+ ResultData urlScheme = remoteMessageService.getUrlScheme(Long.valueOf(String.valueOf(result.getData())));
|
|
|
+ if(urlScheme.getCode() != HttpStatus.SUCCESS){
|
|
|
+ logger.error("获取urlScheme失败!");
|
|
|
+ }
|
|
|
+ String text2 = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getName()+"已过期,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData()+"&urlScheme="+urlScheme.getData();
|
|
|
if (expired.contains("1")) {
|
|
|
//系统通知
|
|
|
LabMessageContent labMessageContent = new LabMessageContent();
|
|
|
@@ -1028,8 +1046,8 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
* @Param []
|
|
|
* @Return void
|
|
|
**/
|
|
|
-// @Scheduled(cron = "0 0/1 * * * ? ")
|
|
|
- @Scheduled(cron = "0 0 0 * * ?")
|
|
|
+ @Scheduled(cron = "0 0/1 * * * ? ")
|
|
|
+// @Scheduled(cron = "0 0 0 * * ?")
|
|
|
public void hxpTimeOut() {
|
|
|
// 查询配置
|
|
|
ResultData<WarningConfigDto> byType = remoteLaboratoryService.getByType(2);
|
|
|
@@ -1093,7 +1111,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
|
|
|
if (HttpStatus.SUCCESS == result.getCode()) {
|
|
|
logger.info("化学品超时未归还保存日志成功!");
|
|
|
}
|
|
|
- String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getApply()+"领用"+warningNoticeLogDto.getName()+"超时未归还,领用时间:"+LocalDateTime.now().toString() +",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData();
|
|
|
+ ResultData urlScheme = remoteMessageService.getUrlScheme(Long.valueOf(String.valueOf(result.getData())));
|
|
|
+ if(urlScheme.getCode() != HttpStatus.SUCCESS){
|
|
|
+ logger.error("获取urlScheme失败!");
|
|
|
+ }
|
|
|
+ String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getApply()+"领用"+warningNoticeLogDto.getName()+"超时未归还,领用时间:"+LocalDateTime.now().toString() +",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData()+"&urlScheme="+ urlScheme.getData();
|
|
|
if (timeout.contains("1")) {
|
|
|
//系统通知
|
|
|
LabMessageContent labMessageContent = new LabMessageContent();
|