Przeglądaj źródła

短信内容拼接提交

hanzhiwei 2 lat temu
rodzic
commit
65b2aab924

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

@@ -455,7 +455,7 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
                 warningNoticeLogDto.setBuildName(i.getBuildName());
                 warningNoticeLogDto.setBuildName(i.getBuildName());
                 warningNoticeLogDto.setFloorId(i.getFloorId());
                 warningNoticeLogDto.setFloorId(i.getFloorId());
                 warningNoticeLogDto.setFloorName(i.getFloorName());
                 warningNoticeLogDto.setFloorName(i.getFloorName());
-                warningNoticeLogDto.setFloorName(i.getRoomNumber());
+                warningNoticeLogDto.setRoomNum(i.getRoomNumber());
                 userIdStr.append(i.getSafeUserId()).append(",").append(i.getAdminId());
                 userIdStr.append(i.getSafeUserId()).append(",").append(i.getAdminId());
                 phones.append(i.getAdminPhone()).append(",").append(i.getSafeUserPhone());
                 phones.append(i.getAdminPhone()).append(",").append(i.getSafeUserPhone());
             }
             }
@@ -467,10 +467,14 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
 
 
             if(qualificationApplies.size() > 0){
             if(qualificationApplies.size() > 0){
                 //过了最大领用时间
                 //过了最大领用时间
-                String text = "【实验室安全系统】实验室名称-人名领用X气气瓶超时未归还,领用时间:"+LocalDateTime.now().toString()+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                 warningNoticeLogDto.setWarningContent("气瓶超时未归还");
                 warningNoticeLogDto.setWarningContent("气瓶超时未归还");
                 String timeout = warningConfigDto.getTimeout();
                 String timeout = warningConfigDto.getTimeout();
                 warningNoticeLogDto.setWarningWay(timeout);
                 warningNoticeLogDto.setWarningWay(timeout);
+                ResultData resultData = laboratoryService.addWarningNoticeLog(warningNoticeLogDto);
+                if (HttpStatus.SUCCESS == resultData.getCode()) {
+                    log.info("气瓶超时未归还保存日志成功!");
+                }
+                String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+qpBottleStorageVO.getCreateBy()+"领用"+warningNoticeLogDto.getName()+"气瓶超时未归还,领用时间:"+LocalDateTime.now().toString()+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+resultData.getData();
                 if (timeout.contains("1")) {
                 if (timeout.contains("1")) {
                     //系统通知
                     //系统通知
                     LabMessageContent labMessageContent = new LabMessageContent();
                     LabMessageContent labMessageContent = new LabMessageContent();
@@ -493,10 +497,6 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
                         log.info("气瓶超时未归还发送短信打电话消息推送完成!");
                         log.info("气瓶超时未归还发送短信打电话消息推送完成!");
                     }
                     }
                 }
                 }
-                ResultData resultData = laboratoryService.addWarningNoticeLog(warningNoticeLogDto);
-                if (HttpStatus.SUCCESS == resultData.getCode()) {
-                    log.info("气瓶超时未归还保存日志成功!");
-                }
             }
             }
         });
         });
     }
     }

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

