wangxianzhang 3 years ago
parent
commit
048b1a10d6
  1. 5
      epmet-admin/epmet-admin-server/deploy/docker-compose-dev.yml
  2. 5
      epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml
  3. 5
      epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml
  4. 5
      epmet-auth/deploy/docker-compose-dev.yml
  5. 5
      epmet-auth/deploy/docker-compose-prod.yml
  6. 5
      epmet-auth/deploy/docker-compose-test.yml
  7. 2
      epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java
  8. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  9. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  10. 26
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  11. 18
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java
  12. 8
      epmet-commons/epmet-commons-tools/src/main/resources/logback-base.xml
  13. 5
      epmet-gateway/deploy/docker-compose-dev.yml
  14. 5
      epmet-gateway/deploy/docker-compose-prod.yml
  15. 5
      epmet-gateway/deploy/docker-compose-test.yml
  16. 5
      epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-dev.yml
  17. 5
      epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml
  18. 5
      epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-test.yml
  19. 5
      epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
  20. 5
      epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
  21. 5
      epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml
  22. 5
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
  23. 5
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml
  24. 5
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml
  25. 34
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  26. 5
      epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-dev.yml
  27. 5
      epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml
  28. 5
      epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-test.yml
  29. 2
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/AreaCodeDTO.java
  30. 13
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDetailFormDTO.java
  31. 76
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/CustomerTreeDTO.java
  32. 22
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
  33. 10
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java
  34. 5
      epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml
  35. 5
      epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml
  36. 5
      epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml
  37. 28
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java
  38. 18
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java
  39. 10
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java
  40. 321
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  41. 10
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml
  42. 31
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml
  43. 5
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml
  44. 5
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml
  45. 5
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml
  46. 5
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  47. 5
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml
  48. 5
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml
  49. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java
  50. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml
  51. 5
      epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml
  52. 5
      epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml
  53. 5
      epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml
  54. 36
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcDataSyncTask.java
  55. 5
      epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml
  56. 5
      epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml
  57. 5
      epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml
  58. 5
      epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml
  59. 5
      epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml
  60. 5
      epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml
  61. 5
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
  62. 5
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml
  63. 5
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml
  64. 5
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  65. 5
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml
  66. 5
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml
  67. 21
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
  68. 1
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java
  69. 5
      epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml
  70. 5
      epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml
  71. 5
      epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml
  72. 5
      epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml
  73. 5
      epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-prod.yml
  74. 5
      epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml
  75. 5
      epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml
  76. 5
      epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml
  77. 5
      epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml
  78. 5
      epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml
  79. 5
      epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml
  80. 5
      epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml
  81. 128
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAreaResultDTO.java
  82. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java
  83. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCodeResultDTO.java
  84. 5
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml
  85. 5
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml
  86. 5
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml
  87. 29
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  88. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  89. 23
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  90. 21
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  91. 159
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  92. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  93. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java
  94. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java
  95. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  96. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  97. 51
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  98. 26
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
  99. 4
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java
  100. 5
      epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml

5
epmet-admin/epmet-admin-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-admin.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-admin.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-admin.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-auth/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-auth.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-auth/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-auth.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-auth/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./epmet-auth.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

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

@ -304,7 +304,7 @@ public class LoginServiceImpl implements LoginService {
passwordLoginUserInfoFormDTO.setPhone(formDTO.getPhone());
Result<PasswordLoginUserInfoResultDTO> userInfoResult = epmetUserFeignClient.selectLoginUserInfoByPassword(passwordLoginUserInfoFormDTO);
if (!userInfoResult.success() || null == userInfoResult.getData()) {
logger.error("根据手机号查询运营人员信息失败,返回10003账号不存在");
// logger.error("根据手机号查询运营人员信息失败,返回10003账号不存在");
throw new RenException(EpmetErrorCode.ERR10003.getCode());
}
//3、密码是否正确

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java

@ -27,7 +27,9 @@ public interface NumConstant {
int ELEVEN = 11;
int TWELVE = 12;
int THIRTEEN = 13;
int SIXTEEN = 16;
int SEVENTEEN = 17;
int EIGHTEEN = 18;
int FIFTEEN = 15;
int FOURTEEN=14;
int TWENTY = 20;

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -258,6 +258,7 @@ public enum EpmetErrorCode {
IC_MOVE_IN(8926,"居民信息中房屋信息与当前选择房屋不一致,是否更新?"),
NOT_REGEIST_RESI(8927,"未注册居民"),
UNIT_EXIST_HOUSES_ERROR(8928,"单元下存在房屋,不可修改单元数"),
IC_VACCINE(8929,"已存在相同记录,请去修改原有记录"),
MISMATCH(10086,"人员与房屋信息不匹配,请与工作人员联系。"),

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

@ -778,6 +778,18 @@ public class RedisKeys {
return rootPrefix.concat("lock:").concat(methodName);
}
/**
* desc:获取分布式锁key
* @param customerId
* @return
*/
public static String getXiaoquEditLock(String customerId) {
if (StringUtils.isBlank(customerId)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误");
}
return rootPrefix.concat("lock:xiaoquedit").concat(customerId);
}
/**
* desc:获取更新 房屋内有居民数量的key
* @param customerId
@ -791,4 +803,18 @@ public class RedisKeys {
}
/**
* desc: 数据同步业务key 根据方法名区分
*
* @param bizType [resi]
* @return java.lang.String
* @author LiuJanJun
* @date 2022/7/16 7:12 下午
*/
public static String getDataSyncKey(String bizType) {
if (StringUtils.isBlank(bizType)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误");
}
return rootPrefix.concat("datasync:").concat(bizType);
}
}

18
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java

@ -357,6 +357,24 @@ public class RedisUtils {
return redisTemplate.opsForSet().members(key);
}
/**
* @Description 获取一个set
* @param key
* @author zxc
*/
public Object sPop(String key){
return redisTemplate.opsForSet().pop(key);
}
/**
* @Description 添加一个元素set
* @param key
* @author zxc
*/
public Long sAdd(String key,Object value){
return redisTemplate.opsForSet().add(key,value);
}
/**
* @Description 获取 zset 中带score的集合
* @param key

8
epmet-commons/epmet-commons-tools/src/main/resources/logback-base.xml

@ -7,11 +7,13 @@ Base logback configuration provided for compatibility with Spring Boot 1.1
<included>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<!--<property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/spring.log}"/>-->
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<include resource="org/springframework/boot/logging/logback/file-appender.xml" />
<!--该配置主要是配置了console控制台日志的输出级别以及appender,配置只输出到CONSOLE,而不输出到file即可避免产生spring.log-->
<!--<property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/spring.log}"/>-->
<!--<include resource="org/springframework/boot/logging/logback/file-appender.xml" />-->
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
<!--<appender-ref ref="FILE" />-->
</root>
</included>

5
epmet-gateway/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-gateway.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-gateway/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-gateway.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-gateway/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-gateway.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./data-aggregator.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx760m -jar ./data-aggregator.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./data-aggregator.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./data-report.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx1524m -jar ./data-report.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./data-report.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./data-stats.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx3000m -jar ./data-stats.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./data-stats.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

34
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -240,28 +240,20 @@
FROM
screen_project_process spp
WHERE
( spp.CUSTOMER_ID = '2fe0065f70ca0e23ce4c26fca5f1d933' OR spp.CUSTOMER_ID = '44876154d10d7cb7affd92000f84f833' OR spp.CUSTOMER_ID = '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND OPERATION = 'closed_case' UNION ALL
SELECT
spp.CUSTOMER_ID,
PROJECT_ID,
HANDLER_ID,
HANDLER_TYPE,
ORG_ID_PATH
FROM
screen_project_process spp
WHERE
( spp.CUSTOMER_ID != '2fe0065f70ca0e23ce4c26fca5f1d933' AND spp.CUSTOMER_ID != '44876154d10d7cb7affd92000f84f833' AND spp.CUSTOMER_ID != '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND OPERATION = 'close'
(( spp.CUSTOMER_ID = '2fe0065f70ca0e23ce4c26fca5f1d933' OR spp.CUSTOMER_ID = '44876154d10d7cb7affd92000f84f833' OR spp.CUSTOMER_ID = '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND OPERATION = 'closed_case')
OR
(( spp.CUSTOMER_ID != '2fe0065f70ca0e23ce4c26fca5f1d933' AND spp.CUSTOMER_ID != '44876154d10d7cb7affd92000f84f833' AND spp.CUSTOMER_ID != '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND OPERATION = 'close')
<if test='null != customerId and "" != customerId'>
AND spp.CUSTOMER_ID = #{customerId}
</if>
<if test='null != projectIds and projectIds.size()>0'>
<foreach collection="projectIds" item="projectId" open="AND (" separator=" OR " close=" )">
spp.PROJECT_ID = #{projectId}
</foreach>
</if>
) b ON a.PROJECT_ID = b.PROJECT_ID
<if test='null != customerId and "" != customerId'>
AND b.CUSTOMER_ID = #{customerId}
</if>
<if test='null != projectIds and projectIds.size()>0'>
<foreach collection="projectIds" item="projectId" open="AND (" separator=" OR " close=" )">
b.PROJECT_ID = #{projectId}
</foreach>
</if>
LEFT JOIN screen_customer_agency c ON b.HANDLER_ID = c.AGENCY_ID
WHERE a.DEL_FLAG = '0'
AND a.CATEGORY_CODE IS NOT NULL

5
epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-activiti.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-activiti.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-activiti.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

2
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/AreaCodeDTO.java

@ -37,7 +37,7 @@ public class AreaCodeDTO implements Serializable {
/**
* 主键
*/
private Integer id;
private String id;
/**
* 省份code

13
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDetailFormDTO.java

@ -0,0 +1,13 @@
package com.epmet.dto.form;
import lombok.Data;
@Data
public class AreaCodeDetailFormDTO {
private String areaCode;
/**
* 省级:province; 市级: city; 区县级: district ;街道:street ;社区级community
*/
private String level;
}

76
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/CustomerTreeDTO.java

@ -0,0 +1,76 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 客户关系表(01.14 add)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-03
*/
@Data
public class CustomerTreeDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 当前客户级别社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
private String level;
/**
* 当前客户的地区编码实际就是根组织的area_code
*/
private String areaCode;
/**
* 当前客户的地区名称
*/
private String areaName;
/**
* 当前客户的父节点地区名称
*/
private String parentCode;
/**
* 客户名称
*/
private String customerName;
/**
* 下一级
*/
private List<CustomerTreeDTO> children;
}

