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

+ 6 - 0
zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/RemoteMessageService.java

@@ -4,6 +4,7 @@ package com.zd.base.api.feign;
 import com.zd.base.api.feign.fallback.RemoteMessageFallbackFactory;
 import com.zd.base.api.feign.fallback.RemoteMessageFallbackFactory;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import com.zd.model.entity.TemplateResult;
 import com.zd.model.entity.TemplateResult;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiImplicitParams;
@@ -85,4 +86,9 @@ public interface RemoteMessageService {
             @ApiImplicitParam(name = "address",value = "报警位置")
             @ApiImplicitParam(name = "address",value = "报警位置")
     })
     })
     R<TemplateResult> sendAlarm(@RequestBody List<Long> userIds, @RequestParam("address") String address);
     R<TemplateResult> sendAlarm(@RequestBody List<Long> userIds, @RequestParam("address") String address);
+
+    @GetMapping("/wx/getUrlScheme")
+    @ApiOperation(value = "获取UrlScheme")
+    @ApiImplicitParam(name = "id",value = "传入id",required = false)
+    ResultData getUrlScheme(@RequestParam(value = "id",required = false)  Long id);
 }
 }

+ 6 - 0
zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/fallback/RemoteMessageFallbackFactory.java

@@ -2,6 +2,7 @@ package com.zd.base.api.feign.fallback;
 
 
 import com.zd.base.api.feign.RemoteMessageService;
 import com.zd.base.api.feign.RemoteMessageService;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import com.zd.model.entity.TemplateResult;
 import com.zd.model.entity.TemplateResult;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
@@ -49,6 +50,11 @@ public class RemoteMessageFallbackFactory implements FallbackFactory<RemoteMessa
             public R<TemplateResult> sendAlarm(List<Long> userIds, String address) {
             public R<TemplateResult> sendAlarm(List<Long> userIds, String address) {
                 return R.fail("气瓶超出范围通知:" + throwable.getMessage());
                 return R.fail("气瓶超出范围通知:" + throwable.getMessage());
             }
             }
+
+            @Override
+            public ResultData getUrlScheme(Long id) {
+                return ResultData.fail("获取UrlScheme失败:" + throwable.getMessage());
+            }
         };
         };
     }
     }
 }
 }

+ 7 - 0
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/mapper/QpUseRecordMapper.java

@@ -137,4 +137,11 @@ public interface QpUseRecordMapper {
      * @return
      * @return
      */
      */
     List<QpUseRecord> selectNoReturnRecords();
     List<QpUseRecord> selectNoReturnRecords();
+
+    /**
+     * 根据id修改使用状态
+     * @param qpUseRecord
+     * @return
+     */
+    int updateUserStatusById(@Param("qpUseRecord") QpUseRecord qpUseRecord);
 }
 }

+ 7 - 0
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/IQpUseRecordService.java

@@ -146,4 +146,11 @@ public interface IQpUseRecordService
      * @return
      * @return
      */
      */
     List<QpUseRecord> selectNoReturnRecords();
     List<QpUseRecord> selectNoReturnRecords();
+
+    /**
+     * 根据id修改使用状态
+     * @Param [qpUseRecord]
+     * @Return int
+     **/
+    int updateUserStatusById(QpUseRecord qpUseRecord);
 }
 }

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

@@ -3,6 +3,7 @@ package com.zd.airbottle.service.impl;
 import cn.hutool.core.date.LocalDateTimeUtil;
 import cn.hutool.core.date.LocalDateTimeUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.zd.airbottle.domain.AlarmRecord;
 import com.zd.airbottle.domain.AlarmRecord;
 import com.zd.airbottle.domain.QpAirBottle;
 import com.zd.airbottle.domain.QpAirBottle;
 import com.zd.airbottle.domain.QpUseRecord;
 import com.zd.airbottle.domain.QpUseRecord;
@@ -97,6 +98,9 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
     @Autowired
     @Autowired
     private IQpQualificationApplyService qualificationApplyService;
     private IQpQualificationApplyService qualificationApplyService;
 
 
