|
|
@ -2,6 +2,8 @@ package com.epmet.dataaggre.service.epmetuser.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.rocketmq.constants.TopicConstants; |
|
|
|
import com.epmet.commons.rocketmq.messages.CheckMQMsg; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.form.IdAndNameDTO; |
|
|
@ -9,12 +11,20 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.enums.OrgTypeEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.IpUtils; |
|
|
|
import com.epmet.constant.BadgeConstant; |
|
|
|
import com.epmet.constant.NeighborhoodConstant; |
|
|
|
import com.epmet.constant.OrgInfoConstant; |
|
|
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
|
|
|
import com.epmet.dataaggre.dao.epmetuser.*; |
|
|
@ -47,8 +57,12 @@ import com.epmet.dto.IcResiUserDTO; |
|
|
|
import com.epmet.dto.UserBaseInfoDTO; |
|
|
|
import com.epmet.dto.form.GetStaffExistRoleFormDTO; |
|
|
|
import com.epmet.dto.result.NewUserRoleResultDTO; |
|
|
|
import com.epmet.dto.form.DetailByTypeFormDTO; |
|
|
|
import com.epmet.dto.form.SystemMsgFormDTO; |
|
|
|
import com.epmet.dto.result.DetailByTypeResultDTO; |
|
|
|
import com.epmet.dto.result.StaffRoleResultDTO; |
|
|
|
import com.epmet.feign.GovAccessFeignClient; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -57,8 +71,11 @@ import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.text.NumberFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -106,6 +123,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
|
private IcPointNucleicMonitoringDao pointNucleicMonitoringDao; |
|
|
|
@Autowired |
|
|
|
private GovAccessFeignClient govAccessFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 根据UserIds查询 |
|
|
@ -989,4 +1008,113 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
|
query.like(StringUtils.isNotBlank(search), IcPointNucleicMonitoringEntity::getName, search); |
|
|
|
return pointNucleicMonitoringDao.selectList(query); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto) { |
|
|
|
DetailByTypeResultDTO result = new DetailByTypeResultDTO(); |
|
|
|
String customerId = tokenDto.getCustomerId(); |
|
|
|
String userId = tokenDto.getUserId(); |
|
|
|
CheckMQMsg msg = new CheckMQMsg(); |
|
|
|
if (formDTO.getType().equals(NeighborhoodConstant.CHECK_HOUSE)){ |
|
|
|
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(customerId, formDTO.getId()); |
|
|
|
if (null == houseInfo){ |
|
|
|
throw new EpmetException("查询房屋信息失败:"+formDTO.getId()); |
|
|
|
} |
|
|
|
result.setMobile(houseInfo.getOwnerPhone()); |
|
|
|
result.setIdCard(houseInfo.getOwnerIdCard()); |
|
|
|
msg.setContent("查看"+houseInfo.getAllName()+"房屋的敏感信息"); |
|
|
|
}else if (formDTO.getType().equals(NeighborhoodConstant.CHECK_IC_RESI_USER)){ |
|
|
|
IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); |
|
|
|
if (null == icResiUserInfo){ |
|
|
|
throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); |
|
|
|
} |
|
|
|
result.setIdCard(icResiUserInfo.getIdCard()); |
|
|
|
result.setMobile(icResiUserInfo.getMobile()); |
|
|
|
msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息"); |
|
|
|
}else if (formDTO.getType().equals(NeighborhoodConstant.JMFYXX)){ |
|
|
|
IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); |
|
|
|
if (null == icResiUserInfo){ |
|
|
|
throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); |
|
|
|
} |
|
|
|
result.setIdCard(icResiUserInfo.getIdCard()); |
|
|
|
result.setMobile(icResiUserInfo.getMobile()); |
|
|
|
msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息(居民防疫信息)"); |
|
|
|
}else if (formDTO.getType().equals(NeighborhoodConstant.ROUTE_FOLLOW)){ |
|
|
|
Map<String, String> info = icResiUserDao.getTripReportRecordInfo(formDTO.getId()); |
|
|
|
if (null == info){ |
|
|
|
throw new EpmetException("未查询到行程随访信息:"+formDTO.getId()); |
|
|
|
} |
|
|
|
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); |
|
|
|
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); |
|
|
|
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(行程随访)"); |
|
|
|
}else if (formDTO.getType().equals(NeighborhoodConstant.VACCINATION_RECORD)){ |
|
|
|
Map<String, String> info = icResiUserDao.getVaccineRecordInfo(formDTO.getId()); |
|
|
|
if (null == info){ |
|
|
|
throw new EpmetException("未查询到疫苗接种信息:"+formDTO.getId()); |
|
|
|
} |
|
|
|
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); |
|
|
|
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); |
|
|
|
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(疫苗接种记录)"); |
|
|
|
}else if (formDTO.getType().equals(NeighborhoodConstant.VACCINE_SPECIAL_ATTENTION) |
|
|
|
|| formDTO.getType().equals(NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_QUARANTINE) |
|
|
|
|| formDTO.getType().equals(NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY)){ |
|
|
|
Map<String, String> info = icResiUserDao.getSpecialAttentionInfo(formDTO.getId()); |
|
|
|
if (null == info){ |
|
|
|
throw new EpmetException("未查询到特别关注名单信息:"+formDTO.getId()); |
|
|
|
} |
|
|
|
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); |
|
|
|
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); |
|
|
|
String cMsg = ""; |
|
|
|
switch (formDTO.getType()){ |
|
|
|
case NeighborhoodConstant.VACCINE_SPECIAL_ATTENTION: |
|
|
|
cMsg = "疫苗接种关注名单"; |
|
|
|
break; |
|
|
|
case NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_QUARANTINE: |
|
|
|
cMsg = "重点人群关注名单(防疫隔离)"; |
|
|
|
break; |
|
|
|
case NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY: |
|
|
|
cMsg = "重点人群关注名单(历史记录)"; |
|
|
|
break; |
|
|
|
default: |
|
|
|
} |
|
|
|
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息("+cMsg+")"); |
|
|
|
|
|
|
|
}else if (formDTO.getType().equals(NeighborhoodConstant.NO_NAT_COMPARE)){ |
|
|
|
Map<String, String> info = icResiUserDao.getNoNatCompareInfo(formDTO.getId()); |
|
|
|
if (null == info){ |
|
|
|
throw new EpmetException("未查询到未做核酸比对信息:"+formDTO.getId()); |
|
|
|
} |
|
|
|
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); |
|
|
|
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); |
|
|
|
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(未做核酸比对)"); |
|
|
|
}else if (formDTO.getType().equals(NeighborhoodConstant.NAT_RECORD)){ |
|
|
|
Map<String, String> info = icResiUserDao.getNatInfo(formDTO.getId()); |
|
|
|
if (null == info){ |
|
|
|
throw new EpmetException("未查询到核酸检测信息:"+formDTO.getId()); |
|
|
|
} |
|
|
|
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); |
|
|
|
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); |
|
|
|
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(核酸检测信息)"); |
|
|
|
} |
|
|
|
// 发送mq消息
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
msg.setOperateTime(new Date()); |
|
|
|
msg.setType(formDTO.getType()); |
|
|
|
msg.setTypeDisplay(msg.getContent()); |
|
|
|
msg.setUserId(userId); |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); |
|
|
|
if(null == staffInfo){ |
|
|
|
throw new EpmetException("未查询到工作人员信息:"+userId); |
|
|
|
} |
|
|
|
msg.setOrgId(staffInfo.getAgencyId()); |
|
|
|
msg.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId())); |
|
|
|
msg.setFromApp(tokenDto.getApp()); |
|
|
|
msg.setIp(IpUtils.getIpAddr(request)); |
|
|
|
msg.setFromClient(tokenDto.getClient()); |
|
|
|
SystemMsgFormDTO form = new SystemMsgFormDTO(); |
|
|
|
form.setMessageType(TopicConstants.CHECK_OR_EXPORT); |
|
|
|
form.setContent(msg); |
|
|
|
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|