22
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java

@ -98,6 +98,28 @@ public interface EpmetCommonServiceOpenFeignClient {
@PostMapping("commonservice/workday/workminutes")
Result<Map<String,Integer>> workMinutes(@RequestBody WorkMinuteFormDTO param);
/**
* 行政地区编码查询
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.AreaCodeDictResultDTO>>
* @author zhy
* @date 2022/7/6 15:07
*/
@PostMapping("commonservice/areacode/areacodedetail")
Result<AreaCodeResultDTO> areaCodeDetail(@RequestBody AreaCodeDetailFormDTO formDTO);
/**
* 行政地区编码树查询
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.AreaCodeDictResultDTO>>
* @author zhy
* @date 2022/7/6 15:07
*/
@PostMapping("commonservice/areacode/areacodetree")
Result<List<CustomerTreeDTO>> areaCodeTree(@RequestBody CustomerTreeDTO formDTO);
/**
* @Description 行政地区编码查询
* @Param formDTO

10
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java

@ -79,6 +79,16 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "workMinutes", param);
}
@Override
public Result<AreaCodeResultDTO> areaCodeDetail(AreaCodeDetailFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "areaCodeDetail", formDTO);
}
@Override
public Result<List<CustomerTreeDTO>> areaCodeTree(CustomerTreeDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "areaCodeTree", formDTO);
}
@Override
public Result<List<AreaCodeDictResultDTO>> areaCodeDictTree(AreaCodeDictFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "areaCodeDictTree", formDTO);

5
epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./common-service.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./common-service.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./common-service.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

28
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java

@ -25,12 +25,10 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.AreaCodeDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AddAreaCodeFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.AreaCodeResultDTO;
import com.epmet.dto.result.CustomerTreeDTO;
import com.epmet.service.AreaCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -133,4 +131,26 @@ public class AreaCodeController {
public Result<List<AreaCodeResultDTO>> nextArea(@RequestBody AreaCodeFormDTO formDTO){
return new Result<List<AreaCodeResultDTO>>().ok(areaCodeService.nextArea(formDTO));
}
/**
* @Description 行政地区编码查询
* @Param formDTO
* @author zxc
* @date 2021/1/7 下午1:41
*/
@PostMapping("areacodedetail")
public Result<AreaCodeResultDTO> areaCodeDetail(@RequestBody AreaCodeDetailFormDTO formDTO){
return new Result<AreaCodeResultDTO>().ok(areaCodeService.getAreaCodeDetail(formDTO));
}
/**
* @Description 行政地区编码查询
* @Param formDTO
* @author zxc
* @date 2021/1/7 下午1:41
*/
@PostMapping("areacodetree")
public Result<List<CustomerTreeDTO>> areaCodeTree(@RequestBody CustomerTreeDTO formDTO){
return new Result<List<CustomerTreeDTO>>().ok(areaCodeService.getAreaCodeTree(formDTO));
}
}

18
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java

