Browse Source

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

master
wxz 2 years ago
parent
commit
cbd68244e7
  1. 7
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java
  2. 2
      epmet-admin/epmet-admin-server/Dockerfile
  3. 3
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java
  4. 7
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java
  5. 4
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java
  6. 13
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java
  7. 5
      epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml
  8. 2
      epmet-auth/Dockerfile
  9. 16
      epmet-auth/src/main/java/com/epmet/controller/LoginController.java
  10. 7
      epmet-auth/src/main/java/com/epmet/service/CaptchaService.java
  11. 2
      epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java
  12. 17
      epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java
  13. 9
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  14. 13
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  15. 5
      epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java
  16. 23
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  17. 2
      epmet-cloud-generator/src/main/resources/application.yml
  18. 2
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java
  19. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/CustomerIdConstant.java
  20. 27
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/PidUtils.java
  21. 2
      epmet-gateway/Dockerfile
  22. 2
      epmet-module/data-aggregator/data-aggregator-server/Dockerfile
  23. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  24. 2
      epmet-module/data-report/data-report-server/Dockerfile
  25. 2
      epmet-module/data-statistical/data-statistical-server/Dockerfile
  26. 2
      epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile
  27. 2
      epmet-module/epmet-common-service/common-service-server/Dockerfile
  28. 2
      epmet-module/epmet-ext/epmet-ext-server/Dockerfile
  29. 2
      epmet-module/epmet-heart/epmet-heart-server/Dockerfile
  30. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
  31. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  32. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  33. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml
  34. 2
      epmet-module/epmet-job/epmet-job-server/Dockerfile
  35. 2
      epmet-module/epmet-message/epmet-message-server/Dockerfile
  36. 2
      epmet-module/epmet-oss/epmet-oss-server/Dockerfile
  37. 2
      epmet-module/epmet-point/epmet-point-server/Dockerfile
  38. 2
      epmet-module/epmet-third/epmet-third-server/Dockerfile
  39. 2
      epmet-module/gov-access/gov-access-server/Dockerfile
  40. 2
      epmet-module/gov-grid/gov-grid-server/Dockerfile
  41. 2
      epmet-module/gov-issue/gov-issue-server/Dockerfile
  42. 2
      epmet-module/gov-mine/gov-mine-server/Dockerfile
  43. 11
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java
  44. 2
      epmet-module/gov-org/gov-org-server/Dockerfile
  45. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  46. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  47. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  48. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  49. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  50. 44
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCoverageCategoryDictDao.xml
  51. 2
      epmet-module/gov-project/gov-project-server/Dockerfile
  52. 4
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  53. 74
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/CategoryDictDTO.java
  54. 2
      epmet-module/gov-voice/gov-voice-server/Dockerfile
  55. 4
      epmet-module/gov-voice/gov-voice-server/pom.xml
  56. 72
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java
  57. 16
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/CategoryDictDao.java
  58. 44
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/CategoryDictEntity.java
  59. 88
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java
  60. 149
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java
  61. 21
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/CategoryDictDao.xml
  62. 2
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml
  63. 2
      epmet-module/open-data-worker/open-data-worker-server/Dockerfile
  64. 2
      epmet-module/oper-access/oper-access-server/Dockerfile
  65. 2
      epmet-module/oper-crm/oper-crm-server/Dockerfile
  66. 2
      epmet-module/oper-customize/oper-customize-server/Dockerfile
  67. 2
      epmet-module/resi-group/resi-group-server/Dockerfile
  68. 2
      epmet-module/resi-guide/resi-guide-server/Dockerfile
  69. 2
      epmet-module/resi-hall/resi-hall-server/Dockerfile
  70. 2
      epmet-module/resi-home/resi-home-server/Dockerfile
  71. 2
      epmet-module/resi-mine/resi-mine-server/Dockerfile
  72. 2
      epmet-module/resi-partymember/resi-partymember-server/Dockerfile
  73. 2
      epmet-module/resi-voice/resi-voice-server/Dockerfile
  74. 2
      epmet-openapi/epmet-openapi-scan/Dockerfile
  75. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java
  76. 2
      epmet-user/epmet-user-server/Dockerfile
  77. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java
  78. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDeathDao.java
  79. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java
  80. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  81. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java
  82. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java
  83. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java
  84. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java
  85. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  86. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java
  87. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java
  88. 43
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java
  89. 59
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java
  90. 195
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  91. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java
  92. 6
      epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDeathDao.xml
  93. 6
      epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml
  94. 28
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

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

@ -27,7 +27,12 @@ public class LogOperationListFormDTO {
*/ */
private String endTime; private String endTime;
/** /**
* 默认传data_tm * 产品原本前端默认传data_tm
* 03.01烟台需求列表展示全部
* 项目流转project_changed
* 登录auth
* 积分point
* 查看脱敏信息data_tm
*/ */
private String category; private String category;
} }

2
epmet-admin/epmet-admin-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

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

@ -41,8 +41,7 @@ public interface LogOperationDao extends BaseDao<LogOperationEntity> {
@Param("endTime")String endTime, @Param("endTime")String endTime,
@Param("operatorName")String operatorName, @Param("operatorName")String operatorName,
@Param("operatorMobile")String operatorMobile, @Param("operatorMobile")String operatorMobile,
@Param("category")String category, @Param("category")String category);
@Param("agencyId")String agencyId);
List<Map<String,String>> getStaffId(); List<Map<String,String>> getStaffId();

7
epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java

@ -1,6 +1,7 @@
package com.epmet.mq.listener.listener; package com.epmet.mq.listener.listener;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.auth.constants.AuthOperationEnum; import com.epmet.auth.constants.AuthOperationEnum;
import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.rocketmq.messages.LoginMQMsg;
@ -77,7 +78,11 @@ public class AuthOperationLogListener implements MessageListenerConcurrently {
logEntity.setOperatorName(operatorInfo.getName()); logEntity.setOperatorName(operatorInfo.getName());
logEntity.setOperatorMobile(operatorInfo.getMobile()); logEntity.setOperatorMobile(operatorInfo.getMobile());
logEntity.setOperatingTime(msgObj.getLoginTime()); logEntity.setOperatingTime(msgObj.getLoginTime());
logEntity.setContent("成功登录系统"); if(AuthOperationConstants.LOGIN.equals(logEntity.getType())){
logEntity.setContent("成功登录系统");
}else{
logEntity.setContent("成功退出系统");
}
DistributedLock distributedLock = null; DistributedLock distributedLock = null;
RLock lock = null; RLock lock = null;

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

@ -1,10 +1,8 @@
package com.epmet.mq.listener.listener; package com.epmet.mq.listener.listener;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.epmet.auth.constants.AuthOperationEnum;
import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.CheckMQMsg; import com.epmet.commons.rocketmq.messages.CheckMQMsg;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
@ -69,7 +67,7 @@ public class CheckAndExportOperationLogListener implements MessageListenerConcur
logEntity.setIp(msgObj.getIp()); logEntity.setIp(msgObj.getIp());
logEntity.setFromApp(msgObj.getFromApp()); logEntity.setFromApp(msgObj.getFromApp());
logEntity.setFromClient(msgObj.getFromClient()); logEntity.setFromClient(msgObj.getFromClient());
logEntity.setTargetId(""); logEntity.setTargetId(msgObj.getTargetId());
logEntity.setCustomerId(operatorInfo.getCustomerId()); logEntity.setCustomerId(operatorInfo.getCustomerId());
logEntity.setOperatorId(msgObj.getUserId()); logEntity.setOperatorId(msgObj.getUserId());
logEntity.setOperatorName(operatorInfo.getName()); logEntity.setOperatorName(operatorInfo.getName());

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

@ -8,7 +8,6 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; 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.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
@ -202,15 +201,15 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
@Override @Override
public PageData<LogOperationResultDTO> page(String customerId, String startTime, String endTime, String operatorName, String operatorMobile, public PageData<LogOperationResultDTO> page(String customerId, String startTime, String endTime, String operatorName, String operatorMobile,
Integer pageNo, Integer pageSize, String category, TokenDto tokenDto) { Integer pageNo, Integer pageSize, String category, TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); // CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){ // if (null == staffInfo){
throw new EpmetException("未查询工作人员信息:"+tokenDto.getUserId()); // throw new EpmetException("未查询工作人员信息:"+tokenDto.getUserId());
} // }
// 列表/导出查询 // 列表/导出查询
PageHelper.startPage(pageNo, pageSize); PageHelper.startPage(pageNo, pageSize);
List<LogOperationResultDTO> list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category,staffInfo.getAgencyId()); List<LogOperationResultDTO> list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category);
PageInfo<LogOperationResultDTO> pageInfo = new PageInfo<>(list); PageInfo<LogOperationResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal()); return new PageData<>(list, pageInfo.getTotal(),pageSize);
} }
/** /**

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

@ -64,7 +64,6 @@
WHERE WHERE
lo.del_flag = '0' lo.del_flag = '0'
AND lo.CUSTOMER_ID = #{customerId} AND lo.CUSTOMER_ID = #{customerId}
AND lo.ORG_ID_PATH LIKE concat('%',#{agencyId},'%')
<if test="category != null and category != ''"> <if test="category != null and category != ''">
AND lo.CATEGORY = #{category} AND lo.CATEGORY = #{category}
</if> </if>
@ -75,10 +74,10 @@
AND lo.OPERATOR_MOBILE LIKE concat('%',#{operatorMobile},'%') AND lo.OPERATOR_MOBILE LIKE concat('%',#{operatorMobile},'%')
</if> </if>
<if test="startTime != null and startTime != ''"> <if test="startTime != null and startTime != ''">
AND DATE_FORMAT( lo.OPERATING_TIME, '%Y%m%d' ) &gt;= #{startTime} AND DATE_FORMAT( lo.OPERATING_TIME, '%Y-%m-%d %H:%i' ) &gt;= #{startTime}
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
AND DATE_FORMAT( lo.OPERATING_TIME, '%Y%m%d' ) &lt;= #{endTime} AND DATE_FORMAT( lo.OPERATING_TIME, '%Y-%m-%d %H:%i' ) &lt;= #{endTime}
</if> </if>
ORDER BY lo.OPERATING_TIME DESC ORDER BY lo.OPERATING_TIME DESC
</select> </select>

2
epmet-auth/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

16
epmet-auth/src/main/java/com/epmet/controller/LoginController.java

@ -29,6 +29,8 @@ import java.io.IOException;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** /**
* @Description 通用登录接口 * @Description 通用登录接口
@ -73,6 +75,20 @@ public class LoginController {
} }
} }
/**
* 返回文字版的验证码
* 磐石大屏3.10号提出的需求
* @param uuid
* @throws IOException
*/
@PostMapping("captcha/{uuid}")
public Result captcha(@PathVariable(name = "uuid", required = true) String uuid) {
Map<String, String> map = new HashMap<>();
map.put("captcha", captchaService.getTextCaptcha(uuid));
return new Result().ok(map);
}
/** /**
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.lang.String> * @return com.epmet.commons.tools.utils.Result<java.lang.String>

7
epmet-auth/src/main/java/com/epmet/service/CaptchaService.java

@ -31,4 +31,11 @@ public interface CaptchaService {
*/ */
boolean validate(String uuid, String code); boolean validate(String uuid, String code);
/**
* 返回文字版的验证码
* 磐石大屏3.10号提出的需求
* @param uuid
* @return
*/
String getTextCaptcha(String uuid);
} }

