Browse Source

明文查看

dev
zxc 3 years ago
parent
commit
9c1d691306
  1. 12
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  2. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  3. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  4. 60
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

12
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -126,6 +126,18 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-rocketmq</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-message-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

14
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java

@ -14,6 +14,8 @@ import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.excel.StaffPatrollExcel;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dto.form.DetailByTypeFormDTO;
import com.epmet.dto.result.DetailByTypeResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -285,4 +287,16 @@ public class EpmetUserController {
return new Result<List<GridMemberPatrolListResultDTO>>().ok(epmetUserService.gridMemberPatrolList(formDTO));
}
/**
* Desc: 数据明文查询
* @param formDTO
* @author zxc
* @date 2022/10/17 13:45
*/
@PostMapping("detailByType")
public Result<DetailByTypeResultDTO> detailByType(@RequestBody DetailByTypeFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, DetailByTypeFormDTO.DetailByTypeForm.class);
return new Result<DetailByTypeResultDTO>().ok(epmetUserService.detailByType(formDTO,tokenDto));
}
}

13
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.epmetuser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO;
import com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO;
import com.epmet.dataaggre.dto.epmetuser.form.*;
@ -20,6 +21,8 @@ import com.epmet.dataaggre.entity.epmetuser.IcPointVaccinesInoculationEntity;
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.DetailByTypeFormDTO;
import com.epmet.dto.result.DetailByTypeResultDTO;
import java.util.List;
import java.util.Map;
@ -250,4 +253,14 @@ public interface EpmetUserService {
List<IcPointVaccinesInoculationEntity> listVaccinePoints(String customerId, String agencyId, String staffOrgIds, String search);
List<IcPointNucleicMonitoringEntity> listNucleicPoints(String customerId, String agencyId,String staffOrgIds, String search);
/**
* Desc: 数据明文查询
* @param formDTO
* @author zxc
* @date 2022/10/17 13:45
*/
DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto);
}

60
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -2,16 +2,26 @@ 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;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgTypeEnum;
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.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.*;
@ -42,7 +52,11 @@ import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
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.EpmetMessageOpenFeignClient;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -51,8 +65,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;
@ -98,6 +115,8 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private IcPointVaccinesInoculationDao pointVaccinesInoculationDao;
@Resource
private IcPointNucleicMonitoringDao pointNucleicMonitoringDao;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* @Description 根据UserIds查询
@ -971,4 +990,45 @@ 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.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()+"房屋的敏感信息");
msg.setType("checkHouse");
msg.setTypeDisplay("查看"+houseInfo.getAllName()+"房屋的敏感信息");
}else if (formDTO.getType().equals(NeighborhoodConstant.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()+"的敏感信息");
msg.setType("checkIcResiUser");
msg.setTypeDisplay("查看"+icResiUserInfo.getName()+"的敏感信息");
}
// 发送mq消息
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
msg.setOperateTime(new Date());
msg.setUserId(userId);
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;
}
}

Loading…
Cancel
Save