@ -37,19 +37,25 @@ public interface AreaCodeDao extends BaseDao<AreaCodeEntity> {
List<AreaCodeDTO> selectAllArea();
AreaCodeDTO selectByCountyCode(String countyCode);
AreaCodeDTO selectByCountyCode(@Param("countyCode") String countyCode);
AreaCodeDTO selectByCityCode(String cityCode);
AreaCodeDTO selectByCityCode(@Param("cityCode") String cityCode);
AreaCodeDTO selectByProvinceCode(@Param("provinceCode") String provinceCode);
AreaCodeResultDTO selectByStreetCode(@Param("streetCode") String streetCode);
AreaCodeResultDTO selectByCommunityCode(@Param("communityCode") String communityCode);
AreaCodeDTO selectMaxCounty(String cityCode);
List<AreaCodeResultDTO> selectProvince();
List<AreaCodeResultDTO> selectCity(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectCity(@Param("pCode") String pCode);
List<AreaCodeResultDTO> selectDistrict(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectDistrict(@Param("pCode") String pCode);
List<AreaCodeResultDTO> selectStreet(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectStreet(@Param("pCode") String pCode);
List<AreaCodeResultDTO> selectCommunity(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectCommunity(@Param("pCode") String pCode);
}

10
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java

@ -20,12 +20,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.AreaCodeDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AddAreaCodeFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.AreaCodeResultDTO;
import com.epmet.dto.result.CustomerTreeDTO;
import com.epmet.entity.AreaCodeEntity;
import java.util.List;
@ -127,4 +125,8 @@ public interface AreaCodeService extends BaseService<AreaCodeEntity> {
String addAreaCode(AddAreaCodeFormDTO formDTO);
List<AreaCodeResultDTO> nextArea(AreaCodeFormDTO formDTO);
AreaCodeResultDTO getAreaCodeDetail(AreaCodeDetailFormDTO formDTO);
List<CustomerTreeDTO> getAreaCodeTree(CustomerTreeDTO formDTO);
}

321
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -36,12 +36,10 @@ import com.epmet.dao.AreaCodeChildDao;
import com.epmet.dao.AreaCodeDao;
import com.epmet.dto.AreaCodeChildDTO;
import com.epmet.dto.AreaCodeDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AddAreaCodeFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.AreaCodeResultDTO;
import com.epmet.dto.result.CustomerTreeDTO;
import com.epmet.entity.AreaCodeEntity;
import com.epmet.redis.AreaCodeRedis;
import com.epmet.service.AreaCodeChildService;
@ -72,6 +70,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
private AreaCodeChildDao childDao;
@Autowired
private AreaCodeChildService areaCodeChildService;
@Override
public PageData<AreaCodeDTO> page(Map<String, Object> params) {
IPage<AreaCodeEntity> page = baseDao.selectPage(
@ -88,8 +87,8 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
return ConvertUtils.sourceToTarget(entityList, AreaCodeDTO.class);
}
private QueryWrapper<AreaCodeEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<AreaCodeEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<AreaCodeEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -125,7 +124,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
/**
* @Description 行政地区编码查询
* @Description 行政地区编码查询
* @Param formDTO
* @author zxc
* @date 2021/1/7 下午1:41
@ -134,14 +133,14 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
public List<AreaCodeDictResultDTO> areaCodeDictTree(AreaCodeDictFormDTO formDTO) {
List<AreaCodeDictResultDTO> tree = new ArrayList<>();
String s = areaCodeRedis.get(AreaCodeConstant.SCREEN_TREE);
if (StringUtils.isNotBlank(s)){
tree = JSON.parseArray(s,AreaCodeDictResultDTO.class);
}else {
if (StringUtils.isNotBlank(s)) {
tree = JSON.parseArray(s, AreaCodeDictResultDTO.class);
} else {
List<AreaCodeDictResultDTO> areaCodeDictResultDTOS = disposeTree(formDTO);
areaCodeRedis.set(AreaCodeConstant.SCREEN_TREE,areaCodeDictResultDTOS);
areaCodeRedis.set(AreaCodeConstant.SCREEN_TREE, areaCodeDictResultDTOS);
tree = areaCodeDictResultDTOS;
}
if (StringUtils.isBlank(formDTO.getRootAreaCode())){
if (StringUtils.isBlank(formDTO.getRootAreaCode())) {
return tree;
}
List<AreaCodeDictResultDTO> treeByRootAreaCode = getTreeByRootAreaCode(tree, formDTO.getRootAreaCode());
@ -149,12 +148,12 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
/**
* @Description 行政区树查询
* @Description 行政区树查询
* @Param
* @author zxc
* @date 2021/1/8 上午8:57
*/
public List<AreaCodeDictResultDTO> disposeTree(AreaCodeDictFormDTO formDTO){
public List<AreaCodeDictResultDTO> disposeTree(AreaCodeDictFormDTO formDTO) {
// 查询所有省市区
List<AreaCodeDTO> areaCodeDTOS = baseDao.selectAllArea();
// 查询所有街道、社区
@ -173,8 +172,8 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
dto.setCode(four.getCode());
dto.setName(four.getName());
dto.setParentCode(four.getPCode());
groupByPCode.forEach((pCode,v) -> {
if (dto.getCode().equals(pCode)){
groupByPCode.forEach((pCode, v) -> {
if (dto.getCode().equals(pCode)) {
List<AreaCodeDictResultDTO> fiveResult = new ArrayList<>();
v.forEach(five -> {
AreaCodeDictResultDTO fiveDto = new AreaCodeDictResultDTO();
@ -189,7 +188,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
fourResult.add(dto);
});
List<AreaCodeDictResultDTO> fourSort = new ArrayList<>();
if (!CollectionUtils.isEmpty(fourResult)){
if (!CollectionUtils.isEmpty(fourResult)) {
fourSort = fourResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList());
}
@ -209,7 +208,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
dto.setName(three.getCountyName());
List<AreaCodeDictResultDTO> fourOnceResult = new ArrayList<>();
finalFourSort.forEach(four -> {
if (dto.getCode().equals(four.getParentCode())){
if (dto.getCode().equals(four.getParentCode())) {
fourOnceResult.add(four);
}
});
@ -220,13 +219,13 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
cityDto.setChildren(threeSort);
cityResult.add(cityDto);
});
groupByProvince.forEach((p,v) -> {
groupByProvince.forEach((p, v) -> {
AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO();
dto.setCode(p);
dto.setName(v.get(NumConstant.ZERO).getProvinceName());
List<AreaCodeDictResultDTO> cityOnceResult = new ArrayList<>();
cityResult.forEach(c -> {
if (dto.getCode().equals(c.getParentCode())){
if (dto.getCode().equals(c.getParentCode())) {
cityOnceResult.add(c);
}
});
@ -239,54 +238,51 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
/**
* @Description 根据节点获取组织区域树遍历传参只能是 区级别 暂时这样循环太多了
*
*
* @Description 根据节点获取组织区域树遍历传参只能是 区级别 暂时这样循环太多了
* <p>
* <p>
* 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样
* ==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==
* 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样
*
*
*
* ==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==
* 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样
* @Param tree
* @Param rootAreaCode
* @author zxc
* @date 2021/1/8 上午10:02
*/
public List<AreaCodeDictResultDTO> getTreeByRootAreaCode(List<AreaCodeDictResultDTO> tree , String rootAreaCode){
public List<AreaCodeDictResultDTO> getTreeByRootAreaCode(List<AreaCodeDictResultDTO> tree, String rootAreaCode) {
List<AreaCodeDictResultDTO> result = new ArrayList<>();
if (!CollectionUtils.isEmpty(tree)){
if (!CollectionUtils.isEmpty(tree)) {
// 省级获取
for (AreaCodeDictResultDTO dto : tree) {
if (rootAreaCode.equals(dto.getCode())){
if (rootAreaCode.equals(dto.getCode())) {
result.add(dto);
return result;
}
// 市级获取
if (!CollectionUtils.isEmpty(dto.getChildren())){
if (!CollectionUtils.isEmpty(dto.getChildren())) {
for (AreaCodeDictResultDTO child : dto.getChildren()) {
if (rootAreaCode.equals(child.getCode())){
if (rootAreaCode.equals(child.getCode())) {
result.add(child);
return result;
}
// 区级获取
if (!CollectionUtils.isEmpty(child.getChildren())){
if (!CollectionUtils.isEmpty(child.getChildren())) {
for (AreaCodeDictResultDTO threeChild : child.getChildren()) {
if (rootAreaCode.equals(threeChild.getCode())){
if (rootAreaCode.equals(threeChild.getCode())) {
result.add(threeChild);
return result;
}
// 街道获取
if (!CollectionUtils.isEmpty(threeChild.getChildren())){
if (!CollectionUtils.isEmpty(threeChild.getChildren())) {
for (AreaCodeDictResultDTO fourChild : threeChild.getChildren()) {
if (rootAreaCode.equals(fourChild.getCode())){
if (rootAreaCode.equals(fourChild.getCode())) {
result.add(fourChild);
return result;
}
// 社区获取
if (!CollectionUtils.isEmpty(fourChild.getChildren())){
if (!CollectionUtils.isEmpty(fourChild.getChildren())) {
for (AreaCodeDictResultDTO fiveChild : fourChild.getChildren()) {
if (rootAreaCode.equals(fiveChild.getCode())){
if (rootAreaCode.equals(fiveChild.getCode())) {
result.add(fiveChild);
return result;
}
@ -304,40 +300,40 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
@Override
public List<AreaCodeDictResultDTO> areaCodeDictTreePlus(AreaCodeDictFormDTO formDTO){
public List<AreaCodeDictResultDTO> areaCodeDictTreePlus(AreaCodeDictFormDTO formDTO) {
List<AreaCodeDictResultDTO> tree = new ArrayList<>();
String s = areaCodeRedis.get(AreaCodeConstant.THREE_SCREEN_TREE);
if (StringUtils.isNotBlank(s)){
tree = JSON.parseArray(s,AreaCodeDictResultDTO.class);
}else {
if (StringUtils.isNotBlank(s)) {
tree = JSON.parseArray(s, AreaCodeDictResultDTO.class);
} else {
List<AreaCodeDictResultDTO> threeTree = beforeThreeTree();
areaCodeRedis.set(AreaCodeConstant.THREE_SCREEN_TREE,threeTree);
areaCodeRedis.set(AreaCodeConstant.THREE_SCREEN_TREE, threeTree);
tree = threeTree;
}
if (StringUtils.isBlank(formDTO.getRootAreaCode())){
if (StringUtils.isBlank(formDTO.getRootAreaCode())) {
return tree;
}
if (StringUtils.isBlank(formDTO.getRootAreaLevel())){
if (StringUtils.isBlank(formDTO.getRootAreaLevel())) {
throw new RenException(AreaCodeConstant.ROOT_AGENCY_LEVEL_IS_LEVEL);
}
// 传参为街道-社区级
if (formDTO.getRootAreaLevel().equals(AreaCodeConstant.STREET) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.COMMUNITY)){
if (formDTO.getRootAreaLevel().equals(AreaCodeConstant.STREET) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.COMMUNITY)) {
tree = disposeAfterTwoLevel(formDTO);
}else if (formDTO.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.CITY) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.DISTRICT)){
tree = disposeBeforeThreeLevelFinal(formDTO,tree);
}else {
throw new RenException(String.format(AreaCodeConstant.LEVEL_ERROR,formDTO.getRootAreaLevel()));
} else if (formDTO.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.CITY) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.DISTRICT)) {
tree = disposeBeforeThreeLevelFinal(formDTO, tree);
} else {
throw new RenException(String.format(AreaCodeConstant.LEVEL_ERROR, formDTO.getRootAreaLevel()));
}
return tree;
}
/**
* @Description 省市区三级联动查询
* @Description 省市区三级联动查询
* @Param
* @author zxc
* @date 2021/1/11 上午9:35
*/
public List<AreaCodeDictResultDTO> beforeThreeTree(){
public List<AreaCodeDictResultDTO> beforeThreeTree() {
// 查询所有省市区
List<AreaCodeDTO> areaCodeDTOS = baseDao.selectAllArea();
Map<String, List<AreaCodeDTO>> groupByCity = areaCodeDTOS.stream().collect(Collectors.groupingBy(AreaCodeDTO::getCityCode));
@ -362,13 +358,13 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
cityDto.setChildren(threeSort);
cityResult.add(cityDto);
});
groupByProvince.forEach((p,v) -> {
groupByProvince.forEach((p, v) -> {
AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO();
dto.setCode(p);
dto.setName(v.get(NumConstant.ZERO).getProvinceName());
List<AreaCodeDictResultDTO> cityOnceResult = new ArrayList<>();
cityResult.forEach(c -> {
if (dto.getCode().equals(c.getParentCode())){
if (dto.getCode().equals(c.getParentCode())) {
cityOnceResult.add(c);
}
});
@ -383,12 +379,12 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
/**
* @Description 街道-社区组织树查询
* @Description 街道-社区组织树查询
* @Param
* @author zxc
* @date 2021/1/11 上午9:48
*/
public List<AreaCodeDictResultDTO> afterTwoTree(AreaCodeDictFormDTO form){
public List<AreaCodeDictResultDTO> afterTwoTree(AreaCodeDictFormDTO form) {
// 查询所有街道、社区
List<AreaCodeChildDTO> areaCodeChildDTOS = childDao.selectAllChild(form.getRootAreaCode());
List<AreaCodeDictResultDTO> fourResult = new ArrayList<>();
@ -399,7 +395,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
List<AreaCodeChildDTO> levelFive = org.apache.commons.collections4.CollectionUtils.isNotEmpty(groupByLevel.get(NumConstant.FIVE)) ? groupByLevel.get(NumConstant.FIVE) : new ArrayList<>();
Map<String, List<AreaCodeChildDTO>> groupByPCode = CollectionUtils.isEmpty(levelFive) ? new HashMap<>() : levelFive.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode));
//街道
List<AreaCodeChildDTO> levelFour = org.apache.commons.collections4.CollectionUtils.isNotEmpty(groupByLevel.get(NumConstant.FOUR)) ?groupByLevel.get(NumConstant.FOUR):new ArrayList<>();
List<AreaCodeChildDTO> levelFour = org.apache.commons.collections4.CollectionUtils.isNotEmpty(groupByLevel.get(NumConstant.FOUR)) ? groupByLevel.get(NumConstant.FOUR) : new ArrayList<>();
// 6级
List<AreaCodeChildDTO> levelSix = groupByLevel.get(NumConstant.SIX);
Map<String, List<AreaCodeChildDTO>> groupBySixPCode = CollectionUtils.isEmpty(levelSix) ? new HashMap<>() : levelSix.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode));
@ -409,8 +405,8 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
dto.setCode(f.getCode());
dto.setName(f.getName());
dto.setParentCode(f.getPCode());
groupBySixPCode.forEach((k,v) -> {
if (dto.getCode().equals(k)){
groupBySixPCode.forEach((k, v) -> {
if (dto.getCode().equals(k)) {
List<AreaCodeDictResultDTO> six = new ArrayList<>();
v.forEach(s -> {
AreaCodeDictResultDTO sixDto = new AreaCodeDictResultDTO();
@ -431,8 +427,8 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
dto.setCode(four.getCode());
dto.setName(four.getName());
dto.setParentCode(four.getPCode());
groupByFivePCode.forEach((pCode,v) -> {
if (dto.getCode().equals(pCode)){
groupByFivePCode.forEach((pCode, v) -> {
if (dto.getCode().equals(pCode)) {
dto.setChildren(v);
}
});
@ -443,28 +439,28 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
/**
* @Description 街道-社区组织树处理
* @Description 街道-社区组织树处理
* @Param form
* @author zxc
* @date 2021/1/11 上午9:58
*/
public List<AreaCodeDictResultDTO> disposeAfterTwoLevel(AreaCodeDictFormDTO form){
public List<AreaCodeDictResultDTO> disposeAfterTwoLevel(AreaCodeDictFormDTO form) {
List<AreaCodeDictResultDTO> result = new ArrayList<>();
List<AreaCodeDictResultDTO> areaCodeDictResultDTOS = afterTwoTree(form);
if (CollectionUtils.isEmpty(areaCodeDictResultDTOS)){
if (CollectionUtils.isEmpty(areaCodeDictResultDTOS)) {
return new ArrayList<>();
}
if (form.getRootAreaLevel().equals(AreaCodeConstant.STREET)){
if (form.getRootAreaLevel().equals(AreaCodeConstant.STREET)) {
for (AreaCodeDictResultDTO dto : areaCodeDictResultDTOS) {
if (dto.getCode().equals(form.getRootAreaCode())){
if (dto.getCode().equals(form.getRootAreaCode())) {
result.add(dto);
}
}
}else {
} else {
for (AreaCodeDictResultDTO dto : areaCodeDictResultDTOS) {
if (!CollectionUtils.isEmpty(dto.getChildren())){
if (!CollectionUtils.isEmpty(dto.getChildren())) {
for (AreaCodeDictResultDTO child : dto.getChildren()) {
if (child.getCode().equals(form.getRootAreaCode())){
if (child.getCode().equals(form.getRootAreaCode())) {
result.add(child);
}
}
@ -475,42 +471,42 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
/**
* @Description 省市区获取
* @Description 省市区获取
* @Param form
* @Param tree
* @author zxc
* @date 2021/1/12 上午9:22
*/
public List<AreaCodeDictResultDTO> disposeBeforeThreeLevel(AreaCodeDictFormDTO form,List<AreaCodeDictResultDTO> tree){
public List<AreaCodeDictResultDTO> disposeBeforeThreeLevel(AreaCodeDictFormDTO form, List<AreaCodeDictResultDTO> tree) {
List<AreaCodeDictResultDTO> result = new ArrayList<>();
if (CollectionUtils.isEmpty(tree)){
if (CollectionUtils.isEmpty(tree)) {
return new ArrayList<>();
}
if (form.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE)){
if (form.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE)) {
for (AreaCodeDictResultDTO dto : tree) {
if (dto.getCode().equals(form.getRootAreaCode())){
if (dto.getCode().equals(form.getRootAreaCode())) {
result.add(dto);
return result;
}
}
}else if (form.getRootAreaLevel().equals(AreaCodeConstant.CITY)){
} else if (form.getRootAreaLevel().equals(AreaCodeConstant.CITY)) {
for (AreaCodeDictResultDTO dto : tree) {
if (!CollectionUtils.isEmpty(dto.getChildren())){
if (!CollectionUtils.isEmpty(dto.getChildren())) {
for (AreaCodeDictResultDTO city : dto.getChildren()) {
if (city.getCode().equals(form.getRootAreaCode())){
if (city.getCode().equals(form.getRootAreaCode())) {
result.add(city);
return result;
}
}
}
}
}else if (form.getRootAreaLevel().equals(AreaCodeConstant.DISTRICT)){
} else if (form.getRootAreaLevel().equals(AreaCodeConstant.DISTRICT)) {
for (AreaCodeDictResultDTO dto : tree) {
if (!CollectionUtils.isEmpty(dto.getChildren())){
if (!CollectionUtils.isEmpty(dto.getChildren())) {
for (AreaCodeDictResultDTO city : dto.getChildren()) {
if (!CollectionUtils.isEmpty(city.getChildren())){
if (!CollectionUtils.isEmpty(city.getChildren())) {
for (AreaCodeDictResultDTO child : city.getChildren()) {
if (child.getCode().equals(form.getRootAreaCode())){
if (child.getCode().equals(form.getRootAreaCode())) {
result.add(child);
return result;
}
@ -524,29 +520,29 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
/**
* @Description 拼接 街道-社区
* @Description 拼接 街道-社区
* @Param form
* @Param tree
* @author zxc
* @date 2021/1/12 上午9:21
*/
public List<AreaCodeDictResultDTO> disposeBeforeThreeLevelFinal(AreaCodeDictFormDTO form,List<AreaCodeDictResultDTO> tree){
public List<AreaCodeDictResultDTO> disposeBeforeThreeLevelFinal(AreaCodeDictFormDTO form, List<AreaCodeDictResultDTO> tree) {
List<AreaCodeDictResultDTO> threeDto = disposeBeforeThreeLevel(form, tree);
List<AreaCodeDictResultDTO> twoDto = afterTwoTree(form);
if (CollectionUtils.isEmpty(threeDto)){
if (CollectionUtils.isEmpty(threeDto)) {
return new ArrayList<>();
}
if (!CollectionUtils.isEmpty(twoDto)){
if (form.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE)){
if (!CollectionUtils.isEmpty(twoDto)) {
if (form.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE)) {
for (AreaCodeDictResultDTO dto : tree) {
if (dto.getCode().equals(form.getRootAreaCode())){
if (!CollectionUtils.isEmpty(dto.getChildren())){
if (dto.getCode().equals(form.getRootAreaCode())) {
if (!CollectionUtils.isEmpty(dto.getChildren())) {
for (AreaCodeDictResultDTO city : dto.getChildren()) {
if (!CollectionUtils.isEmpty(city.getChildren())){
if (!CollectionUtils.isEmpty(city.getChildren())) {
for (AreaCodeDictResultDTO child : city.getChildren()) {
List<AreaCodeDictResultDTO> areaList = new ArrayList<>();
for (AreaCodeDictResultDTO area : twoDto) {
if (child.getCode().equals(area.getParentCode())){
if (child.getCode().equals(area.getParentCode())) {
areaList.add(area);
}
}
@ -557,13 +553,13 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
}
}
}else if (form.getRootAreaLevel().equals(AreaCodeConstant.CITY)){
} else if (form.getRootAreaLevel().equals(AreaCodeConstant.CITY)) {
for (AreaCodeDictResultDTO dto : threeDto) {
if (!CollectionUtils.isEmpty(dto.getChildren())){
if (!CollectionUtils.isEmpty(dto.getChildren())) {
for (AreaCodeDictResultDTO child : dto.getChildren()) {
List<AreaCodeDictResultDTO> areaList = new ArrayList<>();
for (AreaCodeDictResultDTO area : twoDto) {
if (child.getCode().equals(area.getParentCode())){
if (child.getCode().equals(area.getParentCode())) {
areaList.add(area);
}
}
@ -571,11 +567,11 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
}
}
}else{
} else {
for (AreaCodeDictResultDTO dto : threeDto) {
List<AreaCodeDictResultDTO> areaList = new ArrayList<>();
for (AreaCodeDictResultDTO area : twoDto) {
if (dto.getCode().equals(area.getParentCode())){
if (dto.getCode().equals(area.getParentCode())) {
areaList.add(area);
}
}
@ -677,35 +673,35 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
String areaCode = "";
switch (formDTO.getCurrentAreaLevel()) {
case AreaCodeConstant.DISTRICT:
areaCode = addDistrictAreaCode(formDTO.getParentAreaCode(),formDTO.getName());
areaCode = addDistrictAreaCode(formDTO.getParentAreaCode(), formDTO.getName());
break;
case AreaCodeConstant.STREET:
areaCode = addStreetCommAreaCode(ConvertUtils.sourceToTarget(formDTO,AddAreaCodeDictFormDTO.class));
areaCode = addStreetCommAreaCode(ConvertUtils.sourceToTarget(formDTO, AddAreaCodeDictFormDTO.class));
break;
case AreaCodeConstant.COMMUNITY:
areaCode = addStreetCommAreaCode(ConvertUtils.sourceToTarget(formDTO,AddAreaCodeDictFormDTO.class));
areaCode = addStreetCommAreaCode(ConvertUtils.sourceToTarget(formDTO, AddAreaCodeDictFormDTO.class));
break;
default:
log.info("currentAreaLevel值为"+formDTO.getCurrentAreaLevel());
log.info("currentAreaLevel值为" + formDTO.getCurrentAreaLevel());
}
return areaCode;
}
@Override
public List<AreaCodeResultDTO> nextArea(AreaCodeFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getParentAreaCode())&&StringUtils.isBlank(formDTO.getParentLevel())){
String pKey=RedisKeys.getNextAreaCodeKey(NumConstant.ZERO_STR);
List<AreaCodeResultDTO> list=areaCodeRedis.getNextAreaCodeKey(pKey);
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){
if (StringUtils.isBlank(formDTO.getParentAreaCode()) && StringUtils.isBlank(formDTO.getParentLevel())) {
String pKey = RedisKeys.getNextAreaCodeKey(NumConstant.ZERO_STR);
List<AreaCodeResultDTO> list = areaCodeRedis.getNextAreaCodeKey(pKey);
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
return list;
}
List<AreaCodeResultDTO> pList=baseDao.selectProvince();
areaCodeRedis.setNextAreaCodeKey(pKey,pList);
List<AreaCodeResultDTO> pList = baseDao.selectProvince();
areaCodeRedis.setNextAreaCodeKey(pKey, pList);
return pList;
}
String key=RedisKeys.getNextAreaCodeKey(formDTO.getParentAreaCode());
List<AreaCodeResultDTO> list=areaCodeRedis.getNextAreaCodeKey(key);
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){
String key = RedisKeys.getNextAreaCodeKey(formDTO.getParentAreaCode());
List<AreaCodeResultDTO> list = areaCodeRedis.getNextAreaCodeKey(key);
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
return list;
}
switch (formDTO.getParentLevel()) {
@ -723,17 +719,116 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
break;
case AreaCodeConstant.COMMUNITY:
log.info("社区无下级");
list=null;
list = null;
break;
default:
log.warn("parentLevel错误:"+formDTO.getParentLevel());
log.warn("parentLevel错误:" + formDTO.getParentLevel());
}
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){
areaCodeRedis.setNextAreaCodeKey(key,list);
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
areaCodeRedis.setNextAreaCodeKey(key, list);
}
return list;
}
@Override
public AreaCodeResultDTO getAreaCodeDetail(AreaCodeDetailFormDTO formDTO) {
AreaCodeResultDTO result = new AreaCodeResultDTO();
switch (formDTO.getLevel()) {
case AreaCodeConstant.PROVINCE:
AreaCodeDTO province = baseDao.selectByProvinceCode(formDTO.getAreaCode());
if (province != null) {
result.setAreaName(province.getProvinceName());
result.setAreaCode(province.getProvinceCode());
result.setParentCode(NumConstant.ZERO_STR);
result.setLevel(AreaCodeConstant.PROVINCE);
}
break;
case AreaCodeConstant.CITY:
AreaCodeDTO city = baseDao.selectByCityCode(formDTO.getAreaCode());
if (city != null) {
result.setAreaName(city.getCityName());
result.setAreaCode(city.getCityName());
result.setParentCode(city.getProvinceCode());
result.setLevel(AreaCodeConstant.CITY);
}
break;
case AreaCodeConstant.DISTRICT:
AreaCodeDTO county = baseDao.selectByCountyCode(formDTO.getAreaCode());
if (county != null) {
result.setAreaName(county.getCountyName());
result.setAreaCode(county.getCountyCode());
result.setParentCode(county.getCityCode());
result.setLevel(AreaCodeConstant.DISTRICT);
}
break;
case AreaCodeConstant.STREET:
result = baseDao.selectByStreetCode(formDTO.getAreaCode());
break;
case AreaCodeConstant.COMMUNITY:
result = baseDao.selectByCommunityCode(formDTO.getAreaCode());
break;
default:
log.warn("Level错误:" + formDTO.getLevel());
}
return result;
}
@Override
public List<CustomerTreeDTO> getAreaCodeTree(CustomerTreeDTO formDTO) {
List<AreaCodeResultDTO> tree = new ArrayList<>();
areaCodeHandle(formDTO.getLevel(), formDTO.getAreaCode(), tree);
return ConvertUtils.sourceToTarget(tree, CustomerTreeDTO.class);
}
private void areaCodeHandle(String level, String areaCode, List<AreaCodeResultDTO> tree) {
AreaCodeResultDTO result = new AreaCodeResultDTO();
switch (level) {
case AreaCodeConstant.PROVINCE:
AreaCodeDTO province = baseDao.selectByProvinceCode(areaCode);
if (province != null) {
result.setAreaName(province.getProvinceName());
result.setAreaCode(province.getProvinceCode());
result.setParentCode(NumConstant.ZERO_STR);
result.setLevel(AreaCodeConstant.PROVINCE);
tree.add(result);
}
break;
case AreaCodeConstant.CITY:
AreaCodeDTO city = baseDao.selectByCityCode(areaCode);
if (city != null) {
result.setAreaName(city.getCityName());
result.setAreaCode(city.getCityCode());
result.setParentCode(city.getProvinceCode());
result.setLevel(AreaCodeConstant.CITY);
tree.add(result);
areaCodeHandle(AreaCodeConstant.PROVINCE, city.getProvinceCode(), tree);
}
break;
case AreaCodeConstant.DISTRICT:
AreaCodeDTO county = baseDao.selectByCountyCode(areaCode);
if (county != null) {
result.setAreaName(county.getCountyName());
result.setAreaCode(county.getCountyCode());
result.setParentCode(county.getCityCode());
result.setLevel(AreaCodeConstant.DISTRICT);
tree.add(result);
areaCodeHandle(AreaCodeConstant.CITY, county.getCityCode(), tree);
}
break;
case AreaCodeConstant.STREET:
result = baseDao.selectByStreetCode(areaCode);
tree.add(result);
areaCodeHandle(AreaCodeConstant.DISTRICT, result.getParentCode(), tree);
break;
case AreaCodeConstant.COMMUNITY:
result = baseDao.selectByCommunityCode(areaCode);
tree.add(result);
areaCodeHandle(AreaCodeConstant.STREET, result.getParentCode(), tree);
break;
default:
log.warn("Level错误:" + level);
}
}
private String addDistrictAreaCode(String cityCode, String countyName) {
AreaCodeDTO city = baseDao.selectByCityCode(cityCode);

10
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml

@ -20,6 +20,16 @@
and m.`CODE`=#{code}
</select>
<select id="getByCode" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT
*
FROM
area_code_child m
WHERE
m.DEL_FLAG = '0'
and m.`CODE`= #{code}
</select>
<!-- 根据p_code、name查询社区列表 -->
<select id="selectByPCodeAndName" resultType="com.epmet.dto.AreaCodeChildDTO">
SELECT

31
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml

@ -19,6 +19,13 @@
and ac.CITY_CODE=#{cityCode}
</select>
<select id="selectByProvinceCode" resultType="com.epmet.dto.AreaCodeDTO">
select distinct ac.PROVINCE_CODE,ac.PROVINCE_NAME
from area_code ac
where ac.DEL_FLAG='0'
and ac.PROVINCE_CODE=#{provinceCode}
</select>
<select id="selectMaxCounty" resultType="com.epmet.dto.AreaCodeDTO" parameterType="java.lang.String">
select *
from area_code ac
@ -106,4 +113,28 @@
ORDER BY
ac.`code` ASC
</select>
<select id="selectByStreetCode" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT
ac.`code` AS areaCode,
ac.`name` AS areaName,
ac.p_code AS parentCode,
'street' AS LEVEL
FROM
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.`code` = #{streetCode}
</select>
<select id="selectByCommunityCode" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT
ac.`code` AS areaCode,
ac.`name` AS areaName,
ac.p_code AS parentCode,
'street' AS LEVEL
FROM
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.`code` = #{communityCode}
</select>
</mapper>

5
epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-ext.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-ext.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-ext.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-heart.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-heart.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-heart.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

1
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java

@ -150,6 +150,7 @@ public class IcServiceProjectServiceImpl extends BaseServiceImpl<IcServiceProjec
if (null == staffInfo){
throw new EpmetException("未查询到此工作人员"+formDTO.getUserId());
}
//查询当前组织及下级 的数据
formDTO.setAgencyId(staffInfo.getAgencyId());
PageInfo<ServiceProjectListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getServiceProjectList(formDTO));
if (CollectionUtils.isNotEmpty(pageInfo.getList())){

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

@ -43,7 +43,7 @@
AND ID = #{serviceProjectId}
</if>
<if test='null != agencyId and agencyId != "" '>
AND AGENCY_ID = #{agencyId}
AND AGENCY_ID_PATH like concat( '%',#{agencyId},'%')
</if>
<if test='null != serviceCategoryKey and serviceCategoryKey != "" '>
AND SERVICE_CATEGORY_KEY = #{serviceCategoryKey}

5
epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-job.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-job.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-job.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

36
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcDataSyncTask.java

@ -0,0 +1,36 @@
package com.epmet.task.ic;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.task.ITask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* desc:定时弥补数据 保证数据的一致性
*/
@Slf4j
@Component("icDataSyncTask")
public class IcDataSyncTask implements ITask {
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* 执行定时任务接口
*
* @param params 参数多参数使用JSON数据
*/
@Override
public void run(String customerId) {
log.info("icDataSyncTask定时任务正在执行,参数为customerId:{}", customerId);
Result result = epmetUserOpenFeignClient.icDataSyncTask(customerId);
if (result.success()) {
log.info("icDataSyncTask定时任务正在执行定时任务执行成功");
} else {
log.warn("icDataSyncTask定时任务正在执行定时任务执行失败:" + result.getMsg());
}
}
}

5
epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-message.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-message.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-message.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-oss.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-oss.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-oss.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-point.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-point.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-point.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-third.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-third.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-third.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

21
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java

@ -370,7 +370,6 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
* @Description 获取/刷新接口调用令牌
* @author zxc
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void refreshToken() {
//查询 即将过期的 authorizer_access_token
@ -407,9 +406,8 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
AuthorizationInfoFormDTO authorizationInfo = new AuthorizationInfoFormDTO();
BeanUtils.copyProperties(formDTO, authorizationInfo);
authorizationInfo.setAuthorizerAppid(authAppId);
//先逻辑删除,在插入
authorizationInfoDao.deleteOldAuthorizerAccessToken(customerId, clientType);
authorizationInfoDao.insertAuthorizerAccessToken(formDTO);
// 先逻辑删除,在插入
deleteOldAuthorizerAccessTokenAndInsert(customerId,clientType,formDTO);
//缓存 refreshAuthorizerAccessToken
redisThird.setAuthorizerRefreshToken(authorizationInfo);
AuthorizationInfoResultDTO resultDTO = new AuthorizationInfoResultDTO();
@ -425,6 +423,21 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
}
/**
* Desc: 删除旧的AuthorizerAccessToken并新增AuthorizerAccessToken
* @param customerId
* @param clientType
* @param formDTO
* @author zxc
* @date 2022/7/12 09:15
*/
@Transactional(rollbackFor = Exception.class)
public void deleteOldAuthorizerAccessTokenAndInsert(String customerId,String clientType,AuthorizerAccessTokenFormDTO formDTO){
//先逻辑删除,在插入
authorizationInfoDao.deleteOldAuthorizerAccessToken(customerId, clientType);
authorizationInfoDao.insertAuthorizerAccessToken(formDTO);
}
/**
* @param
* @Description 授权回调URL, 回调时并获取授权信息

1
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java

@ -141,6 +141,7 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
WxResult<String> result = new WxResult<>();
String url = WxMaCodeConstant.SUBMIT_AUDIT_URL + "?" + "access_token=" + accessToken;
Result<String> submitResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(auditRequest));
log.info("submitAudit result:{}",JSON.toJSONString(submitResult));
if (!submitResult.success()) {
result.setErrorCode(submitResult.getCode());
result.setErrorMsg(submitResult.getMsg());

5
epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-access.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-access.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-access.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-grid.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-grid.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-grid.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-issue.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-issue.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-issue.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-mine.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-mine.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-mine.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

128
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAreaResultDTO.java

@ -0,0 +1,128 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 组织信息
*
* @author sun
*/
@Data
public class AgencyAreaResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 客户名称
*/
private String customerName;
/**
* 上级组织机构ID
*/
private String pid;
/**
* 所有上级组织机构ID(以英文:隔开)
*/
private String pids;
/**
* 所有上级名称,-连接
*/
private String allParentName;
/**
* 组织名称
*/
private String organizationName;
/**
* 机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
private String level;
/**
* 地区编码
*/
private String areaCode;
/**
* 总人数
*/
private Integer totalUser;
/**
*
*/
private String province;
/**
* 城市名称
*/
private String city;
/**
* 区县名称
*/
private String district;
/**
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
/**
* 街道
*/
private String street;
/**
* 社区名称0409
*/
private String community;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java

@ -16,7 +16,7 @@ public class BuildingListResultDTO implements Serializable {
private static final long serialVersionUID = -1423424057500044373L;
private String id;
private String name;
private Integer unitCoun = 0;
private Integer unitCount = 0;
private Integer houseCount = 0;
private Integer personCount = 0;
private Integer differHouseCount = 0;

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCodeResultDTO.java

@ -6,7 +6,7 @@ import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:小区-楼栋-房屋编码
* @description:小区-楼栋-单元-房屋编码
* @author: wangtong
* @create: 2022-06-29 09:51
**/
@ -14,13 +14,17 @@ import java.io.Serializable;
public class OrganizationCodeResultDTO implements Serializable {
/**
* 可编辑的楼栋编码
* 可编辑的编码
*/
private String coding;
/**
* 不可编辑的楼栋编码
* 不可编辑的编码
*/
private String sysCoding;
/**
* 不可编辑的前缀编码
*/
private String preCoding;
}

5
epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-org.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./gov-org.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

5
epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-org.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

29
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -505,4 +505,33 @@ public class AgencyController {
List<AgencyAddressBookTreeResultDTO> dto = agencyService.getAddressTree(name, customerId);
return new Result<List<AgencyAddressBookTreeResultDTO>>().ok(dto);
}
/**
* 获取区域编码下级的所有客户信息
*
* @param areaCode
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.AgencyAreaResultDTO>>
* @author zhy
* @date 2022/7/7 10:12
*/
@GetMapping("/areasubagency/{areaCode}")
public Result<List<AgencyAreaResultDTO>> getAreaSubAgency(@LoginUser TokenDto tokenDto, @PathVariable String areaCode) {
List<AgencyAreaResultDTO> dto = agencyService.getAreaSubAgency(tokenDto, areaCode);
return new Result<List<AgencyAreaResultDTO>>().ok(dto);
}
/**
* 客户树
*
* @param
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.CustomerRelationTreeDTO>>
* @author zhy
* @date 2022/7/6 13:24
*/
@RequestMapping("customertree")
public Result<List<CustomerTreeDTO>> customerTree(@LoginUser TokenDto tokenDto) {
return new Result<List<CustomerTreeDTO>>().ok(agencyService.getCustomerTree(tokenDto));
}
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java

@ -21,6 +21,8 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -33,6 +35,7 @@ import com.epmet.entity.IcBuildingEntity;
import com.epmet.service.NeighborHoodService;
import com.epmet.util.ExcelPoiUtils;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
@ -44,6 +47,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
@ -61,6 +65,8 @@ public class NeighborHoodController {
private NeighborHoodService neighborHoodService;
@Resource
private IcBuildingDao icBuildingDao;
@Autowired
private DistributedLock distributedLock;
@PostMapping("neighborhoodlist")
@ -88,7 +94,13 @@ public class NeighborHoodController {
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.UpdateShowGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
neighborHoodService.updateNeighborhood(customerId,formDTO);
RLock lock = null;
try {
lock = distributedLock.getLock(RedisKeys.getXiaoquEditLock(tokenDTO.getCustomerId()), 120L, 3L, TimeUnit.SECONDS);
neighborHoodService.updateNeighborhood(customerId,formDTO);
} finally {
distributedLock.unLock(lock);
}
return new Result();
}

23
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -353,5 +353,28 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
CommunityInfoResultDTO getCommunityInfo(OrgInfoPointFormDTO formDTO);
CommunityInfoResultDTO getCommunityInfoByUserId(@Param("userId") String userId);
/**
* 获取区域编码下级的所有客户信息
*
* @param areaCode
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.AgencyAreaResultDTO>>
* @author zhy
* @date 2022/7/7 10:12
*/
List<AgencyAreaResultDTO> getAreaSubAgency(@Param("areaCode") String areaCode);
/**
* 客户树根节点
*
* @param
* @return java.util.List<com.epmet.dto.result.CustomerTreeDTO>
* @author zhy
* @date 2022/7/6 13:32
*/
List<CustomerTreeDTO> selectRootCustomer(@Param("areaCode") String areaCode, @Param("level") String level);
CustomerAgencyEntity getAreaRootAgency(@Param("customerId") String customerId);
}

21
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -178,4 +178,25 @@ public interface AgencyService {
* @date 2022/5/16 10:43
*/
List<AgencyAddressBookTreeResultDTO> getAddressTree(String name, String customerId);
/**
* 获取区域编码下级的所有客户信息
*
* @param areaCode
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.AgencyAreaResultDTO>>
* @author zhy
* @date 2022/7/7 10:12
*/
List<AgencyAreaResultDTO> getAreaSubAgency(TokenDto tokenDto, String areaCode);
/**
* 客户树
*
* @param tokenDto
* @return java.util.List<com.epmet.dto.result.CustomerTreeDTO>
* @author zhy
* @date 2022/7/6 13:32
*/
List<CustomerTreeDTO> getCustomerTree(TokenDto tokenDto);
}

159
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -43,6 +43,7 @@ import com.epmet.dao.CustomerDepartmentDao;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -50,12 +51,14 @@ import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerDepartmentEntity;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCrmFeignClient;
import com.epmet.redis.CustomerAgencyRedis;
import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerOrgParameterService;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Joiner;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -66,10 +69,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 机关单位信息
@ -99,7 +101,7 @@ public class AgencyServiceImpl implements AgencyService {
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
private OperCrmFeignClient operCrmFeignClient;
@Autowired
private IcBuildingDao icBuildingDao;
@Autowired
@ -902,6 +904,46 @@ public class AgencyServiceImpl implements AgencyService {
return NodeTreeUtils.build(list);
}
@Override
public List<AgencyAreaResultDTO> getAreaSubAgency(TokenDto tokenDto, String areaCode) {
if (NumConstant.ZERO_STR.equals(areaCode)) {
CustomerAgencyEntity root = customerAgencyDao.getAreaRootAgency(tokenDto.getCustomerId());
areaCode = root.getAreaCode();
}
List<AgencyAreaResultDTO> list = customerAgencyDao.getAreaSubAgency(areaCode);
list.forEach(item -> {
CustomerDTO customerDTO = new CustomerDTO();
customerDTO.setId(item.getCustomerId());
Result<CustomerDTO> customerResult = operCrmFeignClient.getCustomerInfo(customerDTO);
if (customerResult.success() && null != customerResult.getData()) {
item.setCustomerName(item.getOrganizationName().concat(StrConstant.HYPHEN).concat(customerResult.getData().getCustomerName()));
}
});
return list;
}
@Override
public List<CustomerTreeDTO> getCustomerTree(TokenDto tokenDto) {
List<CustomerTreeDTO> resultList = new ArrayList<>();
List<CustomerTreeDTO> rootList = customerAgencyDao.selectRootCustomer(null, null);
List<CustomerTreeDTO> treeList = new ArrayList<>();
Map<String, CustomerTreeDTO> treeMap = new HashMap<>();
if (!rootList.isEmpty()) {
// 获取已有客户的所有组织架构,并转换成map,保证唯一
rootList.forEach(item -> {
customerHandle(item, treeList);
});
// treeMap = treeList.stream().collect(Collectors.toMap(CustomerTreeDTO::getAreaCode, Function.identity(), (val1, val2) -> val2));
// 组合成组织树
resultList = getCustomerTree(treeList);
}
return resultList;
}
private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) {
CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class);
insertEntity.setOrganizationName(formDTO.getAgencyName());
@ -951,4 +993,109 @@ public class AgencyServiceImpl implements AgencyService {
return insertEntity;
}
/**
* 处理子客户
*
* @param customer
* @return com.epmet.dto.result.CustomerTreeDTO
* @author zhy
* @date 2022/7/6 13:54
*/
private void customerHandle(CustomerTreeDTO customer, List<CustomerTreeDTO> treeList) {
Result<List<CustomerTreeDTO>> area = epmetCommonServiceOpenFeignClient.areaCodeTree(customer);
if (area.success()) {
if (area.getData() != null) {
treeList.addAll(area.getData());
}
}
}
/**
* 生成客户树
*
* @param
* @return com.epmet.dto.result.CustomerTreeDTO
* @author wgf
* @date 2022/7/6 13:54
*/
private List<CustomerTreeDTO> getCustomerTree(List<CustomerTreeDTO> treeList) {
treeList = treeList.stream().distinct().collect(Collectors.toList());
// 回显客户名称
treeList.forEach(item -> {
List<String> customerNames = new ArrayList<>();
List<CustomerTreeDTO> subList = customerAgencyDao.selectRootCustomer(item.getAreaCode(), item.getLevel());
subList.forEach(customer -> {
CustomerDTO customerDTO = new CustomerDTO();
customerDTO.setId(customer.getCustomerId());
Result<CustomerDTO> customerResult = operCrmFeignClient.getCustomerInfo(customerDTO);
if (customerResult.success() && null != customerResult.getData()) {
customerNames.add(customerResult.getData().getCustomerName());
}
});
item.setCustomerName(Joiner.on(",").join(customerNames));
});
// 省
List<CustomerTreeDTO> province = new ArrayList<CustomerTreeDTO>();
// 市
List<CustomerTreeDTO> city = new ArrayList<CustomerTreeDTO>();
// 区
List<CustomerTreeDTO> district = new ArrayList<CustomerTreeDTO>();
// 街道
List<CustomerTreeDTO> street = new ArrayList<CustomerTreeDTO>();
// 社区
List<CustomerTreeDTO> community = new ArrayList<CustomerTreeDTO>();
for (int i = 0; i < treeList.size(); i++) {
if ("province".equals(treeList.get(i).getLevel())) {
province.add(treeList.get(i));
} else if ("city".equals(treeList.get(i).getLevel())) {
city.add(treeList.get(i));
} else if ("district".equals(treeList.get(i).getLevel())) {
district.add(treeList.get(i));
} else if ("street".equals(treeList.get(i).getLevel())) {
street.add(treeList.get(i));
} else if ("community".equals(treeList.get(i).getLevel())) {
community.add(treeList.get(i));
}
}
// 组装街道树
for (CustomerTreeDTO streetDto : street) {
this.addChild(streetDto, community);
}
// 组装区树
for (CustomerTreeDTO districtDto : district) {
this.addChild(districtDto, street);
}
// 组装市树
for (CustomerTreeDTO cityDto : city) {
this.addChild(cityDto, district);
}
// 组装省树
for (CustomerTreeDTO provinceDto : province) {
this.addChild(provinceDto, city);
}
return province;
}
/**
* 组装子项
*
* @param parentDto
* @param childList
*/
private void addChild(CustomerTreeDTO parentDto, List<CustomerTreeDTO> childList) {
List<CustomerTreeDTO> children = new ArrayList<CustomerTreeDTO>();
for (CustomerTreeDTO childDto : childList) {
if (parentDto.getAreaCode().equals(childDto.getParentCode())) {
children.add(childDto);
}
}
parentDto.setChildren(children);
}
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -813,7 +813,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
boolean party = false;
//网格指导员角色
boolean gridParty = false;
for (CustomerStaffRoleListResultDTO role : RoleList) {
//2022.7.8 pc端党建声音发布单位取消角色限制
party = true;
/*for (CustomerStaffRoleListResultDTO role : RoleList) {
if (CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())) {
party = true;
}
@ -823,7 +825,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
if (!party && !gridParty) {
return returnDTO;
}
}*/
//4:根据不同角色查询不同数据
CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId());

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

@ -61,7 +61,7 @@ public class HouseInformationServiceImpl implements HouseInformationService {
if (StringUtils.isEmpty(formDTO.getCommunityId())) {
//获取工作人员所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if(null == staffInfo) {
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败");
}
formDTO.setCommunityId(staffInfo.getAgencyId());
@ -121,7 +121,6 @@ public class HouseInformationServiceImpl implements HouseInformationService {
}
item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
});
}
return new PageData<>(list, pageInfo.getTotal());
}
@ -254,7 +253,7 @@ public class HouseInformationServiceImpl implements HouseInformationService {
//排序
list = list.stream().sorted(Comparator.comparing(BuildingListResultDTO::getDifferPersonCount).reversed()).collect(Collectors.toList());
//分页
list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
}
}
@ -387,7 +386,7 @@ public class HouseInformationServiceImpl implements HouseInformationService {
//排序
list = list.stream().sorted(Comparator.comparing(HomeListResultDTO::getPersonCount).reversed()).collect(Collectors.toList());
//分页
list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
}
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java

@ -123,7 +123,7 @@ public class IcBuildingServiceImpl extends BaseServiceImpl<IcBuildingDao, IcBuil
}
LambdaQueryWrapper<IcBuildingEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId);
wrapper.last("ORDER BY CONVERT ( BUILDING_NAME USING gbk ) ASC");
wrapper.last("ORDER BY SORT ASC, BUILDING_NAME+0 ASC");
List<IcBuildingEntity> list = baseDao.selectList(wrapper);
if(CollectionUtils.isEmpty(list)) {
return Collections.emptyList();

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

@ -120,7 +120,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
LambdaQueryWrapper<IcHouseEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(formDTO.getBuildingId()), IcHouseEntity::getBuildingId, formDTO.getBuildingId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcHouseEntity::getBuildingUnitId, formDTO.getUnitId());
wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC");
wrapper.last("ORDER BY SORT ASC, DOOR_NAME+0 ASC");
List<IcHouseEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();

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

@ -207,6 +207,7 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
//如果更新了网格 则需要更新网格下的居民所属关系
if (!icNeighborHoodEntity.getGridId().equals(icNeighborHoodDTO.getGridId())){
IcUserBelongToChangedFormDTO userForm = new IcUserBelongToChangedFormDTO();
userForm.setNeighborhoodId(icNeighborHoodEntity.getId());
userForm.setSourceGridId(icNeighborHoodEntity.getGridId());
userForm.setTargetGridId(icNeighborHoodDTO.getGridId());
Result<Boolean> updateResult = epmetUserOpenFeignClient.changeIcResiUserBelongTo(userForm);

51
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -930,4 +930,55 @@
limit 1
</select>
<select id="getAreaSubAgency" resultType="com.epmet.dto.result.AgencyAreaResultDTO">
SELECT
ac.*
FROM
customer_agency ac
INNER JOIN customer_org_parameter cop ON cop.CUSTOMER_ID = ac.CUSTOMER_ID
WHERE
ac.DEL_FLAG = '0'
AND cop.DEL_FLAG = '0'
AND cop.PARAMETER_KEY = 'area_code_switch'
AND ac.PID = '0'
AND cop.PARAMETER_VALUE = 'open'
<if test="areaCode != null and areaCode != ''">
AND ac.AREA_CODE LIKE CONCAT(#{areaCode}, '%')
</if>
</select>
<select id="selectRootCustomer" resultType="com.epmet.dto.result.CustomerTreeDTO">
SELECT
c.*
FROM
customer_agency c
WHERE
c.DEL_FLAG = '0'
AND c.pid = '0'
AND c.AREA_CODE IS NOT NULL
<if test="areaCode != null and areaCode != ''">
AND c.AREA_CODE = #{areaCode}
</if>
<if test="level != null and level != ''">
AND c.LEVEL = #{level}
</if>
</select>
<select id="getAreaRootAgency" resultType="com.epmet.entity.CustomerAgencyEntity">
SELECT
ac.*
FROM
customer_agency ac
INNER JOIN customer_org_parameter cop ON cop.CUSTOMER_ID = ac.CUSTOMER_ID
WHERE
ac.DEL_FLAG = '0'
AND cop.DEL_FLAG = '0'
AND cop.PARAMETER_KEY = 'area_code_switch'
AND ac.PID = '0'
AND cop.PARAMETER_VALUE = 'open'
<if test="customerId != null and customerId != ''">
AND ac.CUSTOMER_ID = #{customerId}
</if>
</select>
</mapper>

26
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

@ -529,8 +529,10 @@
FROM (
SELECT
a.ID,
a.SORT,
a.BUILDING_NAME AS name,
IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitCount,
IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitRealCount,
IFNULL(c.unitCount, 0) AS unitCount,
SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount,
SUM( IFNULL( a.REAL_PERSON, 0 ) ) AS personRealCount,
IFNULL(b.houseCount, 0) AS houseCount,
@ -541,6 +543,10 @@
FROM ic_house WHERE DEL_FLAG = '0'
AND NEIGHBOR_HOOD_ID = #{neighborHoodId}
GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_ID
LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS unitCount
FROM ic_building_unit
WHERE DEL_FLAG = '0'
GROUP BY BUILDING_ID ) c ON a.ID = c.BUILDING_ID
WHERE
a.DEL_FLAG = '0'
AND a.NEIGHBOR_HOOD_ID = #{neighborHoodId}
@ -555,16 +561,16 @@
ORDER BY
<choose>
<when test='sort == "1"'>
convert(name using gbk)
SORT ASC, name + 0 ASC
</when>
<when test='sort == "2"'>
houseRealCount desc, convert(name using gbk)
houseRealCount desc, name + 0 ASC
</when>
<when test='sort == "3"'>
personRealCount desc, convert(name using gbk)
personRealCount desc, name + 0 ASC
</when>
<when test='sort == "4"'>
differHouseCount desc, convert(name using gbk)
differHouseCount desc, name + 0 ASC
</when>
<when test='sort == "5"'>
convert(name using gbk)
@ -578,7 +584,8 @@
a.ID AS buildingId,
a.TYPE AS buildingType,
CONCAT(NEIGHBOR_HOOD_NAME,' ',BUILDING_NAME) AS buildingName,
IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitCount,
IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitRealCount,
IFNULL( d.unitCount, 0 ) AS unitCount,
SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount,
SUM( IFNULL( a.REAL_PERSON, 0 ) ) AS personRealCount,
IFNULL( b.houseCount, 0 ) AS houseCount,
@ -590,6 +597,11 @@
WHERE DEL_FLAG = '0'
AND BUILDING_ID = #{buildingId}
GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_ID
LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS unitCount
FROM ic_building_unit
WHERE DEL_FLAG = '0'
AND BUILDING_ID = #{buildingId}
GROUP BY BUILDING_ID ) d ON a.ID = d.BUILDING_ID
INNER JOIN ic_neighbor_hood c ON a.NEIGHBOR_HOOD_ID = c.ID
WHERE
a.DEL_FLAG = '0'
@ -648,7 +660,7 @@
AND DOOR_NAME LIKE CONCAT('%', #{name}, '%')
</if>
ORDER BY
DOOR_NAME
SORT, DOOR_NAME+0
</select>

4
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java

@ -115,7 +115,7 @@ public class IcDemandFormDTO implements Serializable {
/**
* 需求人联系电话
*/
@NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class)
@NotNull(message = "需求人联系电话不能为空",groups = AddUserShowGroup.class)
private String demandUserMobile;
/**
@ -168,7 +168,7 @@ public class IcDemandFormDTO implements Serializable {
/**
* 二级分类Id
*/
@NotBlank(message = "分类id不能为空",groups = AddUserInternalGroup.class)
//@NotBlank(message = "分类id不能为空",groups = AddUserInternalGroup.class)
private String categoryId;
}

5
epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml

@ -11,6 +11,11 @@ services:
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-project.jar"
restart: "unless-stopped"
logging:
driver: local
options:
max-size: "10m"
max-file: "2"
deploy:
resources:
limits:

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save