+    @Autowired
+    private RemoteMessageService remoteMessageService;
+
     private static final String RFID_CODE = "RFID:";
     private static final String RFID_CODE = "RFID:";
 
 
     /**
     /**
@@ -429,22 +433,22 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
             QpBottleStorageVO qpBottleStorageVO = storageService.selectQpBottleStorageById(QpUseRecord.getStorageId());
             QpBottleStorageVO qpBottleStorageVO = storageService.selectQpBottleStorageById(QpUseRecord.getStorageId());
             QpAirBottle qpAirBottle = qpAirBottleService.selectQpAirBottleById(qpBottleStorageVO.getAirBottleId());
             QpAirBottle qpAirBottle = qpAirBottleService.selectQpAirBottleById(qpBottleStorageVO.getAirBottleId());
 
 
-            //过期时间在提醒天数内 并且在一天之内
             WarningNoticeLogDto warningNoticeLogDto = new WarningNoticeLogDto();
             WarningNoticeLogDto warningNoticeLogDto = new WarningNoticeLogDto();
             warningNoticeLogDto.setKeyId(qpBottleStorageVO.getId());
             warningNoticeLogDto.setKeyId(qpBottleStorageVO.getId());
             warningNoticeLogDto.setName(qpAirBottle.getAirName());
             warningNoticeLogDto.setName(qpAirBottle.getAirName());
             warningNoticeLogDto.setWarningType(3);
             warningNoticeLogDto.setWarningType(3);
             warningNoticeLogDto.setWarningSubType(2);
             warningNoticeLogDto.setWarningSubType(2);
             warningNoticeLogDto.setWarningContent("气瓶超时未归还");
             warningNoticeLogDto.setWarningContent("气瓶超时未归还");
-
+            warningNoticeLogDto.setApply(QpUseRecord.getContacts());
             warningNoticeLogDto.setHolder(qpBottleStorageVO.getStorageUser());
             warningNoticeLogDto.setHolder(qpBottleStorageVO.getStorageUser());
             warningNoticeLogDto.setDeposit(qpBottleStorageVO.getLocation());
             warningNoticeLogDto.setDeposit(qpBottleStorageVO.getLocation());
             warningNoticeLogDto.setMargin(new BigDecimal(qpBottleStorageVO.getCurrentPressure()));
             warningNoticeLogDto.setMargin(new BigDecimal(qpBottleStorageVO.getCurrentPressure()));
-            warningNoticeLogDto.setSpecification(qpBottleStorageVO.getConfigName());
+            JSONObject jsonObject = JSON.parseObject(qpBottleStorageVO.getSpecificationName());
+            warningNoticeLogDto.setSpecification(jsonObject.getString("gasLevel"));
             warningNoticeLogDto.setEntryTime(LocalDateTimeUtil.of(qpBottleStorageVO.getCreateTime()));
             warningNoticeLogDto.setEntryTime(LocalDateTimeUtil.of(qpBottleStorageVO.getCreateTime()));
             warningNoticeLogDto.setWarningTime(LocalDateTime.now());
             warningNoticeLogDto.setWarningTime(LocalDateTime.now());
             //查询到实验室负责人id 安全责任人id
             //查询到实验室负责人id 安全责任人id
-            ResultData<List<CheckSubjectDto>> subjectInfoList = laboratoryService.findSubjectInfoList(String.valueOf(qpBottleStorageVO.getSubjectId()));
+            ResultData<List<CheckSubjectDto>> subjectInfoList = laboratoryService.findSubjectInfoList(String.valueOf(QpUseRecord.getSubjectId()));
             StringBuffer userIdStr = new StringBuffer();
             StringBuffer userIdStr = new StringBuffer();
             StringBuffer phones = new StringBuffer();
             StringBuffer phones = new StringBuffer();
             if (HttpStatus.SUCCESS == subjectInfoList.getCode()) {
             if (HttpStatus.SUCCESS == subjectInfoList.getCode()) {
@@ -460,6 +464,7 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
                 phones.append(i.getAdminPhone()).append(",").append(i.getSafeUserPhone());
                 phones.append(i.getAdminPhone()).append(",").append(i.getSafeUserPhone());
             }
             }
             //todo 记录的人物和实验室 气瓶 需要和申请的人物和实验室 气瓶 等 一一对应 现在无法对应 不能找出借出的气瓶对应的归还时间
             //todo 记录的人物和实验室 气瓶 需要和申请的人物和实验室 气瓶 等 一一对应 现在无法对应 不能找出借出的气瓶对应的归还时间
+            //过期时间在提醒天数内 并且在一天之内
             QpQualificationApplyVO qualificationApply = new QpQualificationApplyVO();
             QpQualificationApplyVO qualificationApply = new QpQualificationApplyVO();
             qualificationApply.setUserId(QpUseRecord.getUserId());
             qualificationApply.setUserId(QpUseRecord.getUserId());
             List<QpQualificationApplyVO> qualificationApplies = qualificationApplyService.selectQpQualificationApplyList(qualificationApply);
             List<QpQualificationApplyVO> qualificationApplies = qualificationApplyService.selectQpQualificationApplyList(qualificationApply);
@@ -474,7 +479,11 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
                 if (HttpStatus.SUCCESS == resultData.getCode()) {
                 if (HttpStatus.SUCCESS == resultData.getCode()) {
                     log.info("气瓶超时未归还保存日志成功!");
                     log.info("气瓶超时未归还保存日志成功!");
                 }
                 }
-                String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+qpBottleStorageVO.getCreateBy()+"领用"+warningNoticeLogDto.getName()+"气瓶超时未归还,领用时间:"+LocalDateTime.now().toString()+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+resultData.getData();
+                ResultData urlScheme = remoteMessageService.getUrlScheme(Long.valueOf(String.valueOf(resultData.getData())));
+                if(urlScheme.getCode() != HttpStatus.SUCCESS){
+                    log.error("获取urlScheme失败!");
+                }
+                String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-"+qpBottleStorageVO.getCreateBy()+"领用"+warningNoticeLogDto.getName()+"气瓶超时未归还,领用时间:"+LocalDateTime.now().toString()+",请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+resultData.getData()+"&urlScheme="+urlScheme.getData();
                 if (timeout.contains("1")) {
                 if (timeout.contains("1")) {
                     //系统通知
                     //系统通知
                     LabMessageContent labMessageContent = new LabMessageContent();
                     LabMessageContent labMessageContent = new LabMessageContent();
@@ -497,6 +506,10 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
                         log.info("气瓶超时未归还发送短信打电话消息推送完成!");
                         log.info("气瓶超时未归还发送短信打电话消息推送完成!");
                     }
                     }
                 }
                 }
+                QpUseRecord qpUseRecord = new QpUseRecord();
+                qpUseRecord.setId(QpUseRecord.getId());
+                qpUseRecord.setUserStatus(3);
+                useRecordService.updateUserStatusById(qpUseRecord);
             }
             }
         });
         });
     }
     }

+ 5 - 0
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpUseRecordServiceImpl.java

@@ -376,4 +376,9 @@ public class QpUseRecordServiceImpl implements IQpUseRecordService {
         List<QpUseRecord> qpUseRecords = qpUseRecordMapper.selectNoReturnRecords();
         List<QpUseRecord> qpUseRecords = qpUseRecordMapper.selectNoReturnRecords();
         return qpUseRecords;
         return qpUseRecords;
     }
     }
+
+    @Override
+    public int updateUserStatusById(QpUseRecord qpUseRecord) {
+        return qpUseRecordMapper.updateUserStatusById(qpUseRecord);
+    }
 }
 }

+ 6 - 1
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpUseRecordMapper.xml

@@ -363,7 +363,12 @@
     </select>
     </select>
     <select id="selectNoReturnRecords" resultType="com.zd.airbottle.domain.QpUseRecord">
     <select id="selectNoReturnRecords" resultType="com.zd.airbottle.domain.QpUseRecord">
         <include refid="selectQpUseRecordVo"/>
         <include refid="selectQpUseRecordVo"/>
-        where user_status = 3
+        where user_status = 1
     </select>
     </select>
+    <update id="updateUserStatusById">
+        update qp_use_record
+        set user_status = #{qpUseRecord.userStatus}
+        where id = #{qpUseRecord.id}
+    </update>
 
 
 </mapper>
 </mapper>

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

@@ -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.camera.feign.RemoteCameraService;
 import com.zd.algorithm.api.forward.feign.RemoteForwardService;
 import com.zd.algorithm.api.forward.feign.RemoteForwardService;
 import com.zd.algorithm.api.rfid.feign.RemoteRfidService;
 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.controller.HxpAIOController;
 import com.zd.chemical.domain.*;
 import com.zd.chemical.domain.*;
 import com.zd.chemical.domain.vo.*;
 import com.zd.chemical.domain.vo.*;
@@ -136,6 +137,9 @@ public class HxpStockServiceImpl implements IHxpStockService {
     @Autowired
     @Autowired
     private IHxpChemicalService hxpChemicalService;
     private IHxpChemicalService hxpChemicalService;
 
 
+    @Autowired
+    private RemoteMessageService remoteMessageService;
+
     /**
     /**
      * 查询库存管理
      * 查询库存管理
      *
      *
@@ -422,7 +426,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
                 }
                 }
                 Long logId = (Long)resultData.getData();
                 Long logId = (Long)resultData.getData();
                 if(illegalRemoval != null){
                 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")) {
                     if (illegalRemoval.contains("1")) {
                         //系统通知
                         //系统通知
                         LabMessageContent labMessageContent = new LabMessageContent();
                         LabMessageContent labMessageContent = new LabMessageContent();
@@ -933,6 +941,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
             warningNoticeLogDto.setWarningType(2);
             warningNoticeLogDto.setWarningType(2);
             warningNoticeLogDto.setWarningSubType(1);
             warningNoticeLogDto.setWarningSubType(1);
             warningNoticeLogDto.setWarningTime(LocalDateTime.now());
             warningNoticeLogDto.setWarningTime(LocalDateTime.now());
+            warningNoticeLogDto.setExpirationTime(LocalDateTimeUtil.of(hxpStock.getExpirationTime()));
             warningNoticeLogDto.setWarningWay(warningConfigDto.getTimeout());
             warningNoticeLogDto.setWarningWay(warningConfigDto.getTimeout());
             warningNoticeLogDto.setMargin(hxpStock.getOutUsages());
             warningNoticeLogDto.setMargin(hxpStock.getOutUsages());
             warningNoticeLogDto.setDeposit(hxpStock.getCabinetName());
             warningNoticeLogDto.setDeposit(hxpStock.getCabinetName());
@@ -964,7 +973,12 @@ public class HxpStockServiceImpl implements IHxpStockService {
                 if (HttpStatus.SUCCESS == result.getCode()) {
                 if (HttpStatus.SUCCESS == result.getCode()) {
                     logger.info("即将过期保存日志成功!");
                     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")) {
                 if (unexpired.contains("1")) {
                     //系统通知
                     //系统通知
                     LabMessageContent labMessageContent = new LabMessageContent();
                     LabMessageContent labMessageContent = new LabMessageContent();
@@ -998,7 +1012,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
                 if (HttpStatus.SUCCESS == result.getCode()) {
                 if (HttpStatus.SUCCESS == result.getCode()) {
                     logger.info("已过期保存日志成功!");
                     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")) {
                 if (expired.contains("1")) {
                     //系统通知
                     //系统通知
                     LabMessageContent labMessageContent = new LabMessageContent();
                     LabMessageContent labMessageContent = new LabMessageContent();
@@ -1028,8 +1046,8 @@ public class HxpStockServiceImpl implements IHxpStockService {
      * @Param []
      * @Param []
      * @Return void
      * @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() {
     public void hxpTimeOut() {
         // 查询配置
         // 查询配置
         ResultData<WarningConfigDto> byType = remoteLaboratoryService.getByType(2);
         ResultData<WarningConfigDto> byType = remoteLaboratoryService.getByType(2);
@@ -1093,7 +1111,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
                     if (HttpStatus.SUCCESS == result.getCode()) {
                     if (HttpStatus.SUCCESS == result.getCode()) {
                         logger.info("化学品超时未归还保存日志成功!");
                         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")) {
                     if (timeout.contains("1")) {
                         //系统通知
                         //系统通知
                         LabMessageContent labMessageContent = new LabMessageContent();
                         LabMessageContent labMessageContent = new LabMessageContent();

+ 21 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/WarningNoticeLogVO.java

@@ -2,6 +2,7 @@ package com.zd.laboratory.domain.vo;
 
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.zd.laboratory.domain.WarningDetail;
 import com.zd.laboratory.domain.WarningDetail;
@@ -59,6 +60,7 @@ public class WarningNoticeLogVO {
     @ApiModelProperty("房间号")
     @ApiModelProperty("房间号")
     private String roomNum;
     private String roomNum;
 
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("预警时间")
     @ApiModelProperty("预警时间")
     private LocalDateTime warningTime;
     private LocalDateTime warningTime;
 
 
@@ -72,39 +74,58 @@ public class WarningNoticeLogVO {
     private String specification;
     private String specification;
     @ApiModelProperty("申领人")
     @ApiModelProperty("申领人")
     private String apply;
     private String apply;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("申领时间")
     @ApiModelProperty("申领时间")
     private LocalDateTime applyTime;
     private LocalDateTime applyTime;
+
     @ApiModelProperty("存放位置")
     @ApiModelProperty("存放位置")
     private String deposit;
     private String deposit;
+
     @ApiModelProperty("记录视频")
     @ApiModelProperty("记录视频")
     private String recordVideo;
     private String recordVideo;
+
     @ApiModelProperty("记录照片")
     @ApiModelProperty("记录照片")
     private String recordPhoto;
     private String recordPhoto;
+
     @ApiModelProperty("持续时间")
     @ApiModelProperty("持续时间")
     private Integer riskDuration;
     private Integer riskDuration;
+
     @ApiModelProperty("响应人员")
     @ApiModelProperty("响应人员")
     private String responder;
     private String responder;
+
     @ApiModelProperty("室内人员")
     @ApiModelProperty("室内人员")
     private String indoorUser;
     private String indoorUser;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("预案开始时间")
     @ApiModelProperty("预案开始时间")
     private LocalDateTime startTime;
     private LocalDateTime startTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("预案结束时间")
     @ApiModelProperty("预案结束时间")
     private LocalDateTime endTime;
     private LocalDateTime endTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("入库时间")
     @ApiModelProperty("入库时间")
     private LocalDateTime entryTime;
     private LocalDateTime entryTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("过期时间")
     @ApiModelProperty("过期时间")
     private LocalDateTime expirationTime;
     private LocalDateTime expirationTime;
+
     @ApiModelProperty("所有人")
     @ApiModelProperty("所有人")
     private String holder;
     private String holder;
 
 
     @ApiModelProperty("是否语音播报(0否 1是)")
     @ApiModelProperty("是否语音播报(0否 1是)")
     private Integer voiceBroadcast;
     private Integer voiceBroadcast;
+
     @ApiModelProperty("创建人名称")
     @ApiModelProperty("创建人名称")
     private String createName;
     private String createName;
 
 
     @ApiModelProperty("创建人ID")
     @ApiModelProperty("创建人ID")
     private Long createBy;
     private Long createBy;
 
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("创建时间")
     @ApiModelProperty("创建时间")
     private LocalDateTime createTime;
     private LocalDateTime createTime;
 
 

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

@@ -15,6 +15,7 @@ import com.zd.algorithm.api.forward.vo.AlgorithmWarningVo;
 import com.zd.algorithm.api.speaker.entity.ParamVo;
 import com.zd.algorithm.api.speaker.entity.ParamVo;
 import com.zd.algorithm.api.speaker.entity.PlayVo;
 import com.zd.algorithm.api.speaker.entity.PlayVo;
 import com.zd.algorithm.api.speaker.feign.RemoteSpeakService;
 import com.zd.algorithm.api.speaker.feign.RemoteSpeakService;
+import com.zd.base.api.feign.RemoteMessageService;
 import com.zd.common.core.redis.RedisService;
 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;
@@ -92,6 +93,9 @@ public class RedisExpiredPhotographListener extends KeyExpirationEventMessageLis
     @Resource
     @Resource
     private RemoteLaboratoryService remoteLaboratoryService;
     private RemoteLaboratoryService remoteLaboratoryService;
 
 
+    @Autowired
+    private RemoteMessageService remoteMessageService;
+
     /**
     /**
      * Creates new {@link MessageListener} for {@code __keyevent@*__:expired} messages.
      * Creates new {@link MessageListener} for {@code __keyevent@*__:expired} messages.
      *
      *
@@ -172,7 +176,12 @@ public class RedisExpiredPhotographListener extends KeyExpirationEventMessageLis
                             if (HttpStatus.SUCCESS == result.getCode()) {
                             if (HttpStatus.SUCCESS == result.getCode()) {
                                 log.info("未穿戴实验服保存日志成功!");
                                 log.info("未穿戴实验服保存日志成功!");
                             }
                             }
-                            String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-监测到实验人员违规未穿戴实验服,请尽快确认。点击查看: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){
+                                log.error("获取urlScheme失败!");
+                            }
+                            String text = "【实验室安全系统】"+warningNoticeLogDto.getSubName()+"-监测到实验人员违规未穿戴实验服,请尽快确认。点击查看:https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id="+result.getData()+"&urlScheme="+urlScheme.getData();
+                                    ;
                             //系统 短信 语音通知
                             //系统 短信 语音通知
                             if (warningConfig.getSystemNotice() != null && count1 > warningConfig.getSystemNotice()) {
                             if (warningConfig.getSystemNotice() != null && count1 > warningConfig.getSystemNotice()) {
                                 //系统通知
                                 //系统通知

+ 27 - 4
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabMessageContentServiceImpl.java

@@ -1,8 +1,10 @@
 package com.zd.laboratory.service.impl;
 package com.zd.laboratory.service.impl;
 
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.LocalDateTimeUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
+import com.zd.algorithm.api.alarm.domain.UserPhoneInfo;
 import com.zd.algorithm.api.alarm.entity.AlarmEntrty;
 import com.zd.algorithm.api.alarm.entity.AlarmEntrty;
 import com.zd.algorithm.api.alarm.entity.Routes;
 import com.zd.algorithm.api.alarm.entity.Routes;
 import com.zd.algorithm.api.alarm.entity.SendTypes;
 import com.zd.algorithm.api.alarm.entity.SendTypes;
@@ -14,18 +16,16 @@ import com.zd.common.core.utils.SaveUtil;
 import com.zd.common.core.utils.SecurityUtils;
 import com.zd.common.core.utils.SecurityUtils;
 import com.zd.laboratory.api.entity.LabMessageContent;
 import com.zd.laboratory.api.entity.LabMessageContent;
 import com.zd.laboratory.api.entity.SubAddrr;
 import com.zd.laboratory.api.entity.SubAddrr;
+import com.zd.laboratory.domain.LabRiskPlanAbnormalLog;
 import com.zd.laboratory.domain.LabRiskPlanLevel;
 import com.zd.laboratory.domain.LabRiskPlanLevel;
 import com.zd.laboratory.domain.LabSubject;
 import com.zd.laboratory.domain.LabSubject;
 import com.zd.laboratory.domain.WarningNoticeLog;
 import com.zd.laboratory.domain.WarningNoticeLog;
 import com.zd.laboratory.domain.dto.LabMessageContentDTO;
 import com.zd.laboratory.domain.dto.LabMessageContentDTO;
 import com.zd.laboratory.domain.dto.LabMessageContentListQuery;
 import com.zd.laboratory.domain.dto.LabMessageContentListQuery;
-import com.zd.algorithm.api.alarm.domain.UserPhoneInfo;
 import com.zd.laboratory.domain.vo.LabMessageContentVO;
 import com.zd.laboratory.domain.vo.LabMessageContentVO;
 import com.zd.laboratory.domain.vo.LabSubjectAccessRecordVo;
 import com.zd.laboratory.domain.vo.LabSubjectAccessRecordVo;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
-import com.zd.laboratory.mapper.LabContentMachineMsgMapper;
-import com.zd.laboratory.mapper.LabMessageContentMapper;
-import com.zd.laboratory.mapper.LabSubjectMapper;
+import com.zd.laboratory.mapper.*;
 import com.zd.laboratory.mqtt.entiy.MessageBody;
 import com.zd.laboratory.mqtt.entiy.MessageBody;
 import com.zd.laboratory.mqtt.enums.SendMode;
 import com.zd.laboratory.mqtt.enums.SendMode;
 import com.zd.laboratory.mqtt.service.impl.CommonSend;
 import com.zd.laboratory.mqtt.service.impl.CommonSend;
@@ -93,6 +93,12 @@ public class LabMessageContentServiceImpl implements ILabMessageContentService {
     @Autowired
     @Autowired
     private WarningNoticeLogService warningNoticeLogService;
     private WarningNoticeLogService warningNoticeLogService;
 
 
+    @Autowired
+    private LabRiskPlanAbnormalLogMapper labRiskPlanAbnormalLogMapper;
+
+    @Autowired
+    private LabHardwareStateMapper hardwareStateMapper;
+
     public Integer phoneMode;
     public Integer phoneMode;
 
 
     @Value("${phoneMode:0}")
     @Value("${phoneMode:0}")
@@ -295,6 +301,23 @@ public class LabMessageContentServiceImpl implements ILabMessageContentService {
                     riskPlanName = "高风险";
                     riskPlanName = "高风险";
                 }
                 }
                 warningNoticeLog.setWarningContent(labRiskPlanLevel.getDescribe()+"-"+riskPlanName);
                 warningNoticeLog.setWarningContent(labRiskPlanLevel.getDescribe()+"-"+riskPlanName);
+
+                LabRiskPlanAbnormalLog labRiskPlanAbnormalLogByGroupId = new LabRiskPlanAbnormalLog();
+                labRiskPlanAbnormalLogByGroupId.setGroupId(groupId);
+                List<LabRiskPlanAbnormalLog> list = labRiskPlanAbnormalLogMapper.selectLabRiskPlanAbnormalLogOrderByList(labRiskPlanAbnormalLogByGroupId);
+                if (list != null && list.size() > 0) {
+                    LabRiskPlanAbnormalLog labRiskPlanAbnormalLog = list.get(0);
+                    warningNoticeLog.setStartTime(LocalDateTimeUtil.of(labRiskPlanAbnormalLog.getStartDate()));
+                }
+                //获取实验室内人员
+                Map<String, Object> params = new HashMap<>();
+                params.put("subId",subject.getId());
+                List<SysUser> users = hardwareStateMapper.querySubOnlineUserByOnepc(params);
+                String internalPerson = "";
+                if (users != null && users.size() > 0) {
+                    internalPerson = users.stream().map(SysUser::getUserName).collect(Collectors.joining(","));
+                }
+                warningNoticeLog.setIndoorUser(internalPerson);
                 warningNoticeLogService.addWarningNoticeLog(warningNoticeLog);
                 warningNoticeLogService.addWarningNoticeLog(warningNoticeLog);
                 try {
                 try {
                     if (subject.getAdminId() != null) {
                     if (subject.getAdminId() != null) {

+ 1 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanAbnormalDescServiceImpl.java

@@ -124,8 +124,7 @@ public class LabRiskPlanAbnormalDescServiceImpl implements ILabRiskPlanAbnormalD
             desc.setUpdateTime(new Date());
             desc.setUpdateTime(new Date());
             warningNoticeLogService.update(new LambdaUpdateWrapper<WarningNoticeLog>().eq(WarningNoticeLog::getKeyId,groupId)
             warningNoticeLogService.update(new LambdaUpdateWrapper<WarningNoticeLog>().eq(WarningNoticeLog::getKeyId,groupId)
                     .set(WarningNoticeLog::getRiskDuration,rd).set(WarningNoticeLog::getRecordVideo,recordVideo)
                     .set(WarningNoticeLog::getRiskDuration,rd).set(WarningNoticeLog::getRecordVideo,recordVideo)
-                    .set(WarningNoticeLog::getResponder,handledPerson).set(WarningNoticeLog::getStartTime,desc.getStartDate())
-                    .set(WarningNoticeLog::getEndTime,now).set(WarningNoticeLog::getWarningContent,desc.getRiskReason()));
+                    .set(WarningNoticeLog::getResponder,handledPerson).set(WarningNoticeLog::getEndTime,now));
             return labRiskPlanAbnormalDescMapper.updateByGroupId(desc);
             return labRiskPlanAbnormalDescMapper.updateByGroupId(desc);
         }
         }
         return 0;
         return 0;