Browse Source

Merge branch 'dev_compare_data' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_compare_data

 Conflicts:
	epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java
master
jianjun 3 years ago
parent
commit
8ffa9801a4
  1. 21
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/ComplementLogOperationDTO.java
  2. 20
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java
  3. 5
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java
  4. 25
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java
  5. 20
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java
  6. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java
  7. 8
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java
  8. 21
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java
  9. 75
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java
  10. 3
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.25__alter_log_operation2.sql
  11. 62
      epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml
  12. 6
      epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java
  13. 3
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  14. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java
  15. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java
  16. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java
  17. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  18. 38
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java
  19. 539
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/IcResiUserInfoCache.java
  20. 12
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  21. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  22. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java
  23. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  24. 128
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  25. 43
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml
  26. 6
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  27. 3
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  28. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  29. 49
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java
  30. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java
  31. 52
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  32. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  33. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  34. 48
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  35. 1
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java
  36. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatCompareRecordDTO.java
  37. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java
  38. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  39. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  40. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java
  41. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java
  42. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  43. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  44. 142
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java
  45. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  46. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java
  47. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  48. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx
  49. 1
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml
  50. 34
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.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;
}

20
epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java

@ -10,4 +10,24 @@ public class LogOperationListFormDTO {
private Integer pageNo = 1;
private Integer pageSize = 10;
/**
* 姓名
*/
private String operatorName;
/**
* 手机号
*/
private String operatorMobile;
/**
* yyyyMMdd
*/
private String startTime;
/**
* yyyyMMdd
*/
private String endTime;
/**
* 默认传data_tm
*/
private String category;
}

5
epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java

@ -1,7 +1,10 @@
package com.epmet.dto.region;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
*
*/
@ -45,4 +48,6 @@ public class LogOperationResultDTO {
*/
private Long operatingTime;
@JsonFormat(pattern="yyyy-MM-dd HH:mm")
private Date operateTime;
}

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

@ -1,7 +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;
@ -45,4 +48,26 @@ public class LogOperationController {
return new Result<List<LogOperationResultDTO>>().ok(resultList);
}
/**
* 数字社区-操作记录
* @param formDTO
* @return
*/
@PostMapping("page")
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(),
formDTO.getOperatorName(),
formDTO.getOperatorMobile(),
formDTO.getPageNo(),
formDTO.getPageSize(),
formDTO.getCategory(),tokenDto));
}
@PostMapping("complementLogOperation")
public Result complementLogOperation(){
logOperationService.complementLogOperation();
return new Result();
}
}

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

@ -18,8 +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;
/**
* 操作日指标
@ -29,5 +35,17 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface LogOperationDao extends BaseDao<LogOperationEntity> {
List<LogOperationResultDTO> pageList(@Param("customerId") String customerId,
@Param("startTime")String startTime,
@Param("endTime")String endTime,
@Param("operatorName")String operatorName,
@Param("operatorMobile")String operatorMobile,
@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;
/**
* 操作时间,该时间不是插入数据的时间而是操作发生的真实时间

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

@ -63,9 +63,9 @@ public class CheckAndExportOperationLogListener implements MessageListenerConcur
//获取操作人信息
OperatorInfo operatorInfo = LogOperationHelper.getInstance().getOperatorInfo(msgObj.getUserId());
LogOperationEntity logEntity = new LogOperationEntity();
logEntity.setCategory(messageExt.getTopic());
logEntity.setType(tags);
logEntity.setTypeDisplay(AuthOperationEnum.getDisplay(tags));
logEntity.setCategory("data_tm");
logEntity.setType(msgObj.getType());
logEntity.setTypeDisplay(msgObj.getTypeDisplay());
logEntity.setIp(msgObj.getIp());
logEntity.setFromApp(msgObj.getFromApp());
logEntity.setFromClient(msgObj.getFromClient());
@ -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;

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

@ -1,5 +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;
@ -25,4 +27,23 @@ public interface LogOperationService {
* @date 2021.06.07 21:56
*/
List<LogOperationResultDTO> listOperationLogs(String condition, String customerId, Integer pageNo, Integer pageSize);
/**
* 数字社区-操作记录
* @param loginUserCustomerId
* @param startTime
* @param endTime
* @param operatorName
* @param operatorMobile
* @return
*/
PageData<LogOperationResultDTO> page(String loginUserCustomerId,
String startTime,
String endTime,
String operatorName,
String operatorMobile,
Integer pageNo, Integer pageSize, String category, TokenDto tokenDto);
void complementLogOperation();
}

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