2
epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java

@ -124,4 +124,6 @@ public interface ThirdLoginService {
* @return * @return
*/ */
UserTokenResultDTO yanTaiSSOLogin(String authCode); UserTokenResultDTO yanTaiSSOLogin(String authCode);
void sendLoginEvent(String userId, String appId, String fromApp, String fromClient,String messageType);
} }

17
epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java

@ -52,4 +52,21 @@ public class CaptchaServiceImpl implements CaptchaService {
//验证码是否正确 //验证码是否正确
return code.equalsIgnoreCase(captcha); return code.equalsIgnoreCase(captcha);
} }
/**
* 返回文字版的验证码
* 磐石大屏3.10号提出的需求
*
* @param uuid
* @return
*/
@Override
public String getTextCaptcha(String uuid) {
// 生成验证码 //producer.createText();
String captcha = StringRandomUtils.getRandomStr(NumConstant.FIVE);
// logger.info("uuid:"+uuid+",生成的验证码:"+captcha);
// 保存验证码
captchaRedis.set(uuid, captcha);
return captcha;
}
} }

9
epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java

@ -1,6 +1,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.common.token.constant.LoginConstant; import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
@ -11,10 +12,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
@ -31,6 +29,7 @@ import com.epmet.jwt.JwtTokenUtils;
import com.epmet.redis.CaptchaRedis; import com.epmet.redis.CaptchaRedis;
import com.epmet.service.GovLoginService; import com.epmet.service.GovLoginService;
import com.epmet.service.LoginService; import com.epmet.service.LoginService;
import com.epmet.service.ThirdLoginService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -326,6 +325,8 @@ public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver
throw new RenException("当前用户信息获取失败"); throw new RenException("当前用户信息获取失败");
} }
cpUserDetailRedis.logout(tokenDto.getApp() , tokenDto.getClient() , tokenDto.getUserId()); cpUserDetailRedis.logout(tokenDto.getApp() , tokenDto.getClient() , tokenDto.getUserId());
SpringContextUtils.getBean(ThirdLoginService.class).sendLoginEvent(tokenDto.getUserId(), "小程序内退出登录",
tokenDto.getApp(), tokenDto.getClient(), AuthOperationConstants.LOGOUT);
} }
@Override @Override

13
epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java

@ -1,7 +1,9 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO;
import com.epmet.common.token.constant.LoginConstant; import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -14,6 +16,7 @@ import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.form.GovWebLoginFormDTO;
import com.epmet.dto.form.GovWebOperLoginFormDTO; import com.epmet.dto.form.GovWebOperLoginFormDTO;
import com.epmet.dto.result.GovWebOperLoginResultDTO; import com.epmet.dto.result.GovWebOperLoginResultDTO;
@ -23,6 +26,7 @@ import com.epmet.jwt.JwtTokenProperties;
import com.epmet.jwt.JwtTokenUtils; import com.epmet.jwt.JwtTokenUtils;
import com.epmet.service.CaptchaService; import com.epmet.service.CaptchaService;
import com.epmet.service.GovWebService; import com.epmet.service.GovWebService;
import com.epmet.service.ThirdLoginService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -103,6 +107,15 @@ public class GovWebServiceImpl implements GovWebService, ResultDataResolver {
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO();
userTokenResultDTO.setCustomerId(formDTO.getCustomerId()); userTokenResultDTO.setCustomerId(formDTO.getCustomerId());
userTokenResultDTO.setToken(this.packagingUserToken(formDTO, resultDTO.getUserId())); userTokenResultDTO.setToken(this.packagingUserToken(formDTO, resultDTO.getUserId()));
// 6.发送登录事件
try {
SpringContextUtils.getBean(ThirdLoginService.class).sendLoginEvent(resultDTO.getUserId(), "数字社区登录",
AppClientConstant.APP_GOV,
AppClientConstant.CLIENT_WEB,
AuthOperationConstants.LOGIN);
} catch (Exception e) {
log.error("【数字社区web端登录】发送登录事件失败,程序继续执行。错误信息");
}
return userTokenResultDTO; return userTokenResultDTO;
} }

5
epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

@ -5,6 +5,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.common.token.constant.LoginConstant; import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -15,6 +16,7 @@ import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.UserDTO; import com.epmet.dto.UserDTO;
import com.epmet.dto.UserWechatDTO; import com.epmet.dto.UserWechatDTO;
@ -28,6 +30,7 @@ import com.epmet.jwt.JwtTokenUtils;
import com.epmet.redis.CustomerAppWxServiceUtil; import com.epmet.redis.CustomerAppWxServiceUtil;
import com.epmet.service.CaptchaService; import com.epmet.service.CaptchaService;
import com.epmet.service.LoginService; import com.epmet.service.LoginService;
import com.epmet.service.ThirdLoginService;
import com.epmet.utils.WxMaServiceUtils; import com.epmet.utils.WxMaServiceUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxErrorException;
@ -372,6 +375,8 @@ public class LoginServiceImpl implements LoginService {
if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){ if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){
CustomerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(),tokenDto.getUserId()); CustomerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(),tokenDto.getUserId());
} }
SpringContextUtils.getBean(ThirdLoginService.class).sendLoginEvent(tokenDto.getUserId(), "数字社区退出登录",
tokenDto.getApp(), tokenDto.getClient(), AuthOperationConstants.LOGOUT);
return new Result(); return new Result();
} }

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

@ -24,7 +24,6 @@ import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache;
import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.api.yt.YantaiApi; import com.epmet.commons.tools.utils.api.yt.YantaiApi;
import com.epmet.commons.tools.utils.api.yt.YantaiSSOUser; import com.epmet.commons.tools.utils.api.yt.YantaiSSOUser;
@ -36,7 +35,9 @@ import com.epmet.dto.dingres.DingUserDetailDTO;
import com.epmet.dto.dingres.V2UserGetuserinfoResDTO; import com.epmet.dto.dingres.V2UserGetuserinfoResDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.feign.*; import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenProperties;
import com.epmet.jwt.JwtTokenUtils; import com.epmet.jwt.JwtTokenUtils;
import com.epmet.redis.CaptchaRedis; import com.epmet.redis.CaptchaRedis;
@ -87,17 +88,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
@Autowired @Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient; private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Autowired @Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private DingTalkClientToken dingTalkClientToken; private DingTalkClientToken dingTalkClientToken;
@Autowired @Autowired
private DingTalkClientUser dingTalkClientUser; private DingTalkClientUser dingTalkClientUser;
@Autowired @Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private GovWebService govWebService; private GovWebService govWebService;
@Autowired
private ThirdOpenFeignClient thirdOpenFeignClient;
/** /**
* @param formDTO * @param formDTO
@ -224,7 +219,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
//7.发送登录事件 //7.发送登录事件
try { try {
sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, AuthOperationConstants.LOGIN);
} catch (RenException e) { } catch (RenException e) {
log.error(e.getInternalMsg()); log.error(e.getInternalMsg());
} catch (Exception e) { } catch (Exception e) {
@ -455,7 +450,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
//6.发送登录事件 //6.发送登录事件
try { try {
sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, AuthOperationConstants.LOGIN);
} catch (RenException e) { } catch (RenException e) {
log.error(e.getInternalMsg()); log.error(e.getInternalMsg());
} catch (Exception e) { } catch (Exception e) {
@ -517,7 +512,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
//6.发送登录事件 //6.发送登录事件
try { try {
sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, AuthOperationConstants.LOGIN);
} catch (RenException e) { } catch (RenException e) {
log.error(e.getInternalMsg()); log.error(e.getInternalMsg());
} catch (Exception e) { } catch (Exception e) {
@ -842,7 +837,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
* @author wxz * @author wxz
* @date 2021.06.08 15:27 * @date 2021.06.08 15:27
*/ */
private void sendLoginEvent(String userId, String appId, String fromApp, String fromClient) { @Override
public void sendLoginEvent(String userId, String appId, String fromApp, String fromClient,String messageType) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
LoginMQMsg loginMQMsg = new LoginMQMsg(); LoginMQMsg loginMQMsg = new LoginMQMsg();
@ -853,7 +849,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
loginMQMsg.setFromApp(fromApp); loginMQMsg.setFromApp(fromApp);
loginMQMsg.setFromClient(fromClient); loginMQMsg.setFromClient(fromClient);
SystemMsgFormDTO form = new SystemMsgFormDTO(); SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(AuthOperationConstants.LOGIN); // form.setMessageType(AuthOperationConstants.LOGIN);
form.setMessageType(messageType);
form.setContent(loginMQMsg); form.setContent(loginMQMsg);
messageOpenFeignClient.sendSystemMsgByMQ(form); messageOpenFeignClient.sendSystemMsgByMQ(form);
//getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败"); //getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败");

2
epmet-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置 #MySQL配置
driverClassName: com.mysql.jdbc.Driver driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://118.190.150.119:43306/epmet_gov_org?useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://192.168.1.140:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: root password: root
#oracle配置 #oracle配置

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

@ -29,5 +29,5 @@ public class CheckMQMsg {
private String fromClient; private String fromClient;
private String orgId; private String orgId;
private String orgIdPath; private String orgIdPath;
private String targetId;
} }

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/CustomerIdConstant.java

@ -12,4 +12,14 @@ public interface CustomerIdConstant {
* 市北生产-客户ID * 市北生产-客户ID
*/ */
String SHI_BEI_CUSTOMER_ID = "b09527201c4409e19d1dbc5e3c3429a1"; String SHI_BEI_CUSTOMER_ID = "b09527201c4409e19d1dbc5e3c3429a1";
/**
* 烟台生产客户id
*/
String YT_CUSTOMER_ID = "1535072605621841922";
/**
* 市北智慧社区,2月份去社区学习新开立的一个客户
*/
String SHIBEI_YANSHI="1623486671774978060";
} }

27
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/PidUtils.java

@ -0,0 +1,27 @@
package com.epmet.commons.tools.utils;
import org.apache.commons.lang3.StringUtils;
/**
* pid用到的工具
*/
public class PidUtils {
/**
* 将orgId和pids组合传话为orgIdPath(包含自己)
* @param orgId
* @param pids
* @return
*/
public static String convertPid2OrgIdPath(String orgId,String pids) {
StringBuilder orgIdPath = new StringBuilder();
if (StringUtils.isBlank(pids) || pids.equals("0")) {
orgIdPath.append(orgId);
} else {
orgIdPath.append(pids).append(":").append(orgId);
}
return orgIdPath.toString();
}
}

2
epmet-gateway/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/data-aggregator/data-aggregator-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

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

