hanzhiwei лет назад: 2
Родитель
Сommit
17138f8cbc

+ 14 - 13
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/AlarmRecordServiceImpl.java

@@ -411,8 +411,8 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
      * @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 = laboratoryService.getByType(3);
@@ -436,11 +436,12 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
             warningNoticeLogDto.setWarningSubType(2);
             warningNoticeLogDto.setWarningContent("气瓶超时未归还");
 
+            warningNoticeLogDto.setHolder(qpBottleStorageVO.getStorageUser());
+            warningNoticeLogDto.setDeposit(qpBottleStorageVO.getLocation());
+            warningNoticeLogDto.setMargin(new BigDecimal(qpBottleStorageVO.getCurrentPressure()));
+            warningNoticeLogDto.setSpecification(qpBottleStorageVO.getConfigName());
+            warningNoticeLogDto.setEntryTime(LocalDateTimeUtil.of(qpBottleStorageVO.getCreateTime()));
             warningNoticeLogDto.setWarningTime(LocalDateTime.now());
-            //TODO 余量
-            warningNoticeLogDto.setMargin(BigDecimal.ZERO);
-//            warningNoticeLogDto.setSpecification(String.valueOf(hxpStock.getChemicalAmount()));
-
             //查询到实验室负责人id 安全责任人id
             ResultData<List<CheckSubjectDto>> subjectInfoList = laboratoryService.findSubjectInfoList(String.valueOf(qpBottleStorageVO.getSubjectId()));
             StringBuffer userIdStr = new StringBuffer();
@@ -464,8 +465,8 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
 
             if(qualificationApplies.size() > 0){
                 //过了最大领用时间
-                String text = "【实验室安全系统】实验室名称-人名领用X气气瓶超时未归还,领用时间:"+LocalDateTime.now().toString()+",请尽快确认。点击查看:http://";
-                warningNoticeLogDto.setWarningContent("化学品超时未归还");
+                String text = "【实验室安全系统】实验室名称-人名领用X气气瓶超时未归还,领用时间:"+LocalDateTime.now().toString()+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
+                warningNoticeLogDto.setWarningContent("气瓶超时未归还");
                 String timeout = warningConfigDto.getTimeout();
                 warningNoticeLogDto.setWarningWay(timeout);
                 if (timeout.contains("1")) {
@@ -487,13 +488,13 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
                     if (strings != null) {
                         AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.toString(), text);
                         remoteAlarmService.send(alarmEntrty);
-                        log.info("化学品发送短信打电话消息推送完成!");
+                        log.info("气瓶超时未归还发送短信打电话消息推送完成!");
                     }
                 }
-            }
-            ResultData resultData = laboratoryService.addWarningNoticeLog(warningNoticeLogDto);
-            if (HttpStatus.SUCCESS == resultData.getCode()) {
-                log.info("气瓶超时未归还保存日志成功!");
+                ResultData resultData = laboratoryService.addWarningNoticeLog(warningNoticeLogDto);
+                if (HttpStatus.SUCCESS == resultData.getCode()) {
+                    log.info("气瓶超时未归还保存日志成功!");
+                }
             }
         });
     }

+ 11 - 8
zd-modules/zd-chemical/src/main/java/com/zd/chemical/service/impl/HxpStockServiceImpl.java