@ -4,20 +4,30 @@ 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;
import com.epmet.entity.LogOperationEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.LogOperationService;
import com.github.pagehelper.PageHelper;
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.*;
@ -174,7 +184,72 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
ldto.setCustomerId(l.getCustomerId());
ldto.setOperatorMobile(staffMap.get(l.getOperatorId()).getMobile());
ldto.setOperatorName(staffMap.get(l.getOperatorId()).getRealName());
ldto.setOperateTime(l.getOperatingTime());
return ldto;
}).collect(Collectors.toList());
}
/**
* 数字社区-操作记录
*
* @param customerId
* @param startTime
* @param endTime
* @param operatorName
* @param operatorMobile
* @return
*/
@Override
public PageData<LogOperationResultDTO> page(String customerId, String startTime, String endTime, String operatorName, String operatorMobile,
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,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;

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

@ -26,5 +26,67 @@
<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,
lo.TYPE as type,
lo.TYPE_DISPLAY as typeDisplay,
lo.CONTENT as content,
lo.TARGET_ID as targetId,
lo.CUSTOMER_ID as customerId,
lo.OPERATOR_ID as operatorId,
lo.OPERATOR_NAME as operatorName,
lo.OPERATOR_MOBILE as operatorMobile,
lo.OPERATING_TIME as operateTime
FROM
log_operation lo
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>
<if test="operatorName != null and operatorName != ''">
AND lo.OPERATOR_NAME LIKE concat('%',#{operatorName},'%')
</if>
<if test="operatorMobile != null and operatorMobile != ''">
AND lo.OPERATOR_MOBILE LIKE concat('%',#{operatorMobile},'%')
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( lo.OPERATING_TIME, '%Y%m%d' ) &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( lo.OPERATING_TIME, '%Y%m%d' ) &lt;= #{endTime}
</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;
@ -830,7 +832,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);

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

@ -14,6 +14,9 @@ public class CheckMQMsg {
private String content;
private String typeDisplay;
private String type;
/**
* 操作时间
*/
@ -24,5 +27,7 @@ public class CheckMQMsg {
private String fromApp;
private String fromClient;
private String orgId;
private String orgIdPath;
}

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java

@ -2,6 +2,7 @@ package com.epmet.commons.tools.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.feign.fallback.CommonUserFeignClientFallBackFactory;
import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache;
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache;
import com.epmet.commons.tools.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
@ -17,4 +18,7 @@ import org.springframework.web.bind.annotation.PostMapping;
public interface CommonUserFeignClient {
@PostMapping("/epmetuser/userbaseinfo/getUserInfo/{userId}")
Result<ResiUserInfoCache> getUserInfo(@PathVariable("userId") String userId);
@PostMapping("/epmetuser/icresiuser/getIcResiUserInfo/{userId}")
Result<IcResiUserInfoCache> getIcResiUserInfo(@PathVariable("userId") String userId);
}

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java

@ -2,6 +2,7 @@ package com.epmet.commons.tools.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.feign.CommonUserFeignClient;
import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache;
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
@ -20,4 +21,9 @@ public class CommonUserFeignClientFallback implements CommonUserFeignClient {
public Result<ResiUserInfoCache> getUserInfo(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserInfo", userId);
}
@Override
public Result<IcResiUserInfoCache> getIcResiUserInfo(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcResiUserInfo", userId);
}
}

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -393,6 +393,10 @@ public class RedisKeys {
return rootPrefix.concat("resi:user:").concat(userId);
}
public static String getIcResiUserKey(String userId) {
return rootPrefix.concat("resi:icResiUser:").concat(userId);
}
/**
* @param userId
* @return epmet:badge:user:[customerId]:[userId]

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

@ -1,10 +1,12 @@
package com.epmet.commons.tools.redis.common;
import cn.hutool.core.bean.BeanUtil;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.CommonUserFeignClient;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache;
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -70,6 +72,31 @@ public class CustomerResiUserRedis {
return resultData;
}
public static IcResiUserInfoCache getIcResiUserInfo(String icResiUserId){
if (StringUtils.isBlank(icResiUserId)){
log.warn("getIcResiUserInfo param is blank,userId:{}",icResiUserId);
return null;
}
String key = RedisKeys.getIcResiUserKey(icResiUserId);
Map<String, Object> map = customerResiUserRedis.redisUtils.hGetAll(key);
if (!CollectionUtils.isEmpty(map)) {
return ConvertUtils.mapToEntity(map, IcResiUserInfoCache.class);
}
Result<IcResiUserInfoCache> result = customerResiUserRedis.commonUserFeignClient.getIcResiUserInfo(icResiUserId);
if (result == null || !result.success()) {
throw new EpmetException("获取居民信息失败");
}
IcResiUserInfoCache data = result.getData();
if (null == data) {
log.warn("居民信息为空,userId:{}", icResiUserId);
return null;
}
Map<String, Object> cacheMap = BeanUtil.beanToMap(data, false, true);
customerResiUserRedis.redisUtils.hMSet(key, cacheMap);
return data;
}
@Nullable
private static ResiUserInfoCache reloadStaffCache(String userId, String key) {
Result<ResiUserInfoCache> result = customerResiUserRedis.commonUserFeignClient.getUserInfo(userId);
@ -87,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);
}
}

539
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/IcResiUserInfoCache.java

@ -0,0 +1,539 @@
package com.epmet.commons.tools.redis.common.bean;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2022/10/17 15:40
* @DESC
*/
@Data
public class IcResiUserInfoCache implements Serializable {
private static final long serialVersionUID = -3644143706074015380L;
/**
* 主键
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
*
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 网格ID
*/
private String gridId;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 是否本地户籍
*/
private String isBdhj;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 备注
*/
private String remarks;
/**
* 联系人
*/
private String contacts;
/**
* 联系人电话
*/
private String contactsMobile;
/**
* 九小场所url
*/
private String ninePlace;
/**
* 是否党员
*/
private String isParty;
/**
* 是否低保户
*/
private String isDbh;
/**
* 是否保障房
*/
private String isEnsureHouse;
/**
* 是否失业
*/
private String isUnemployed;
/**
* 是否育龄妇女
*/
private String isYlfn;
/**
* 是否退役军人
*/
private String isVeterans;
/**
* 是否统战人员
*/
private String isUnitedFront;
/**
* 是否信访人员
*/
private String isXfry;
/**
* 是否志愿者
*/
private String isVolunteer;
/**
* 是否老年人
*/
private String isOldPeople;
/**
* 是否空巢
*/
private String isKc;
/**
* 是否失独
*/
private String isSd;
/**
* 是否失能
*/
private String isSn;
/**
* 是否失智
*/
private String isSz;
/**
* 是否残疾
*/
private String isCj;
/**
* 是否大病
*/
private String isDb;
/**
* 是否慢病
*/
private String isMb;
/**
* 是否特殊人群
*/
private String isSpecial;
/**
* 是否租户:1 :0
*/
private String isTenant;
/**
* 是否是流动人口:1 :0
*/
private String isFloating;
/**
* 是否新阶层人士:1 :0
*/
private String isXjc;
/**
* 文化程度字典表
*/
private String culture;
/**
* 文化程度备注
*/
private String cultureRemakes;
/**
* 特长字典表
*/
private String specialSkill;
/**
* 兴趣爱好
*/
private String hobby;
/**
* 兴趣爱好备注
*/
private String hobbyRemakes;
/**
* 宗教信仰
*/
private String faith;
/**
* 宗教信仰备注
*/
private String faithRemakes;
/**
* 残疾类别字典表
*/
private String cjlb;
/**
* 残疾登记(状况)字典表
*/
private String cjzk;
/**
* 残疾证号
*/
private String cjzh;
/**
* 残疾说明
*/
private String cjsm;
/**
* 有无监护人yes no
*/
private String ynJdr;
/**
* 有无技能特长yes no
*/
private String ynJntc;
/**
* 有无劳动能力
*/
private String ynLdnl;
/**
* 有无非义务教育阶段助学yes no
*/
private String ynFywjyjdzx;
/**
* 所患大病
*/
private String shdb;
/**
* 患大病时间
*/
private String dbsj;
/**
* 所患慢性病
*/
private String shmxb;
/**
* 患慢性病时间
*/
private String mxbsj;
/**
* 是否参保
*/
private String isCb;
/**
* 自付金额
*/
private String zfje;
/**
* 救助金额
*/
private String jzje;
/**
* 救助时间[yyyy-MM-dd]
*/
private String jzsj;
/**
* 享受救助明细序号
*/
private String jzmxxh;
/**
* 健康信息备注
*/
private String healthRemakes;
/**
* 工作单位
*/
private String gzdw;
/**
* 职业
*/
private String zy;
/**
* 离退休时间
*/
private String ltxsj;
/**
* 工作信息备注
*/
private String workRemake;
/**
* 退休金额
*/
private String txje;
/**
* 月收入
*/
private String ysr;
/**
* 是否经济低保
*/
private String isJjdb;
/**
* 籍贯
*/
private String jg;
/**
* 户籍所在地
*/
private String hjszd;
/**
* 现居住地
*/
private String xjzd;
/**
* 人户情况
*/
private String rhzk;
/**
* 居住信息备注
*/
private String jzxxRemakes;
/**
* 民族字典表
*/
private String mz;
/**
* 与户主关系字典表
*/
private String yhzgx;
/**
* 居住情况字典表
*/
private String jzqk;
/**
* 婚姻状况字典表
*/
private String hyzk;
/**
* 配偶情况字典表
*/
private String poqk;
/**
* 有无赡养人
*/
private String ynSyr;
/**
* 与赡养人关系字典表
*/
private String ysyrgx;
/**
* 赡养人电话
*/
private String syrMobile;
/**
* 家庭信息备注
*/
private String jtxxRemakes;
/**
* 用户状态0:正常;1:迁出;2:注销
*/
private String status;
/**
* 用户详细状态01新增02导入03迁入04新生11迁出21死亡
*/
private String subStatus;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 预留字段1
*/
private String field1;
/**
* 预留字段2
*/
private String field2;
/**
* 预留字段3
*/
private String field3;
/**
* 预留字段4
*/
private String field4;
/**
* 预留字段5
*/
private String field5;
/**
* 预留字段6
*/
private String field6;
/**
* 预留字段7
*/
private String field7;
/**
* 预留字段8
*/
private String field8;
/**
* 预留字段9
*/
private String field9;
/**
* 预留字段10
*/
private String field10;
}

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,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,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>

6
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java

@ -175,6 +175,12 @@ public interface SystemMessageType {
*/
String PARTY_MEETING_MESSAGE = "party_meeting_message";
/**
* 查看或者导出 日志记录
*/
String CHECK_OR_EXPORT = "check_or_export";
String ZBWYH = "参加支部委员会";
String ZBDYDH = "参加支部党员大会";
String DXZH = "参加党小组会";

3
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java

@ -248,6 +248,9 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.WMFWHD:
topic=TopicConstants.PARTY_BUILDING;
break;
case SystemMessageType.CHECK_OR_EXPORT:
topic = TopicConstants.CHECK_OR_EXPORT;
break;
default:
logger.error("getTopicByMsgType msgType:{} is not support for any topic", msgType);
}

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

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java

@ -161,4 +161,13 @@ public class IcHouseDTO implements Serializable {
* 房屋可编辑编码
*/
private String coding;
/**
* 加密后的联系方式
*/
private String showOwnerPhone;
/**
* 加密后的房主身份证
*/
private String showOwnerIdCard;
}

52
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -25,6 +25,8 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.messages.CheckMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.annotation.ReportRequest;
@ -40,10 +42,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.HouseQRcodeUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.poi.excel.handler.ExcelFillRowMergeStrategy;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -54,6 +53,7 @@ import com.epmet.dto.result.*;
import com.epmet.entity.CustomerOrgParameterEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.HouseService;
import com.epmet.util.ExcelPoiUtils;
@ -66,18 +66,18 @@ import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import javax.imageio.stream.ImageOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -105,6 +105,8 @@ public class HouseController implements ResultDataResolver {
@Autowired
private IcHouseDao icHouseDao;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@ReportRequest
@PostMapping("houselist")
@ -265,7 +267,7 @@ public class HouseController implements ResultDataResolver {
* @throws Exception
*/
@RequestMapping("exporthouseinfo")
public void exporthouseinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exporthouseinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response,@LoginUser TokenDto tokenDto) throws Exception {
ValidatorUtils.validateEntity(formDTO);
if (StringUtils.isNotBlank(formDTO.getId())){
formDTO.setSelectType("id");
@ -274,7 +276,21 @@ public class HouseController implements ResultDataResolver {
}
formDTO.setIsPage(false);
houseService.exportBuildinginfo(formDTO, response);
// 新增操作日志
CheckMQMsg msg = new CheckMQMsg();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
msg.setOperateTime(new Date());
msg.setContent("导出房屋数据");
msg.setType("exportHouse");
msg.setTypeDisplay("导出房屋数据");
msg.setUserId(tokenDto.getUserId());
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);
}
@PostMapping("queryListHouseInfo")
@ -452,6 +468,22 @@ public class HouseController implements ResultDataResolver {
//获取导出配置
haveSearchCache.invalidateAll();
// 发送操作日志
CheckMQMsg msg = new CheckMQMsg();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
msg.setOperateTime(new Date());
msg.setContent("导出一户一档数据");
msg.setType("exportYHYD");
msg.setTypeDisplay("导出一户一档数据");
msg.setUserId(tokenDto.getUserId());
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);
} catch (EpmetException e) {
response.reset();
response.setCharacterEncoding("UTF-8");

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

@ -18,17 +18,16 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.IcVaccinePrarmeterDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.DetailByTypeFormDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.form.VaccinePrarmeterListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.service.IcHouseService;
import org.springframework.beans.factory.annotation.Autowired;
@ -51,6 +50,7 @@ public class IcHouseController {
@Autowired
private IcHouseService icHouseService;
@MaskResponse(fieldNames = { "showOwnerPhone", "showOwnerIdCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD })
@GetMapping("{id}")
public Result<IcHouseDTO> get(@PathVariable("id") String id) {
IcHouseDTO data = icHouseService.get(id);
@ -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);
}

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

@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.messages.CheckMQMsg;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
@ -15,7 +14,7 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache;
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.IpUtils;
@ -93,6 +92,8 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
if (null == dto) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("houseId:%s已删除", id), "房屋已删除");
}
dto.setShowOwnerIdCard(dto.getOwnerIdCard());
dto.setShowOwnerPhone(dto.getOwnerPhone());
dto.setHouseTypeName(HouseTypeEnums.getTypeValue(dto.getHouseType()));
dto.setRentName(HouseRentFlagEnums.getTypeValue(dto.getRentFlag()));
dto.setPurposeName(HousePurposeEnums.getTypeValue(dto.getPurpose()));
@ -415,47 +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("查看房屋信息明文");
}else if (formDTO.getType().equals(NeighborhoodConstant.IC_RESI_USER)){
ResiUserInfoCache userBaseInfo = CustomerResiUserRedis.getUserBaseInfo(formDTO.getId());
if (null == userBaseInfo){
throw new EpmetException("查询icResiUser失败:"+formDTO.getId());
}
result.setIdCard(userBaseInfo.getIdNum());
result.setMobile(userBaseInfo.getMobile());
msg.setContent("查看居民信息明文");
}
// 发送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;
/**
* 姓名
*/

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java

@ -60,7 +60,7 @@ public class NatListResultDTO implements Serializable {
* 身份证号
*/
@ColumnWidth(25)
@ExcelProperty(value = "身份证号",order = 3)
@ExcelProperty(value = "证号",order = 3)
private String idCard;
/**

24
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -22,6 +22,8 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillWrapper;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.messages.CheckMQMsg;
import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
@ -46,6 +48,7 @@ import com.epmet.commons.tools.page.PageData;
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.redis.common.bean.IcResiUserInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*;
@ -84,6 +87,8 @@ import org.jetbrains.annotations.NotNull;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
@ -557,6 +562,20 @@ public class IcResiUserController implements ResultDataResolver {
} else {
icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, response,false);
}
CheckMQMsg msg = new CheckMQMsg();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
msg.setOperateTime(new Date());
msg.setContent("导出居民数据");
msg.setType("exportIcResiUser");
msg.setTypeDisplay("导出居民数据");
msg.setUserId(tokenDto.getUserId());
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);
} catch (EpmetException e) {
response.reset();
response.setCharacterEncoding("UTF-8");
@ -1436,4 +1455,9 @@ public class IcResiUserController implements ResultDataResolver {
return new Result();
}
@PostMapping("getIcResiUserInfo/{userId}")
public Result<IcResiUserInfoCache> getIcResiUserInfo(@PathVariable("userId") String userId){
return new Result<IcResiUserInfoCache>().ok(icResiUserService.getIcResiUserInfo(userId));
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java

@ -64,4 +64,6 @@ public interface IcNatDao extends BaseDao<IcNatEntity> {
List<NatUserInfoResultDTO> getExistNatInfo(@Param("list") List<IcNatEntity> entities);
void updateBatchNat(@Param("list")List<IcNatEntity> entities);
}

6
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java

@ -24,9 +24,9 @@ public class IcNatImportExcelData {
@Length(max = 15, message = "手机号长度不正确,应小于15位")
private String mobile;
@NotBlank(message = "身份证号为必填项")
@ExcelProperty("身份证号")
@Length(max = 18, message = "身份证号长度不正确,应小于18位")
@NotBlank(message = "证号为必填项")
@ExcelProperty("证号")
@Length(max = 18, message = "证号长度不正确,应小于18位")
private String idCard;
// @NotNull(message = "检测时间为必填项")

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java

@ -68,7 +68,7 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
// 先校验数据
ValidatorUtils.validateEntity(data);
if ((null == data.getSampleTime() && null == data.getNatTime() || org.apache.commons.lang3.StringUtils.isBlank(data.getNatResultZh()))){
if (null == data.getSampleTime() && (null == data.getNatTime() || org.apache.commons.lang3.StringUtils.isBlank(data.getNatResultZh()))){
throw new EpmetException(EpmetErrorCode.SAMPLE_TIME_AND_RESULT_IS_NULL_ERROR.getCode());
}
if(null != data.getSampleTime() && org.apache.commons.lang3.StringUtils.isNotBlank(data.getNatResultZh()) && null == data.getNatTime()){

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java

@ -92,4 +92,6 @@ public interface IcNatService extends BaseService<IcNatEntity> {
* @return
*/
Integer updateIsResiFlag(String customerId, String icResiUserId);
void updateBatchNat(List<IcNatEntity> entities);
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcResiUserDTO;
@ -518,4 +519,6 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @Date 2022/9/8 15:45
*/
void updateYlfn();
IcResiUserInfoCache getIcResiUserInfo(String userId);
}

142
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java

@ -450,100 +450,64 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao
* @author zxc
* @date 2022/9/27 11:08
*/
@Transactional(rollbackFor = Exception.class)
public void hsjc(List<NatUserInfoResultDTO> idCards, String customerId, String isSync) {
try {
List<IcNatEntity> entities = new ArrayList<>();
idCards.forEach(idCard -> {
// YtHscyResDTO sampleResult = YtHsResUtils.hscy(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE);
YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE);
/*Boolean aBoolean = CollectionUtils.isEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData());
Boolean bBoolean = CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData());*/
/**
* 1.采样结果 检测结果 都不为空以检测结果为准
* 2.采样结果为空检测结果不为空
*/
// if (aBoolean || bBoolean) {
if (CollectionUtils.isNotEmpty(natInfoResult.getData())) {
natInfoResult.getData().forEach(natInfo -> {
YtHscyResDTO sampleResult = YtHsResUtils.hscy(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE);
if (CollectionUtils.isNotEmpty(sampleResult.getData())){
List<IcNatEntity> entities = new ArrayList<>();
sampleResult.getData().forEach(sampleInfo -> {
IcNatEntity e = new IcNatEntity();
e.setCustomerId(customerId);
e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR);
e.setUserId(idCard.getUserId());
e.setMobile("");
e.setUserType(isSync.equals(NumConstant.ONE_STR) ? "manualSync" : "sync");
e.setName(StringUtils.isNotBlank(natInfo.getName()) ? natInfo.getName() : "");
e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : "");
e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : "");
e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN));
e.setSampleTime(DateUtils.parseDate(natInfo.getSample_time(), DateUtils.DATE_TIME_PATTERN));
String resultPcr = natInfo.getSample_result_pcr();
//检测结果 转换 我们 0:阴性 1:阳性, 他们 :1:阳性,2:阴性
e.setNatResult(NumConstant.ZERO_STR);
if (NumConstant.ONE_STR.equals(resultPcr)) {
e.setNatResult(NumConstant.ONE_STR);
}
e.setNatAddress(natInfo.getSampling_org_pcr());
e.setName(StringUtils.isNotBlank(sampleInfo.getName()) ? sampleInfo.getName() : "");
e.setIdCard(StringUtils.isNotBlank(sampleInfo.getCard_no()) ? sampleInfo.getCard_no() : "");
e.setSampleTime(DateUtils.parseDate(sampleInfo.getCreate_time(), DateUtils.DATE_TIME_PATTERN));
e.setAgencyId(idCard.getAgencyId());
e.setPids(idCard.getPids());
e.setAttachmentType("");
e.setAttachmentUrl("");
entities.add(e);
});
if (CollectionUtils.isNotEmpty(entities)){
List<NatUserInfoResultDTO> existSampleInfo = icNatDao.getExistNatInfo(entities);
sampleAndNat(existSampleInfo,entities,NumConstant.ONE_STR,customerId,isSync);
}
}
/*if (CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isEmpty(natInfoResult.getData())){
sampleResult.getData().forEach(sampleInfo -> {
YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE);
if (CollectionUtils.isNotEmpty(natInfoResult.getData())) {
List<IcNatEntity> entities = new ArrayList<>();
natInfoResult.getData().forEach(natInfo -> {
IcNatEntity e = new IcNatEntity();
e.setCustomerId(customerId);
e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR);
e.setUserId(idCard.getUserId());
e.setUserType(isSync.equals(NumConstant.ONE_STR) ? "manualSync" : "sync");
e.setName(StringUtils.isNotBlank(sampleInfo.getName()) ? sampleInfo.getName() : "");
e.setMobile(StringUtils.isNotBlank(sampleInfo.get()) ? sampleInfo.getTelephone() : "");
e.setIdCard(StringUtils.isNotBlank(sampleInfo.getCard_no()) ? sampleInfo.getCard_no() : "");
e.setNatTime(DateUtils.parseDate(sampleInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN));
e.setSampleTime(DateUtils.parseDate(sampleInfo.getSample_time(), DateUtils.DATE_TIME_PATTERN));
String resultPcr = sampleInfo.getSample_result_pcr();
e.setName(StringUtils.isNotBlank(natInfo.getName()) ? natInfo.getName() : "");
e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : "");
e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : "");
e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN));
e.setSampleTime(DateUtils.parseDate(natInfo.getSample_time(), DateUtils.DATE_TIME_PATTERN));
String resultPcr = natInfo.getSample_result_pcr();
//检测结果 转换 我们 0:阴性 1:阳性, 他们 :1:阳性,2:阴性
e.setNatResult(NumConstant.ZERO_STR);
if (NumConstant.ONE_STR.equals(resultPcr)){
if (NumConstant.ONE_STR.equals(resultPcr)) {
e.setNatResult(NumConstant.ONE_STR);
}
e.setNatAddress(sampleInfo.getSampling_org_pcr());
e.setNatAddress(natInfo.getSampling_org_pcr());
e.setAgencyId(idCard.getAgencyId());
e.setPids(idCard.getPids());
e.setAttachmentType("");
e.setAttachmentUrl("");
entities.add(e);
});
}
});*/
if (CollectionUtils.isNotEmpty(entities)) {
List<NatUserInfoResultDTO> existNatInfos = icNatDao.getExistNatInfo(entities);
entities.forEach(e -> existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true)));
Map<Boolean, List<IcNatEntity>> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus));
if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) {
for (List<IcNatEntity> icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) {
icNatService.insertBatch(icNatEntities);
//组织关系表
List<IcNatRelationEntity> relationEntities = new ArrayList<>();
icNatEntities.forEach(ne -> {
// 不是居民的先不加关系表吧
if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) {
IcNatRelationEntity e = new IcNatRelationEntity();
e.setCustomerId(customerId);
e.setAgencyId(ne.getAgencyId());
e.setPids(ne.getPids());
e.setIcNatId(ne.getId());
e.setUserType("sync");
relationEntities.add(e);
}
});
if (CollectionUtils.isNotEmpty(relationEntities)) {
icNatRelationService.insertBatch(relationEntities);
}
}
if (CollectionUtils.isNotEmpty(entities)) {
List<NatUserInfoResultDTO> existNatInfos = icNatDao.getExistNatInfo(entities);
sampleAndNat(existNatInfos,entities,NumConstant.TWO_STR,customerId,isSync);
}
}
});
} catch (Exception e) {
@ -552,6 +516,58 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao
}
/**
* Desc: 处理采样和检测结果
* @param existInfo 库里存在的ic_nat
* @param entities 所有的
* @param type 1采样结果2检测结果
* @param isSync 1:页面调用同步2定时任务
* @author zxc
* @date 2022/10/18 09:08
*/
private void sampleAndNat(List<NatUserInfoResultDTO> existInfo, List<IcNatEntity> entities, String type, String customerId, String isSync){
/**
* 采样结果不为空
* 数据库采样时间+idCard+userId 存在的 不做操作
* 数据库采样时间+idCard+userId 不存在的 新增
*
* 检测结果不为空
* 数据库采样时间+idCard+userId 存在的 做更新
* 数据库采样时间+idCard+userId 不存在的 新增
*/
entities.forEach(e -> existInfo.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true)));
Map<Boolean, List<IcNatEntity>> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus));
if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) {
for (List<IcNatEntity> icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) {
// 主表新增
icNatService.insertBatch(icNatEntities);
// 组织关系表
List<IcNatRelationEntity> relationEntities = new ArrayList<>();
icNatEntities.forEach(ne -> {
if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) {
IcNatRelationEntity e = new IcNatRelationEntity();
e.setCustomerId(customerId);
e.setAgencyId(ne.getAgencyId());
e.setPids(ne.getPids());
e.setIcNatId(ne.getId());
e.setUserType(isSync.equals(NumConstant.ONE_STR) ? "manualSync" : "sync");
relationEntities.add(e);
}
});
if (CollectionUtils.isNotEmpty(relationEntities)) {
icNatRelationService.insertBatch(relationEntities);
}
}
}
if (NumConstant.TWO_STR.equals(type)){
if (CollectionUtils.isNotEmpty(groupByStatus.get(true))){
for (List<IcNatEntity> icNatEntities : ListUtils.partition(groupByStatus.get(true), NumConstant.ONE_HUNDRED)) {
icNatService.updateBatchNat(icNatEntities);
}
}
}
}
private class JudgeDealStatus {
private boolean isNext;
private DataSyncRecordDisabilityDTO dbDisablityEntity;

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

@ -464,6 +464,14 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
return baseDao.updateIsResiFlag(customerId,icResiUserId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateBatchNat(List<IcNatEntity> entities) {
if (CollectionUtils.isNotEmpty(entities)){
baseDao.updateBatchNat(entities);
}
}
/**
* 批量持久化
* @param entities

18
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java

@ -7,6 +7,8 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.messages.CheckMQMsg;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -20,22 +22,17 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Md5Util;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.poi.excel.handler.ExcelFillCellMergeStrategy;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.IcResiUserConstant;
import com.epmet.dto.form.ExportResiUserFormDTO;
import com.epmet.dto.form.IcExportTemplateQueryFormDTO;
import com.epmet.dto.form.IcResiUserPageFormDTO;
import com.epmet.dto.form.ResiUserQueryValueDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.FormItemResult;
import com.epmet.dto.result.IcCustomExportResultDTO;
import com.epmet.dto.result.OptionDTO;
import com.epmet.excel.support.ExportResiUserItemDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcResiUserExportService;
import com.epmet.service.IcResiUserImportService;
@ -53,7 +50,10 @@ import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.jetbrains.annotations.Nullable;
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.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
@ -76,6 +76,8 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService {
private IcResiUserService icResiUserService;
@Autowired
private IcResiUserImportService icResiUserImportService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* key:itemId,value: key:columnName,中文

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

@ -44,10 +44,7 @@ import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache;
import com.epmet.commons.tools.redis.common.bean.*;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.IcPlatformConstant;
@ -697,6 +694,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
log.error("同步党员信息失败");
}
}
CustomerResiUserRedis.delIcResiUserInfo(resiUserId);
return resiUserId;
}
@ -3540,4 +3538,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
});
}
@Override
public IcResiUserInfoCache getIcResiUserInfo(String userId) {
IcResiUserEntity icResiUserEntity = baseDao.selectById(userId);
return ConvertUtils.sourceToTarget(icResiUserEntity,IcResiUserInfoCache.class);
}
}

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx

Binary file not shown.

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`,

34
epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml

@ -164,7 +164,7 @@
WHERE del_flag = '0'
AND USER_ID = #{l.userId}
AND ID_CARD = #{l.idCard}
AND UNIX_TIMESTAMP(NAT_TIME) = UNIX_TIMESTAMP(#{l.natTime})
AND UNIX_TIMESTAMP(SAMPLE_TIME) = UNIX_TIMESTAMP(#{l.sampleTime})
</foreach>
</select>
@ -189,4 +189,36 @@
m.ID_CARD = t.ID_CARD
AND m.DEL_FLAG = '0'
</update>
<update id="updateBatchNat">
UPDATE ic_nat
<trim prefix="set" suffixOverrides=",">
<trim prefix="NAT_TIME =(case" suffix="end),">
<foreach collection="list" item="l">
when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natTime}
</foreach>
</trim>
<trim prefix="NAT_ADDRESS =(case" suffix="end),">
<foreach collection="list" item="l">
when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natAddress}
</foreach>
</trim>
<trim prefix="NAT_RESULT =(case" suffix="end),">
<foreach collection="list" item="l">
when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natResult}
</foreach>
</trim>
<trim prefix="MOBILE =(case" suffix="end),">
<foreach collection="list" item="l">
when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.mobile}
</foreach>
</trim>
UPDATED_TIME = NOW()
</trim>
WHERE DEL_FLAG = '0'
<foreach collection="list" item="l" separator=",">
AND USER_ID = #{l.userId}
AND ID_CARD = #{l.idCard}
</foreach>
</update>
</mapper>

Loading…
Cancel
Save