@ -1023,6 +1023,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
result.setMobile(houseInfo.getOwnerPhone()); result.setMobile(houseInfo.getOwnerPhone());
result.setIdCard(houseInfo.getOwnerIdCard()); result.setIdCard(houseInfo.getOwnerIdCard());
msg.setContent("查看"+houseInfo.getAllName()+"房屋的敏感信息"); msg.setContent("查看"+houseInfo.getAllName()+"房屋的敏感信息");
msg.setTargetId(formDTO.getId());
}else if (formDTO.getType().equals(NeighborhoodConstant.CHECK_IC_RESI_USER)){ }else if (formDTO.getType().equals(NeighborhoodConstant.CHECK_IC_RESI_USER)){
IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId());
if (null == icResiUserInfo){ if (null == icResiUserInfo){
@ -1031,14 +1032,16 @@ public class EpmetUserServiceImpl implements EpmetUserService {
result.setIdCard(icResiUserInfo.getIdCard()); result.setIdCard(icResiUserInfo.getIdCard());
result.setMobile(icResiUserInfo.getMobile()); result.setMobile(icResiUserInfo.getMobile());
msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息"); msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息");
msg.setTargetId(formDTO.getId());
}else if (formDTO.getType().equals(NeighborhoodConstant.JMFYXX)){ }else if (formDTO.getType().equals(NeighborhoodConstant.JMFYXX)){
IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId());
if (null == icResiUserInfo){ if (null == icResiUserInfo){
throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); throw new EpmetException("居民防疫信息查询icResiUser失败:"+formDTO.getId());
} }
result.setIdCard(icResiUserInfo.getIdCard()); result.setIdCard(icResiUserInfo.getIdCard());
result.setMobile(icResiUserInfo.getMobile()); result.setMobile(icResiUserInfo.getMobile());
msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息(居民防疫信息)"); msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息(居民防疫信息)");
msg.setTargetId(formDTO.getId());
}else if (formDTO.getType().equals(NeighborhoodConstant.ROUTE_FOLLOW)){ }else if (formDTO.getType().equals(NeighborhoodConstant.ROUTE_FOLLOW)){
Map<String, String> info = icResiUserDao.getTripReportRecordInfo(formDTO.getId()); Map<String, String> info = icResiUserDao.getTripReportRecordInfo(formDTO.getId());
if (null == info){ if (null == info){
@ -1047,6 +1050,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); result.setIdCard(info.get(NeighborhoodConstant.ID_CARD));
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); result.setMobile(info.get(NeighborhoodConstant.MOBILE));
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(行程随访)"); msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(行程随访)");
msg.setTargetId(formDTO.getId());
}else if (formDTO.getType().equals(NeighborhoodConstant.VACCINATION_RECORD)){ }else if (formDTO.getType().equals(NeighborhoodConstant.VACCINATION_RECORD)){
Map<String, String> info = icResiUserDao.getVaccineRecordInfo(formDTO.getId()); Map<String, String> info = icResiUserDao.getVaccineRecordInfo(formDTO.getId());
if (null == info){ if (null == info){
@ -1055,6 +1059,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); result.setIdCard(info.get(NeighborhoodConstant.ID_CARD));
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); result.setMobile(info.get(NeighborhoodConstant.MOBILE));
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(疫苗接种记录)"); msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(疫苗接种记录)");
msg.setTargetId(formDTO.getId());
}else if (formDTO.getType().equals(NeighborhoodConstant.VACCINE_SPECIAL_ATTENTION) }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_QUARANTINE)
|| formDTO.getType().equals(NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY)){ || formDTO.getType().equals(NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY)){
@ -1078,7 +1083,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
default: default:
} }
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息("+cMsg+")"); msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息("+cMsg+")");
msg.setTargetId(formDTO.getId());
}else if (formDTO.getType().equals(NeighborhoodConstant.NO_NAT_COMPARE)){ }else if (formDTO.getType().equals(NeighborhoodConstant.NO_NAT_COMPARE)){
Map<String, String> info = icResiUserDao.getNoNatCompareInfo(formDTO.getId()); Map<String, String> info = icResiUserDao.getNoNatCompareInfo(formDTO.getId());
if (null == info){ if (null == info){
@ -1087,6 +1092,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); result.setIdCard(info.get(NeighborhoodConstant.ID_CARD));
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); result.setMobile(info.get(NeighborhoodConstant.MOBILE));
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(未做核酸比对)"); msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(未做核酸比对)");
msg.setTargetId(formDTO.getId());
}else if (formDTO.getType().equals(NeighborhoodConstant.NAT_RECORD)){ }else if (formDTO.getType().equals(NeighborhoodConstant.NAT_RECORD)){
Map<String, String> info = icResiUserDao.getNatInfo(formDTO.getId()); Map<String, String> info = icResiUserDao.getNatInfo(formDTO.getId());
if (null == info){ if (null == info){
@ -1095,6 +1101,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); result.setIdCard(info.get(NeighborhoodConstant.ID_CARD));
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); result.setMobile(info.get(NeighborhoodConstant.MOBILE));
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(核酸检测信息)"); msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(核酸检测信息)");
msg.setTargetId(formDTO.getId());
}else if (formDTO.getType().equals(NeighborhoodConstant.EMPLOYEE_EPIDEMIC_MANAGE_DETAIL)){ }else if (formDTO.getType().equals(NeighborhoodConstant.EMPLOYEE_EPIDEMIC_MANAGE_DETAIL)){
Map<String, String> info = govOrgService.getEmployeeRegisterMobileAndIdCard(formDTO.getId()); Map<String, String> info = govOrgService.getEmployeeRegisterMobileAndIdCard(formDTO.getId());
if (null == info){ if (null == info){
@ -1103,6 +1110,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); result.setIdCard(info.get(NeighborhoodConstant.ID_CARD));
result.setMobile(info.get(NeighborhoodConstant.MOBILE)); result.setMobile(info.get(NeighborhoodConstant.MOBILE));
msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(员工登记信息)"); msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(员工登记信息)");
msg.setTargetId(formDTO.getId());
} }
// 发送mq消息 // 发送mq消息
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();

2
epmet-module/data-report/data-report-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/data-statistical/data-statistical-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-common-service/common-service-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-ext/epmet-ext-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-heart/epmet-heart-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java

@ -88,7 +88,7 @@ public class IcPartyActivityController implements ResultDataResolver {
*/ */
@PostMapping("search") @PostMapping("search")
public Result<PageData<IcPartyActivityDTO>> page(@LoginUser TokenDto tokenDto,@RequestBody PartyActivityFormDTO formDTO){ public Result<PageData<IcPartyActivityDTO>> page(@LoginUser TokenDto tokenDto,@RequestBody PartyActivityFormDTO formDTO){
formDTO.setCustomerId(formDTO.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
PageData<IcPartyActivityDTO> page = icPartyActivityService.search(formDTO); PageData<IcPartyActivityDTO> page = icPartyActivityService.search(formDTO);
return new Result<PageData<IcPartyActivityDTO>>().ok(page); return new Result<PageData<IcPartyActivityDTO>>().ok(page);
} }

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.ActConstant; import com.epmet.constant.ActConstant;
import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActInfoDao;
import com.epmet.dao.ActUserRelationDao; import com.epmet.dao.ActUserRelationDao;
@ -66,16 +67,13 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
private Logger logger = LogManager.getLogger(ActInfoServiceImpl.class); private Logger logger = LogManager.getLogger(ActInfoServiceImpl.class);
@Autowired
private ActUserRelationService relationService;
@Autowired @Autowired
private ActUserRelationDao actUserRelationDao; private ActUserRelationDao actUserRelationDao;
@Autowired @Autowired
private HeartUserInfoDao heartUserInfoDao; private HeartUserInfoDao heartUserInfoDao;
@Resource // @Resource
private IcPartyUnitService icPartyUnitService; // private IcPartyUnitService icPartyUnitService;
@Resource @Resource
private IcServiceItemDictService icServiceItemDictService; private IcServiceItemDictService icServiceItemDictService;
@Resource @Resource
@ -276,7 +274,7 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
//获取联建单位 //获取联建单位
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(dto.getAgencyId()); unitDTO.setAgencyId(dto.getAgencyId());
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> option = SpringContextUtils.getBean(IcPartyUnitService.class).option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId()); List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId());
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
detailResultDTO.setUnitIdList(unitIds); detailResultDTO.setUnitIdList(unitIds);

