Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into dev_bugfix_ljj

master
jianjun 4 years ago
parent
commit
d1d41d7e35
  1. 6
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  2. 2
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  3. 20
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallbackFactory.java
  4. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java
  5. 2
      epmet-auth/src/main/java/com/epmet/AuthApplication.java
  6. 2
      epmet-auth/src/main/java/com/epmet/controller/AuthController.java
  7. 90
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ThreadLocalInitAspect.java
  8. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java
  9. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  10. 30
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/GlobalFilter.java
  11. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java
  12. 12
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  13. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java
  14. 2
      epmet-gateway/src/main/java/com/epmet/GatewayApplication.java
  15. 40
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffRoleListResultDTO.java
  16. 48
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffAgencyGridListResultDTO.java
  17. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/DataAggregatorApplication.java
  18. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  19. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.java
  20. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  21. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java
  22. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java
  23. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  24. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  25. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  26. 83
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  27. 24
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml
  28. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
  29. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  30. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  31. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml
  32. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/DataReportOpenFeignClient.java
  33. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBack.java
  34. 19
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBackFactory.java
  35. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java
  36. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBackFactory.java
  37. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java
  38. 2
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/ActivitiApplication.java
  39. 5
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
  40. 2
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java
  41. 20
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallbackFactory.java
  42. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/EpmetCommonServiceApplication.java
  43. 2
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/DemoApplication.java
  44. 2
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java
  45. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  46. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  47. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallbackFactory.java
  48. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java
  49. 2
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/JobApplication.java
  50. 3
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java
  51. 2
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java
  52. 20
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallbackFactory.java
  53. 2
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/MessageApplication.java
  54. 9
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java
  55. 2
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java
  56. 20
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallbackFactory.java
  57. 2
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/OssApplication.java
  58. 3
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
  59. 2
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
  60. 20
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallbackFactory.java
  61. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java
  62. 5
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java
  63. 5
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java
  64. 2
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java
  65. 18
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallbackFactory.java
  66. 2
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java
  67. 20
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallbackFactory.java
  68. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java
  69. 6
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java
  70. 2
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java
  71. 28
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBackFactory.java
  72. 16
      epmet-module/gov-access/gov-access-server/pom.xml
  73. 2
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/GovAccessApplication.java
  74. 20
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/TestController.java
  75. 5
      epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml
  76. 18
      epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml
  77. 2
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/GovGridApplication.java
  78. 5
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  79. 2
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  80. 20
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBackFactory.java
  81. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/GovIssueApplication.java
  82. 2
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java
  83. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateTagFormDTO.java
  84. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  85. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  86. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallbackFactory.java
  87. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java
  88. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  89. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  90. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  91. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  92. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  93. 5
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  94. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
  95. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
  96. 20
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallbackFactory.java
  97. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/GovProjectApplication.java
  98. 120
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java
  99. 56
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddSpecialSubjectFormDTO.java
  100. 42
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DelSpecialSubjectFormDTO.java

6
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java

