Browse Source

Merge remote-tracking branch 'remotes/origin/dev_compare_data' into 烟台-政务master

# Conflicts:
#	epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
dev
jianjun 3 years ago
parent
commit
34662c8832
  1. 21
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/ComplementLogOperationDTO.java
  2. 12
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java
  3. 10
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java
  4. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java
  5. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java
  6. 6
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java
  7. 55
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java
  8. 3
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.25__alter_log_operation2.sql
  9. 29
      epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml
  10. 6
      epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java
  11. 3
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  12. 2
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java
  13. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java
  14. 12
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  15. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  16. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java
  17. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  18. 128
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  19. 43
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml
  20. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  21. 49
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java
  22. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  23. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  24. 47
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  25. 1
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java
  26. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatCompareRecordDTO.java
  27. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  28. 1
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml

21
epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/ComplementLogOperationDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/10/20 14:21
* @DESC
*/
@Data
public class ComplementLogOperationDTO implements Serializable {
private static final long serialVersionUID = 7563210356670229204L;
private String staffId;
private String orgId;
private String orgIdPath;
}

12
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java

@ -1,8 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -52,7 +54,7 @@ public class LogOperationController {
* @return
*/
@PostMapping("page")
public Result<PageData<LogOperationResultDTO>> page(@RequestBody LogOperationListFormDTO formDTO){
public Result<PageData<LogOperationResultDTO>> page(@RequestBody LogOperationListFormDTO formDTO, @LoginUser TokenDto tokenDto){
return new Result<PageData<LogOperationResultDTO>>().ok(logOperationService.page(loginUserUtil.getLoginUserCustomerId(),
formDTO.getStartTime(),
formDTO.getEndTime(),
@ -60,6 +62,12 @@ public class LogOperationController {
formDTO.getOperatorMobile(),
formDTO.getPageNo(),
formDTO.getPageSize(),
formDTO.getCategory()));
formDTO.getCategory(),tokenDto));
}
@PostMapping("complementLogOperation")
public Result complementLogOperation(){
logOperationService.complementLogOperation();
return new Result();
}
}

10
epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java

@ -18,12 +18,14 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ComplementLogOperationDTO;
import com.epmet.dto.region.LogOperationResultDTO;
import com.epmet.entity.LogOperationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 操作日指标
@ -39,5 +41,11 @@ public interface LogOperationDao extends BaseDao<LogOperationEntity> {
@Param("endTime")String endTime,
@Param("operatorName")String operatorName,
@Param("operatorMobile")String operatorMobile,
@Param("category")String category);
@Param("category")String category,
@Param("agencyId")String agencyId);
List<Map<String,String>> getStaffId();
void updateBatchLog(@Param("list") List<ComplementLogOperationDTO> list);
}

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java

@ -79,6 +79,8 @@ public class LogOperationEntity extends BaseEpmetEntity {
* 操作人手机号
*/
private String operatorMobile;
private String orgId;
private String orgIdPath;
/**
* 操作时间,该时间不是插入数据的时间而是操作发生的真实时间

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java

@ -76,6 +76,8 @@ public class CheckAndExportOperationLogListener implements MessageListenerConcur
logEntity.setOperatorMobile(operatorInfo.getMobile());
logEntity.setOperatingTime(msgObj.getOperateTime());
logEntity.setContent(msgObj.getContent());
logEntity.setOrgId(msgObj.getOrgId());
logEntity.setOrgIdPath(msgObj.getOrgIdPath());
DistributedLock distributedLock = null;
RLock lock = null;

6
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java

@ -1,6 +1,7 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.region.LogOperationResultDTO;
import com.epmet.entity.LogOperationEntity;
@ -41,5 +42,8 @@ public interface LogOperationService {
String endTime,
String operatorName,
String operatorMobile,
Integer pageNo, Integer pageSize,String category);
Integer pageNo, Integer pageSize, String category, TokenDto tokenDto);
void complementLogOperation();
}

55
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java

@ -4,12 +4,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.LogOperationDao;
import com.epmet.dto.ComplementLogOperationDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.CustomerStaffFormDTO;
import com.epmet.dto.region.LogOperationResultDTO;
@ -21,6 +27,7 @@ import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
@ -194,11 +201,55 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
*/
@Override
public PageData<LogOperationResultDTO> page(String customerId, String startTime, String endTime, String operatorName, String operatorMobile,
Integer pageNo, Integer pageSize,String category) {
Integer pageNo, Integer pageSize, String category, TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询工作人员信息:"+tokenDto.getUserId());
}
// 列表/导出查询
PageHelper.startPage(pageNo, pageSize);
List<LogOperationResultDTO> list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category);
List<LogOperationResultDTO> list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category,staffInfo.getAgencyId());
PageInfo<LogOperationResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* Desc: 补全 log_operation 表的 org_id org_id_path
* @param
* @author zxc
* @date 2022/10/20 13:50
*/
@Override
public void complementLogOperation() {
Integer no = NumConstant.ONE;
Integer size;
do {
PageInfo<Map<String,String>> pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> logOperationDao.getStaffId());
size = pageInfo.getList().size();
if (!CollectionUtils.isEmpty(pageInfo.getList())){
List<ComplementLogOperationDTO> needUpdate = new ArrayList<>();
for (Map<String, String> m : pageInfo.getList()) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(m.get("CUSTOMER_ID"), m.get("OPERATOR_ID"));
if (null == staffInfo){
logger.warn("未查询到工作人员信息"+m.get("OPERATOR_ID"));
continue;
}
ComplementLogOperationDTO dto = new ComplementLogOperationDTO();
dto.setStaffId(staffInfo.getStaffId());
dto.setOrgId(staffInfo.getAgencyId());
dto.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId()));
needUpdate.add(dto);
}
if (!CollectionUtils.isEmpty(needUpdate)){
updateLog(needUpdate);
}
}
no++;
}while (size == NumConstant.ONE_HUNDRED);
}
@Transactional(rollbackFor = Exception.class)
public void updateLog(List<ComplementLogOperationDTO> list){
logOperationDao.updateBatchLog(list);
}
}