@@ -422,7 +422,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
                 }
                 }
                 Long logId = (Long)resultData.getData();
                 Long logId = (Long)resultData.getData();
                 if(illegalRemoval != null){
                 if(illegalRemoval != null){
-                    String text = "【实验室安全系统】实验室名称-实验人员违规携带化学品名称离开房间,发生时间:"+LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy-MM-dd HH:mm:ss")+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
+                    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;
                     if (illegalRemoval.contains("1")) {
                     if (illegalRemoval.contains("1")) {
                         //系统通知
                         //系统通知
                         LabMessageContent labMessageContent = new LabMessageContent();
                         LabMessageContent labMessageContent = new LabMessageContent();
@@ -446,7 +446,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
                         if (strings != null) {
                         if (strings != null) {
                             AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.toString(),text);
                             AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.toString(),text);
                             remoteAlarmService.send(alarmEntrty);
                             remoteAlarmService.send(alarmEntrty);
-                            logger.info("气瓶发送短信打电话消息推送完成!");
+                            logger.info("化学品违规带离发送短信打电话消息推送完成!");
                         }
                         }
                     }
                     }
                     if (hardwareRfidDto!=null && illegalRemoval.contains("3")) {
                     if (hardwareRfidDto!=null && illegalRemoval.contains("3")) {
@@ -956,11 +956,15 @@ public class HxpStockServiceImpl implements IHxpStockService {
             }
             }
             //即将过期
             //即将过期
             if (startDateTime.getTime() < expirationTime.getTime() && endDateTime.getTime() > expirationTime.getTime()) {
             if (startDateTime.getTime() < expirationTime.getTime() && endDateTime.getTime() > expirationTime.getTime()) {
-                String text = "【实验室安全系统】实验室名称-化学品名称即将过期,发生时间:" + LocalDateTime.now() + ",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                 warningNoticeLogDto.setWarningContent("化学品即将过期");
                 warningNoticeLogDto.setWarningContent("化学品即将过期");
                 warningNoticeLogDto.setWarningSubType(3);
                 warningNoticeLogDto.setWarningSubType(3);
                 String unexpired = warningConfigDto.getUnexpired();
                 String unexpired = warningConfigDto.getUnexpired();
                 warningNoticeLogDto.setWarningWay(unexpired);
                 warningNoticeLogDto.setWarningWay(unexpired);
+                ResultData result = remoteLaboratoryService.addWarningNoticeLog(warningNoticeLogDto);
+                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();
                 if (unexpired.contains("1")) {
                 if (unexpired.contains("1")) {
                     //系统通知
                     //系统通知
                     LabMessageContent labMessageContent = new LabMessageContent();
                     LabMessageContent labMessageContent = new LabMessageContent();
@@ -983,18 +987,18 @@ public class HxpStockServiceImpl implements IHxpStockService {
                         logger.info("化学品发送短信打电话消息推送完成!");
                         logger.info("化学品发送短信打电话消息推送完成!");
                     }
                     }
                 }
                 }
-                ResultData result = remoteLaboratoryService.addWarningNoticeLog(warningNoticeLogDto);
-                if (HttpStatus.SUCCESS == result.getCode()) {
-                    logger.info("即将过期保存日志成功!");
-                }
             }
             }
             //已过期
             //已过期
             if (DateUtils.getNowDate().getTime() >= expirationTime.getTime() && logDtoList.size() <= warningConfigDto.getExpiredWarnCount()) {
             if (DateUtils.getNowDate().getTime() >= expirationTime.getTime() && logDtoList.size() <= warningConfigDto.getExpiredWarnCount()) {
-                String text2 = "【实验室安全系统】实验室名称-化学品名称已过期,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                 warningNoticeLogDto.setWarningContent("化学品已过期");
                 warningNoticeLogDto.setWarningContent("化学品已过期");
                 warningNoticeLogDto.setWarningSubType(4);
                 warningNoticeLogDto.setWarningSubType(4);
                 String expired = warningConfigDto.getExpired();
                 String expired = warningConfigDto.getExpired();
                 warningNoticeLogDto.setWarningWay(expired);
                 warningNoticeLogDto.setWarningWay(expired);
+                ResultData result = remoteLaboratoryService.addWarningNoticeLog(warningNoticeLogDto);
+                if (HttpStatus.SUCCESS == result.getCode()) {
+                    logger.info("已过期保存日志成功!");
+                }
+                String text2 =  "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+warningNoticeLogDto.getName()+"已过期,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData();
                 if (expired.contains("1")) {
                 if (expired.contains("1")) {
                     //系统通知
                     //系统通知
                     LabMessageContent labMessageContent = new LabMessageContent();
                     LabMessageContent labMessageContent = new LabMessageContent();
@@ -1016,10 +1020,6 @@ public class HxpStockServiceImpl implements IHxpStockService {
                         logger.info("化学品发送短信打电话消息推送完成!");
                         logger.info("化学品发送短信打电话消息推送完成!");
                     }
                     }
                 }
                 }
-                ResultData result = remoteLaboratoryService.addWarningNoticeLog(warningNoticeLogDto);
-                if (HttpStatus.SUCCESS == result.getCode()) {
-                    logger.info("已过期保存日志成功!");
-                }
             }
             }
         });
         });
     }
     }