19
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -44,6 +44,7 @@ import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.FileUtils; import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.UserDemandConstant; import com.epmet.constant.UserDemandConstant;
import com.epmet.constants.ImportTaskConstants; import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPartyUnitDao; import com.epmet.dao.IcPartyUnitDao;
@ -99,16 +100,16 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Resource @Resource
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Resource // @Resource
private IcUserDemandRecService icUserDemandRecService; // private IcUserDemandRecService icUserDemandRecService;
@Resource @Resource
private IcServiceItemDictService icServiceItemDictService; private IcServiceItemDictService icServiceItemDictService;
@Resource @Resource
private OssFeignClient ossFeignClient; private OssFeignClient ossFeignClient;
@Resource @Resource
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Resource // @Resource
private EpmetHeartOpenFeignClient heartOpenFeignClient; // private EpmetHeartOpenFeignClient heartOpenFeignClient;
@Resource @Resource
private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService; private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService;
@Resource @Resource
@ -140,7 +141,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取单位积分 //获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); Map<String, Integer> pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> { dtoList.forEach(item -> {
item.setTypeName(unitTypeMap.getData().get(item.getType())); item.setTypeName(unitTypeMap.getData().get(item.getType()));
//这是错误的,应该是赋值type,遗留bug, 先不改了.... //这是错误的,应该是赋值type,遗留bug, 先不改了....
@ -180,7 +181,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取单位积分 //获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); Map<String, Integer> pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> { dtoList.forEach(item -> {
item.setTypeName(unitTypeMap.getData().get(item.getType())); item.setTypeName(unitTypeMap.getData().get(item.getType()));
//这是错误的,应该是赋值type,遗留bug, 先不改了.... //这是错误的,应该是赋值type,遗留bug, 先不改了....
@ -211,7 +212,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
IcPartyUnitDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyUnitDTO.class); IcPartyUnitDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyUnitDTO.class);
if (StringUtils.isNotBlank(dto.getServiceMatter())) { if (StringUtils.isNotBlank(dto.getServiceMatter())) {
//获取单位积分 //获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT); Map<String, Integer> pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)));
dto.setScore(null == pointMap.get(id) ? NumConstant.ZERO : pointMap.get(id)); dto.setScore(null == pointMap.get(id) ? NumConstant.ZERO : pointMap.get(id));
// 分类名称 // 分类名称
@ -271,7 +272,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void delete(String id) { public void delete(String id) {
//存在未完成的需求,不能删除 //存在未完成的需求,不能删除
if (icUserDemandRecService.selectCountByServerId(id) > NumConstant.ZERO) { if (SpringContextUtils.getBean(IcUserDemandRecService.class).selectCountByServerId(id) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除");
} }
//校验是否有同步到通讯录,是否存在工作人员下有未处理项目数据【联建单位被同步到通讯录部门的,如果部门下人员存在未办结项目则不允许删除】 //校验是否有同步到通讯录,是否存在工作人员下有未处理项目数据【联建单位被同步到通讯录部门的,如果部门下人员存在未办结项目则不允许删除】
@ -438,7 +439,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Override @Override
public void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO) { public void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO) {
log.info("收到消息内容啦...." + JSON.toJSONString(formDTO)); log.info("收到消息内容啦...." + JSON.toJSONString(formDTO));
List<ServiceStatDTO> list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType()); List<ServiceStatDTO> list = SpringContextUtils.getBean(IcUserDemandRecService.class).groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType());
for (ServiceStatDTO serviceStatDTO : list) { for (ServiceStatDTO serviceStatDTO : list) {
if (0 != serviceStatDTO.getDemandCount()) { if (0 != serviceStatDTO.getDemandCount()) {
BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP);

2
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml

@ -52,7 +52,7 @@
a.ACT_ID, a.ACT_ID,
a.GRID_ID, a.GRID_ID,
ur.UNIT_ID, ur.UNIT_ID,
GROUP_CONCAT( sr.SERVICE_MATTER ) AS serviceMatter, GROUP_CONCAT( distinct sr.SERVICE_MATTER ) AS serviceMatter,
a.TITLE, a.TITLE,
a.TARGET, a.TARGET,
a.CONTENT, a.CONTENT,

2
epmet-module/epmet-job/epmet-job-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-message/epmet-message-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-oss/epmet-oss-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-point/epmet-point-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/epmet-third/epmet-third-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/gov-access/gov-access-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/gov-grid/gov-grid-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/gov-issue/gov-issue-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/gov-mine/gov-mine-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

11
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java

@ -21,6 +21,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
@ -54,6 +55,11 @@ public class IcNeighborHoodDTO implements Serializable {
*/ */
private String agencyId; private String agencyId;
/**
* agencyId列表
*/
private List<String> agencyIds;
/** /**
* 上级组织id * 上级组织id
*/ */
@ -69,6 +75,11 @@ public class IcNeighborHoodDTO implements Serializable {
*/ */
private String gridId; private String gridId;
/**
* gridId列表
*/
private List<String> gridIds;
/** /**
* 网格 * 网格
*/ */

2
epmet-module/gov-org/gov-org-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java

@ -141,7 +141,7 @@ public class IcNeighborHoodController {
} }
/** /**
* @Description 获取网格下小区列表 * @Description 获取组织/网格下小区列表支持单选和多选
* @Param dto * @Param dto
* @Return {@link Result< List< OptionResultDTO>>} * @Return {@link Result< List< OptionResultDTO>>}
* @Author zhaoqifeng * @Author zhaoqifeng
@ -149,7 +149,13 @@ public class IcNeighborHoodController {
*/ */
@PostMapping("neighborhoodoption") @PostMapping("neighborhoodoption")
public Result<List<OptionResultDTO>> getNeighborHoodOptions(@LoginUser TokenDto tokenDto, @RequestBody IcNeighborHoodDTO dto) { public Result<List<OptionResultDTO>> getNeighborHoodOptions(@LoginUser TokenDto tokenDto, @RequestBody IcNeighborHoodDTO dto) {
return new Result<List<OptionResultDTO>>().ok(icNeighborHoodService.getNeighborHoodOptions(dto.getAgencyId(), dto.getGridId(),tokenDto.getUserId(),tokenDto.getCustomerId())); return new Result<List<OptionResultDTO>>().ok(icNeighborHoodService.getNeighborHoodOptions(
dto.getAgencyId(),
dto.getGridId(),
dto.getAgencyIds(),
dto.getGridIds(),
tokenDto.getUserId(),
tokenDto.getCustomerId()));
} }
/** /**

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java

@ -117,7 +117,8 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @Author zhaoqifeng * @Author zhaoqifeng
* @Date 2021/10/26 14:32 * @Date 2021/10/26 14:32
*/ */
List<OptionResultDTO> getNeighborHoodOptions(String agencyId, String gridId,String staffId,String customerId); List<OptionResultDTO> getNeighborHoodOptions(String agencyId, String gridId, List<String> agencyIds, List<String> gridIds,
String staffId,String customerId);
/** /**
* 获取用户组织下小区列表 * 获取用户组织下小区列表

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -7,6 +7,7 @@ import com.alibaba.excel.read.metadata.ReadSheet;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.constant.CustomerIdConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -1156,7 +1157,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到房屋信息", "未查到房屋信息"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到房屋信息", "未查到房屋信息");
} }
// 市北区-智慧社区: 1623486671774978060 23.2月为了方便社区的同事们演示系统,新建的一个客户id // 市北区-智慧社区: 1623486671774978060 23.2月为了方便社区的同事们演示系统,新建的一个客户id
if("1623486671774978060".equals(house.getCustomerId())){ if (CustomerIdConstant.SHIBEI_YANSHI.equals(house.getCustomerId()) || CustomerIdConstant.YT_CUSTOMER_ID.equals(house.getCustomerId())) {
return StrConstant.EPMETY_STR; return StrConstant.EPMETY_STR;
} }
//url组成:小程序地址?房屋编码 //url组成:小程序地址?房屋编码

28
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -185,22 +185,34 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
* @Date 2021/10/26 14:32 * @Date 2021/10/26 14:32
*/ */
@Override @Override
public List<OptionResultDTO> getNeighborHoodOptions(String agencyId, String gridId,String staffId,String customerId) { public List<OptionResultDTO> getNeighborHoodOptions(String agencyId, String gridId,
if (StringUtils.isBlank(agencyId)&&StringUtils.isEmpty(gridId)) { List<String> agencyIds, List<String> gridIds,
log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区"); String staffId,String customerId) {
CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(customerId,staffId); if (StringUtils.isBlank(agencyId)
&& StringUtils.isEmpty(gridId)
&& CollectionUtils.isEmpty(agencyIds)
&& CollectionUtils.isEmpty(gridIds)) {
log.info("agencyId(s)与gridId(s)都为空时,默认查询当前工作人员所属组织下的小区");
CustomerStaffInfoCacheResult result = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if (null == result || StringUtils.isBlank(result.getAgencyId())) { if (null == result || StringUtils.isBlank(result.getAgencyId())) {
log.error(String.format("staffId:%s,工作人员缓存信息查询异常", staffId)); log.error(String.format("staffId:%s,工作人员缓存信息查询异常", staffId));
return Collections.emptyList(); return Collections.emptyList();
} }
agencyId=result.getAgencyId(); agencyId = result.getAgencyId();
} }
// 此处支持多种条件,or连接
LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(agencyId),IcNeighborHoodEntity::getAgencyId, agencyId); wrapper.eq(StringUtils.isNotBlank(agencyId), IcNeighborHoodEntity::getAgencyId, agencyId)
wrapper.eq(StringUtils.isNotBlank(gridId), IcNeighborHoodEntity::getGridId, gridId); .or()
.eq(StringUtils.isNotBlank(gridId), IcNeighborHoodEntity::getGridId, gridId)
.or()
.in(!CollectionUtils.isEmpty(agencyIds), IcNeighborHoodEntity::getAgencyId, agencyIds)
.or()
.in(!CollectionUtils.isEmpty(gridIds), IcNeighborHoodEntity::getGridId, gridIds);
wrapper.last("ORDER BY CONVERT ( NEIGHBOR_HOOD_NAME USING gbk ) ASC"); wrapper.last("ORDER BY CONVERT ( NEIGHBOR_HOOD_NAME USING gbk ) ASC");
List<IcNeighborHoodEntity> list = baseDao.selectList(wrapper); List<IcNeighborHoodEntity> list = baseDao.selectList(wrapper);
if(CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return list.stream().map(item -> { return list.stream().map(item -> {

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.CustomerIdConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.CollectUrlEnum; import com.epmet.commons.tools.enums.CollectUrlEnum;
@ -147,7 +148,7 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
*/ */
private String createNeiQrcodeUrl(IcNeighborHoodEntity entity) throws Exception { private String createNeiQrcodeUrl(IcNeighborHoodEntity entity) throws Exception {
// 市北区-智慧社区: 1623486671774978060 23.2月为了方便社区的同事们演示系统,新建的一个客户id // 市北区-智慧社区: 1623486671774978060 23.2月为了方便社区的同事们演示系统,新建的一个客户id
if ("1623486671774978060".equals(entity.getCustomerId())) { if (CustomerIdConstant.SHIBEI_YANSHI.equals(entity.getCustomerId())||CustomerIdConstant.YT_CUSTOMER_ID.equals(entity.getCustomerId())) {
return StrConstant.EPMETY_STR; return StrConstant.EPMETY_STR;
} }
if (null == entity) { if (null == entity) {
@ -349,7 +350,7 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
@Override @Override
public Result createBatchNeiQrUrl(String customerId) { public Result createBatchNeiQrUrl(String customerId) {
// 市北区-智慧社区: 1623486671774978060 23.2月为了方便社区的同事们演示系统,新建的一个客户id // 市北区-智慧社区: 1623486671774978060 23.2月为了方便社区的同事们演示系统,新建的一个客户id
if ("1623486671774978060".equals(customerId)) { if (CustomerIdConstant.SHIBEI_YANSHI.equals(customerId) || CustomerIdConstant.YT_CUSTOMER_ID.equals(customerId)) {
return new Result(); return new Result();
} }
//查询该客户下没有二维码的小区 //查询该客户下没有二维码的小区

44
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCoverageCategoryDictDao.xml

@ -7,11 +7,14 @@
INSERT INTO ic_coverage_category_dict ( INSERT INTO ic_coverage_category_dict (
id, id,
customer_id, customer_id,
category_key, CATEGORY_KEY,
category_name, CATEGORY_NAME,
place_type, PLACE_TYPE,
coverage_type, PLACE_TYPE_IN_ANALYSIS,
sort, MENU_URL,
DATA_TYPE,
COVERAGE_TYPE,
SORT,
del_flag, del_flag,
revision, revision,
created_by, created_by,
@ -19,24 +22,27 @@
updated_by, updated_by,
updated_time updated_time
) SELECT ) SELECT
MD5(UUID()), MD5(UUID()),
#{customerId}, #{customerId},
category_key, CATEGORY_KEY,
category_name, CATEGORY_NAME,
place_type, PLACE_TYPE,
coverage_type, PLACE_TYPE_IN_ANALYSIS,
sort, MENU_URL,
del_flag, DATA_TYPE,
revision, COVERAGE_TYPE,
'APP_USER', SORT,
NOW(), del_flag,
'APP_USER', revision,
NOW() 'APP_USER',
NOW(),
'APP_USER',
NOW()
FROM FROM
ic_coverage_category_dict ic_coverage_category_dict
WHERE WHERE
del_flag = '0' del_flag = '0'
AND customer_id = 'default' AND customer_id = 'default'
</insert> </insert>
<select id="dictMap" resultType="com.epmet.dto.result.IcCoverageCategoryDictListResultDTO"> <select id="dictMap" resultType="com.epmet.dto.result.IcCoverageCategoryDictListResultDTO">

2
epmet-module/gov-project/gov-project-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

4
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -28,6 +28,7 @@
<if test="orgType == 'grid'"> <if test="orgType == 'grid'">
and e.GRID_ID=#{orgId} and e.GRID_ID=#{orgId}
</if> </if>
and e.DEL_FLAG = '0'
and CUSTOMER_ID = #{customerId} and CUSTOMER_ID = #{customerId}
and HAPPEN_TIME >= #{queryStartTime} and HAPPEN_TIME >= #{queryStartTime}
and HAPPEN_TIME <![CDATA[<=]]> #{queryEndTime} and HAPPEN_TIME <![CDATA[<=]]> #{queryEndTime}
@ -81,7 +82,8 @@
select date_format(e.HAPPEN_TIME, '%Y-%m') monthName select date_format(e.HAPPEN_TIME, '%Y-%m') monthName
from ic_event e from ic_event e
<where> <where>
e.HAPPEN_TIME >= date_format(#{queryStartTime}, '%Y-%m') e.DEL_FLAG = '0'
and e.HAPPEN_TIME >= date_format(#{queryStartTime}, '%Y-%m')
and e.HAPPEN_TIME <![CDATA[ <= ]]> date_format(#{queryEndTime}, '%Y-%m') and e.HAPPEN_TIME <![CDATA[ <= ]]> date_format(#{queryEndTime}, '%Y-%m')
<if test="orgType == 'grid'"> <if test="orgType == 'grid'">
and e.GRID_ID =#{orgId} and e.GRID_ID =#{orgId}

74
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/CategoryDictDTO.java

@ -0,0 +1,74 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@Data
public class CategoryDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 分类栏目名称
*/
private String categoryName;
/**
* 父栏目ID
*/
private String pid;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

2
epmet-module/gov-voice/gov-voice-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

4
epmet-module/gov-voice/gov-voice-server/pom.xml

@ -164,8 +164,8 @@
<spring.datasource.druid.url> <spring.datasource.druid.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_gov_voice?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> <![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_gov_voice?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url> </spring.datasource.druid.url>
<spring.datasource.druid.username>epmet</spring.datasource.druid.username> <spring.datasource.druid.username>root</spring.datasource.druid.username>
<spring.datasource.druid.password>EpmEt_lsjd@@</spring.datasource.druid.password> <spring.datasource.druid.password>root</spring.datasource.druid.password>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host> <spring.redis.host>192.168.1.140</spring.redis.host>

72
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java

@ -0,0 +1,72 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CategoryDictDTO;
import com.epmet.service.CategoryDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@RestController
@RequestMapping("categoryDict")
public class CategoryDictController {
@Autowired
private CategoryDictService categoryDictService;
@RequestMapping("list")
public Result<List<CategoryDictDTO>> list(@RequestParam Integer pageNo, @RequestParam Integer pageSize){
List<CategoryDictDTO> list = categoryDictService.list(pageNo, pageSize);
return new Result<List<CategoryDictDTO>>().ok(list);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<CategoryDictDTO> get(@PathVariable("id") String id){
CategoryDictDTO data = categoryDictService.get(id);
return new Result<CategoryDictDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody CategoryDictDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
categoryDictService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody CategoryDictDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
categoryDictService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
categoryDictService.delete(ids);
return new Result();
}
}

16
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/CategoryDictDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.CategoryDictEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@Mapper
public interface CategoryDictDao extends BaseDao<CategoryDictEntity> {
}

44
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/CategoryDictEntity.java

@ -0,0 +1,44 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("category_dict")
public class CategoryDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 分类栏目名称
*/
private String categoryName;
/**
* 父栏目ID
*/
private String pid;
/**
* 排序
*/
private Integer sort;
}

88
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java

@ -0,0 +1,88 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CategoryDictDTO;
import com.epmet.entity.CategoryDictEntity;
import java.util.List;
import java.util.Map;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
public interface CategoryDictService extends BaseService<CategoryDictEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CategoryDictDTO>
* @author generator
* @date 2023-04-11
*/
PageData<CategoryDictDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CategoryDictDTO>
* @author generator
* @date 2023-04-11
*/
List<CategoryDictDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return CategoryDictDTO
* @author generator
* @date 2023-04-11
*/
CategoryDictDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2023-04-11
*/
void save(CategoryDictDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2023-04-11
*/
void update(CategoryDictDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2023-04-11
*/
void delete(String[] ids);
/**
* @description: 列表
* @param pageNo:
* @param pageSize:
* @return java.util.List<com.epmet.dto.CategoryDictDTO>
* @author: WangXianZhang
* @date: 2023/4/11 7:06 PM
*/
List<CategoryDictDTO> list(Integer pageNo, Integer pageSize);
}

149
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java

@ -0,0 +1,149 @@
package com.epmet.service.impl;
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.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.distributedlock.DistributedLock;
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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.dao.CategoryDictDao;
import com.epmet.dto.CategoryDictDTO;
import com.epmet.entity.CategoryDictEntity;
import com.epmet.service.CategoryDictService;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 文章栏目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-04-11
*/
@Service
public class CategoryDictServiceImpl extends BaseServiceImpl<CategoryDictDao, CategoryDictEntity> implements CategoryDictService {
@Autowired
private DistributedLock distributedLock;
@Override
public PageData<CategoryDictDTO> page(Map<String, Object> params) {
IPage<CategoryDictEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CategoryDictDTO.class);
}
@Override
public List<CategoryDictDTO> list(Map<String, Object> params) {
List<CategoryDictEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CategoryDictDTO.class);
}
private QueryWrapper<CategoryDictEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CategoryDictEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public CategoryDictDTO get(String id) {
CategoryDictEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, CategoryDictDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(CategoryDictDTO dto) {
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
// 重名检查,客户下不能重名
LambdaQueryWrapper<CategoryDictEntity> query = new LambdaQueryWrapper<>();
query.eq(CategoryDictEntity::getCustomerId, customerId);
query.eq(CategoryDictEntity::getCategoryName, dto.getCategoryName());
// 加锁
RLock lock = distributedLock.getLock("voice:categorydict");
try {
if (baseDao.selectCount(query) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "栏目名称已存在");
}
dto.setCustomerId(customerId);
CategoryDictEntity entity = ConvertUtils.sourceToTarget(dto, CategoryDictEntity.class);
insert(entity);
} catch (EpmetException ee) {
throw ee;
} catch (Exception e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【文章】新增文章栏目失败:" + ExceptionUtils.getErrorStackTrace(e));
} finally {
// 解锁
lock.unlock();
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(CategoryDictDTO dto) {
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
// 重名检查,客户下不能重名
LambdaQueryWrapper<CategoryDictEntity> query = new LambdaQueryWrapper<>();
query.eq(CategoryDictEntity::getCustomerId, customerId);
query.eq(CategoryDictEntity::getCategoryName, dto.getCategoryName());
RLock lock = distributedLock.getLock("voice:categorydict");
try {
CategoryDictEntity inDb = null;
// 能查询到一条数据,并且该条数据的ID不是当前修改的这条数据的ID,说明已存在同名的其他标签,该名字已被其他标签占用
if ((inDb = baseDao.selectOne(query)) != null
&& !inDb.getId().equals(dto.getId())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "栏目名称已存在");
}
dto.setCustomerId(customerId);
CategoryDictEntity entity = ConvertUtils.sourceToTarget(dto, CategoryDictEntity.class);
updateById(entity);
} catch (EpmetException ee) {
throw ee;
} catch (Exception e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【文章】新增文章栏目失败:" + ExceptionUtils.getErrorStackTrace(e));
} finally {
// 解锁
lock.unlock();
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<CategoryDictDTO> list(Integer pageNo, Integer pageSize) {
List<CategoryDictEntity> list = baseDao.selectList(null);
return ConvertUtils.sourceToTarget(list, CategoryDictDTO.class);
}
}

21
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/CategoryDictDao.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.CategoryDictDao">
<resultMap type="com.epmet.entity.CategoryDictEntity" id="categoryDictMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="categoryName" column="CATEGORY_NAME"/>
<result property="pid" column="PID"/>
<result property="sort" column="SORT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

2
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml

@ -5,7 +5,7 @@
<insert id="upsertTagCount" parameterType="com.epmet.dto.form.UpdateTagFormDTO"> <insert id="upsertTagCount" parameterType="com.epmet.dto.form.UpdateTagFormDTO">
<selectKey keyProperty="id" order="AFTER" resultType="String"> <selectKey keyProperty="id" order="AFTER" resultType="String">
select id from tag_customer where tag_name = #{tagName} AND CUSTOMER_ID = #{customerId} select id from tag_customer where tag_name = #{tagName} AND CUSTOMER_ID = #{customerId} and del_flag='0'
</selectKey> </selectKey>
INSERT INTO tag_customer ( ID, CUSTOMER_ID, TAG_NAME, TAG_COLOR, USE_COUNT, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) INSERT INTO tag_customer ( ID, CUSTOMER_ID, TAG_NAME, TAG_COLOR, USE_COUNT, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES VALUES

2
epmet-module/open-data-worker/open-data-worker-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/oper-access/oper-access-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/oper-crm/oper-crm-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/oper-customize/oper-customize-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/resi-group/resi-group-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/resi-guide/resi-guide-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/resi-hall/resi-hall-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/resi-home/resi-home-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/resi-mine/resi-mine-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/resi-partymember/resi-partymember-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-module/resi-voice/resi-voice-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2
epmet-openapi/epmet-openapi-scan/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java

@ -21,6 +21,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
@ -37,8 +38,13 @@ public class StatsResiListFormDTO implements Serializable {
/** /**
* 组织id * 组织id
*/ */
@NotBlank(message = "id不能为空") // @NotBlank(message = "id不能为空")
private String id; private String id;
/**
* 目前只支持传入小区id
* levelneighborHood
*/
private List<String> idList;
@NotBlank(message = "level不能为空") @NotBlank(message = "level不能为空")
private String level; private String level;

2
epmet-user/epmet-user-server/Dockerfile

@ -1,4 +1,4 @@
FROM java:8 FROM openjdk:8-jre
RUN export LANG="zh_CN.UTF-8" RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

8
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java

@ -19,6 +19,8 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -34,6 +36,7 @@ import com.epmet.dto.result.IcUserWarnNoticeResultDTO;
import com.epmet.dto.result.UserWarnNameListResultDTO; import com.epmet.dto.result.UserWarnNameListResultDTO;
import com.epmet.service.IcStatsResiWarnService; import com.epmet.service.IcStatsResiWarnService;
import com.epmet.service.StatsResiWarnService; import com.epmet.service.StatsResiWarnService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -67,7 +70,10 @@ public class StatsResiWarnController {
public Result<List<IcStatsResiResultDTO>> list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){ public Result<List<IcStatsResiResultDTO>> list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
List<IcStatsResiResultDTO> icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel()); if (StringUtils.isBlank(formDTO.getId()) && CollectionUtils.isEmpty(formDTO.getIdList())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "id或者idList不能同时为空", "参数错误");
}
List<IcStatsResiResultDTO> icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel(),formDTO.getIdList());
return new Result<List<IcStatsResiResultDTO>>().ok(icStatsResiResultDTOList); return new Result<List<IcStatsResiResultDTO>>().ok(icStatsResiResultDTOList);
} }

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

@ -29,4 +29,6 @@ public interface DataSyncRecordDeathDao extends BaseDao<DataSyncRecordDeathEntit
@Param("idCard") String idCard, @Param("idCard") String idCard,
@Param("name") String name, @Param("name") String name,
@Param("agencyId") String agencyId); @Param("agencyId") String agencyId);
int deleteByIcResiUserId(String icResiUserId);
} }

7
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java

@ -36,4 +36,11 @@ public interface DataSyncRecordDisabilityDao extends BaseDao<DataSyncRecordDisab
* @date 2022/10/14 13:44 * @date 2022/10/14 13:44
*/ */
void batchUpdateDisability(List<DataSyncRecordDisabilityEntity> entities); void batchUpdateDisability(List<DataSyncRecordDisabilityEntity> entities);
/**
* 删除居民信息时同时删除data_sync_record_disability
* @param icResiUserId
* @return
*/
int deleteByIcResiUserId(String icResiUserId);
} }

20
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -19,7 +19,6 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiUserConfirmDTO; import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.IcVolunteerPolyDTO;
@ -67,8 +66,9 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("conditions") List<ResiUserQueryValueDTO> conditions, @Param("conditions") List<ResiUserQueryValueDTO> conditions,
@Param("resultColumns") List<IcFormResColumnDTO> resultColumns, @Param("resultColumns") List<IcFormResColumnDTO> resultColumns,
@Param("subTables") List<String> subTables, @Param("subTables") List<String> subTables,
@Param("currentStaffAgencyId") String currentStaffAgencyId, @Param("currentStaffAgencyId") List<String> currentStaffAgencyIds,
@Param("staffOrgPath") String staffOrgPath, @Param("staffOrgPaths") List<String> staffOrgPaths,
@Param("gridIds") Set<String> gridIds,
@Param("resultTableName") String resultTableName, @Param("resultTableName") String resultTableName,
@Param("keyword") String keyword, @Param("keyword") String keyword,
@Param("groupByTables") Set<String> groupByTables); @Param("groupByTables") Set<String> groupByTables);
@ -116,8 +116,10 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("resultTableName") String resultTableName, @Param("resultTableName") String resultTableName,
@Param("conditions") List<ResiUserQueryValueDTO> conditions, @Param("conditions") List<ResiUserQueryValueDTO> conditions,
@Param("subTables") List<String> subTables, @Param("subTables") List<String> subTables,
@Param("showSqlColumns") List<IcCustomExportResultDTO.SqlColumn> showSqlColumns, @Param("currentStaffAgencyId") String currentStaffAgencyId, @Param("showSqlColumns") List<IcCustomExportResultDTO.SqlColumn> showSqlColumns,
@Param("staffOrgPath") String staffOrgPath, @Param("currentStaffAgencyId") String currentStaffAgencyId,
@Param("staffOrgPaths") List<String> staffOrgPaths,
@Param("gridIds") List<String> gridIds,
@Param("groupByTables") List<String> groupByTables); @Param("groupByTables") List<String> groupByTables);
/** /**
@ -278,8 +280,12 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @author LiuJanJun * @author LiuJanJun
* @date 2022/2/12 3:03 下午 * @date 2022/2/12 3:03 下午
*/ */
Map<String, BigDecimal> getDataAnalyseCount(@Param("customerId") String customerId, @Param("tableName") String tableName, Map<String, BigDecimal> getDataAnalyseCount(@Param("customerId") String customerId,
@Param("columnList") List<String> columnList, @Param("id") String id, @Param("level") String level); @Param("tableName") String tableName,
@Param("columnList") List<String> columnList,
@Param("id") String id,
@Param("level") String level,
@Param("idList")List<String> idList);
List<Map<String, String>> getIcUserList(@Param("customerId") String customerId, @Param("columns") List<String> columns); List<Map<String, String>> getIcUserList(@Param("customerId") String customerId, @Param("columns") List<String> columns);

1
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java

@ -47,6 +47,7 @@ public class UserBadgeCertificateRecordEntity extends BaseEpmetEntity {
*/ */
private String gridId; private String gridId;
/** /**
* 用户ID * 用户ID
*/ */

2
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java

@ -16,7 +16,7 @@ import static com.epmet.constant.EpidemicConstant.JOB_TYPE_VACCINE;
* @Author zxc * @Author zxc
* @Date 2022/11/22 14:08 * @Date 2022/11/22 14:08
*/ */
@Component // @Component
@Slf4j @Slf4j
public class YanTaiTripReportSyncProcessor extends AbstractDataSyncJobProcessor { public class YanTaiTripReportSyncProcessor extends AbstractDataSyncJobProcessor {

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java

@ -67,4 +67,10 @@ public interface DataSyncRecordDeathService extends BaseService<DataSyncRecordDe
* @param ids 要操作的记录id * @param ids 要操作的记录id
*/ */
void batchUpdate(String userId, String customerId, List<String> ids); void batchUpdate(String userId, String customerId, List<String> ids);
/**
* 删除居民信息时同时删除data_sync_record_death
* @param icResiUserId
*/
void deleteByIcResiUserId(String icResiUserId);
} }

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java

@ -107,4 +107,10 @@ public interface DataSyncRecordDisabilityService extends BaseService<DataSyncRec
* @date 2022/10/13 16:18 * @date 2022/10/13 16:18
*/ */
void batchUpdate(String[] ids, TokenDto tokenDto); void batchUpdate(String[] ids, TokenDto tokenDto);
/**
* 删除居民信息时同时删除data_sync_record_disability
* @param icResiUserId
*/
void deleteByIcResiUserId(String icResiUserId);
} }

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

@ -290,7 +290,14 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
*/ */
List<HomeUserBriefResultDTO> listHomeUserBrief(String houseId, String customerId); List<HomeUserBriefResultDTO> listHomeUserBrief(String houseId, String customerId);
List<Map<String, Object>> dynamicQuery(String loginUserCustomerId, String formCode, String icResiUser, List<IcCustomExportResultDTO.SqlColumn> showSqlColumns, List<ResiUserQueryValueDTO> conditions, String agencyId, String finalStaffOrgPath); List<Map<String, Object>> dynamicQuery(String loginUserCustomerId,
String formCode,
String icResiUser,
List<IcCustomExportResultDTO.SqlColumn> showSqlColumns,
List<ResiUserQueryValueDTO> conditions,
String agencyId,
List<String> finalStaffOrgPath,
List<String> gridIds);
/** /**
* 租客房东黑名单查询个人数据 * 租客房东黑名单查询个人数据

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

@ -58,7 +58,7 @@ public interface StatsResiWarnService{
PageData<UserWarnNameListResultDTO> allUserWarnList(StatsResiWarnFormDTO formDTO); PageData<UserWarnNameListResultDTO> allUserWarnList(StatsResiWarnFormDTO formDTO);
List<IcStatsResiResultDTO> list(String customerId,String id, String level); List<IcStatsResiResultDTO> list(String customerId,String id, String level,List<String> idList);
List<IcStatsResiResultDTO> list2(StatsResiListFormDTO formDTO); List<IcStatsResiResultDTO> list2(StatsResiListFormDTO formDTO);

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java

@ -155,5 +155,13 @@ public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncReco
} }
} }
/**
* 删除居民信息时同时删除data_sync_record_death
*
* @param icResiUserId
*/
@Override
public void deleteByIcResiUserId(String icResiUserId) {
baseDao.deleteByIcResiUserId(icResiUserId);
}
} }

43
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; 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.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.GenderEnum; import com.epmet.commons.tools.enums.GenderEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -41,8 +42,10 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -97,17 +100,30 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl<DataSyn
@Override @Override
public DataSyncRecordDisabilityDTO get(String id) { public DataSyncRecordDisabilityDTO get(String id) {
DataSyncRecordDisabilityEntity entity = baseDao.selectById(id); DataSyncRecordDisabilityEntity entity = baseDao.selectById(id);
if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "data_sync_record_disability记录不存在,id:" + id, "记录不存在");
}
DataSyncRecordDisabilityDTO result = ConvertUtils.sourceToTarget(entity, DataSyncRecordDisabilityDTO.class); DataSyncRecordDisabilityDTO result = ConvertUtils.sourceToTarget(entity, DataSyncRecordDisabilityDTO.class);
result.setGenderCn(GenderEnum.UN_KNOWN.getName()); result.setGenderCn(GenderEnum.UN_KNOWN.getName());
if (null != result.getGender()){ if (null != result.getGender()){
result.setGenderCn(result.getGender() == NumConstant.ONE ? "男" : "女"); result.setGenderCn(result.getGender() == NumConstant.ONE ? "男" : "女");
} }
IcResiUserDTO icResiUserDTO = icResiUserService.get(entity.getIcResiUserId()); if (StringUtils.isNotBlank(entity.getIcResiUserId())) {
ResiInfoDTO resiInfoDTO = ConvertUtils.sourceToTarget(icResiUserDTO, ResiInfoDTO.class); IcResiUserDTO icResiUserDTO = icResiUserService.get(entity.getIcResiUserId());
resiInfoDTO.setGenderCn(resiInfoDTO.getGender().equals(NumConstant.ONE_STR) ? "男" : "女"); if (null != icResiUserDTO) {
resiInfoDTO.setCjzkCn(getCj(resiInfoDTO.getCjzk())); ResiInfoDTO resiInfoDTO = ConvertUtils.sourceToTarget(icResiUserDTO, ResiInfoDTO.class);
resiInfoDTO.setCjlbCn(getCjlb(resiInfoDTO.getCjlb(),entity.getCustomerId())); if (StringUtils.isNotBlank(resiInfoDTO.getGender())) {
result.setResiInfo(resiInfoDTO); resiInfoDTO.setGenderCn(resiInfoDTO.getGender().equals(NumConstant.ONE_STR) ? "男" : "女");
} else {
resiInfoDTO.setGenderCn(GenderEnum.UN_KNOWN.getName());
}
resiInfoDTO.setCjzkCn(getCj(resiInfoDTO.getCjzk()));
resiInfoDTO.setCjlbCn(getCjlb(resiInfoDTO.getCjlb(), entity.getCustomerId()));
result.setResiInfo(resiInfoDTO);
} else {
log.warn(String.format("ic_resi_user is null icResiUserId:%s", entity.getIcResiUserId()));
}
}
return result; return result;
} }
@ -145,7 +161,10 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl<DataSyn
throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败"); throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败");
} }
Map<String, String> data = cjlbOptionsMap.getData(); Map<String, String> data = cjlbOptionsMap.getData();
return data.get(cjlb); if(MapUtils.isNotEmpty(data)&&data.containsKey(cjlb)){
return data.get(cjlb);
}
return StrConstant.EPMETY_STR;
} }
@Override @Override
@ -307,4 +326,14 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl<DataSyn
baseDao.batchUpdateDisability(entities); baseDao.batchUpdateDisability(entities);
} }
/**
* 删除居民信息时同时删除data_sync_record_disability
*
* @param icResiUserId
*/
@Async
@Override
public void deleteByIcResiUserId(String icResiUserId) {
baseDao.deleteByIcResiUserId(icResiUserId);
}
} }

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