3
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.25__alter_log_operation2.sql

@ -0,0 +1,3 @@
alter table log_operation add COLUMN ORG_ID VARCHAR(32) comment '组织ID' AFTER ID;
alter table log_operation add COLUMN ORG_ID_PATH VARCHAR(255) comment '组织ID全路径,包括组织ID' AFTER ORG_ID;

29
epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml

@ -26,6 +26,27 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="updateBatchLog">
update log_operation
<trim prefix="set" suffixOverrides=",">
<trim prefix="ORG_ID =(case" suffix="end),">
<foreach collection="list" item="item">
when OPERATOR_ID = #{item.staffId} then #{item.orgId}
</foreach>
</trim>
<trim prefix="ORG_ID_PATH =(case" suffix="end),">
<foreach collection="list" item="item">
when OPERATOR_ID = #{item.staffId} then #{item.orgIdPath}
</foreach>
</trim>
UPDATED_TIME = NOW()
</trim>
where 1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
OPERATOR_ID = #{item.staffId}
</foreach>
</update>
<select id="pageList" parameterType="map" resultType="com.epmet.dto.region.LogOperationResultDTO">
SELECT
lo.CATEGORY as category,
@ -43,6 +64,7 @@
WHERE
lo.del_flag = '0'
AND lo.CUSTOMER_ID = #{customerId}
AND lo.ORG_ID_PATH LIKE concat('%',#{agencyId},'%')
<if test="category != null and category != ''">
AND lo.CATEGORY = #{category}
</if>
@ -60,4 +82,11 @@
</if>
ORDER BY lo.OPERATING_TIME DESC
</select>
<select id="getStaffId" resultType="java.util.Map">
SELECT
OPERATOR_ID,
CUSTOMER_ID
FROM log_operation
GROUP BY OPERATOR_ID
</select>
</mapper>

6
epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java

@ -5,11 +5,14 @@ import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.IcTokenDto;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.IpUtils;
@ -23,6 +26,7 @@ import com.epmet.jwt.JwtTokenProperties;
import com.epmet.jwt.JwtTokenUtils;
import com.epmet.service.IcLoginService;
import lombok.extern.slf4j.Slf4j;
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;
@ -115,14 +119,12 @@ public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver {
*/
private void sendLoginEvent(String userId, String fromApp, String fromClient) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
LoginMQMsg loginMQMsg = new LoginMQMsg();
loginMQMsg.setUserId(userId);
loginMQMsg.setLoginTime(new Date());
loginMQMsg.setIp(IpUtils.getIpAddr(request));
loginMQMsg.setFromApp(fromApp);
loginMQMsg.setFromClient(fromClient);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(AuthOperationConstants.LOGIN);
form.setContent(loginMQMsg);

3
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -12,6 +12,7 @@ import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@ -19,6 +20,7 @@ import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerDingDingRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache;
import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -831,7 +833,6 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
loginMQMsg.setIp(IpUtils.getIpAddr(request));
loginMQMsg.setFromApp(fromApp);
loginMQMsg.setFromClient(fromClient);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(AuthOperationConstants.LOGIN);
form.setContent(loginMQMsg);

2
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java

@ -27,5 +27,7 @@ public class CheckMQMsg {
private String fromApp;
private String fromClient;
private String orgId;
private String orgIdPath;
}

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java

@ -114,4 +114,15 @@ public class CustomerResiUserRedis {
return resultData;
}
/**
* Desc: 删除Ic居民缓存
* @param icResiUserId
* @author zxc
* @date 2022/10/20 15:57
*/
public static Boolean delIcResiUserInfo(String icResiUserId){
String key = RedisKeys.getIcResiUserKey(icResiUserId);
return customerResiUserRedis.redisUtils.delete(key);
}
}

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));
}
}

11
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java

