|
@@ -3,7 +3,6 @@ package com.zd.laboratory.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.zd.model.domain.DTO.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;
|
|
@@ -15,7 +14,6 @@ import com.zd.common.core.utils.DateUtils;
|
|
|
import com.zd.common.core.utils.SaveUtil;
|
|
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.domain.LabRiskPlanAbnormalGroup;
|
|
import com.zd.laboratory.domain.LabRiskPlanAbnormalGroup;
|
|
|
import com.zd.laboratory.domain.LabRiskPlanLevel;
|
|
import com.zd.laboratory.domain.LabRiskPlanLevel;
|
|
|
import com.zd.laboratory.domain.LabSubject;
|
|
import com.zd.laboratory.domain.LabSubject;
|
|
@@ -30,15 +28,12 @@ import com.zd.laboratory.mqtt.service.impl.CommonSend;
|
|
|
import com.zd.laboratory.service.*;
|
|
import com.zd.laboratory.service.*;
|
|
|
import com.zd.model.constant.HttpStatus;
|
|
import com.zd.model.constant.HttpStatus;
|
|
|
import com.zd.model.constant.MqttConstants;
|
|
import com.zd.model.constant.MqttConstants;
|
|
|
-import com.zd.model.domain.R;
|
|
|
|
|
|
|
+import com.zd.model.domain.DTO.UserPhoneInfo;
|
|
|
import com.zd.model.domain.ResultData;
|
|
import com.zd.model.domain.ResultData;
|
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
|
import com.zd.model.entity.SysUser;
|
|
import com.zd.model.entity.SysUser;
|
|
|
import com.zd.model.enums.WarnUserAttrEnum;
|
|
import com.zd.model.enums.WarnUserAttrEnum;
|
|
|
-import com.zd.system.api.feign.RemoteUserService;
|
|
|
|
|
-import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.jetbrains.annotations.NotNull;
|
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -66,12 +61,6 @@ public class LabMessageContentServiceImpl implements ILabMessageContentService {
|
|
|
private LabMessageContentMapper labMessageContentMapper;
|
|
private LabMessageContentMapper labMessageContentMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private ILabSubjectLayoutService subjectLayoutService;
|
|
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private RemoteUserService remoteUserService;
|
|
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
private LabSubjectMapper labSubjectMapper;
|
|
private LabSubjectMapper labSubjectMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ILabSubjectAccessRecordService subjectAccessRecordService;
|
|
private ILabSubjectAccessRecordService subjectAccessRecordService;
|
|
@@ -231,13 +220,6 @@ public class LabMessageContentServiceImpl implements ILabMessageContentService {
|
|
|
if (StringUtils.isNotBlank(safeUserId)) {
|
|
if (StringUtils.isNotBlank(safeUserId)) {
|
|
|
subject.setSafeUserPhone(labSubjectMapper.queryUserPhoneBySafeUserId(safeUserId));
|
|
subject.setSafeUserPhone(labSubjectMapper.queryUserPhoneBySafeUserId(safeUserId));
|
|
|
}
|
|
}
|
|
|
- String deptName = "";
|
|
|
|
|
- List<SubAddrr> subAddrrs = subjectLayoutService.selectAddrrByLayoutIds(subject.getLayoutId());
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(subAddrrs) && subAddrrs.size() > 0) {
|
|
|
|
|
- deptName = subAddrrs.get(0).getBuildName();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
WarningNoticeLog warningNoticeLog = new WarningNoticeLog();
|
|
WarningNoticeLog warningNoticeLog = new WarningNoticeLog();
|
|
|
warningNoticeLog.setKeyId(groupId);
|
|
warningNoticeLog.setKeyId(groupId);
|
|
|
warningNoticeLog.setSubId(subject.getId());
|
|
warningNoticeLog.setSubId(subject.getId());
|
|
@@ -348,47 +330,7 @@ public class LabMessageContentServiceImpl implements ILabMessageContentService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @NotNull
|
|
|
|
|
- private List<UserPhoneInfo> getUserPhoneInfos(LabSubjectVO subject) {
|
|
|
|
|
- List<UserPhoneInfo> userPhoneInfoList = new ArrayList<>();
|
|
|
|
|
- R<SysUser> sysUserR = remoteUserService.getUserByPhone(subject.getAdminPhone());
|
|
|
|
|
- if (HttpStatus.SUCCESS != sysUserR.getCode()) {
|
|
|
|
|
- logger.error("手机号码为:{}用户不存在!", subject.getAdminPhone());
|
|
|
|
|
- }
|
|
|
|
|
- UserPhoneInfo userPhoneInfo = new UserPhoneInfo();
|
|
|
|
|
- userPhoneInfo.setPhone(subject.getAdminPhone());
|
|
|
|
|
- userPhoneInfo.setNickName(sysUserR.getData().getNickName());
|
|
|
|
|
- userPhoneInfo.setRole("实验室负责人");
|
|
|
|
|
- userPhoneInfoList.add(userPhoneInfo);
|
|
|
|
|
- String[] split = subject.getSafeUserPhone().split(",");
|
|
|
|
|
- if(split != null && split.length >0){
|
|
|
|
|
- for (String phoneNumber : split) {
|
|
|
|
|
- R<SysUser> result = remoteUserService.getUserByPhone(phoneNumber);
|
|
|
|
|
- if (HttpStatus.SUCCESS != result.getCode()) {
|
|
|
|
|
- logger.error("手机号码为:{}用户不存在!",phoneNumber);
|
|
|
|
|
- }
|
|
|
|
|
- UserPhoneInfo userPhoneInfo1 = new UserPhoneInfo();
|
|
|
|
|
- userPhoneInfo1.setPhone(phoneNumber);
|
|
|
|
|
- userPhoneInfo1.setNickName(result.getData().getNickName());
|
|
|
|
|
- userPhoneInfo1.setRole("安全责任人");
|
|
|
|
|
- userPhoneInfoList.add(userPhoneInfo1);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-// if(StringUtils.isNotBlank(phone)){
|
|
|
|
|
-// for (String phoneNumber : phone.split(",")) {
|
|
|
|
|
-// R<SysUser> result1 = remoteUserService.getUserByPhone(phoneNumber);
|
|
|
|
|
-// if (HttpStatus.SUCCESS != result1.getCode()) {
|
|
|
|
|
-// logger.error("手机号码为:{}用户不存在!",phoneNumber);
|
|
|
|
|
-// }
|
|
|
|
|
-// UserPhoneInfo userPhoneInfo2 = new UserPhoneInfo();
|
|
|
|
|
-// userPhoneInfo2.setPhone(phoneNumber);
|
|
|
|
|
-// userPhoneInfo2.setNickName(result1.getData().getNickName());
|
|
|
|
|
-// userPhoneInfo2.setRole("室内人员");
|
|
|
|
|
-// userPhoneInfoList.add(userPhoneInfo2);
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
- return userPhoneInfoList;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
private String getDoingUserId(LabSubjectVO subject) {
|
|
private String getDoingUserId(LabSubjectVO subject) {
|
|
|
LabSubjectAccessRecordVo labSubjectAccessRecordVo;
|
|
LabSubjectAccessRecordVo labSubjectAccessRecordVo;
|