@ -20,7 +20,9 @@ import com.epmet.commons.tools.enums.FormItemTypeEnum;
import com.epmet.commons.tools.enums.IcFormCodeEnum; import com.epmet.commons.tools.enums.IcFormCodeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; 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.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*; 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.ExcelFillCellMergeStrategy;
@ -159,14 +161,49 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService {
writeSheet = EasyExcel.writerSheet("Sheet1").head(exportConfigData.getHeaders()).build(); writeSheet = EasyExcel.writerSheet("Sheet1").head(exportConfigData.getHeaders()).build();
} }
String staffOrgPath = null; allShowColumns.addAll(exportConfigData.getHiddenSqlColumns());
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfoCacheResult.getAgencyId()); // 组织和网格单独处理
Set<String> queryAgencyIdList = new HashSet<>();
Set<String> queryGridIdList = new HashSet<>();
// 将以下几列单独提出来,组合起来,放入集合,自动去重
searchForm.getConditions().stream().forEach(c -> {
if (IcResiUserConstant.IC_RESI_USER.equals(c.getTableName()) && CollectionUtils.isNotEmpty(c.getColumnValue())
&& StringUtils.isNotBlank(c.getColumnValue().get(NumConstant.ZERO))) {
if ("AGENCY_IDS".equals(c.getColumnName())) {
queryAgencyIdList.addAll(c.getColumnValue());
} else if ("GRID_IDS".equals(c.getColumnName())) {
queryGridIdList.addAll(c.getColumnValue());
} else if ("AGENCY_ID".equals(c.getColumnName())) {
queryAgencyIdList.addAll(c.getColumnValue());
} else if ("GRID_ID".equals(c.getColumnName())) {
queryGridIdList.addAll(c.getColumnValue());
}
}
});
// 移除grid grids agencyId agencyIds四种字段,改为
searchForm.getConditions().removeIf(o->IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && IcResiUserServiceImpl.ORG_FIELDS.contains(o.getColumnName()));
//添加数据权限
List<String> staffOrgPaths;
//如果查询条件中 没有有居民表的agencyId,则查询该工作人员所属组织的信息
if (queryAgencyIdList.isEmpty() && queryGridIdList.isEmpty()){
String staffOrgPath = PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds());
staffOrgPaths = Arrays.asList(staffOrgPath);
} else { } else {
staffOrgPath = staffInfoCacheResult.getAgencyId(); // 将组织id列表,转化为组织orgIdPath列表
staffOrgPaths = queryAgencyIdList.stream().map(agId -> {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agId);
if (agencyInfo == null) {
String errorMsg = "查询机关单位失败:" + agId;
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
return PidUtils.convertPid2OrgIdPath(agId, agencyInfo.getPids());
}).collect(Collectors.toList());
} }
allShowColumns.addAll(exportConfigData.getHiddenSqlColumns());
do { do {
if(StringUtils.isNotBlank(exportResiUserFormDTO.getId())){ if(StringUtils.isNotBlank(exportResiUserFormDTO.getId())){
ResiUserQueryValueDTO idCondition=new ResiUserQueryValueDTO(); ResiUserQueryValueDTO idCondition=new ResiUserQueryValueDTO();
@ -183,9 +220,17 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService {
searchForm.setConditions(conditions); searchForm.setConditions(conditions);
} }
} }
String finalStaffOrgPath = staffOrgPath; List<String> finalStaffOrgPath = staffOrgPaths;
List<String> finalGridIds = new ArrayList<>(queryGridIdList);
mapListPage = PageHelper.startPage(searchForm.getPageNo(), searchForm.getPageSize(), searchForm.getIsPage()).doSelectPage(() -> { mapListPage = PageHelper.startPage(searchForm.getPageNo(), searchForm.getPageSize(), searchForm.getIsPage()).doSelectPage(() -> {
icResiUserService.dynamicQuery(searchForm.getCustomerId(), searchForm.getFormCode(), IcResiUserConstant.IC_RESI_USER, allShowColumns, searchForm.getConditions(), staffInfoCacheResult.getAgencyId(), finalStaffOrgPath); icResiUserService.dynamicQuery(searchForm.getCustomerId(),
searchForm.getFormCode(),
IcResiUserConstant.IC_RESI_USER,
allShowColumns,
searchForm.getConditions(),
staffInfoCacheResult.getAgencyId(),
finalStaffOrgPath,
finalGridIds);
}); });
if (!searchForm.getIsPage()){ if (!searchForm.getIsPage()){
searchForm.setPageNo(searchForm.getPageNo() + NumConstant.ONE); searchForm.setPageNo(searchForm.getPageNo() + NumConstant.ONE);

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

@ -58,7 +58,6 @@ import com.epmet.dao.*;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.stats.UserHouseStatsQueryFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
@ -74,7 +73,6 @@ import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO;
import com.epmet.opendata.feign.GuardarDatosFeignClient; import com.epmet.opendata.feign.GuardarDatosFeignClient;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.service.*; import com.epmet.service.*;
import com.epmet.stats.UserHouseStatsResultDTO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -183,7 +181,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Autowired @Autowired
private IcVaccineRelationDao icVaccineRelationDao; private IcVaccineRelationDao icVaccineRelationDao;
/**
* 组织字段目前用于居民信息动态查询接口将此条件从conditions中移除单独生成固定的sql片段
*/
public static final List<String> ORG_FIELDS = Arrays.asList("AGENCY_IDS", "GRID_IDS", "AGENCY_ID", "GRID_ID");
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params) { private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
@ -211,6 +212,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
icUserTransferRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); icUserTransferRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
icUserChangeRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); icUserChangeRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
icUserChangeDetailedService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); icUserChangeDetailedService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
//如果是烟台客户,删除居民时,同时删除死亡数据data_sync_record_death、残疾记录data_sync_record_disability
if(CustomerIdConstant.YT_CUSTOMER_ID.equals(formDTO.getCustomerId())){
SpringContextUtils.getBean(DataSyncRecordDisabilityService.class).deleteByIcResiUserId(formDTO.getIcResiUserId());
SpringContextUtils.getBean(DataSyncRecordDeathService.class).deleteByIcResiUserId(formDTO.getIcResiUserId());
}
} }
/** /**
@ -915,36 +921,55 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
List<IcFormResColumnDTO> resultColumns = resultColumnRes.getData(); List<IcFormResColumnDTO> resultColumns = resultColumnRes.getData();
// 查询结果列对应的表: // 查询结果列对应的表:
Set<String> resultColumnTables = resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet()); Set<String> resultColumnTables = resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet());
List<String> queryAgencyIdList = formDTO.getConditions().stream()
.filter(o -> IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && "AGENCY_ID".equals(o.getColumnName()) // List<String> queryAgencyIdList = formDTO.getConditions().stream()
&& CollectionUtils.isNotEmpty(o.getColumnValue()) && StringUtils.isNotBlank(o.getColumnValue().get(NumConstant.ZERO))) // .filter(o -> IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && "AGENCY_IDS".equals(o.getColumnName())
.flatMap(o -> o.getColumnValue().stream()).collect(Collectors.toList()); // && CollectionUtils.isNotEmpty(o.getColumnValue()) && StringUtils.isNotBlank(o.getColumnValue().get(NumConstant.ZERO)))
// .flatMap(o -> o.getColumnValue().stream()).collect(Collectors.toList());
// 组织和网格单独处理
Set<String> queryAgencyIdList = new HashSet<>();
Set<String> queryGridIdList = new HashSet<>();
// 将以下几列单独提出来,组合起来,放入集合,自动去重
formDTO.getConditions().stream().forEach(c -> {
if (IcResiUserConstant.IC_RESI_USER.equals(c.getTableName()) && CollectionUtils.isNotEmpty(c.getColumnValue())
&& StringUtils.isNotBlank(c.getColumnValue().get(NumConstant.ZERO))) {
if ("AGENCY_IDS".equals(c.getColumnName())) {
queryAgencyIdList.addAll(c.getColumnValue());
} else if ("GRID_IDS".equals(c.getColumnName())) {
queryGridIdList.addAll(c.getColumnValue());
} else if ("AGENCY_ID".equals(c.getColumnName())) {
queryAgencyIdList.addAll(c.getColumnValue());
} else if ("GRID_ID".equals(c.getColumnName())) {
queryGridIdList.addAll(c.getColumnValue());
}
}
});
// 移除需要特殊处理的conditions
formDTO.getConditions().removeIf(o->IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && ORG_FIELDS.contains(o.getColumnName()));
//添加数据权限 //添加数据权限
String staffOrgPath; List<String> staffOrgPaths;
String agencyId; List<String> agencyIds = null;
//如果查询条件中 有居民表的agencyId 则匹配查询该组织下的 数据 //如果查询条件中 没有有居民表的agencyId,则查询该工作人员所属组织的信息
if (queryAgencyIdList.isEmpty()){ if (queryAgencyIdList.isEmpty() && queryGridIdList.isEmpty()){
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
agencyId = staffInfoCacheResult.getAgencyId(); agencyIds = Arrays.asList(staffInfoCacheResult.getAgencyId());
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); String op = PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds());
} else { staffOrgPaths = Arrays.asList(op);
staffOrgPath = staffInfoCacheResult.getAgencyId();
}
} else { } else {
formDTO.getConditions().removeIf(o->IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && "AGENCY_ID".equals(o.getColumnName())); // 将组织id列表,转化为组织orgIdPath列表
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(queryAgencyIdList.get(NumConstant.ZERO)); staffOrgPaths = queryAgencyIdList.stream().map(agId -> {
if (agencyInfo == null){ AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agId);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取组织信息失败"); if (agencyInfo == null) {
} String errorMsg = "查询机关单位失败:" + agId;
agencyId = agencyInfo.getId(); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
staffOrgPath = agencyInfo.getPids(); }
if (StringUtils.isBlank(staffOrgPath)){ return PidUtils.convertPid2OrgIdPath(agId, agencyInfo.getPids());
staffOrgPath = agencyId; }).collect(Collectors.toList());
}else{
staffOrgPath = staffOrgPath+StrConstant.COLON+agencyInfo.getId();
}
} }
// 查询列表展示项需要用到哪些子表 // 查询列表展示项需要用到哪些子表
Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1); Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1);
@ -973,14 +998,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(); PageInfo<Map<String, Object>> pageInfo = new PageInfo<>();
if (null == formDTO.getIsPage() || formDTO.getIsPage()) { if (null == formDTO.getIsPage() || formDTO.getIsPage()) {
//分页 //分页
String finalStaffOrgPath = staffOrgPath; List<String> finalStaffOrgPath = staffOrgPaths;
List<String> finalAgencyIds = agencyIds;
pageInfo = PageHelper.startPage(formDTO.getPageNo(), pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListResiMap(formDTO.getCustomerId(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListResiMap(formDTO.getCustomerId(),
formDTO.getFormCode(), formDTO.getFormCode(),
formDTO.getConditions(), formDTO.getConditions(),
resultColumns, resultColumns,
finalSubTables, finalSubTables,
agencyId, finalStaffOrgPath,null, formDTO.getKeyword(), finalAgencyIds,
finalStaffOrgPath,
queryGridIdList,
null,
formDTO.getKeyword(),
groupByTables)); groupByTables));
} else { } else {
List<Map<String, Object>> list = baseDao.selectListResiMap(formDTO.getCustomerId(), List<Map<String, Object>> list = baseDao.selectListResiMap(formDTO.getCustomerId(),
@ -988,8 +1018,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
formDTO.getConditions(), formDTO.getConditions(),
resultColumns, resultColumns,
finalSubTables, finalSubTables,
agencyId, agencyIds,
staffOrgPath,null, staffOrgPaths,
queryGridIdList,
null,
formDTO.getKeyword(), formDTO.getKeyword(),
groupByTables); groupByTables);
pageInfo.setTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size()); pageInfo.setTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size());
@ -1164,7 +1196,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
String staffOrgPath) { String staffOrgPath) {
// List<String> finalSubTables = getFinalSubables(customerId, formCode, resultTableName, conditions); // List<String> finalSubTables = getFinalSubables(customerId, formCode, resultTableName, conditions);
Map<String, List<String>> map = getFinalSubables(customerId, formCode, resultTableName, conditions, null); Map<String, List<String>> map = getFinalSubables(customerId, formCode, resultTableName, conditions, null);
return baseDao.dynamicQuery(customerId, resultTableName, conditions, map.get("finalSubTables"), null, currentStaffAgencyId, staffOrgPath, map.get("groupByTables")); return baseDao.dynamicQuery(customerId, resultTableName, conditions, map.get("finalSubTables"), null,
currentStaffAgencyId, Arrays.asList(staffOrgPath), null,map.get("groupByTables"));
} }
@NotNull @NotNull
@ -2205,11 +2238,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
} }
@Override @Override
public List<Map<String, Object>> dynamicQuery(String customerId, String formCode, String resultTableName, List<IcCustomExportResultDTO.SqlColumn> showSqlColumns, List<ResiUserQueryValueDTO> conditions, String currentStaffAgencyId, String staffOrgPath) { public List<Map<String, Object>> dynamicQuery(String customerId,
String formCode,
String resultTableName,
List<IcCustomExportResultDTO.SqlColumn> showSqlColumns,
List<ResiUserQueryValueDTO> conditions,
String currentStaffAgencyId,
List<String> staffOrgPath,
List<String> gridIds) {
// List<String> finalSubTables = getFinalSubables(customerId, formCode, resultTableName, conditions); // List<String> finalSubTables = getFinalSubables(customerId, formCode, resultTableName, conditions);
List<String> exportNeedTableList = showSqlColumns.stream().map(IcCustomExportResultDTO.SqlColumn::getTableName).collect(Collectors.toList()); List<String> exportNeedTableList = showSqlColumns.stream().map(IcCustomExportResultDTO.SqlColumn::getTableName).collect(Collectors.toList());
Map<String, List<String>> map = getFinalSubables(customerId, formCode, resultTableName, conditions, exportNeedTableList); Map<String, List<String>> map = getFinalSubables(customerId, formCode, resultTableName, conditions, exportNeedTableList);
return baseDao.dynamicQuery(customerId, resultTableName, conditions, map.get("finalSubTables"), showSqlColumns, currentStaffAgencyId, staffOrgPath, map.get("groupByTables")); return baseDao.dynamicQuery(customerId, resultTableName, conditions, map.get("finalSubTables"), showSqlColumns,
currentStaffAgencyId, staffOrgPath, gridIds, map.get("groupByTables"));
} }
@Override @Override
@ -3317,37 +3358,52 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
List<IcFormResColumnDTO> resultColumns = resultColumnRes.getData(); List<IcFormResColumnDTO> resultColumns = resultColumnRes.getData();
// 查询结果列对应的表: // 查询结果列对应的表:
Set<String> resultColumnTables = resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet()); Set<String> resultColumnTables = resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet());
List<String> queryAgencyIdList = formDTO.getConditions().stream()
.filter(o -> IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && "AGENCY_ID".equals(o.getColumnName()) // 组织和网格单独处理
&& CollectionUtils.isNotEmpty(o.getColumnValue()) && StringUtils.isNotBlank(o.getColumnValue().get(NumConstant.ZERO))) Set<String> queryAgencyIdList = new HashSet<>();
.flatMap(o -> o.getColumnValue().stream()).collect(Collectors.toList()); Set<String> queryGridIdList = new HashSet<>();
// 将以下几列单独提出来,组合起来,放入列表
formDTO.getConditions().stream().forEach(c -> {
if (IcResiUserConstant.IC_RESI_USER.equals(c.getTableName()) && CollectionUtils.isNotEmpty(c.getColumnValue())
&& StringUtils.isNotBlank(c.getColumnValue().get(NumConstant.ZERO))) {
if ("AGENCY_IDS".equals(c.getColumnName())) {
queryAgencyIdList.addAll(c.getColumnValue());
} else if ("GRID_IDS".equals(c.getColumnName())) {
queryGridIdList.addAll(c.getColumnValue());
} else if ("AGENCY_ID".equals(c.getColumnName())) {
queryAgencyIdList.addAll(c.getColumnValue());
} else if ("GRID_ID".equals(c.getColumnName())) {
queryGridIdList.addAll(c.getColumnValue());
}
}
});
// 移除需要特殊处理的conditions
formDTO.getConditions().removeIf(o->IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && ORG_FIELDS.contains(o.getColumnName()));
//添加数据权限 //添加数据权限
String staffOrgPath; List<String> staffOrgPaths;
String agencyId; List<String> agencyIds = null;
//如果查询条件中 有居民表的agencyId 则匹配查询该组织下的 数据 //如果查询条件中 没有有居民表的agencyId,则查询该工作人员所属组织的信息
if (queryAgencyIdList.isEmpty()){ if (queryAgencyIdList.isEmpty() && queryGridIdList.isEmpty()){
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
agencyId = staffInfoCacheResult.getAgencyId(); agencyIds = Arrays.asList(staffInfoCacheResult.getAgencyId());
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); String op = PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds());
} else { staffOrgPaths = Arrays.asList(op);
staffOrgPath = staffInfoCacheResult.getAgencyId();
}
} else { } else {
formDTO.getConditions().removeIf(o->IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && "AGENCY_ID".equals(o.getColumnName())); // 将组织id列表,转化为组织orgIdPath列表
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(queryAgencyIdList.get(NumConstant.ZERO)); staffOrgPaths = queryAgencyIdList.stream().map(agId -> {
if (agencyInfo == null){ AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agId);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取组织信息失败"); if (agencyInfo == null) {
} String errorMsg = "查询机关单位失败:" + agId;
agencyId = agencyInfo.getId(); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
staffOrgPath = agencyInfo.getPids(); }
if (StringUtils.isBlank(staffOrgPath)){ return PidUtils.convertPid2OrgIdPath(agId, agencyInfo.getPids());
staffOrgPath = agencyId; }).collect(Collectors.toList());
}else{
staffOrgPath = staffOrgPath+StrConstant.COLON+agencyInfo.getId();
}
} }
// 查询列表展示项需要用到哪些子表 // 查询列表展示项需要用到哪些子表
Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1); Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1);
List<SubTableJoinDTO> subTables = subTablesRes.getData(); List<SubTableJoinDTO> subTables = subTablesRes.getData();
@ -3375,14 +3431,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(); PageInfo<Map<String, Object>> pageInfo = new PageInfo<>();
if (null == formDTO.getIsPage() || formDTO.getIsPage()) { if (null == formDTO.getIsPage() || formDTO.getIsPage()) {
//分页 //分页
String finalStaffOrgPath = staffOrgPath; List<String> finalStaffOrgPath = staffOrgPaths;
List<String> finalAgencyIds = agencyIds;
pageInfo = PageHelper.startPage(formDTO.getPageNo(), pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListResiMap(formDTO.getCustomerId(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListResiMap(formDTO.getCustomerId(),
formDTO.getFormCode(), formDTO.getFormCode(),
formDTO.getConditions(), formDTO.getConditions(),
resultColumns, resultColumns,
finalSubTables, finalSubTables,
agencyId, finalStaffOrgPath,null, formDTO.getKeyword(), finalAgencyIds,
finalStaffOrgPath,
queryGridIdList,
null,
formDTO.getKeyword(),
groupByTables)); groupByTables));
} else { } else {
List<Map<String, Object>> list = baseDao.selectListResiMap(formDTO.getCustomerId(), List<Map<String, Object>> list = baseDao.selectListResiMap(formDTO.getCustomerId(),
@ -3390,8 +3451,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
formDTO.getConditions(), formDTO.getConditions(),
resultColumns, resultColumns,
finalSubTables, finalSubTables,
agencyId, agencyIds,
staffOrgPath,null, staffOrgPaths,
queryGridIdList,
null,
formDTO.getKeyword(), formDTO.getKeyword(),
groupByTables); groupByTables);
pageInfo.setTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size()); pageInfo.setTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size());

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

@ -243,7 +243,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
} }
@Override @Override
public List<IcStatsResiResultDTO> list(String customerId,String id, String level) { public List<IcStatsResiResultDTO> list(String customerId,String id, String level,List<String> idList) {
//获取所有配置类项 getshow //获取所有配置类项 getshow
IcResiCategoryStatsConfigFormDTO dto = new IcResiCategoryStatsConfigFormDTO(); IcResiCategoryStatsConfigFormDTO dto = new IcResiCategoryStatsConfigFormDTO();
dto.setStatus("show"); dto.setStatus("show");
@ -263,7 +263,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
}); });
Map<String,Map<String, BigDecimal>> tableColumnCountMap = new HashMap<>(); Map<String,Map<String, BigDecimal>> tableColumnCountMap = new HashMap<>();
paramMap.forEach((tableName,columnList) ->{ paramMap.forEach((tableName,columnList) ->{
Map<String, BigDecimal> countMap = icResiUserDao.getDataAnalyseCount(customerId,tableName,columnList, id,level); Map<String, BigDecimal> countMap = icResiUserDao.getDataAnalyseCount(customerId,tableName,columnList, id,level,idList);
if (countMap != null){ if (countMap != null){
tableColumnCountMap.put(tableName,countMap); tableColumnCountMap.put(tableName,countMap);
} }
@ -287,7 +287,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
@Override @Override
public List<IcStatsResiResultDTO> list2(StatsResiListFormDTO formDTO) { public List<IcStatsResiResultDTO> list2(StatsResiListFormDTO formDTO) {
return list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel()); return list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel(),null);
} }
/** /**

6
epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDeathDao.xml

@ -60,4 +60,10 @@
ORDER BY ORDER BY
d.CREATED_TIME DESC d.CREATED_TIME DESC
</select> </select>
<delete id="deleteByIcResiUserId" parameterType="java.lang.String">
delete from data_sync_record_death
where IC_RESI_USER_ID = #{icResiUserId}
</delete>
</mapper> </mapper>

6
epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml

@ -215,4 +215,10 @@
<!-- sex = values(sex),--> <!-- sex = values(sex),-->
<!-- class = values(class)--> <!-- class = values(class)-->
<!-- </insert>--> <!-- </insert>-->
<delete id="deleteByIcResiUserId" parameterType="java.lang.String">
delete from data_sync_record_disability
where IC_RESI_USER_ID = #{icResiUserId}
</delete>
</mapper> </mapper>

28
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -90,7 +90,24 @@
<if test="resultTableName != null and resultTableName != ''"> <if test="resultTableName != null and resultTableName != ''">
AND ${resultTableName}.ID IS NOT NULL AND ${resultTableName}.ID IS NOT NULL
</if> </if>
and ic_resi_user.pids like concat(#{staffOrgPath},'%') <!-- orgIdPath过滤 -->
and (
<foreach collection="staffOrgPaths" item="orgIdPath" separator="or">
ic_resi_user.pids like concat(#{orgIdPath},'%')
</foreach>
<if test='staffOrgPaths != null and staffOrgPaths.size() > 0 and gridIds != null and gridIds.size() > 0'>
or
</if>
<!-- 网格id过滤 -->
<if test="gridIds != null and gridIds.size() > 0">
ic_resi_user.GRID_ID in (
<foreach collection="gridIds" item="gridId" separator=",">
#{gridId}
</foreach>
)
</if>
)
<if test="null != conditions and conditions.size() > 0"> <if test="null != conditions and conditions.size() > 0">
<foreach item="subCondition" collection="conditions" open="" separator="" close=""> <foreach item="subCondition" collection="conditions" open="" separator="" close="">
<if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0"> <if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0">
@ -818,7 +835,14 @@
AND GRID_ID = #{id} AND GRID_ID = #{id}
</if> </if>
<if test="level=='neighborHood'"> <if test="level=='neighborHood'">
AND VILLAGE_ID = #{id} <if test="id != null and id != ''">
AND VILLAGE_ID = #{id}
</if>
<if test="idList != null and idList.size() > 0">
<foreach collection="idList" item="id" open="AND (" close=")" separator=" OR ">
VILLAGE_ID = #{id}
</foreach>
</if>
</if> </if>
<if test="level=='building'"> <if test="level=='building'">
AND BUILD_ID = #{id} AND BUILD_ID = #{id}

Loading…
Cancel
Save