@ -30,6 +30,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 用户基础信息
@ -138,4 +139,14 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("agencyId")String agencyId,
@Param("staffOrgIds")String staffOrgIds,
@Param("search")String search);
Map<String,String> getTripReportRecordInfo(@Param("id")String id);
Map<String,String> getVaccineRecordInfo(@Param("id")String id);
Map<String,String> getSpecialAttentionInfo(@Param("id")String id);
Map<String,String> getNoNatCompareInfo(@Param("id")String id);
Map<String,String> getNatInfo(@Param("id")String id);
}

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);
}

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

@ -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;
}
}

43
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -283,4 +283,47 @@
having volunteerCategory is null
or volunteerCategory = ''
</select>
<select id="getTripReportRecordInfo" resultType="java.util.Map">
select
MOBILE,
ID_CARD,
NAME
from ic_trip_report_record
where id = #{id}
</select>
<select id="getVaccineRecordInfo" resultType="java.util.Map">
select
MOBILE,
ID_CARD,
NAME
from ic_vaccine
where id = #{id}
</select>
<select id="getSpecialAttentionInfo" resultType="java.util.Map">
select
MOBILE,
ID_CARD,
NAME
from ic_epidemic_special_attention
where id = #{id}
</select>
<select id="getNoNatCompareInfo" resultType="java.util.Map">
select
MOBILE,
ID_CARD,
NAME
from ic_nat_compare_record
where id = #{id}
</select>
<select id="getNatInfo" resultType="java.util.Map">
select
MOBILE,
ID_CARD,
NAME
from ic_nat
where id = #{id}
</select>
</mapper>

3
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java

@ -26,11 +26,14 @@ import com.epmet.commons.rocketmq.messages.PointRuleChangedMQMsg;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.CommonOperateTypeEnum;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;

49
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java

@ -6,12 +6,61 @@ package com.epmet.constant;
*/
public interface NeighborhoodConstant {
String MOBILE = "MOBILE";
String ID_CARD = "ID_CARD";
String NAME = "NAME";
String GRID = "grid";
String NEIGHBOR_HOOD= "neighbourHood";
String BUILDING = "building";
String HOUSE = "house";
String CHECK_HOUSE = "checkHouse";
/**
* ic居民
*/
String IC_RESI_USER = "icResiUser";
String CHECK_IC_RESI_USER = "checkIcResiUser";
/**
* 居民防疫信息
*/
String JMFYXX = "JMFYXX";
/**
* 行程随访
*/
String ROUTE_FOLLOW = "routeFollow";
/**
* 疫苗接种记录
*/
String VACCINATION_RECORD = "vaccinationRecord";
/**
* 疫苗接种关注名单
*/
String VACCINE_SPECIAL_ATTENTION = "vaccineSpecialAttention";
/**
* 未做核酸比对
*/
String NO_NAT_COMPARE = "noNatCompare";
/**
* 核酸检测记录
*/
String NAT_RECORD = "natRecord";
/**
* 重点人群关注名单防疫隔离
*/
String FOCUS_GROUP_SPECIAL_ATTENTION_QUARANTINE = "focusGroupSpecialAttentionQuarantine";
/**
* 重点人群关注名单历史记录
*/
String FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY = "focusGroupSpecialAttentionHistory";
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java

@ -154,15 +154,4 @@ public class IcHouseController {
return icHouseService.checkHomeInfo(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(icHouseService.detailByType(formDTO,tokenDto));
}
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java

@ -138,12 +138,5 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
*/
Result checkHomeInfo(CheckHouseInfoFormDTO formDTO);
/**
* Desc: 数据明文查询
* @param formDTO
* @author zxc
* @date 2022/10/17 13:45
*/
DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto);
}

47
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -416,51 +416,4 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
return new Result<CheckHomeInfoResultInfo>().ok(checkHomeInfoResultInfo);
}
/**
* Desc: 数据明文查询
* @param formDTO
* @author zxc
* @date 2022/10/17 13:45
*/
@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;
}
}

1
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java

@ -51,5 +51,6 @@ public class TransferFormDTO implements Serializable {
* 协办单位类型1社区自组织2联建单位
*/
private String assistanceUnitType;
}

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatCompareRecordDTO.java

@ -30,6 +30,9 @@ public class IcNatCompareRecordDTO implements Serializable {
@ExcelIgnore
private String relationId;
@ExcelIgnore
private String recordId;
/**
* 姓名
*/

1
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -699,6 +699,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
log.error("同步党员信息失败");
}
}
CustomerResiUserRedis.delIcResiUserInfo(resiUserId);
return resiUserId;
}

1
epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml

@ -7,6 +7,7 @@
<select id="pageList" parameterType="com.epmet.dto.form.yqfk.IcNatCompareRecordPageFormDTO" resultType="com.epmet.dto.IcNatCompareRecordDTO">
SELECT
r.ID as relationId,
c.ID as recordId,
c.MOBILE,
c.ID_CARD,
c.`NAME`,

Loading…
Cancel
Save