@@ -1085,11 +1085,15 @@ public class HxpStockServiceImpl implements IHxpStockService {
                 if(DateUtils.getNowDate().getTime() > dateTime.getTime()){
                 if(DateUtils.getNowDate().getTime() > dateTime.getTime()){
                     hxpIds.add(hxpUserecord.getId());
                     hxpIds.add(hxpUserecord.getId());
                     //过了最大领用时间
                     //过了最大领用时间
-                    String text = "【实验室安全系统】实验室名称-人名领用化学品名称超时未归还,领用时间:"+LocalDateTime.now().toString() +",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
                     warningNoticeLogDto.setWarningContent("化学品超时未归还");
                     warningNoticeLogDto.setWarningContent("化学品超时未归还");
                     warningNoticeLogDto.setWarningSubType(2);
                     warningNoticeLogDto.setWarningSubType(2);
                     String timeout = warningConfigDto.getTimeout();
                     String timeout = warningConfigDto.getTimeout();
                     warningNoticeLogDto.setWarningWay(timeout);
                     warningNoticeLogDto.setWarningWay(timeout);
+                    ResultData result = remoteLaboratoryService.addWarningNoticeLog(warningNoticeLogDto);
+                    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();
                     if (timeout.contains("1")) {
                     if (timeout.contains("1")) {
                         //系统通知
                         //系统通知
                         LabMessageContent labMessageContent = new LabMessageContent();
                         LabMessageContent labMessageContent = new LabMessageContent();
@@ -1111,10 +1115,6 @@ public class HxpStockServiceImpl implements IHxpStockService {
                             logger.info("化学品发送短信打电话消息推送完成!");
                             logger.info("化学品发送短信打电话消息推送完成!");
                         }
                         }
                     }
                     }
-                    ResultData result = remoteLaboratoryService.addWarningNoticeLog(warningNoticeLogDto);
-                    if (HttpStatus.SUCCESS == result.getCode()) {
-                        logger.info("化学品超时未归还保存日志成功!");
-                    }
                 }
                 }
             });
             });
             hxpUserecordMapper.updateUserecordOvertimeByIds(hxpIds);
             hxpUserecordMapper.updateUserecordOvertimeByIds(hxpIds);

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

@@ -19,6 +19,7 @@ import com.zd.common.core.redis.RedisService;
 import com.zd.laboratory.api.dto.CheckSubjectDto;
 import com.zd.laboratory.api.dto.CheckSubjectDto;
 import com.zd.laboratory.api.dto.WarningNoticeLogDto;
 import com.zd.laboratory.api.dto.WarningNoticeLogDto;
 import com.zd.laboratory.api.entity.LabMessageContent;
 import com.zd.laboratory.api.entity.LabMessageContent;
+import com.zd.laboratory.api.feign.RemoteLaboratoryService;
 import com.zd.laboratory.domain.LabHardware;
 import com.zd.laboratory.domain.LabHardware;
 import com.zd.laboratory.domain.WarningConfig;
 import com.zd.laboratory.domain.WarningConfig;
 import com.zd.laboratory.domain.WarningDetail;
 import com.zd.laboratory.domain.WarningDetail;
@@ -88,6 +89,9 @@ public class RedisExpiredPhotographListener extends KeyExpirationEventMessageLis
     @Autowired
     @Autowired
     private ILabSparseHardwareService labSparseHardwareService;
     private ILabSparseHardwareService labSparseHardwareService;
 
 
+    @Resource
+    private RemoteLaboratoryService remoteLaboratoryService;
+
     /**
     /**
      * Creates new {@link MessageListener} for {@code __keyevent@*__:expired} messages.
      * Creates new {@link MessageListener} for {@code __keyevent@*__:expired} messages.
      *
      *
@@ -164,7 +168,11 @@ public class RedisExpiredPhotographListener extends KeyExpirationEventMessageLis
                                 userIds.append(i.getSafeUserId()).append(",").append(i.getAdminId());
                                 userIds.append(i.getSafeUserId()).append(",").append(i.getAdminId());
                                 phones.append(i.getAdminPhone()).append(",").append(i.getSafeUserPhone());
                                 phones.append(i.getAdminPhone()).append(",").append(i.getSafeUserPhone());
                             }
                             }
-                            String text = "【实验室安全系统】实验室名称-监测到实验人员违规未穿戴实验服,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+warningNoticeLogDto.getKeyId();
+                            ResultData result = remoteLaboratoryService.addWarningNoticeLog(warningNoticeLogDto);
+                            if (HttpStatus.SUCCESS == result.getCode()) {
+                                log.info("未穿戴实验服保存日志成功!");
+                            }
+                            String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-监测到实验人员违规未穿戴实验服,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData();
                             //系统 短信 语音通知
                             //系统 短信 语音通知
                             if (warningConfig.getSystemNotice() != null && count1 > warningConfig.getSystemNotice()) {
                             if (warningConfig.getSystemNotice() != null && count1 > warningConfig.getSystemNotice()) {
                                 //系统通知
                                 //系统通知
@@ -185,7 +193,7 @@ public class RedisExpiredPhotographListener extends KeyExpirationEventMessageLis
                                 if (strings != null) {
                                 if (strings != null) {
                                     AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.toString(), text);
                                     AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, strings, SendTypes.SMS.toString(), text);
                                     remoteAlarmService.send(alarmEntrty);
                                     remoteAlarmService.send(alarmEntrty);
-                                    log.info("气瓶发送短信打电话消息推送完成!");
+                                    log.info("未穿戴实验服发送短信打电话消息推送完成!");
                                 }
                                 }
                             }
                             }
                             if (warningConfig.getVoiceNotcie() != null && count1 > warningConfig.getVoiceNotcie()) {
                             if (warningConfig.getVoiceNotcie() != null && count1 > warningConfig.getVoiceNotcie()) {