@@ -421,7 +421,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
                 }
                 Long logId = (Long)resultData.getData();
                 if(illegalRemoval != null){
-                    String text = "【实验室安全系统】实验室名称-实验人员违规携带化学品名称离开房间,发生时间:"+LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy-MM-dd HH:mm:ss")+",请尽快确认。点击查看:http://";
+                    String text = "【实验室安全系统】实验室名称-实验人员违规携带化学品名称离开房间,发生时间:"+LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy-MM-dd HH:mm:ss")+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                     if (illegalRemoval.contains("1")) {
                         //系统通知
                         LabMessageContent labMessageContent = new LabMessageContent();
@@ -954,7 +954,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
             }
             //即将过期
             if (startDateTime.getTime() < expirationTime.getTime() && endDateTime.getTime() > expirationTime.getTime()) {
-                String text = "【实验室安全系统】实验室名称-化学品名称即将过期,发生时间:" + LocalDateTime.now() + ",请尽快确认。点击查看:http://";
+                String text = "【实验室安全系统】实验室名称-化学品名称即将过期,发生时间:" + LocalDateTime.now() + ",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                 warningNoticeLogDto.setWarningContent("化学品即将过期");
                 warningNoticeLogDto.setWarningSubType(3);
                 String unexpired = warningConfigDto.getUnexpired();
@@ -988,7 +988,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
             }
             //已过期
             if (DateUtils.getNowDate().getTime() >= expirationTime.getTime() && logDtoList.size() <= warningConfigDto.getExpiredWarnCount()) {
-                String text2 = "【实验室安全系统】实验室名称-化学品名称已过期,请尽快确认。点击查看:http://";
+                String text2 = "【实验室安全系统】实验室名称-化学品名称已过期,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                 warningNoticeLogDto.setWarningContent("化学品已过期");
                 warningNoticeLogDto.setWarningSubType(4);
                 String expired = warningConfigDto.getExpired();
@@ -1054,12 +1054,15 @@ public class HxpStockServiceImpl implements IHxpStockService {
             //过期时间在提醒天数内 并且在一天之内
             WarningNoticeLogDto warningNoticeLogDto = new WarningNoticeLogDto();
             warningNoticeLogDto.setKeyId(hxpStock.getId());
-            warningNoticeLogDto.setName(hxpStock.getChemicalShapeName());
+            warningNoticeLogDto.setName(hxpStock.getChemicalName());
             warningNoticeLogDto.setWarningType(2);
+            warningNoticeLogDto.setWarningSubType(1);
+            warningNoticeLogDto.setWarningContent("化学品违规带离");
             warningNoticeLogDto.setWarningTime(LocalDateTime.now());
-            //TODO 余量
-            warningNoticeLogDto.setMargin(BigDecimal.ZERO);
-            warningNoticeLogDto.setSpecification(String.valueOf(hxpStock.getChemicalAmount()));
+            warningNoticeLogDto.setWarningWay(warningConfigDto.getTimeout());
+            warningNoticeLogDto.setMargin(hxpStock.getOutUsages());
+            warningNoticeLogDto.setDeposit(hxpStock.getCabinetName());
+            warningNoticeLogDto.setSpecification(hxpChemicalJoinCabinet.getChemicalAmount() + hxpChemicalJoinCabinet.getChemicalAmountUnit());
 
             //查询到实验室负责人id 安全责任人id
             ResultData<List<CheckSubjectDto>> subjectInfoList = remoteLaboratoryService.findSubjectInfoList(String.valueOf(hxpStock.getSubId()));
@@ -1079,7 +1082,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
             if(DateUtils.getNowDate().getTime() > dateTime.getTime()){
                 hxpIds.add(hxpUserecord.getId());
                 //过了最大领用时间
-                String text = "【实验室安全系统】实验室名称-人名领用化学品名称超时未归还,领用时间:"+LocalDateTime.now().toString() +",请尽快确认。点击查看:http://";
+                String text = "【实验室安全系统】实验室名称-人名领用化学品名称超时未归还,领用时间:"+LocalDateTime.now().toString() +",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                 warningNoticeLogDto.setWarningContent("化学品超时未归还");
                 warningNoticeLogDto.setWarningSubType(2);
                 String timeout = warningConfigDto.getTimeout();

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/event/RedisExpiredPhotographListener.java

@@ -163,7 +163,7 @@ public class RedisExpiredPhotographListener extends KeyExpirationEventMessageLis
                                 userIds.append(i.getSafeUserId()).append(",").append(i.getAdminId());
                                 phones.append(i.getAdminPhone()).append(",").append(i.getSafeUserPhone());
                             }
-                            String text = "【实验室安全系统】实验室名称-监测到实验人员违规未穿戴实验服,请尽快确认。点击查看:http://";
+                            String text = "【实验室安全系统】实验室名称-监测到实验人员违规未穿戴实验服,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                             //系统 短信 语音通知
                             if (warningConfig.getSystemNotice() != null && count1 > warningConfig.getSystemNotice()) {
                                 //系统通知