@ -3,14 +3,14 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallback;
import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@FeignClient(name = ServiceConstant.EPMET_ADMIN_SERVER, fallback = EpmetAdminOpenFeignClientFallback.class)
//@FeignClient(name = ServiceConstant.EPMET_ADMIN_SERVER, fallback = EpmetAdminOpenFeignClientFallback.class, url = "localhost:8082")
@FeignClient(name = ServiceConstant.EPMET_ADMIN_SERVER, fallbackFactory = EpmetAdminOpenFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_ADMIN_SERVER, fallbackFactory = EpmetAdminOpenFeignClientFallbackFactory.class, url = "localhost:8082")
public interface EpmetAdminOpenFeignClient {
/**

2
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java

@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
//@Component
public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignClient {
@Override
public Result<List<CorsConfigResultDTO>> list() {

20
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class EpmetAdminOpenFeignClientFallbackFactory implements FallbackFactory<EpmetAdminOpenFeignClient> {
private EpmetAdminOpenFeignClientFallback fallback = new EpmetAdminOpenFeignClientFallback();
@Override
public EpmetAdminOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class AdminApplication {
public static void main(String[] args) {

2
epmet-auth/src/main/java/com/epmet/AuthApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan // 开启Servlet容器扫描,扫描@WebFilter等注解
public class AuthApplication {
public static void main(String[] args) {

2
epmet-auth/src/main/java/com/epmet/controller/AuthController.java

@ -15,7 +15,9 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.AuthorizationDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.LoginDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.AuthService;
import com.epmet.service.CaptchaService;
import com.epmet.service.ResourceService;

90
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ThreadLocalInitAspect.java

@ -1,45 +1,45 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
package com.epmet.commons.tools.aspect;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO;
import com.epmet.commons.tools.exception.ExceptionUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* 每次请求清理ThreadLocal线程中的变量
* @Author wxz
* @Description
* @Date 2020/4/23 16:16
**/
@Aspect
@Component
@Order(1)
public class ThreadLocalInitAspect {
private static final Logger log = LoggerFactory.getLogger(ThreadLocalInitAspect.class);
@Before(value = "execution(* com.epmet.controller.*Controller*.*(..)) ")
public void before(JoinPoint point) throws Throwable {
// 清理权限过滤中的变量残留
try {
ThreadLocalConstant.sqlFilter.remove();
ThreadLocalConstant.requirePermissionTl.remove();
} catch (Exception e) {
log.error("清理sqlFilter缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}
///**
// * Copyright (c) 2018 人人开源 All rights reserved.
// * <p>
// * https://www.renren.io
// * <p>
// * 版权所有,侵权必究!
// */
//
//package com.epmet.commons.tools.aspect;
//
//import com.epmet.commons.tools.constant.ThreadLocalConstant;
//import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO;
//import com.epmet.commons.tools.exception.ExceptionUtils;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Before;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.core.annotation.Order;
//import org.springframework.stereotype.Component;
//
///**
// * 每次请求,清理ThreadLocal线程中的变量(已废弃,改用GlobalFilter)
// * @Author wxz
// * @Description
// * @Date 2020/4/23 16:16
// **/
//@Aspect
//@Component
//@Order(1)
//public class ThreadLocalInitAspect {
//
// private static final Logger log = LoggerFactory.getLogger(ThreadLocalInitAspect.class);
//
// @Before(value = "execution(* com.epmet.controller.*Controller*.*(..)) ")
// public void before(JoinPoint point) throws Throwable {
// // 清理权限过滤中的变量残留
// try {
// ThreadLocalConstant.sqlFilter.remove();
// ThreadLocalConstant.requirePermissionTl.remove();
// } catch (Exception e) {
// log.error("清理sqlFilter缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
// }
// }
//}

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java

@ -126,6 +126,12 @@ public enum RequirePermissionEnum {
WORK_PARTY_VOICE_EDIT("work_party_voice_edit", "党建声音:重新编辑", ""),
WORK_PARTY_VOICE_OFFLINE("work_party_voice_offline", "党建声音:下线文章", ""),
WORK_PARTY_VOICE_OPERATION_LIST("work_party_voice_operation_list","党建声音:查看文章操作记录",""),
/**
* 党务工作-专题管理
*/
WORK_SPECIAL_PROJECT_ENTRANCE("work_special_project_entrance","专题管理:功能入口图标","专题管理:图标入口"),
WORK_SPECIAL_PROJECT_ADD("work_special_project_add","专题管理:新增专题","专题管理:新增专题"),
WORK_SPECIAL_PROJECT_DEL("work_special_project_del","专题管理:移除专题","专题管理:移除专题"),
/**
* 基层治理-支部管理

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

@ -138,7 +138,9 @@ public enum EpmetErrorCode {
REPEATED_SUBMIT_ERROR(8804, "请勿重复提交"),
CUSTOMER_VALIDATE_ERROR(8805, "内部数据校验异常"),
CATEGORY_IS_NULL(8806, "请设置分类"),
EXISTED_SPECIAL_PROJECT(8807, "已经添加过此专题"),
CAN_NOT_DEL_SPECIAL_PROJECT(8808, "您没有权限删除此专题"),
TAG_NOT_EXIST(8809,"标签不存在"),
//公众号 865..开头的码
PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"),

30
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/GlobalFilter.java

@ -0,0 +1,30 @@
package com.epmet.commons.tools.filter;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
/**
* @Description 全局过滤器可在请求结束的时候清除线程变量残留
* @author wxz
* @date 2021.07.19 10:19:24
*/
@WebFilter(value = "/*")
public class GlobalFilter implements Filter {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
try {
filterChain.doFilter(servletRequest, servletResponse);
} catch (Throwable e) {
throw e;
} finally {
// 清除线程变量残留
ThreadLocalConstant.sqlFilter.remove();
ThreadLocalConstant.requirePermissionTl.remove();
ThreadLocalConstant.requestParam.remove();
}
}
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java

@ -205,7 +205,7 @@ public class LogMsgSendFilter extends LevelFilter {
return slashMatcher.start();
} catch (Exception e) {
logger.warn("getCharacterPosition no matche", e);
return 0;
return string.length();
}
}

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

@ -228,7 +228,11 @@ public class RedisKeys {
* @return
*/
public static String getCustomerReTagKey(String customerId,String tagId) {
return rootPrefix.concat("tags:customer:relationTag:").concat(customerId).concat(StrConstant.COLON).concat(tagId);
String reTagKey = rootPrefix.concat("tags:customer:relationTag:").concat(customerId);
if (StringUtils.isNotBlank(tagId)){
reTagKey = reTagKey.concat(StrConstant.COLON).concat(tagId);
}
return reTagKey;
}
/**
@ -247,7 +251,11 @@ public class RedisKeys {
* @return
*/
public static String getGridReTagKey(String gridId,String tagId) {
return rootPrefix.concat("tags:grid:relationTag:").concat(gridId).concat(StrConstant.COLON).concat(tagId);
String gridReTagKey = rootPrefix.concat("tags:grid:relationTag:").concat(gridId);
if (StringUtils.isNotBlank(tagId)){
gridReTagKey = gridReTagKey.concat(StrConstant.COLON).concat(tagId);
}
return gridReTagKey;
}
/**

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java

@ -66,7 +66,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
//日期格式转换
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE));
mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN));
mapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
//Long类型转String类型

2
epmet-gateway/src/main/java/com/epmet/GatewayApplication.java

@ -11,6 +11,7 @@ package com.epmet;
import com.epmet.commons.tools.aspect.ServletExceptionHandler;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
@ -25,6 +26,7 @@ import org.springframework.context.annotation.FilterType;
@SpringBootApplication()
@EnableDiscoveryClient
@EnableFeignClients
//@ServletComponentScan
@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {ServletExceptionHandler.class}))
public class GatewayApplication {

40
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffRoleListResultDTO.java

@ -0,0 +1,40 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 根据客户Id staffId查询人员在客户下的角色列表-接口返参
* @Author sun
*/
@Data
public class StaffRoleListResultDTO implements Serializable {
private static final long serialVersionUID = -2049883620062097446L;
/**
* 客户Id
* */
private String customerId;
/**
* 员工Id
* */
private String staffId;
/**
* 员工姓名
* */
private String staffName;
/**
* 角色Id
* */
private String roleId;
/**
* 角色Key
* */
private String roleKey;
/**
* 角色名称
* */
private String roleName;
}

48
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffAgencyGridListResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 专题设置-组织网格切换树结构-接口返参
* @author sun
*/
@Data
public class StaffAgencyGridListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
//机关组织Id
private String agencyId = "";
//机关组织名称
private String agencyName = "";
//机关组织名称
private Boolean isOpt = true;
//网格:grid;社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province
private String orgLevel = "";
//当前组织id的上级id,如果当前是跟组织返回0
private String pid = "";
//当前组织id的所有上级id,如果当前是跟组织返回0
private String pids = "";
//当前机关的下属网格列表
private List<StaffAgencyGridListResultDTO.GridResultDTO> gridList = new ArrayList<>();
//当前组织的所有下级组织信息(递归)
private List<StaffAgencyGridListResultDTO> subAgencyGridList = new ArrayList<>();
@Data
public static class GridResultDTO{
//机关组织Id
private String gridId = "";
//机关组织名称
private String gridName = "";
//网格:grid;社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province
private String orgLevel = "";
//当前网格所属的组织id
private String pid = "";
//当前网格所有上级
private String pids = "";
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/DataAggregatorApplication.java

@ -3,12 +3,14 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication(scanBasePackages = {"com.epmet"}, exclude = {DataSourceAutoConfiguration.class})
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class DataAggregatorApplication {
public static void main(String[] args) {
SpringApplication.run(DataAggregatorApplication.class, args);

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -14,12 +14,11 @@ import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.result.AgencyGridListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govorg.result.NextAreaCodeResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dto.result.PublicAndInternalFileResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
@ -29,7 +28,6 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.PriorityQueue;
/**
* @Author zxc
@ -119,4 +117,15 @@ public class GovOrgController {
List<GridMemberDataAnalysisResultDTO> resultList = aggreGridService.getGridMemberDataAnalysis(gridIds, searchedStaffName, loginUserId, month, sortType.getValue(), pageNo, pageSize);
return new Result().ok(resultList);
}
/**
* @Param tokenDto
* @Description 专题设置-组织网格切换树结构
* @author sun
*/
@PostMapping("staffagencygridlist")
public Result<StaffAgencyGridListResultDTO> staffAgencyGridList(@LoginUser TokenDto tokenDto) {
return new Result<StaffAgencyGridListResultDTO>().ok(govOrgService.staffAgencyGridList(tokenDto));
}
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity;
import org.apache.ibatis.annotations.Mapper;
@ -40,4 +41,11 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @author sun
*/
List<GridStaffResultDTO> staffGridRole(@Param("forms") List<GridStaffResultDTO> forms, @Param("staffName") String staffName);
/**
* @Description 根据客户Id和staffId查询工作人员拥有的角色列表
* @Author sun
**/
List<StaffRoleListResultDTO> selectStaffRoleList(@Param("customerId") String customerId, @Param("staffId") String staffId);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java

@ -19,6 +19,7 @@ package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -52,4 +53,10 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<CustomerAgencyEntity> selectNextAgency(@Param("customerId")String customerId, @Param("pid")String pid);
/**
* @Author sun
* @Description 递归查询当前组织的直属下级组织列表
**/
List<StaffAgencyGridListResultDTO> selectSubAgencyList(@Param("subAgencyPids") String subAgencyPids);
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -68,4 +69,11 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @author sun
*/
List<CustomerGridDTO> getGridInfoList(@Param("gridIds") List<String> gridIds, @Param("staffId") String staffId);
/**
* @Author sun
* @Description 查询当前组织下网格列表
**/
List<StaffAgencyGridListResultDTO.GridResultDTO> getGridListByAgencyId(@Param("agencyId") String agencyId);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java

@ -19,6 +19,7 @@ package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -39,4 +40,10 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @author sun
*/
List<GridStaffResultDTO> selectGridStaffByGridIds(@Param("gridIds") List<String> gridIds);
/**
* @Description 查询工作人员参与的网格列表信息
* @author sun
*/
List<StaffAgencyGridListResultDTO.GridResultDTO> getStaffGridList(@Param("agencyId") String agencyId, @Param("staffId") String staffId);
}

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

@ -81,4 +81,9 @@ public interface EpmetUserService {
*/
OpenStaffDetailResultDTO openStaffDetail(OpenStaffDetailFormDTO formDTO);
/**
* @Description 根据客户Id和staffId查询工作人员拥有的角色列表
* @Author sun
**/
List<StaffRoleListResultDTO> getStaffRoleList(String customerId, String userId);
}

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

@ -365,5 +365,14 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return resultDTO;
}
/**
* @Description 根据客户Id和staffId查询工作人员拥有的角色列表
* @Author sun
**/
@Override
public List<StaffRoleListResultDTO> getStaffRoleList(String customerId, String userId) {
return staffRoleDao.selectStaffRoleList(customerId, userId);
}
}

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -1,5 +1,6 @@
package com.epmet.dataaggre.service.govorg;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
@ -72,4 +73,12 @@ public interface GovOrgService {
* @author sun
*/
CustomerAgencyDTO gridByAgencyId(String customerId, String staffId);
/**
* @Param tokenDto
* @Description 专题设置-组织网格切换树结构
* @author sun
*/
StaffAgencyGridListResultDTO staffAgencyGridList(TokenDto tokenDto);
}

83
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -5,12 +5,13 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao;
import com.epmet.dataaggre.dao.govorg.CustomerGridDao;
import com.epmet.dataaggre.dao.govorg.CustomerStaffAgencyDao;
import com.epmet.dataaggre.dao.govorg.CustomerStaffGridDao;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO;
@ -285,4 +286,84 @@ public class GovOrgServiceImpl implements GovOrgService {
return customerStaffAgencyDao.selectAgencyByStaffId(customerId, staffId);
}
/**
* @Param tokenDto
* @Description 专题设置-组织网格切换树结构
* @author sun
*/
@Override
public StaffAgencyGridListResultDTO staffAgencyGridList(TokenDto tokenDto) {
StaffAgencyGridListResultDTO resultDTO = new StaffAgencyGridListResultDTO();
//1.查询当前人员所属组织信息
CustomerAgencyDTO agencyDTO = customerStaffAgencyDao.selectAgencyByStaffId(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == agencyDTO) {
throw new RenException("未查询到当前工作人员所属组织信息");
}
//2.获取当前人员工作端角色列表信息
List<StaffRoleListResultDTO> roleList = epmetUserService.getStaffRoleList(tokenDto.getCustomerId(), tokenDto.getUserId());
if (roleList.size() < NumConstant.ONE) {
return resultDTO;
}
//3.判断是否具有党建负责人或党建宣传员角色
//机关党建负责人角色
boolean party = false;
//党建宣传员角色
boolean gridParty = false;
for (StaffRoleListResultDTO role : roleList) {
if ("party_principals".equals(role.getRoleKey())) {
party = true;
}
if ("grid_party_director".equals(role.getRoleKey())) {
gridParty = true;
}
}
if (!party && !gridParty) {
return resultDTO;
}
//4.根据不同角色查询不同数据
if (party) {
//4.1:查询当前机关的网格列表以及所有下级机关的网格列表
//当前机关下网格列表
List<StaffAgencyGridListResultDTO.GridResultDTO> gridList = customerGridDao.getGridListByAgencyId(agencyDTO.getId());
resultDTO.setGridList(gridList);
//递归查询当前组织的下级组织以及每个下级组织对应的网格列表
//根组织pids为空
List<StaffAgencyGridListResultDTO> subAgencyGridList = getSubAgencyAndGridList(("".equals(agencyDTO.getPids()) ? "" : agencyDTO.getPids() + ":") + agencyDTO.getId());
resultDTO.setSubAgencyGridList(subAgencyGridList);
} else if (gridParty) {
resultDTO.setIsOpt(false);
//4.2:查询人员在当前机关下参与的网格列表
List<StaffAgencyGridListResultDTO.GridResultDTO> gridList = customerStaffGridDao.getStaffGridList(agencyDTO.getId(), tokenDto.getUserId());
resultDTO.setGridList(gridList);
}
//5.封装数据并返回
resultDTO.setAgencyId(agencyDTO.getId());
resultDTO.setAgencyName(agencyDTO.getOrganizationName());
resultDTO.setOrgLevel(agencyDTO.getLevel());
resultDTO.setPid(agencyDTO.getPid());
resultDTO.setPids(("".equals(agencyDTO.getPids()) ? "0" : agencyDTO.getPids()));
return resultDTO;
}
/**
* @Author sun
* @Description 递归查询当前组织的下一级组织网格列表
**/
private List<StaffAgencyGridListResultDTO> getSubAgencyAndGridList(String subAgencyPids) {
List<StaffAgencyGridListResultDTO> subAgencyList = customerAgencyDao.selectSubAgencyList(subAgencyPids);
if (subAgencyList.size() > NumConstant.ZERO) {
for (StaffAgencyGridListResultDTO sub : subAgencyList) {
List<StaffAgencyGridListResultDTO.GridResultDTO> gridList = customerGridDao.getGridListByAgencyId(sub.getAgencyId());
sub.setGridList(gridList);
List<StaffAgencyGridListResultDTO> subAgency = getSubAgencyAndGridList(sub.getPids() + ":" + sub.getAgencyId());
sub.setSubAgencyGridList(subAgency);
}
}
return subAgencyList;
}
}

24
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml

@ -22,4 +22,28 @@
</foreach>
</select>
<select id="selectStaffRoleList" resultType="com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO">
SELECT
staff.customer_id AS "customerId",
staff.user_id AS "staffId",
staff.real_name AS "staffName",
role.role_id AS "roleId",
rolename.role_key AS "roleKey",
rolename.role_name AS "roleName"
FROM
staff_role role
LEFT JOIN customer_staff staff ON ( role.staff_id = staff.user_id )
LEFT JOIN gov_staff_role rolename ON ( role.role_id = rolename.id )
WHERE
role.del_flag = '0'
AND staff.del_flag = '0'
AND rolename.del_flag = '0'
<if test='null != customerId and "" != customerId'>
AND staff.customer_id = #{customerId}
</if>
<if test='null != staffId and "" != staffId'>
AND staff.user_id = #{staffId}
</if>
</select>
</mapper>

17
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

@ -45,4 +45,21 @@
AND ca.PID = #{pid}
order by ca.CREATED_TIME asc
</select>
<select id="selectSubAgencyList" resultType="com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO">
SELECT
id AS "agencyId",
organization_name AS "agencyName",
level AS "orgLevel",
pid AS "pid",
pids AS "pids"
FROM
customer_agency
WHERE
del_flag = '0'
AND pids = #{subAgencyPids}
ORDER BY
created_time DESC
</select>
</mapper>

16
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

@ -147,4 +147,20 @@
</choose>
</select>
<select id="getGridListByAgencyId" resultType="com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO$GridResultDTO">
SELECT
cg.id AS "gridId",
cg.grid_name AS "gridName",
'grid' AS "orgLevel",
ca.id AS "pid",
IF (ca.pids = '', ca.id, CONCAT(ca.pids, ':', ca.id)) AS "pids"
FROM
customer_grid cg
INNER JOIN customer_agency ca ON cg.pid = ca.id
WHERE
cg.del_flag = '0'
AND ca.del_flag = '0'
AND cg.pid = #{agencyId}
</select>
</mapper>

9
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -19,7 +19,14 @@
<select id="selectAgencyByStaffId" resultType="com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO">
SELECT
ca.id,
ca.all_parent_name
ca.customer_id,
ca.pid,
ca.pids AS "pids" ,
ca.all_parent_name,
ca.organization_name,
ca.level,
ca.area_code,
ca.parent_area_code
FROM
customer_staff_agency csa
INNER JOIN customer_agency ca ON csa.agency_id = ca.id

17
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml

@ -18,4 +18,21 @@
)
</select>
<select id="getStaffGridList" resultType="com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO$GridResultDTO">
SELECT
cg.id AS "gridId",
cg.grid_name AS "gridName",
'grid' AS "orgLevel",
ca.id AS "pid",
IF (ca.pids = '', ca.id, CONCAT(ca.pids, ':', ca.id)) AS "pids"
FROM
customer_staff_grid csg
INNER JOIN customer_grid cg ON csg.grid_id = cg.id
INNER JOIN customer_agency ca ON cg.pid = ca.id
WHERE
csg.del_flag = '0'
AND csg.user_id = #{staffId}
AND ca.id = #{agencyId}
</select>
</mapper>

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/DataReportOpenFeignClient.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.feign.impl.DataReportOpenFeignClientFallBack;
import com.epmet.feign.impl.DataReportOpenFeignClientFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -14,8 +15,8 @@ import org.springframework.web.bind.annotation.PathVariable;
* @author yinzuomei@elink-cn.com
* @date 2021/2/3 22:05
*/
// @FeignClient(name = ServiceConstant.DATA_REPORT_SERVER, fallback = DataReportOpenFeignClientFallBack.class,url = "localhost:8109")
@FeignClient(name = ServiceConstant.DATA_REPORT_SERVER, fallback = DataReportOpenFeignClientFallBack.class)
//@FeignClient(name = ServiceConstant.DATA_REPORT_SERVER, fallbackFactory = DataReportOpenFeignClientFallBackFactory.class,url = "localhost:8109")
@FeignClient(name = ServiceConstant.DATA_REPORT_SERVER, fallbackFactory = DataReportOpenFeignClientFallBackFactory.class)
public interface DataReportOpenFeignClient {
/**
* @param agencyId

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBack.java

@ -7,7 +7,7 @@ import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.feign.DataReportOpenFeignClient;
import org.springframework.stereotype.Component;
@Component
//@Component
public class DataReportOpenFeignClientFallBack implements DataReportOpenFeignClient {
/**
* @param agencyId

19
epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBackFactory.java

@ -0,0 +1,19 @@
package com.epmet.feign.impl;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.DataReportOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class DataReportOpenFeignClientFallBackFactory implements FallbackFactory<DataReportOpenFeignClient> {
private DataReportOpenFeignClientFallBack fallback = new DataReportOpenFeignClientFallBack();
@Override
public DataReportOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java

@ -2,6 +2,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
@ -10,6 +11,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
@EnableDiscoveryClient
@EnableFeignClients
@EnableAsync
@ServletComponentScan
public class DataReportApplication {
public static void main(String[] args) {
SpringApplication.run(DataReportApplication.class, args);

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBackFactory.java

@ -14,7 +14,7 @@ public class DataStatisticalOpenFeignClientFallBackFactory implements FallbackFa
@Override
public DataStatisticalOpenFeignClient create(Throwable cause) {
log.error(ExceptionUtils.getThrowableErrorStackTrace(cause));//自己写的工具类
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java

@ -3,6 +3,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
@ -11,6 +12,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
@EnableFeignClients
@SpringBootApplication (exclude = {DataSourceAutoConfiguration.class})
@EnableAsync
@ServletComponentScan
public class DataStatsApplication {
public static void main(String[] args) {

2
epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/ActivitiApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -25,6 +26,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
})
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class ActivitiApplication {
public static void main(String[] args) {

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

@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallback;
import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
@ -19,8 +20,8 @@ import java.util.Map;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 10:28
*/
@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class)
//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://192.168.1.132:8103")
@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallbackFactory = EpmetCommonServiceOpenFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallbackFactory = EpmetCommonServiceOpenFeignClientFallbackFactory.class, url = "http://192.168.1.132:8103")
public interface EpmetCommonServiceOpenFeignClient {
/**
* @param formDTO

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

@ -17,7 +17,7 @@ import java.util.Map;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 10:32
*/
@Component
//@Component
public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonServiceOpenFeignClient {
@Override
public Result<List<WorkDayResultDTO>> detentionDays(List<WorkDayFormDTO> formDTO) {

20
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class EpmetCommonServiceOpenFeignClientFallbackFactory implements FallbackFactory<EpmetCommonServiceOpenFeignClient> {
private EpmetCommonServiceOpenFeignClientFallback fallback = new EpmetCommonServiceOpenFeignClientFallback();
@Override
public EpmetCommonServiceOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/EpmetCommonServiceApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class EpmetCommonServiceApplication {
public static void main(String[] args) {

2
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/DemoApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class DemoApplication {
public static void main(String[] args) {

2
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java

@ -2,12 +2,14 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class EpmetExtApplication {
public static void main(String[] args) {

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -6,6 +6,7 @@ import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -19,7 +20,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:25
*/
@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallback = EpmetHeartOpenFeignClientFallback.class)
@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallbackFactory = EpmetHeartOpenFeignClientFallbackFactory.class)
public interface EpmetHeartOpenFeignClient {
/**

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -17,7 +17,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:26
*/
@Component
//@Component
public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignClient {
/**

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class EpmetHeartOpenFeignClientFallbackFactory implements FallbackFactory<EpmetHeartOpenFeignClient> {
private EpmetHeartOpenFeignClientFallback fallback = new EpmetHeartOpenFeignClientFallback();
@Override
public EpmetHeartOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

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

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class EpmetHeartApplication {
public static void main(String[] args) {

2
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/JobApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class JobApplication {
public static void main(String[] args) {

3
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java

@ -11,6 +11,7 @@ import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.WxSubscribeUpdateFormDTO;
import com.epmet.dto.result.SendVerificationCodeResultDTO;
import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback;
import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
@ -27,7 +28,7 @@ import java.util.List;
* @date 2020/6/4 13:47
*/
//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class,url = "http://127.0.0.1:8085")
@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class)
@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallbackFactory = EpmetMessageOpenFeignClientFallbackFactory.class)
public interface EpmetMessageOpenFeignClient {
/**
* 发送短信

2
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java

@ -22,7 +22,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:48
*/
@Component
//@Component
public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeignClient {
@Override

20
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class EpmetMessageOpenFeignClientFallbackFactory implements FallbackFactory<EpmetMessageOpenFeignClient> {
private EpmetMessageOpenFeignClientFallback fallback = new EpmetMessageOpenFeignClientFallback();
@Override
public EpmetMessageOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/MessageApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class MessageApplication {
public static void main(String[] args) {

9
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java

@ -12,6 +12,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.feign.fallback.OssFeignClientFallback;
import com.epmet.feign.fallback.OssFeignClientFallbackFactory;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.cloud.openfeign.FeignClient;
@ -28,10 +29,10 @@ import org.springframework.web.multipart.MultipartFile;
* @author Mark sunlightcs@gmail.c om
* @since 1.1.0
*/
@FeignClient(name = ServiceConstant.EPMET_OSS_SERVER, configuration = OssFeignClient.MultipartSupportConfig.class, fallback =
OssFeignClientFallback.class)
//@FeignClient(name = ServiceConstant.EPMET_OSS_SERVER, configuration = OssFeignClient.MultipartSupportConfig.class, fallback =
// OssFeignClientFallback.class)
@FeignClient(name = ServiceConstant.EPMET_OSS_SERVER, configuration = OssFeignClient.MultipartSupportConfig.class, fallbackFactory =
OssFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_OSS_SERVER, configuration = OssFeignClient.MultipartSupportConfig.class, fallbackFactory =
// OssFeignClientFallbackFactory.class)
public interface OssFeignClient {
/**
* 文件上传

2
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java

@ -22,7 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
* @author Mark sunlightcs@gmail.c om
* @since 1.1.0
*/
@Component
//@Component
public class OssFeignClientFallback implements OssFeignClient {
@Override

20
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.OssFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class OssFeignClientFallbackFactory implements FallbackFactory<OssFeignClient> {
private OssFeignClientFallback fallback = new OssFeignClientFallback();
@Override
public OssFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/OssApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class OssApplication {
public static void main(String[] args) {

3
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java

@ -8,6 +8,7 @@ import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback;
import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -18,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @author wangc
* @date 2020/7/9 13:25
*/
@FeignClient(name = ServiceConstant.EPMET_POINT_SERVER, fallback = EpmetPointOpenFeignClientFallback.class)
@FeignClient(name = ServiceConstant.EPMET_POINT_SERVER, fallbackFactory = EpmetPointOpenFeignClientFallbackFactory.class)
public interface EpmetPointOpenFeignClient {
/**

2
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java

@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @Auth wangc
* @Date 2020-07-10 09:14
*/
@Component
//@Component
public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignClient {
@Override
public Result<ResiPointDetailResultDTO> myPoint(CommonUserFormDTO param) {

20
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.EpmetPointOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class EpmetPointOpenFeignClientFallbackFactory implements FallbackFactory<EpmetPointOpenFeignClient> {
private EpmetPointOpenFeignClientFallback fallback = new EpmetPointOpenFeignClientFallback();
@Override
public EpmetPointOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java

@ -2,6 +2,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -14,6 +15,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class EpmetPointApplication {
public static void main(String[] args) {
SpringApplication.run(EpmetPointApplication.class, args);

5
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java

@ -6,6 +6,7 @@ import com.epmet.dto.ProjectDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.EpmetThirdOpenFeignClientFallback;
import com.epmet.feign.fallback.EpmetThirdOpenFeignClientFallbackFactory;
import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import feign.codec.Encoder;
@ -24,9 +25,9 @@ import java.util.List;
* @author zhaoqifeng
* @date 2021/3/18 14:18
*/
// @FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = EpmetThirdOpenFeignClientFallback.class,configuration =
// @FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallbackFactory = EpmetThirdOpenFeignClientFallbackFactory.class,configuration =
// EpmetThirdOpenFeignClient.MultipartSupportConfig.class,url = "localhost:8110")
@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = EpmetThirdOpenFeignClientFallback.class, configuration =
@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallbackFactory = EpmetThirdOpenFeignClientFallbackFactory.class, configuration =
EpmetThirdOpenFeignClient.MultipartSupportConfig.class)
public interface EpmetThirdOpenFeignClient {
/**

5
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java

@ -6,14 +6,15 @@ import com.epmet.dto.form.SaveOrUpdateCustSelPlatformFormDTO;
import com.epmet.dto.form.ThirdPlatformFormDTO;
import com.epmet.dto.result.ThirdplatformResultDTO;
import com.epmet.feign.fallback.ThirdOpenFeignClientFallback;
import com.epmet.feign.fallback.ThirdOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = ThirdOpenFeignClientFallback.class)
//@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = ThirdOpenFeignClientFallback.class, url = "http://localhost:8110")
@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallbackFactory = ThirdOpenFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallbackFactory = ThirdOpenFeignClientFallbackFactory.class, url = "http://localhost:8110")
public interface ThirdOpenFeignClient {
/**

2
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java

@ -18,7 +18,7 @@ import java.util.List;
* @author zhaoqifeng
* @date 2021/3/18 14:17
*/
@Component
//@Component
public class EpmetThirdOpenFeignClientFallback implements EpmetThirdOpenFeignClient {
/**

18
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallbackFactory.java

@ -0,0 +1,18 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.EpmetThirdOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class EpmetThirdOpenFeignClientFallbackFactory implements FallbackFactory<EpmetThirdOpenFeignClient> {
private EpmetThirdOpenFeignClientFallback fallback = new EpmetThirdOpenFeignClientFallback();
@Override
public EpmetThirdOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java

@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
//@Component
public class ThirdOpenFeignClientFallback implements ThirdOpenFeignClient {
@Override
public Result saveOrUpdateSelectedPlatformsInfo(SaveOrUpdateCustSelPlatformFormDTO input) {

20
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.ThirdOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class ThirdOpenFeignClientFallbackFactory implements FallbackFactory<ThirdOpenFeignClient> {
private ThirdOpenFeignClientFallback fallback = new ThirdOpenFeignClientFallback();
@Override
public ThirdOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java

@ -2,12 +2,14 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class EpmetThirdApplication {
public static void main(String[] args) {

6
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java

@ -4,15 +4,15 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.InitDefaultOperationsFormDTO;
import com.epmet.dto.form.ListOpePermsFormDTO;
import com.epmet.feign.fallback.GovAccessFeignClientFallBack;
import com.epmet.feign.fallback.GovAccessFeignClientFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Set;
//@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallBack.class, url = "http://localhost:8099")
@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallBack.class)
//@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallbackFactory = GovAccessFeignClientFallBackFactory.class, url = "http://localhost:8099")
@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallbackFactory = GovAccessFeignClientFallBackFactory.class)
public interface GovAccessFeignClient {
/**

2
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java

@ -14,7 +14,7 @@ import java.util.Set;
* @Description
* @Author sun
*/
@Component
//@Component
public class GovAccessFeignClientFallBack implements GovAccessFeignClient {

28
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBackFactory.java

@ -0,0 +1,28 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.GovAccessFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @Description fallBackFactory用于抛出异常之后返回一个Fallback降级处理对象
* @author wxz
* @date 2021.07.15 09:54:14
*/
@Component
@Slf4j
public class GovAccessFeignClientFallBackFactory implements FallbackFactory<GovAccessFeignClient> {
/**
* 降级处理对象
*/
private GovAccessFeignClientFallBack fallBack = new GovAccessFeignClientFallBack();
@Override
public GovAccessFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallBack;
}
}

16
epmet-module/gov-access/gov-access-server/pom.xml

@ -127,6 +127,10 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
</properties>
</profile>
<profile>
@ -160,6 +164,10 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
</properties>
</profile>
<profile>
@ -193,6 +201,10 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
</properties>
</profile>
<profile>
@ -223,6 +235,10 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1</dingTalk.robot.secret>
</properties>
</profile>
</profiles>

2
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/GovAccessApplication.java

@ -2,6 +2,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -12,6 +13,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
//@EnableConfigurationProperties(value = {DatabaseProperties.class})
public class GovAccessApplication {
public static void main(String[] args) {

20
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/TestController.java

@ -1,12 +1,11 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.ExternalRequestAuth;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.service.TestService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("test")
@ -16,10 +15,17 @@ public class TestController {
private TestService testService;
@ExternalRequestAuth
@GetMapping("test")
public void test() {
System.out.println("TestController -> test()");
@PostMapping("test")
public void test(@RequestBody Input input) {
if (true) {
throw new RenException("测试报错");
}
testService.test();
}
@Data
public static class Input {
private String name;
}
}

5
epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml

@ -124,3 +124,8 @@ pagehelper:
logging:
level:
com.epmet: debug
dingTalk:
robot:
webHook: @dingTalk.robot.webHook@
secret: @dingTalk.robot.secret@

18
epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml

@ -6,6 +6,9 @@
<springProperty scope="context" name="appname" source="spring.application.name"/>
<springProperty scope="context" name="webHook" source="dingTalk.robot.webHook"/>
<springProperty scope="context" name="secret" source="dingTalk.robot.secret"/>
<!-- 日志上下文名称 -->
<contextName>${appname}</contextName>
@ -125,16 +128,25 @@
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 此日志文档只记录ERROR级别的 发送钉钉短信 -->
<filter class="com.epmet.commons.tools.filter.LogMsgSendFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
<webHook>${webHook}</webHook>
<secret>${secret}</secret>
<appName>${appname}</appName>
</filter>
<!-- 此日志文档只记录ERROR级别的 -->
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>-->
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<springProfile name="dev,test,local">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>

2
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/GovGridApplication.java

@ -2,6 +2,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -14,6 +15,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class GovGridApplication {
public static void main(String[] args) {

5
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java

@ -6,6 +6,7 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack;
import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBackFactory;
import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.resi.group.dto.group.form.AllIssueFormDTO;
@ -34,8 +35,8 @@ import java.util.Map;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37
*/
@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class)
//@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101")
@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallbackFactory = GovIssueOpenFeignClientFallBackFactory.class)
//@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallbackFactory = GovIssueOpenFeignClientFallBackFactory.class,url = "localhost:8101")
public interface GovIssueOpenFeignClient {
/**

2
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java

@ -30,7 +30,7 @@ import java.util.Map;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:43
*/
@Component
//@Component
public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient {
@Override
public Result<ApplicationDetailResultDTO> applicationDetail(ApplicationDetailFormDTO applicationDetailFormDTO) {

20
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.GovIssueOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class GovIssueOpenFeignClientFallBackFactory implements FallbackFactory<GovIssueOpenFeignClient> {
private GovIssueOpenFeignClientFallBack fallback = new GovIssueOpenFeignClientFallBack();
@Override
public GovIssueOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/GovIssueApplication.java

@ -2,6 +2,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -13,6 +14,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class GovIssueApplication {
public static void main(String[] args) {
SpringApplication.run(GovIssueApplication.class, args);

2
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java

@ -2,12 +2,14 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class GovMineApplication {
public static void main(String[] args) {

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateTagFormDTO.java

@ -25,6 +25,11 @@ public class UpdateTagFormDTO implements Serializable {
*/
private String tagName;
/**
* 标签颜色
*/
private String tagColor;
/**
* 使用计数
*/

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -8,6 +8,7 @@ import com.epmet.dto.CustomerPartyBranchDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback;
import com.epmet.feign.fallback.GovOrgOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
@ -20,8 +21,8 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37
*/
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092")
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class)
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092")
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class)
public interface GovOrgOpenFeignClient {
/**
@ -352,4 +353,21 @@ public interface GovOrgOpenFeignClient {
**/
@GetMapping(value = "/gov/org/customeragency/getareacodeswitch/{customerId}")
Result<String> getAreaCodeSwitch(@PathVariable("customerId")String customerId);
/**
* @Description 根据网格ID查询pids
* @Param gridId
* @author zxc
* @date 2021/7/16 9:52 上午
*/
@PostMapping(value = "/gov/org/customergrid/pidsbygrid")
Result<String> selectPidsByGridId(@RequestParam("gridId") String gridId);
/**
* 工作人员的个人信息
* @param fromDTO
* @return
*/
@PostMapping("/gov/org/staff/mine")
Result<MineResultDTO> queryStaffProfile(@RequestBody StaffInfoFromDTO fromDTO);
}

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -19,7 +19,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37
*/
@Component
//@Component
public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
@Override
public Result<CustomerAgencyDTO> getAgencyById(String agencyId) {
@ -209,4 +209,14 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<String> getAreaCodeSwitch(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAreaCodeSwitch", customerId);
}
@Override
public Result<MineResultDTO> queryStaffProfile(StaffInfoFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "mine", fromDTO);
}
@Override
public Result<String> selectPidsByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);
}
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.GovOrgOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class GovOrgOpenFeignClientFallbackFactory implements FallbackFactory<GovOrgOpenFeignClient> {
private GovOrgOpenFeignClientFallback fallback = new GovOrgOpenFeignClientFallback();
@Override
public GovOrgOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java

@ -10,6 +10,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -22,6 +23,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class GovOrgApplication {
public static void main(String[] args) {

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

@ -241,4 +241,15 @@ public class CustomerGridController {
List<String> resultDTOS = customerGridService.listGridIdsInCommunity(gridId);
return new Result<List<String>>().ok(resultDTOS);
}
/**
* @Description 根据网格ID查询pids
* @Param gridId
* @author zxc
* @date 2021/7/16 9:52 上午
*/
@PostMapping("pidsbygrid")
public Result<String> selectPidsByGridId(@RequestParam("gridId") String gridId){
return new Result<String>().ok(customerGridService.selectPidsByGridId(gridId));
}
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -268,4 +268,12 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @date 2021/4/19 11:56 上午
*/
CustomerGridDTO getGridBaseInfoById(@Param("gridId") String gridId);
/**
* @Description 根据网格ID查询pids
* @Param gridId
* @author zxc
* @date 2021/7/16 9:52 上午
*/
String selectPidsByGridId(@Param("gridId")String gridId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -287,4 +287,12 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @date 2021/4/19 11:53 上午
*/
Result<CustomerGridDTO> getBaseInfo(CustomerGridFormDTO customerGridFormDTO);
/**
* @Description 根据网格ID查询pids
* @Param gridId
* @author zxc
* @date 2021/7/16 9:52 上午
*/
String selectPidsByGridId(String gridId);
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -707,4 +707,18 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
public Result<CustomerGridDTO> getBaseInfo(CustomerGridFormDTO customerGridFormDTO) {
return new Result<CustomerGridDTO>().ok(ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class));
}
/**
* @Description 根据网格ID查询pids
* @Param gridId
* @author zxc
* @date 2021/7/16 9:52 上午
*/
@Override
public String selectPidsByGridId(String gridId) {
if (StringUtils.isNotBlank(gridId)){
return baseDao.selectPidsByGridId(gridId);
}
return "";
}
}

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

@ -118,6 +118,8 @@
FROM customer_staff_agency csa
INNER JOIN customer_agency ca ON (csa.AGENCY_ID = ca.ID)
WHERE csa.USER_ID = #{staffId}
and csa.del_flag='0'
and ca.del_flag='0'
</select>
<select id="selectAgencyListByIds" resultType="com.epmet.dto.CustomerAgencyDTO">

5
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -579,4 +579,9 @@
cg.ID = #{gridId}
AND cg.DEL_FLAG = '0'
</select>
<!-- 根据网格ID查询pids -->
<select id="selectPidsByGridId" resultType="java.lang.String">
SELECT PIDS FROM customer_grid WHERE DEL_FLAG = '0' AND ID = #{gridId}
</select>
</mapper>

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java

@ -7,6 +7,7 @@ import com.epmet.dto.ProjectDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback;
import com.epmet.feign.fallback.GovProjectOpenFeignClientFallbackFactory;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
@ -22,8 +23,8 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:32
*/
// @FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class,url = "localhost:8102")
@FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class)
// @FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallbackFactory = GovProjectOpenFeignClientFallbackFactory.class,url = "localhost:8102")
@FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallbackFactory = GovProjectOpenFeignClientFallbackFactory.class)
public interface GovProjectOpenFeignClient {
/**
* 待处理项目列表

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java

@ -19,7 +19,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:33
*/
@Component
//@Component
public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignClient {
@Override
public Result<List<PendProjectListResultDTO>> getPendProjectList(ProjectListFromDTO fromDTO) {

20
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.feign.GovProjectOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class GovProjectOpenFeignClientFallbackFactory implements FallbackFactory<GovProjectOpenFeignClient> {
private GovProjectOpenFeignClientFallback fallback = new GovProjectOpenFeignClientFallback();
@Override
public GovProjectOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/GovProjectApplication.java

@ -2,6 +2,7 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -13,6 +14,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
public class GovProjectApplication {
public static void main(String[] args) {
SpringApplication.run(GovProjectApplication.class, args);

120
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java

@ -0,0 +1,120 @@
/**
* 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;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 专题表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-07-15
*/
@Data
public class SpecialSubjectDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键(专题id)
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 标签id
*/
private String tagId;
/**
* 新增此专题的用户id
*/
private String addUserId;
/**
* 新增此专题时用户所在的组织id或者网格id
*/
private String addOrgId;
/**
* 网格grid社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
private String orgLevel;
/**
* 新增此专题用户所属的组织id
*/
private String addUserAgencyId;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 标签名
*/
private String tagName;
/**
* 扩展属性标签颜色
*/
private String tagColor;
/**
* 删除人id
*/
private String delStaffId;
}

56
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddSpecialSubjectFormDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 专题管理添加专题
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/15 14:24
*/
@Data
public class AddSpecialSubjectFormDTO implements Serializable {
private static final long serialVersionUID = -4469613386814496224L;
public interface AddUserInternalGroup {
}
/**
* 当前所在网格或者组织id
*/
@NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class)
private String orgId;
@NotBlank(message = "pid不能为空", groups = AddUserInternalGroup.class)
private String pid;
/**
* orgId的所有上级id
*/
@NotBlank(message = "pids不能为空", groups = AddUserInternalGroup.class)
private String pids;
/**
* 网格grid社区级community 街道:street, 区县级: district, 市级: city 省级:province
*/
@NotBlank(message = "orgLevel不能为空", groups = AddUserInternalGroup.class)
private String orgLevel;
/**
* 所选的标签id
*/
@NotBlank(message = "tagId不能为空", groups = AddUserInternalGroup.class)
private String tagId;
// 以下属性从token中获取
/**
* 从TokenDto中获取当前用户id
*/
@NotBlank(message = "从token中获取userId为空", groups = AddUserInternalGroup.class)
private String addUserId;
@NotBlank(message = "从token中获取客户id为空", groups = AddUserInternalGroup.class)
private String customerId;
}

42
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DelSpecialSubjectFormDTO.java

@ -0,0 +1,42 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 专题管理删除专题
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/15 20:50
*/
@Data
public class DelSpecialSubjectFormDTO implements Serializable {
private static final long serialVersionUID = -2305529822756834522L;
public interface AddUserInternalGroup {
}
/**
* 专题id
*/
@NotBlank(message = "specialSubjectId不能为空", groups = AddUserInternalGroup.class)
private String specialSubjectId;
/**
* 当前所在网格或者组织id
*/
@NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class)
private String orgId;
// 以下属性从token中获取
/**
* 从TokenDto中获取当前用户id
*/
@NotBlank(message = "从token中获取userId为空", groups = AddUserInternalGroup.class)
private String userId;
@NotBlank(message = "从token中获取客户id为空", groups = AddUserInternalGroup.class)
private String customerId;
}

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

Loading…
Cancel
Save