Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_screen_data_2.0

master
wangchao 5 years ago
parent
commit
c788d18084
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
  2. 7
      epmet-gateway/pom.xml
  3. 26
      epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java
  4. 31
      epmet-gateway/src/main/java/com/epmet/auth/ExtAppAuthProcessor.java
  5. 92
      epmet-gateway/src/main/java/com/epmet/auth/ExtAppJwtAuthProcessor.java
  6. 75
      epmet-gateway/src/main/java/com/epmet/auth/ExtAppMD5AuthProcessor.java
  7. 79
      epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java
  8. 175
      epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java
  9. 275
      epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java
  10. 9
      epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java
  11. 35
      epmet-gateway/src/main/java/com/epmet/filter/UserTokenFilter.java
  12. 12
      epmet-gateway/src/main/java/com/epmet/jwt/JwtTokenUtils.java
  13. 8
      epmet-gateway/src/main/resources/bootstrap.yml
  14. 34
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java
  15. 55
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java
  16. 4
      epmet-module/data-report/data-report-server/pom.xml
  17. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
  18. 22
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  19. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java
  20. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java
  21. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java
  22. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  23. 146
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java
  24. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java
  25. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  26. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java
  27. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  28. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  29. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java
  30. 22
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java
  31. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  32. 32
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  33. 36
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java
  34. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  35. 1
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
  36. 19
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  37. 12
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml
  38. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java
  39. 21
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java
  40. 19
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java
  41. 97
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java
  42. 73
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java
  43. 90
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java
  44. 23
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java
  45. 22
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java
  46. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java
  47. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  48. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  49. 2
      epmet-module/data-statistical/data-statistical-server/pom.xml
  50. 54
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  51. 55
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java
  52. 48
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java
  53. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
  54. 159
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java
  55. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java
  56. 108
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java
  57. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  58. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  59. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  60. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  61. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  62. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  63. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  64. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java
  65. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java
  66. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java
  67. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java
  68. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java
  69. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java
  70. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java
  71. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java
  72. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java
  73. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  74. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java
  75. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java
  76. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java
  77. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java
  78. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  79. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  80. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  81. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java
  82. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java
  83. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java
  84. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java
  85. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java
  86. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  87. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java
  88. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  89. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  90. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  91. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java
  92. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  93. 68
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  94. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java
  95. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java
  96. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java
  97. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java
  98. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java
  99. 124
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  100. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java

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

@ -96,6 +96,8 @@ public interface Constant {
* authorization header
*/
String AUTHORIZATION_HEADER = "authorization";
String ACCESS_TOKEN_HEADER = "AccessToken";
/**
* APP用户标识
*/

7
epmet-gateway/pom.xml

@ -58,6 +58,13 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<!--用于外部应用认证的查询-->
<dependency>
<groupId>com.epmet</groupId>
<artifactId>common-service-client</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>

26
epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java

@ -0,0 +1,26 @@
package com.epmet.auth;
import com.alibaba.fastjson.JSON;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.nio.charset.StandardCharsets;
public abstract class AuthProcessor {
abstract Mono<Void> auth(ServerWebExchange exchange, GatewayFilterChain chain);
protected Mono<Void> response(ServerWebExchange exchange, Object object) {
String json = JSON.toJSONString(object);
DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8));
exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8);
exchange.getResponse().setStatusCode(HttpStatus.OK);
return exchange.getResponse().writeWith(Flux.just(buffer));
}
}

31
epmet-gateway/src/main/java/com/epmet/auth/ExtAppAuthProcessor.java

@ -0,0 +1,31 @@
package com.epmet.auth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.server.ServerWebExchange;
/**
* 外部应用认证处理器父类
*/
public abstract class ExtAppAuthProcessor {
private Logger logger = LoggerFactory.getLogger(getClass());
private int diffMillins = 1000 * 60 * 5;
public abstract void auth(String appId, String token, Long ts, ServerWebExchange exchange);
/**
* 时间戳校验
* @param timestamp
* @return
*/
protected boolean validTimeStamp(Long timestamp) {
long now = System.currentTimeMillis();
if (Math.abs(now - timestamp) > diffMillins) {
return false;
}
return true;
}
}

92
epmet-gateway/src/main/java/com/epmet/auth/ExtAppJwtAuthProcessor.java

@ -0,0 +1,92 @@
package com.epmet.auth;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.jwt.JwtTokenUtils;
import io.jsonwebtoken.Claims;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
/**
* jwt 认证处理器
*/
@Component
public class ExtAppJwtAuthProcessor extends ExtAppAuthProcessor {
private static Logger logger = LoggerFactory.getLogger(ExtAppJwtAuthProcessor.class);
@Autowired
private JwtTokenUtils jwtTokenUtils;
@Autowired
private RedisUtils redisUtils;
@Override
public void auth(String appId, String token, Long ts, ServerWebExchange exchange) {
String secret;
if (StringUtils.isBlank(secret = getTokenFromCache(appId))) {
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), String.format("根据AppId:【%s】没有找到对应的秘钥", appId));
}
Claims claim;
try {
claim = jwtTokenUtils.getClaimByToken(token, secret);
} catch (Exception e) {
String errorStackTrace = ExceptionUtils.getErrorStackTrace(e);
logger.error("解析token失败:{}", errorStackTrace);
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "解析token失败");
}
String appIdIn = (String)claim.get("appId");
String customerId = (String)claim.get("customerId");
Long timestamp = (Long)claim.get("ts");
//校验时间戳,允许5分钟误差
if (StringUtils.isAnyBlank(appIdIn, customerId) || timestamp == null) {
logger.error("access token不完整。{},{},{}", appIdIn, customerId, timestamp);
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken不完整");
}
if (!validTimeStamp(timestamp)) {
logger.error("extapp token已经超时,请求被拒绝");
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken已经超时");
}
if (!appId.equals(appIdIn)) {
logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn);
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AppId不匹配");
}
// 添加客户ID等到请求头
exchange.getRequest().mutate().header("CustomerId", customerId);
}
/**
* 通过APP ID查询对应的秘钥
* @param appId
* @return
*/
public String getTokenFromCache(String appId) {
String secret = (String)redisUtils.get(RedisKeys.getExternalAppSecretKey(appId));
if (StringUtils.isBlank(secret)) {
EpmetCommonServiceOpenFeignClient commonService = SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class);
Result<String> result = commonService.getSecret(appId);
if (!result.success()) {
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), result.getInternalMsg());
}
secret = result.getData();
redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret);
}
return secret;
}
}

75
epmet-gateway/src/main/java/com/epmet/auth/ExtAppMD5AuthProcessor.java

@ -0,0 +1,75 @@
package com.epmet.auth;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.Md5Util;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
/**
* md5 认证处理器
*/
@Component
public class ExtAppMD5AuthProcessor extends ExtAppAuthProcessor {
private static Logger logger = LoggerFactory.getLogger(ExtAppMD5AuthProcessor.class);
//@Autowired
//private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private RedisUtils redisUtils;
@Override
public void auth(String appId, String token, Long ts, ServerWebExchange exchange) {
if (ts == null) {
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "需要传入时间戳参数");
}
String secret;
if (StringUtils.isBlank(secret = getTokenFromCache(appId))) {
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), String.format("根据AppId:%s没有找到对应的秘钥", appId));
}
String localDigest = Md5Util.md5(secret.concat(":") + ts);
if (!localDigest.equals(token)) {
// 调用方生成的摘要跟本地生成的摘要不匹配
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "签名不匹配,认证失败");
}
if (!validTimeStamp(ts)) {
logger.error("AccessToken已经超时,请求被拒绝");
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken已经超时,请求被拒绝");
}
}
/**
* 通过APP ID查询对应的秘钥
*
* @param appId
* @return
*/
public String getTokenFromCache(String appId) {
String secret = (String) redisUtils.get(RedisKeys.getExternalAppSecretKey(appId));
if (StringUtils.isBlank(secret)) {
EpmetCommonServiceOpenFeignClient commonService = SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class);
Result<String> result = commonService.getSecret(appId);
if (!result.success()) {
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), result.getInternalMsg());
}
secret = result.getData();
redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret);
}
return secret;
}
}

79
epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java

@ -0,0 +1,79 @@
package com.epmet.auth;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
/**
* 外部应用认证
*/
@Component
public class ExternalAuthProcessor extends AuthProcessor {
private Logger logger = LoggerFactory.getLogger(getClass());
// 头s
public static final String AUTHORIZATION_TOKEN_HEADER_KEY = "Authorization";
public static final String ACCESS_TOKEN_HEADER_KEY = "AccessToken";
public static final String APP_ID_HEADER_KEY = "appId";
public static final String APP_ID_TIMESTAMP_KEY = "ts";
public static final String APP_ID_CUSTOMER_ID_KEY = "CustomerId";
public static final String APP_ID_AUTY_TYPE_KEY = "AuthType";
// 认证方式
public static final String APP_AUTH_TYPE_JWT = "jwt";
public static final String APP_AUTH_TYPE_MD5 = "md5";
@Autowired
private ExtAppJwtAuthProcessor jwtAuthProcessor;
@Autowired
private ExtAppMD5AuthProcessor md5AuthProcessor;
@Override
public Mono<Void> auth(ServerWebExchange exchange, GatewayFilterChain chain) {
HttpHeaders headers = exchange.getRequest().getHeaders();
String token = headers.getFirst(ACCESS_TOKEN_HEADER_KEY);
String appId = headers.getFirst(APP_ID_HEADER_KEY);
String ts = headers.getFirst(APP_ID_TIMESTAMP_KEY);
String customerId = headers.getFirst(APP_ID_CUSTOMER_ID_KEY);
String authType = headers.getFirst(APP_ID_AUTY_TYPE_KEY);
if (StringUtils.isAnyBlank(token, appId)) {
throw new RenException("请求头中的AccessToken和AppId不能为空");
}
logger.info("外部应用请求认证拦截Aspect执行,appId:{}, token:{}, ts:{}, customerId:{}, authType:{}",
appId, token, ts, customerId, authType);
// 没传authType或者传的jwt都用jwtprocessor处理
try {
if (StringUtils.isBlank(authType) || APP_AUTH_TYPE_JWT.equals(authType)) {
jwtAuthProcessor.auth(appId, token, StringUtils.isNotBlank(ts) ? new Long(ts) : null, exchange);
} else if (APP_AUTH_TYPE_MD5.equals(authType)) {
md5AuthProcessor.auth(appId, token, StringUtils.isNotBlank(ts) ? new Long(ts) : null, exchange);
} else {
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "未知的认证类型");
}
} catch (RenException e) {
return response(exchange, new Result<>().error(e.getCode(), e.getMsg()));
} catch (Exception e) {
logger.error("外部应用请求认证发生未知错误:" + ExceptionUtils.getErrorStackTrace(e));
return response(exchange, new Result<>().error("外部应用请求认证发生未知错误"));
}
return chain.filter(exchange);
}
}

175
epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java

@ -0,0 +1,175 @@
package com.epmet.auth;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.BaseTokenDto;
import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.jwt.JwtTokenUtils;
import io.jsonwebtoken.Claims;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
/**
* 内部认证处理器
*/
@Component
public class InternalAuthProcessor extends AuthProcessor {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private JwtTokenUtils jwtTokenUtils;
@Autowired
private CpUserDetailRedis cpUserDetailRedis;
@Override
public Mono<Void> auth(ServerWebExchange exchange, GatewayFilterChain chain) {
ServerHttpRequest request = exchange.getRequest();
String requestUri = request.getPath().pathWithinApplication().value();
logger.info("CpAuthGatewayFilterFactory当前requestUri=[" + requestUri + "]CpAuthGatewayFilterFactory拦截成功");
String token = getTokenFromRequest(request);
//BaseTokenDto baseTokenDto = StringUtils.isNotBlank(token) ? getBaseTokenDto(token, jwtTokenUtils) : null;
BaseTokenDto baseTokenDto;
if(StringUtils.isNotBlank(token)){
try{
baseTokenDto = getBaseTokenDto(token, jwtTokenUtils);
}catch(RenException e){
return response(exchange,new Result<>().error(e.getCode(),e.getMsg()));
}
}else{
baseTokenDto = null;
}
String customerId = "";
if (baseTokenDto != null) {
if (AppClientConstant.APP_RESI.equals(baseTokenDto.getApp())) {
// 居民端
TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, TokenDto.class);
if (resiTokenDto != null) {
customerId = resiTokenDto.getCustomerId();
baseTokenDto = resiTokenDto;
}
} else if (AppClientConstant.APP_GOV.equals(baseTokenDto.getApp())) {
// 政府端
GovTokenDto govTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, GovTokenDto.class);
if (govTokenDto != null) {
customerId = govTokenDto.getCustomerId();
baseTokenDto = govTokenDto;
}
} else if(AppClientConstant.APP_OPER.equals(baseTokenDto.getApp())){
//运营端
TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, TokenDto.class);
if (resiTokenDto != null) {
customerId = resiTokenDto.getCustomerId();
baseTokenDto = resiTokenDto;
}
}
}
// 校验token
if (StringUtils.isBlank(token)) {
return response(exchange,new Result<>().error(EpmetErrorCode.ERR10005.getCode(),EpmetErrorCode.ERR10005.getMsg()));
}
try {
validateTokenDto(baseTokenDto, token);
} catch (RenException e) {
return response(exchange,new Result<>().error(e.getCode(),e.getMsg()));
}
// 添加header
if (baseTokenDto != null) {
String redisKey = baseTokenDto.getApp() + "-" + baseTokenDto.getClient() + "-" + baseTokenDto.getUserId();
logger.info("redisKey=" + redisKey);
exchange.getRequest().mutate()
.header(Constant.APP_USER_KEY, redisKey)
.header(AppClientConstant.APP,baseTokenDto.getApp())
.header(AppClientConstant.CLIENT,baseTokenDto.getClient())
.header(AppClientConstant.USER_ID,baseTokenDto.getUserId());
if (StringUtils.equals(baseTokenDto.getApp(), "gov")) {//工作端
if(StringUtils.isNotBlank(customerId)){
exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId);
}
} else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端
exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId);
}
ServerHttpRequest build = exchange.getRequest().mutate().build();
return chain.filter(exchange.mutate().request(build).build());
}
return chain.filter(exchange);
}
/**
* 从请求中获取token
* @param request
* @return
*/
private String getTokenFromRequest(ServerHttpRequest request) {
HttpHeaders headers = request.getHeaders();
String token = headers.getFirst(Constant.AUTHORIZATION_HEADER);
if (StringUtils.isBlank(token)) {
token = headers.getFirst(Constant.TOKEN_HEADER);
}
if (StringUtils.isBlank(token)) {
token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER);
}
return token;
}
private BaseTokenDto getBaseTokenDto(String token, JwtTokenUtils jwtTokenUtils) {
//是否过期
Claims claims = jwtTokenUtils.getClaimByToken(token);
if (claims == null || jwtTokenUtils.isTokenExpired(claims.getExpiration())) {
return null;
}
//获取用户ID
String app = (String) claims.get("app");
String client = (String) claims.get("client");
String userId = (String) claims.get("userId");
return new BaseTokenDto(app, client, userId, token);
}
private <T> T getLoginUserInfoByToken(String token, JwtTokenUtils jwtTokenUtils, Class<T> clz) {
BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils);
//查询Redis
return cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId(), clz);
}
/**
* 校验Token是否异常
* @param tokenDto
* @param tokenStr
*/
private void validateTokenDto(BaseTokenDto tokenDto, String tokenStr) {
if (null == tokenDto) {
//说明登录状态时效(超时)
throw new RenException(EpmetErrorCode.ERR10006.getCode());
}else{
//Redis中存在数据,取出token,进行比对
if(StringUtils.equals(tokenDto.getToken(),tokenStr)){
//用户携带token与Redis中一致
}else{
//用户携带token与Redis中不一致,说明当前用户此次会话失效,提示重新登陆
throw new RenException(EpmetErrorCode.ERR10007.getCode());
}
}
}
}

275
epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java

@ -2,16 +2,12 @@
package com.epmet.filter;
import com.alibaba.fastjson.JSON;
import com.epmet.auth.ExternalAuthProcessor;
import com.epmet.auth.InternalAuthProcessor;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.BaseTokenDto;
import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.jwt.JwtTokenUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -40,16 +36,25 @@ import java.util.List;
* @since 1.0.0
*/
@Component("CpAuth")
public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpAuthGatewayFilterFactory.CpAuthConfig> implements UserTokenFilter {
public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpAuthGatewayFilterFactory.CpAuthConfig> {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private CpProperty cpProperty;
private final AntPathMatcher antPathMatcher = new AntPathMatcher();
public static final String AUTH_TYPE_INTERNAL = "internal";
public static final String AUTH_TYPE_EXTERNAL = "external";
public static final String AUTH_TYPE_NO_NEED = "no_need";
public static final String AUTH_TYPE_UNKNOW = "unknow";
@Autowired
private JwtTokenUtils jwtTokenUtils;
private CpProperty cpProperty;
@Autowired
private CpUserDetailRedis cpUserDetailRedis;
private InternalAuthProcessor internalAuthProcessor;
@Autowired
private ExternalAuthProcessor externalAuthProcessor;
@Override
public List<String> shortcutFieldOrder() {
@ -67,82 +72,23 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpA
return chain.filter(exchange);
}
ServerHttpRequest request = exchange.getRequest();
String requestUri = request.getPath().pathWithinApplication().value();
logger.info("CpAuthGatewayFilterFactory当前requestUri=[" + requestUri + "]CpAuthGatewayFilterFactory拦截成功");
String token = getTokenFromRequest(request);
//BaseTokenDto baseTokenDto = StringUtils.isNotBlank(token) ? getBaseTokenDto(token, jwtTokenUtils) : null;
BaseTokenDto baseTokenDto;
if(StringUtils.isNotBlank(token)){
try{
baseTokenDto = getBaseTokenDto(token, jwtTokenUtils);
}catch(RenException e){
return response(exchange,new Result<>().error(e.getCode(),e.getMsg()));
}
}else{
baseTokenDto = null;
}
String customerId = "";
if (baseTokenDto != null) {
if (AppClientConstant.APP_RESI.equals(baseTokenDto.getApp())) {
// 居民端
TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, TokenDto.class);
if (resiTokenDto != null) {
customerId = resiTokenDto.getCustomerId();
baseTokenDto = resiTokenDto;
}
} else if (AppClientConstant.APP_GOV.equals(baseTokenDto.getApp())) {
// 政府端
GovTokenDto govTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, GovTokenDto.class);
if (govTokenDto != null) {
customerId = govTokenDto.getCustomerId();
baseTokenDto = govTokenDto;
}
} else if(AppClientConstant.APP_OPER.equals(baseTokenDto.getApp())){
//运营端
TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, TokenDto.class);
if (resiTokenDto != null) {
customerId = resiTokenDto.getCustomerId();
baseTokenDto = resiTokenDto;
}
}
}
//需要认证
if (needAuth(requestUri)) {
if (StringUtils.isBlank(token)) {
return response(exchange,new Result<>().error(EpmetErrorCode.ERR10005.getCode(),EpmetErrorCode.ERR10005.getMsg()));
}
// 校验token
try {
validateTokenDto(baseTokenDto, token);
} catch (RenException e) {
return response(exchange,new Result<>().error(e.getCode(),e.getMsg()));
}
}
//添加流水号
exchange.getRequest().mutate().header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()});
if (baseTokenDto != null) {
String redisKey = baseTokenDto.getApp() + "-" + baseTokenDto.getClient() + "-" + baseTokenDto.getUserId();
logger.info("redisKey=" + redisKey);
exchange.getRequest().mutate()
.header(Constant.APP_USER_KEY, redisKey)
.header(AppClientConstant.APP,baseTokenDto.getApp())
.header(AppClientConstant.CLIENT,baseTokenDto.getClient())
.header(AppClientConstant.USER_ID,baseTokenDto.getUserId())
;
if (StringUtils.equals(baseTokenDto.getApp(), "gov")) {//工作端
if(StringUtils.isNotBlank(customerId)){
exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId);
}
} else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端
exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId);
}
ServerHttpRequest build = exchange.getRequest().mutate().build();
return chain.filter(exchange.mutate().request(build).build());
ServerHttpRequest request = exchange.getRequest();
String authType = getAuthType(request);
switch (authType) {
case AUTH_TYPE_EXTERNAL:
return externalAuthProcessor.auth(exchange, chain);
case AUTH_TYPE_INTERNAL:
return internalAuthProcessor.auth(exchange, chain);
case AUTH_TYPE_NO_NEED:
break;
default:
return response(exchange, new Result<>().error(EpmetErrorCode.ERR401.getCode(),
EpmetErrorCode.ERR401.getMsg()));
}
return chain.filter(exchange);
@ -150,85 +96,71 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpA
}
/**
* 获取事务流水号
* 判断需要执行的认证方式(内部应用认证还是外部应用认证)
* @return
*/
public static String getTransactionSerial() {
String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n"
, "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
private String getAuthType(ServerHttpRequest request) {
String requestUri = request.getPath().pathWithinApplication().value();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 2; i++) {
sb.append(letterPool[(int) (Math.random() * 25)]);
boolean existsInInternal = false;
boolean existsInExternal = false;
for (String url : cpProperty.getInternalAuthUrls()) {
if (antPathMatcher.match(url, requestUri)) {
existsInInternal = true;
}
}
sb.append(System.currentTimeMillis());
return sb.toString();
for (String url : cpProperty.getExternalAuthUrls()) {
if (antPathMatcher.match(url, requestUri)) {
existsInExternal = true;
}
}
if (!existsInInternal && !existsInExternal) {
// 既不再内部认证url,也不在外部认证url,那么不需要认证
return AUTH_TYPE_NO_NEED;
}
// 内部认证
if (StringUtils.isNotBlank(getHeader(request, Constant.AUTHORIZATION_HEADER))
&& existsInInternal) {
return AUTH_TYPE_INTERNAL;
}
if (StringUtils.isNotBlank(getHeader(request, Constant.ACCESS_TOKEN_HEADER))
&& existsInExternal) {
return AUTH_TYPE_EXTERNAL;
}
return AUTH_TYPE_UNKNOW;
}
//public TokenDto getLoginUserInfo(String token) {
// //是否过期
// Claims claims = jwtTokenUtils.getClaimByToken(token);
// if (claims == null || jwtTokenUtils.isTokenExpired(claims.getExpiration())) {
// throw new RenException(ErrorCode.ERR401.getCode(),ErrorCode.ERR401.getMsg());
// }
// //获取用户ID
// String app = (String) claims.get("app");
// String client = (String) claims.get("client");
// String userId = (String) claims.get("userId");
// //查询Redis
// TokenDto tokenDto = cpUserDetailRedis.get(app, client, userId);
// if (null == tokenDto) {
// //说明登录状态时效(超时)
// throw new RenException(ErrorCode.ERR10006.getCode(),ErrorCode.ERR10006.getMsg());
// }else{
// //Redis中存在数据,取出token,进行比对
// if(StringUtils.equals(tokenDto.getToken(),token)){
// //用户携带token与Redis中一致
//
// }else{
// //用户携带token与Redis中不一致,说明当前用户此次会话失效,提示重新登陆
// throw new RenException(ErrorCode.ERR10007.getCode(),ErrorCode.ERR10007.getMsg());
// }
//
// }
//
// return tokenDto;
//}
private Mono<Void> response(ServerWebExchange exchange, Object object) {
String json = JSON.toJSONString(object);
DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8));
exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8);
exchange.getResponse().setStatusCode(HttpStatus.OK);
return exchange.getResponse().writeWith(Flux.just(buffer));
/**
* 获取请求头
* @param request
* @return
*/
private String getHeader(ServerHttpRequest request, String headerName) {
HttpHeaders headers = request.getHeaders();
return headers.getFirst(headerName);
}
/**
* 是否需要认证
* @param requestUri
* 获取事务流水号
* @return
*/
private boolean needAuth(String requestUri) {
// 优先判断白名单,在白名单中的就直接放行
for (String url : cpProperty.getUrlWhiteList()) {
if (antPathMatcher.match(url, requestUri)) {
return false;
}
}
public static String getTransactionSerial() {
String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n"
, "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
for (String url : cpProperty.getSwaggerUrls()) {
if (antPathMatcher.match(url, requestUri)) {
return false;
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 2; i++) {
sb.append(letterPool[(int) (Math.random() * 25)]);
}
for (String url : cpProperty.getUrls()) {
if (antPathMatcher.match(url, requestUri)) {
return true;
}
}
return false;
sb.append(System.currentTimeMillis());
return sb.toString();
}
public static class CpAuthConfig {
@ -250,45 +182,12 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpA
}
}
/**
* 校验Token是否异常
* @param tokenDto
* @param tokenStr
*/
public void validateTokenDto(BaseTokenDto tokenDto, String tokenStr) {
if (null == tokenDto) {
//说明登录状态时效(超时)
throw new RenException(EpmetErrorCode.ERR10006.getCode());
}else{
//Redis中存在数据,取出token,进行比对
if(StringUtils.equals(tokenDto.getToken(),tokenStr)){
//用户携带token与Redis中一致
}else{
//用户携带token与Redis中不一致,说明当前用户此次会话失效,提示重新登陆
throw new RenException(EpmetErrorCode.ERR10007.getCode());
}
}
protected Mono<Void> response(ServerWebExchange exchange, Object object) {
String json = JSON.toJSONString(object);
DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8));
exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8);
exchange.getResponse().setStatusCode(HttpStatus.OK);
return exchange.getResponse().writeWith(Flux.just(buffer));
}
/**
* 从请求中获取token
* @param request
* @return
*/
private String getTokenFromRequest(ServerHttpRequest request) {
HttpHeaders headers = request.getHeaders();
String token = headers.getFirst(Constant.AUTHORIZATION_HEADER);
if (StringUtils.isBlank(token)) {
token = headers.getFirst(Constant.TOKEN_HEADER);
logger.info("token=" + token);
} else {
logger.info("authorization=" + token);
}
if (StringUtils.isBlank(token)) {
token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER);
logger.info("params token:" + token);
}
return token;
}
}

9
epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java

@ -17,12 +17,15 @@ import java.util.List;
@ConfigurationProperties(prefix = "epmet")
public class CpProperty {
private List<String> urls;
/**
* 需要内部认证的url
*/
private List<String> internalAuthUrls;
/**
* 白名单
* 需要外部认证的url
*/
private List<String> urlWhiteList;
private List<String> externalAuthUrls;
/**
* 不处理token直接通过

35
epmet-gateway/src/main/java/com/epmet/filter/UserTokenFilter.java

@ -1,35 +0,0 @@
package com.epmet.filter;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.BaseTokenDto;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.jwt.JwtTokenUtils;
import io.jsonwebtoken.Claims;
/**
* 用户token的过滤器接口提供通用的默认方法
*/
public interface UserTokenFilter {
default BaseTokenDto getBaseTokenDto(String token, JwtTokenUtils jwtTokenUtils) {
//是否过期
Claims claims = jwtTokenUtils.getClaimByToken(token);
if (claims == null || jwtTokenUtils.isTokenExpired(claims.getExpiration())) {
// throw new RenException(EpmetErrorCode.ERR401.getCode());
return null;
}
//获取用户ID
String app = (String) claims.get("app");
String client = (String) claims.get("client");
String userId = (String) claims.get("userId");
return new BaseTokenDto(app, client, userId, token);
}
default <T> T getLoginUserInfoByToken(String token, JwtTokenUtils jwtTokenUtils, CpUserDetailRedis cpUserDetailRedis, Class<T> clz) {
BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils);
//查询Redis
return cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId(), clz);
}
}

12
epmet-gateway/src/main/java/com/epmet/jwt/JwtTokenUtils.java

@ -62,6 +62,18 @@ public class JwtTokenUtils {
}
}
public Claims getClaimByToken(String token, String secret) {
try {
return Jwts.parser()
.setSigningKey(secret)
.parseClaimsJws(token)
.getBody();
} catch (Exception e) {
logger.debug("validate is token error, token = " + token, e);
return null;
}
}
/**
* @return java.util.Date
* @param token

8
epmet-gateway/src/main/resources/bootstrap.yml

@ -415,8 +415,8 @@ ribbon:
ConnectTimeout: 300000
epmet:
# 党群e事通(校验是否登录)
urls:
# 内部认证,需要Authorization请求头
internalAuthUrls:
- /oper/customize/**
- /oper/crm/**
- /epmetuser/**
@ -438,8 +438,8 @@ epmet:
- /resi/home/**
- /data/report/**
# url认证白名单,先判断白名单,在白名单中的url直接放行,不再判断上述需要认证的名单
urlWhiteList:
# 外部应用认证,使用AccessToken等头进行认证
externalAuthUrls:
- /data/report/test/test
- /data/report/screen/**
- /data/report/kcscreen/**

34
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 组织月度指数得分--接口入参
* @Author sun
*/
@Data
public class IndexScoreFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织或网格Id
*/
@NotBlank(message = "组织或网格ID不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class})
private String orgId;
/**
* 类型组织agency 网格grid
*/
@NotBlank(message = "数据类型不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class})
private String orgType;
/**
* 月份Id eg202009
*/
@NotBlank(message = "月份Id不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class})
private String monthId;
public interface AddUserInternalGroup {}
}

55
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java

@ -0,0 +1,55 @@
package com.epmet.evaluationindex.screen.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 组织月度指数得分--接口返参
* @Author sun
*/
@Data
public class IndexScoreResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 年度平均指数(保留一位小数)
*/
@JsonIgnore
private String total;
private BigDecimal totalScore;
/**
* 党建能力(保留一位小数)
*/
@JsonIgnore
private String party;
private BigDecimal partyDevAbility;
/**
* 党建能力权重(保留一位小数)
*/
private String partyDevAbilityWeight;
/**
* 治理能力(保留一位小数)
*/
@JsonIgnore
private String govern;
private BigDecimal governAbility;
/**
* 治理能力权重(保留一位小数)
*/
private String governAbilityWeight;
/**
* 服务能力(保留一位小数)
*/
@JsonIgnore
private String service;
private BigDecimal serviceAbility;
/**
* 服务能力权重(保留一位小数)
*/
private String serviceAbilityWeight;
}

4
epmet-module/data-report/data-report-server/pom.xml

@ -62,11 +62,11 @@
<version>0.3.1</version>
</dependency>
<dependency>
<!--<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-extapp-auth</artifactId>
<version>2.0.0</version>
</dependency>
</dependency>-->
<!--动态数据源-->
<dependency>
<groupId>com.epmet</groupId>

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java

@ -1,6 +1,5 @@
package com.epmet.datareport.controller.fact;
import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;

22
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java

@ -1,21 +1,13 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
/**
* 组织相关api
@ -31,19 +23,14 @@ public class AgencyController {
private AgencyService agencyService;
/**
* @Description 1组织机构树
* @param
* @Description 1组织机构树 只返回 is_display = '1'
* @author zxc
* @date 2020/8/18 2:04 下午
*/
@ExternalAppRequestAuth
@PostMapping("tree")
public Result<TreeResultDTO> tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){
String customerId = request.getHeader("CustomerId");
if(StringUtils.isBlank(externalAppRequestParam.getCustomerId())){
externalAppRequestParam.setCustomerId(customerId);
}
return new Result<TreeResultDTO>().ok(agencyService.tree(externalAppRequestParam));
public Result<TreeResultDTO> tree(@RequestHeader("CustomerId") String customerId){
return new Result<TreeResultDTO>().ok(agencyService.tree(customerId));
}
/**
@ -52,7 +39,6 @@ public class AgencyController {
* @author zxc
* @date 2020/8/18 2:33 下午
*/
@ExternalAppRequestAuth
@PostMapping("compartment")
public Result<CompartmentResultDTO> compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){
ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class);

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java

@ -1,6 +1,5 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.DistributionService;
@ -33,7 +32,6 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 10:59 上午
*/
@ExternalAppRequestAuth
@PostMapping("branch")
public Result<List<BranchResultDTO>> branch(@RequestBody BranchFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class);
@ -46,7 +44,6 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 11:10 上午
*/
@ExternalAppRequestAuth
@PostMapping("user")
public Result<UserResultDTO> user(@RequestBody UserFormDTO userFormDTO){
ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class);
@ -59,7 +56,6 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 11:20 上午
*/
@ExternalAppRequestAuth
@PostMapping("parymember")
public Result<ParymemberResultDTO> parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){
ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class);
@ -72,7 +68,6 @@ public class DistributionController {
* @author zxc
* @date 2020/8/19 1:29 下午
*/
@ExternalAppRequestAuth
@PostMapping("project")
public Result<List<ProjectResultDTO>> project(@RequestBody ProjectFormDTO projectFormDTO){
ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class);
@ -85,7 +80,6 @@ public class DistributionController {
* @author zxc
* @date 2020/8/19 1:52 下午
*/
@ExternalAppRequestAuth
@PostMapping("topprofile")
public Result<TopProfileResultDTO> topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){
ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class);

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java

@ -1,6 +1,5 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService;
@ -39,7 +38,6 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 11:16
**/
@ExternalAppRequestAuth
@PostMapping("userpointrank")
public Result<UserPointRankResultDTO> userPointRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class);
@ -54,7 +52,6 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 13:55
**/
@ExternalAppRequestAuth
@PostMapping("difficultprojects")
public Result<List<DifficultProjectResultDTO>> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){
ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class);
@ -69,7 +66,6 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 14:37
**/
@ExternalAppRequestAuth
@PostMapping("publicpartiprofile")
public Result<PublicPartiProfileResultDTO> publicPartiProfile(@RequestBody AgencyFormDTO param){
ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class);
@ -84,7 +80,6 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 15:32
**/
@ExternalAppRequestAuth
@PostMapping("publicpartirank")
public Result<List<PublicPartiRankResultDTO>> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class);
@ -99,7 +94,6 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 17:46
**/
@ExternalAppRequestAuth
@PostMapping("governcapacityrank")
public Result<List<GovernCapacityRankResultDTO>> governCapacityRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class);

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java

@ -1,6 +1,5 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService;
@ -38,7 +37,6 @@ public class GrassrootsPartyDevController {
* @author wangc
* @date 2020.08.18 16:59
**/
@ExternalAppRequestAuth
@PostMapping("basicinfo")
public Result<PartymemberPercentResultDTO> baseInfo(@RequestBody ParymemberFormDTO param){
ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class);
@ -53,7 +51,6 @@ public class GrassrootsPartyDevController {
* @author wangc
* @date 2020.08.18 17:54
**/
@ExternalAppRequestAuth
@PostMapping("ageinfo")
public Result<PartymemberAgeDistributionResultDTO> ageInfo(@RequestBody ParymemberFormDTO param){
ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class);
@ -68,7 +65,6 @@ public class GrassrootsPartyDevController {
* @author wangc
* @date 2020.08.19 11:02
**/
@ExternalAppRequestAuth
@PostMapping("branchbuildtrend")
public Result<BranchBuildTrendResultDTO> branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){
ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class);
@ -83,7 +79,6 @@ public class GrassrootsPartyDevController {
* @author wangc
* @date 2020.08.19 15:25
**/
@ExternalAppRequestAuth
@PostMapping("branchbuildrank")
public Result<BranchBuildRankResultDTO> branchBuildRank(@RequestBody BranchBuildRankFormDTO param){
ValidatorUtils.validateEntity(param, BranchBuildRankFormDTO.BranchBuildRankGroup.class);

33
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -1,8 +1,7 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.eum.OrgTypeEnum;
@ -10,10 +9,7 @@ import com.epmet.datareport.service.evaluationindex.screen.IndexService;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -36,7 +32,6 @@ public class IndexController {
* @author zxc
* @date 2020/8/19 2:53 下午
*/
@ExternalAppRequestAuth
@PostMapping("yearaverageindex")
public Result<YearAverageIndexResultDTO> yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){
ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class);
@ -49,7 +44,6 @@ public class IndexController {
* @author zxc
* @date 2020/8/19 3:17 下午
*/
@ExternalAppRequestAuth
@PostMapping("monthindexanalysis/piechart")
public Result<MonthPieChartResultDTO> monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){
ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class);
@ -62,7 +56,6 @@ public class IndexController {
* @author zxc
* @date 2020/8/19 5:27 下午
*/
@ExternalAppRequestAuth
@PostMapping("monthindexanalysis/barchart")
public Result<MonthBarchartResultDTO> monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){
ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class);
@ -75,7 +68,6 @@ public class IndexController {
* @author zxc
* @date 2020/8/20 10:02 上午
*/
@ExternalAppRequestAuth
@PostMapping("subagencyindexrank")
public Result<List<SubAgencyIndexRankResultDTO>> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){
ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class);
@ -90,8 +82,6 @@ public class IndexController {
* @Author zhangyong
* @Date 13:39 2020-09-11
**/
@InternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("dataclient/subagencyindexrank")
public Result<List<AnNingSubAgencyIndexRankResultDTO>> getSubAgencyIndexRank(@RequestBody SubAgencyIndexRankYMFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, SubAgencyIndexRankYMFormDTO.SubAgencyIndexRank.class);
@ -104,13 +94,24 @@ public class IndexController {
* @author jianjun.liu
* @date 2020/8/20 10:02 上午
*/
@ExternalAppRequestAuth
@PostMapping("gridindexrank")
public Result<List<SubAgencyIndexRankResultDTO>> gridIndexRank(ExternalAppRequestParam extParam, @RequestBody GridIndexRankFormDTO formDTO) {
formDTO.setCustomerId(extParam.getCustomerId());
public Result<List<SubAgencyIndexRankResultDTO>> gridIndexRank(@RequestHeader("CustomerId") String customerId, @RequestBody GridIndexRankFormDTO formDTO) {
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
formDTO.setOrgType(OrgTypeEnum.GRID.getCode());
return new Result<List<SubAgencyIndexRankResultDTO>>().ok(indexService.selectIndexRankByOrgType(formDTO));
}
/**
* @param tokenDTO
* @Description 组织月度指数得分
* @author sun
*/
@PostMapping("month/indexscore")
public Result<IndexScoreResultDTO> indexScore(@LoginUser TokenDto tokenDTO, @RequestBody IndexScoreFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IndexScoreFormDTO.AddUserInternalGroup.class);
return new Result<IndexScoreResultDTO>().ok(indexService.indexScore(formDTO));
}
}

146
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java

@ -1,8 +1,5 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
@ -17,10 +14,7 @@ import com.epmet.dto.result.issue.KcIssueSummary;
import com.epmet.dto.result.issue.KcPartiTrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -39,42 +33,37 @@ public class KcScreenController {
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
* @author sun
*/
@PostMapping("homepage/summary")
public Result<HomepageSummaryResultDTO> homepageSummary(ExternalAppRequestParam externalAppRequestParam){
return new Result<HomepageSummaryResultDTO>().ok(kcScreenService.homepageSummary(externalAppRequestParam));
public Result<HomepageSummaryResultDTO> homepageSummary(@RequestHeader("CustomerId") String customerId){
return new Result<HomepageSummaryResultDTO>().ok(kcScreenService.homepageSummary(customerId));
}
/**
* @param externalAppRequestParam
* @Description 公益互助-各类总数汇总
* @author sun
*/
@PostMapping("heart/summary")
public Result<HeartSummaryResultDTO> heartSummary(ExternalAppRequestParam externalAppRequestParam){
return new Result<HeartSummaryResultDTO>().ok(kcScreenService.heartSummary(externalAppRequestParam));
public Result<HeartSummaryResultDTO> heartSummary(@RequestHeader("CustomerId") String customerId){
return new Result<HeartSummaryResultDTO>().ok(kcScreenService.heartSummary(customerId));
}
/**
* @param externalAppRequestParam
* @Description 公益互助-公益活动次数
* @author sun
*/
@PostMapping("heart/actcounttrend")
public Result<HeartActcounttrendResultDTO> heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){
return new Result<HeartActcounttrendResultDTO>().ok(kcScreenService.heartActcounttrend(externalAppRequestParam));
public Result<HeartActcounttrendResultDTO> heartActcounttrend(@RequestHeader("CustomerId") String customerId){
return new Result<HeartActcounttrendResultDTO>().ok(kcScreenService.heartActcounttrend(customerId));
}
/**
* 议题分析-各类总数
* @param externalAppRequestParam
* @return
*/
@PostMapping("issue/summary")
public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
public Result getIssueSummary(@RequestHeader("CustomerId") String customerId) {
//String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
KcIssueSummary issueSummary = kcScreenService.getIssueSummary(customerId);
return new Result().ok(issueSummary);
@ -82,300 +71,247 @@ public class KcScreenController {
/**
* 参与趋势
* @param externalAppRequestParam
* @return
*/
@PostMapping("issue/partitrend")
public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
public Result getIssuePartiTrend(@RequestHeader("CustomerId") String customerId) {
KcPartiTrendResultDTO trendResultDTO = kcScreenService.getIssuePartiTrend(customerId);
return new Result().ok(trendResultDTO);
}
/**
* 按照议题数量排名
* @param externalAppRequestParam
* @return
*/
@PostMapping("issue/gridtotalrank")
public Result getIssueGridTotalRank(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
public Result getIssueGridTotalRank(@RequestHeader("CustomerId") String customerId) {
return new Result().ok(kcScreenService.getIssueGridTotalRank(customerId));
}
/**
* 议题分析-审核效率排名
* @param externalAppRequestParam
* @return
*/
@PostMapping("issue/avgaudittimerank")
public Result getAvgAuditTimeRank(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
public Result getAvgAuditTimeRank(@RequestHeader("CustomerId") String customerId) {
return new Result().ok(kcScreenService.getAvgAuditTimeRank(customerId));
}
/**
* 议题分析-议题效率
* @param externalAppRequestParam
* @return
*/
@PostMapping("issue/effective")
public Result getIssueEffective(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
public Result getIssueEffective(@RequestHeader("CustomerId") String customerId) {
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
return new Result().ok(kcScreenService.getIssueEffective(customerId));
}
/**
* @param externalAppRequestParam
* @Description 公益互助-志愿者画像
* @author sun
*/
@PostMapping("heart/volunteerportrayal")
public Result<HeartVolunteerportrayalResultDTO> heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam){
return new Result<HeartVolunteerportrayalResultDTO>().ok(kcScreenService.heartVolunteerportrayal(externalAppRequestParam));
public Result<HeartVolunteerportrayalResultDTO> heartVolunteerportrayal(@RequestHeader("CustomerId") String customerId){
return new Result<HeartVolunteerportrayalResultDTO>().ok(kcScreenService.heartVolunteerportrayal(customerId));
}
/**
* @param externalAppRequestParam
* @Description 公益互助-个人志愿者公益时长排名
* @author sun
*/
@PostMapping("heart/volunteerrank")
public Result<List<HeartVolunteerrankResultDTO>> heartVolunteerrank(ExternalAppRequestParam externalAppRequestParam, @RequestBody HeartVolunteerrankFormDTO formDTO){
public Result<List<HeartVolunteerrankResultDTO>> heartVolunteerrank(@RequestHeader("CustomerId") String customerId, @RequestBody HeartVolunteerrankFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, HeartVolunteerrankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(externalAppRequestParam.getCustomerId());
formDTO.setCustomerId(customerId);
return new Result<List<HeartVolunteerrankResultDTO>>().ok(kcScreenService.heartVolunteerrank(formDTO));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-各类总数
* @author sun
*/
@PostMapping("group/summary")
public Result<GroupSummaryResultDTO> groupSummary(ExternalAppRequestParam externalAppRequestParam){
return new Result<GroupSummaryResultDTO>().ok(kcScreenService.groupSummary(externalAppRequestParam));
public Result<GroupSummaryResultDTO> groupSummary(@RequestHeader("CustomerId") String customerId){
return new Result<GroupSummaryResultDTO>().ok(kcScreenService.groupSummary(customerId));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-话题参与趋势
* @author sun
*/
@PostMapping("group/partitopictrend")
public Result<GroupPartitopictrendResultDTO> groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam){
return new Result<GroupPartitopictrendResultDTO>().ok(kcScreenService.groupPartitopictrend(externalAppRequestParam));
public Result<GroupPartitopictrendResultDTO> groupPartitopictrend(@RequestHeader("CustomerId") String customerId){
return new Result<GroupPartitopictrendResultDTO>().ok(kcScreenService.groupPartitopictrend(customerId));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-社群数量排名
* @author sun
*/
@PostMapping("group/gridgroupcountrank")
public Result<GroupGridgroupcountrankResultDTO> groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam){
return new Result<GroupGridgroupcountrankResultDTO>().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam));
public Result<GroupGridgroupcountrankResultDTO> groupGridgroupcountrank(@RequestHeader("CustomerId") String customerId){
return new Result<GroupGridgroupcountrankResultDTO>().ok(kcScreenService.groupGridgroupcountrank(customerId));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-社群数量排名
* @author sun
*/
@PostMapping("group/usercountrank")
public Result<List<GroupUserCountRankResultDTO>> groupUserCountRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupUserCountRankFormDTO formDTO){
public Result<List<GroupUserCountRankResultDTO>> groupUserCountRank(@RequestHeader("CustomerId") String customerId, @RequestBody GroupUserCountRankFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GroupUserCountRankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(externalAppRequestParam.getCustomerId());
formDTO.setCustomerId(customerId);
return new Result<List<GroupUserCountRankResultDTO>>().ok(kcScreenService.groupUserCountRank(formDTO));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-话题转化率排名
* @author sun
*/
@PostMapping("group/topicshiftissueratiorank")
public Result<List<GroupTopicShiftIssueRatioRankResultDTO>> groupTopicShiftIssueRatioRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){
public Result<List<GroupTopicShiftIssueRatioRankResultDTO>> groupTopicShiftIssueRatioRank(@RequestHeader("CustomerId") String customerId, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GroupTopicShiftIssueRatioRankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(externalAppRequestParam.getCustomerId());
formDTO.setCustomerId(customerId);
return new Result<List<GroupTopicShiftIssueRatioRankResultDTO>>().ok(kcScreenService.groupTopicShiftIssueRatioRank(formDTO));
}
/**
* 项目各类总数汇总
* @param externalAppRequestParam
* @return
*/
@PostMapping("project/summary")
public Result<ProjectSummaryResultDTO> getProjectSummary(ExternalAppRequestParam externalAppRequestParam){
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
String customerId = externalAppRequestParam.getCustomerId();
public Result<ProjectSummaryResultDTO> getProjectSummary(@RequestHeader("CustomerId") String customerId){
return new Result<ProjectSummaryResultDTO>().ok(kcScreenService.getProjectSummary(customerId));
}
/**
* 项目分析-网格下项目数量排名
* @param externalAppRequestParam
* @return
*/
@PostMapping("project/gridcountrank")
public Result<GridProjectCountRankResultDTO> getProjectGridCountRank(ExternalAppRequestParam externalAppRequestParam){
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
String customerId = externalAppRequestParam.getCustomerId();
public Result<GridProjectCountRankResultDTO> getProjectGridCountRank(@RequestHeader("CustomerId") String customerId){
return new Result<GridProjectCountRankResultDTO>().ok(kcScreenService.getGridProjectCountRank(customerId));
}
/**
* 项目分析-项目类别
* @param externalAppRequestParam
* @return
*/
@PostMapping("project/categoryanalysis")
public Result<List<ProjectCategoryAnalysisResultDTO>> getProjectCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam){
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
String customerId = externalAppRequestParam.getCustomerId();
public Result<List<ProjectCategoryAnalysisResultDTO>> getProjectCategoryAnalysis(@RequestHeader("CustomerId") String customerId){
return new Result<List<ProjectCategoryAnalysisResultDTO>>().ok(kcScreenService.getProjectCategoryAnalysis(customerId));
}
/**
* 网格项目平均结案时间
* @param externalAppRequestParam
* @return
*/
@PostMapping("project/avgclosedtimeanalysis")
public Result<List<ProjectAvgClosedTimeResultDTO>> getGridProjectAvgClosedTimeAnalysis(ExternalAppRequestParam externalAppRequestParam){
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
String customerId = externalAppRequestParam.getCustomerId();
public Result<List<ProjectAvgClosedTimeResultDTO>> getGridProjectAvgClosedTimeAnalysis(@RequestHeader("CustomerId") String customerId){
return new Result<List<ProjectAvgClosedTimeResultDTO>>().ok(kcScreenService.getGridProjectAvgClosedTimeAnalysis(customerId));
}
/**
* 项目分析-居民满意度
* @param externalAppRequestParam
* @return
*/
@PostMapping("project/statis")
public Result<ProjectSatisfactionResultDTO> getProjectSatisfactionAnalyze(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
public Result<ProjectSatisfactionResultDTO> getProjectSatisfactionAnalyze(@RequestHeader("CustomerId") String customerId){
return new Result<ProjectSatisfactionResultDTO>().ok(kcScreenService.getProjectSatisfactionAnalyze(customerId));
}
/**
* 用户-summary
* @param externalAppRequestParam
* @return
*/
@PostMapping("user/summary")
public Result<UserSummaryResultDTO> getUserSummary(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
public Result<UserSummaryResultDTO> getUserSummary(@RequestHeader("CustomerId") String customerId){
return new Result<UserSummaryResultDTO>().ok(kcScreenService.getUserSummary(customerId));
}
/**
* 用户量趋势
* @param externalAppRequestParam
* @return
*/
@PostMapping("user/trend")
public Result<KcUserTrendResultDTO> getUserTrend(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
public Result<KcUserTrendResultDTO> getUserTrend(@RequestHeader("CustomerId") String customerId){
return new Result<KcUserTrendResultDTO>().ok(kcScreenService.getUserTrend(customerId));
}
/**
* 网格用户数量排名
* @param externalAppRequestParam
* @return
*/
@PostMapping("user/griduserrank")
public Result<KcUserRankResultDTO> getUserRank(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
public Result<KcUserRankResultDTO> getUserRank(@RequestHeader("CustomerId") String customerId){
return new Result<KcUserRankResultDTO>().ok(kcScreenService.getUserRank(customerId));
}
/**
* 用户画像
* @param externalAppRequestParam
* @return
*/
@PostMapping("user/userportrayal")
public Result<KcUserPortrayalResultDTO> getUserPortrayal(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
public Result<KcUserPortrayalResultDTO> getUserPortrayal(@RequestHeader("CustomerId") String customerId){
return new Result<KcUserPortrayalResultDTO>().ok(kcScreenService.getUserPortrayal(customerId));
}
/**
* 用户积分排名
* @param externalAppRequestParam
* @return
*/
@PostMapping("user/pointsrank")
public Result<KcUserPointRankResultDTO> getUserPointsRank(ExternalAppRequestParam externalAppRequestParam,
public Result<KcUserPointRankResultDTO> getUserPointsRank(@RequestHeader("CustomerId") String customerId,
@RequestBody PageFormDTO form) {
String customerId = externalAppRequestParam.getCustomerId();
return new Result<KcUserPointRankResultDTO>().ok(kcScreenService.getUserPointsRank(customerId, form.getPageNo(), form.getPageSize()));
}
/**
* 党建声音-各类总数
* @param externalAppRequestParam
* @return
*/
@PostMapping("news/summary")
public Result<ScreenKcNewsSummaryResultDTO> getNewsSummary(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
public Result<ScreenKcNewsSummaryResultDTO> getNewsSummary(@RequestHeader("CustomerId") String customerId){
return new Result<ScreenKcNewsSummaryResultDTO>().ok(kcScreenService.getNewsSummary(customerId));
}
/**
* 新闻阅读参与趋势
* @param externalAppRequestParam
* @return
*/
@PostMapping("news/partitrend")
public Result<ScreenKcNewsPartiTrendResultDTO> getNewsPartiTrend(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
public Result<ScreenKcNewsPartiTrendResultDTO> getNewsPartiTrend(@RequestHeader("CustomerId") String customerId){
return new Result<ScreenKcNewsPartiTrendResultDTO>().ok(kcScreenService.getNewsPartiTrend(customerId));
}
/**
* 党建声音-分类的news数量
* @param externalAppRequestParam
* @return
*/
@PostMapping("news/category")
public Result<List<ScreenKcCategoryNewsCountResultDTO>> getNewsCountGroupByCategory(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
public Result<List<ScreenKcCategoryNewsCountResultDTO>> getNewsCountGroupByCategory(@RequestHeader("CustomerId") String customerId){
return new Result<List<ScreenKcCategoryNewsCountResultDTO>>().ok(kcScreenService.getNewsCountOfCategory(customerId));
}
/**
* 党建声音-分类的用户参与数排行
* @param externalAppRequestParam
* @return
*/
@PostMapping("news/userparticategoryrank")
public Result<ScreenKcCategoryNewsRankResultDTO> getNewsPartiCategoryRank(ExternalAppRequestParam externalAppRequestParam){
String customerId = externalAppRequestParam.getCustomerId();
public Result<ScreenKcCategoryNewsRankResultDTO> getNewsPartiCategoryRank(@RequestHeader("CustomerId") String customerId){
return new Result<ScreenKcCategoryNewsRankResultDTO>().ok(kcScreenService.getNewsPartiCategoryRank(customerId));
}
/**
* 党建声音-热点新闻排行
* @param externalAppRequestParam
* @return
*/
@PostMapping("news/hotrank")
public Result<List<ScreenKcNewsHotRankResultDTO>> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam,
public Result<List<ScreenKcNewsHotRankResultDTO>> listNewsHotRank(@RequestHeader("CustomerId") String customerId,
@RequestBody PageFormDTO form){
String customerId = externalAppRequestParam.getCustomerId();
return new Result<List<ScreenKcNewsHotRankResultDTO>>().ok(kcScreenService.getNewsHotRank(customerId, form.getPageNo(), form.getPageSize()));
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java

@ -1,6 +1,5 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService;
@ -33,7 +32,6 @@ public class PartyMemberLeadController {
* @author zxc
* @date 2020/8/20 1:56 下午
*/
@ExternalAppRequestAuth
@PostMapping("fineexample")
public Result<FineExampleResultDTO> fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){
ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class);
@ -46,7 +44,6 @@ public class PartyMemberLeadController {
* @author zxc
* @date 2020/8/20 2:35 下午
*/
@ExternalAppRequestAuth
@PostMapping("contactmasslinechart")
public Result<ContactMassLineChartResultDTO> contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){
ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class);
@ -59,7 +56,6 @@ public class PartyMemberLeadController {
* @author zxc
* @date 2020/8/20 3:19 下午
*/
@ExternalAppRequestAuth
@PostMapping("volunteerservice")
public Result<VolunteerServiceResultDTO> volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){
ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class);
@ -74,7 +70,6 @@ public class PartyMemberLeadController {
* @author wangc
* @date 2020.08.21 11:05
**/
@ExternalAppRequestAuth
@PostMapping("advancedbranchrank")
Result<List<AdvanceBranchRankResultDTO>> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class);
@ -89,7 +84,6 @@ public class PartyMemberLeadController {
* @author wangc
* @date 2020.08.21 14:22
**/
@ExternalAppRequestAuth
@PostMapping("advancedpartymemberrank")
Result<List<PartyUserPointResultDTO>> advancedPartymemberRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class);

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -1,6 +1,5 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
@ -31,7 +30,6 @@ public class ScreenProjectController {
* @author zxc
* @date 2020/8/19 4:36 下午
*/
@ExternalAppRequestAuth
@PostMapping("detail")
public Result<ProjectDetailResultDTO> projectDetail(@RequestBody ProjectDetailFormDTO projectDetailFormDTO){
ValidatorUtils.validateEntity(projectDetailFormDTO, ProjectDetailFormDTO.ProjectDetail.class);

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java

@ -1,6 +1,5 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -35,7 +34,6 @@ public class ScreenUserController {
* @Description 热心市民积分排行列表
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("userpointrank")
public Result<List<UserPointRankListResultDTO>> userPointRank(@LoginUser TokenDto tokenDTO, @RequestBody UserPointRankFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class);
@ -47,7 +45,6 @@ public class ScreenUserController {
* @Description 党员指标得分排行
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("partindexscroerank")
public Result<List<PartIndexScroeRankResultDTO>> partIndexScroeRank(@LoginUser TokenDto tokenDTO, @RequestBody PartIndexScroeRankFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class);

12
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -17,10 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.GridIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.PeerComparisonFormDTO;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -84,4 +81,11 @@ public interface ScreenIndexDataMonthlyDao{
* @author sun
*/
List<PeerComparisonResultDTO> selectScoreList(PeerComparisonFormDTO formDTO);
/**
* @param formDTO
* @Description 根据组织或网格Id以及月份Id查询各项月度指数得分
* @author sun
*/
IndexScoreResultDTO selectMonthData(IndexScoreFormDTO formDTO);
}

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java

@ -1,6 +1,5 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
@ -14,12 +13,12 @@ import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
public interface AgencyService {
/**
* @Description 1组织机构树
* @param
* @Description 1组织机构树 只返回 is_display = '1'
* @author zxc
* @date 2020/8/18 2:04 下午
*/
TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam);
TreeResultDTO tree(String customerId);
/**
* @Description 2组织区域查询

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java

@ -62,4 +62,11 @@ public interface IndexService {
* @return
*/
List<SubAgencyIndexRankResultDTO> selectIndexRankByOrgType(GridIndexRankFormDTO formDTO);
/**
* @param formDTO
* @Description 组织月度指数得分
* @author sun
*/
IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO);
}

22
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java

@ -1,6 +1,5 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.dto.result.issue.*;
import com.epmet.dto.result.project.*;
import com.epmet.dto.result.user.*;
@ -22,32 +21,28 @@ import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
public interface KcScreenService {
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
* @author sun
*/
HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam);
HomepageSummaryResultDTO homepageSummary(String customerId);
/**
* @param externalAppRequestParam
* @Description 公益互助-各类总数汇总
* @author sun
*/
HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam);
HeartSummaryResultDTO heartSummary(String customerId);
/**
* @param externalAppRequestParam
* @Description 公益互助-公益活动次数
* @author sun
*/
HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam);
HeartActcounttrendResultDTO heartActcounttrend(String customerId);
/**
* @param externalAppRequestParam
* @Description 公益互助-志愿者画像
* @author sun
*/
HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam);
HeartVolunteerportrayalResultDTO heartVolunteerportrayal(String customerId);
/**
* @param formDTO
@ -67,25 +62,22 @@ public interface KcScreenService {
/**
* @param externalAppRequestParam
* @Description 邻里党群-各类总数
* @author sun
*/
GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam);
GroupSummaryResultDTO groupSummary(String customerId);
/**
* @param externalAppRequestParam
* @Description 邻里党群-话题参与趋势
* @author sun
*/
GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam);
GroupPartitopictrendResultDTO groupPartitopictrend(String customerId);
/**
* @param externalAppRequestParam
* @Description 邻里党群-社群数量排名
* @author sun
*/
GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam);
GroupGridgroupcountrankResultDTO groupGridgroupcountrank(String customerId);
/**
* @param formDTO

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.constant.DataSourceConstant;
@ -13,7 +12,6 @@ import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.exceptions.TooManyResultsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -44,15 +42,9 @@ public class AgencyServiceImpl implements AgencyService {
*/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) {
public TreeResultDTO tree(String customerId) {
// 1. 查询客户根组织ID
String customerId = externalAppRequestParam.getCustomerId();
// 验签关闭,customerId无法获取,暂时写死
if (StringUtils.isBlank(customerId)) {
customerId = "b09527201c4409e19d1dbc5e3c3429a1";
}
TreeResultDTO rootAgency = null;
try {
rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId);

32
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Comparator;
@ -258,4 +259,35 @@ public class IndexServiceImpl implements IndexService {
BigDecimal b = bigDecimal.setScale(NumConstant.ONE, BigDecimal.ROUND_HALF_UP);
return Double.valueOf(b.toString());
}
/**
* @param formDTO
* @Description 组织月度指数得分
* @author sun
*/
@Override
public IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO) {
//screen_index_data_monthly 根据组织id和月份获取月度指标得分
//1.根据组织或网格Id以及月份Id查询各项月度指数得分
IndexScoreResultDTO resultDTO = screenIndexDataMonthlyDao.selectMonthData(formDTO);
//2.将数据改成正确格式 四舍五入保留一位小数 权重转成百分比
NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMaximumFractionDigits(1);
BigDecimal num = new BigDecimal(resultDTO.getTotal()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros();
resultDTO.setTotalScore(num);
BigDecimal num1 = new BigDecimal(resultDTO.getParty()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros();
resultDTO.setPartyDevAbility(num1);
resultDTO.setPartyDevAbilityWeight(nf.format(Double.parseDouble(resultDTO.getPartyDevAbilityWeight())));
BigDecimal num2 = new BigDecimal(resultDTO.getGovern()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros();
resultDTO.setGovernAbility(num2);
resultDTO.setGovernAbilityWeight(nf.format(Double.parseDouble(resultDTO.getGovernAbilityWeight())));
BigDecimal num3 = new BigDecimal(resultDTO.getService()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros();
resultDTO.setServiceAbility(num3);
resultDTO.setServiceAbilityWeight(nf.format(Double.parseDouble(resultDTO.getServiceAbilityWeight())));
return resultDTO;
}
}

36
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao;
@ -99,37 +98,34 @@ public class KcScreenServiceImpl implements KcScreenService {
private ScreenKcNewsRankDao screenKcNewsRankDao;
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
* @author sun
*/
@Override
public HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam) {
return screenKcPlatformSummaryDailyDao.selectSummaryDaily(externalAppRequestParam.getCustomerId());
public HomepageSummaryResultDTO homepageSummary(String customerId) {
return screenKcPlatformSummaryDailyDao.selectSummaryDaily(customerId);
}
/**
* @param externalAppRequestParam
* @Description 公益互助-各类总数汇总
* @author sun
*/
@Override
public HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam) {
return screenKcActSummaryDailyDao.selectHeartSummary(externalAppRequestParam.getCustomerId());
public HeartSummaryResultDTO heartSummary(String customerId) {
return screenKcActSummaryDailyDao.selectHeartSummary(customerId);
}
/**
* @param externalAppRequestParam
* @Description 公益互助-公益活动次数
* @author sun
*/
@Override
public HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam) {
public HeartActcounttrendResultDTO heartActcounttrend(String customerId) {
HeartActcounttrendResultDTO resultDTO = new HeartActcounttrendResultDTO();
LinkedList<String> xAxis = new LinkedList<>();
LinkedList<String> actCountDataList = new LinkedList<>();
//1.按客户查询最近十二个月数据
List<ActTrendMonthlyResultDTO> list = screenKcActTrendMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId());
List<ActTrendMonthlyResultDTO> list = screenKcActTrendMonthlyDao.selectActTrendMonthly(customerId);
//2.倒序遍历封装数据
for (int i = list.size() - 1; i >= 0; i--) {
xAxis.add(list.get(i).getMonthId());
@ -142,16 +138,15 @@ public class KcScreenServiceImpl implements KcScreenService {
}
/**
* @param externalAppRequestParam
* @Description 公益互助-志愿者画像
* @author sun
*/
@Override
public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam) {
public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(String customerId) {
HeartVolunteerportrayalResultDTO resultDTO = new HeartVolunteerportrayalResultDTO();
GenderDistributionResultDTO genderDistribution = new GenderDistributionResultDTO();
//1.根据客户Id查询最近日期志愿者统计数据
AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(externalAppRequestParam.getCustomerId());
AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(customerId);
//2.封装数据并返回
if (null == ageDistribution) {
resultDTO.setAgeDistribution(new AgeDistributionResultDTO());
@ -219,14 +214,13 @@ public class KcScreenServiceImpl implements KcScreenService {
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-各类总数
* @author sun
*/
@Override
public GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam) {
public GroupSummaryResultDTO groupSummary(String customerId) {
//1.按客户查询最近一天各网格各项数据的汇总值
GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(externalAppRequestParam.getCustomerId());
GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(customerId);
if (null == resultDTO) {
return new GroupSummaryResultDTO();
}
@ -246,17 +240,16 @@ public class KcScreenServiceImpl implements KcScreenService {
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-话题参与趋势
* @author sun
*/
@Override
public GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam) {
public GroupPartitopictrendResultDTO groupPartitopictrend(String customerId) {
GroupPartitopictrendResultDTO resultDTO = new GroupPartitopictrendResultDTO();
LinkedList<String> xAxis = new LinkedList<>();
LinkedList<Integer> actCountDataList = new LinkedList<>();
//1.按客户查询最近十二个月所有网格汇总数据
List<KcTopicTrendGridMonthlyResultDTO> list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId());
List<KcTopicTrendGridMonthlyResultDTO> list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(customerId);
//2.倒序遍历封装数据
for (int i = list.size() - 1; i >= 0; i--) {
xAxis.add(list.get(i).getMonthId());
@ -269,17 +262,16 @@ public class KcScreenServiceImpl implements KcScreenService {
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-社群数量排名
* @author sun
*/
@Override
public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam) {
public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(String customerId) {
GroupGridgroupcountrankResultDTO resultDTO = new GroupGridgroupcountrankResultDTO();
LinkedList<String> gridNameDataList = new LinkedList<>();
LinkedList<Integer> groupCountDataList = new LinkedList<>();
//1.按日期降序,查询客户最近一天所有网格数据,按每个网格的社区总数降序排列
LinkedList<GridNameGroupCountResultDTO> list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(externalAppRequestParam.getCustomerId());
LinkedList<GridNameGroupCountResultDTO> list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(customerId);
//2.封装数据
list.forEach(l -> {
gridNameDataList.add(l.getGridName());

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -16,6 +16,7 @@
WHERE
del_flag = 0
AND pid = '0'
AND IS_DISPLAY = '1'
AND customer_id = #{customerId}
</select>
@ -31,6 +32,7 @@
screen_customer_agency
WHERE
del_flag = '0'
AND IS_DISPLAY = '1'
AND pids = #{subAgencyPids}
ORDER BY
created_time DESC

1
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml

@ -77,6 +77,7 @@
screen_customer_grid
WHERE
del_flag = '0'
AND IS_DISPLAY = '1'
AND parent_agency_id = #{agencyId}
ORDER BY
created_time DESC

19
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -165,4 +165,23 @@
</if>
LIMIT #{pageSize}
</select>
<select id="selectMonthData" resultType="com.epmet.evaluationindex.screen.dto.result.IndexScoreResultDTO">
SELECT
index_total AS "total",
party_dev_ablity AS "party",
party_dev_weight AS "partyDevAbilityWeight",
govern_ablity AS "govern",
govern_ablity_weight AS "governAbilityWeight",
service_ablity AS "service",
service_ablity_weight AS "serviceAbilityWeight"
FROM
screen_index_data_monthly
WHERE
del_flag = '0'
AND org_id = #{orgId}
AND org_type = #{orgType}
AND month_id = #{monthId}
</select>
</mapper>

12
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -58,11 +58,11 @@
screen_party_user_rank_data
WHERE
del_flag = '0'
<if test="orgType != null and orgType !='' and orgType = 'agency'">
<if test="orgType = 'agency'">
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND org_id = #{orgId}
</if>
<if test="orgType = 'grid'">
<if test="orgType == 'grid'">
AND grid_id = #{orgId}
</if>
</if>
@ -85,11 +85,11 @@
WHERE
del_flag = '0'
AND party_flag = '1'<!-- 是否是党员标志:1是。0不是党员 -->
<if test="orgType != null and orgType !='' and orgType = 'agency'">
<if test="orgType = 'agency'">
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND org_id = #{orgId}
</if>
<if test="orgType = 'grid'">
<if test="orgType == 'grid'">
AND grid_id = #{orgId}
</if>
</if>

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java → epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java

@ -7,11 +7,13 @@ import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* desc: 从业务数据抽取到统计库 dto
*
* @Author zxc
* @DateTime 2020/9/16 6:01 下午
*/
@Data
public class ExtractFormDTO implements Serializable {
public class ExtractOriginFormDTO implements Serializable {
private static final long serialVersionUID = -6180252151765854242L;

21
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* desc: 抽取大屏数据dto
*
* @author LiuJanJun
* @date 2020/9/25 2:32 下午
*/
@Data
public class ExtractScreenFormDTO implements Serializable {
private static final long serialVersionUID = 7659170440875719461L;
private String customerId;
private String monthId;
private String dateId;
}

19
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/25 4:17 下午
*/
@Data
public class ScreenExtractFormDTO implements Serializable {
private static final long serialVersionUID = -6092830982601961936L;
private String customerId;
private String monthId;
}

97
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java

@ -0,0 +1,97 @@
package com.epmet.dto.extract.form;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/25 9:07 上午
*/
@Data
public class ScreenPartyBranchDataFormDTO implements Serializable {
private static final long serialVersionUID = -5521810726686859779L;
/**
* 客户Id
*/
private String customerId;
/**
* 年Id
*/
private String yearId;
/**
* 月份Id
*/
private String monthId;
/**
* 数据类别 party:支部建设; union:联合建设党员志愿服务voluntaryservice
*/
private String type;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 会议分类Id
*/
private String meetCategoryId;
/**
* 会议分类名称三会党课主题党日.....等等
*/
private String meetCategoryName;
/**
* 组织次数
*/
private Integer organizeCount;
/**
* 参加人数
*/
private Integer joinUserCount;
/**
* 平均参加人数
*/
private Integer averageJoinUserCount;
private String delFlag;
private Integer revision;
private String createdBy;
private String updatedBy;
public ScreenPartyBranchDataFormDTO() {
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
this.type = "voluntaryservice";
}
}

73
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java

@ -0,0 +1,73 @@
package com.epmet.dto.extract.form;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/24 6:03 下午
*/
@Data
public class ScreenPartyLinkMassesDataFormDTO implements Serializable {
private static final long serialVersionUID = -7534140815638694052L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 党员建群总数
*/
private Integer createGroupTotal;
/**
* 群成员总数
*/
private Integer groupUserTotal;
/**
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/
private String dataEndTime;
private String delFlag;
private Integer revision;
private String createdBy;
private String updatedBy;
public ScreenPartyLinkMassesDataFormDTO() {
this.createGroupTotal = NumConstant.ZERO;
this.groupUserTotal = NumConstant.ZERO;
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

90
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java

@ -0,0 +1,90 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/25 3:38 下午
*/
@Data
public class ActInfoResultDTO implements Serializable {
private static final long serialVersionUID = 2322961372193392320L;
/**
* 客户ID
*/
private String customerId;
/**
* 组织IDgridId或agencyId
*/
private String orgId;
/**
* 组织类型agencygrid
*/
private String orgType;
/**
* 组织名称
*/
private String orgName;
/**
* 年度ID
*/
private String yearId;
/**
* 月度ID
*/
private String monthId;
/**
* 父级ID
*/
private String parentId;
/**
* 组织次数
*/
private Integer organizeCount;
/**
* 会议分类Id
*/
private String meetCategoryId;
/**
* 会议分类名称三会党课主题党日.....等等
*/
private String meetCategoryName;
/**
* 平均参加人数
*/
private Integer averageJoinUserCount;
/**
* 删除状态
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
}

23
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.extract.result;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/25 10:10 上午
*/
@Data
@AllArgsConstructor
public class GridPartyGuideDTO implements Serializable {
private static final long serialVersionUID = 8986034496647129566L;
private List<String> orgIds;
private List<ScreenPartyLinkMassesDataFormDTO> result;
}

22
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/25 5:14 下午
*/
@Data
public class JoinUserCountResultDTO implements Serializable {
private static final long serialVersionUID = 3961393565082322770L;
private String orgId;
/**
* 参与人数
*/
private Integer joinUserCount;
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 11基层治理-公众参与 入参
@ -47,7 +48,7 @@ public class UserJoinFormDTO implements Serializable {
/**
* 人均议题
*/
private Integer avgIssue;
private BigDecimal avgIssue;
/**
* 总的参与次数
@ -57,5 +58,5 @@ public class UserJoinFormDTO implements Serializable {
/**
* 平均参与度
*/
private Integer avgJoin;
private BigDecimal avgJoin;
}

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -3,8 +3,8 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -202,7 +202,7 @@ public interface DataStatisticalOpenFeignClient {
* @author: jianjun liu
*/
@PostMapping(value = "/data/stats/factorigin/extractall")
Result factOriginExtractAll(@RequestBody(required = false) ExtractFormDTO formDTO);
Result factOriginExtractAll(@RequestBody(required = false) ExtractOriginFormDTO formDTO);
/**
* ˚
@ -222,11 +222,11 @@ public interface DataStatisticalOpenFeignClient {
Result initAllEIDims();
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@PostMapping(value = "/data/stats/screenextract/extractdailyall")
Result extractDailyAll(@RequestBody(required = false) ExtractFormDTO extractFormDTO);
Result extractDailyAll(@RequestBody(required = false) ExtractOriginFormDTO extractOriginFormDTO);
}

8
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -4,8 +4,8 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -192,7 +192,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
* @author: jianjun liu
*/
@Override
public Result factOriginExtractAll(ExtractFormDTO formDTO) {
public Result factOriginExtractAll(ExtractOriginFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO);
}
@ -214,7 +214,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
}
@Override
public Result extractDailyAll(ExtractFormDTO extractFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll",extractFormDTO);
public Result extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll", extractOriginFormDTO);
}
}

2
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -70,7 +70,7 @@
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-extapp-auth</artifactId>
<artifactId>common-service-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>

54
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -16,7 +16,8 @@ import com.epmet.dao.stats.DimCustomerDao;
import com.epmet.dao.stats.DimDateDao;
import com.epmet.dao.stats.DimMonthDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ScreenExtractFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -35,14 +36,12 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityS
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -104,6 +103,8 @@ public class DemoController {
private IndexCollStreetService indexCollStreetService;
@Autowired
private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService;
@Autowired
private GovernRankDataExtractService governRankDataExtractService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -526,7 +527,7 @@ public class DemoController {
@PostMapping("inserttopicorigin")
public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
ExtractFormDTO param = new ExtractFormDTO();
ExtractOriginFormDTO param = new ExtractOriginFormDTO();
param.setDateId(dateId);
param.setCustomerId(customerId);
Boolean aBoolean = factOriginTopicMainDailyService.topicCleaning(param);
@ -537,7 +538,7 @@ public class DemoController {
List<DimDateEntity> dimDateEntityList= dimDateDao.selectList(wrapper);
for(DimCustomerEntity customerEntity:customerEntityList){
for(DimDateEntity dateEntity:dimDateEntityList) {
ExtractFormDTO param = new ExtractFormDTO();
ExtractOriginFormDTO param = new ExtractOriginFormDTO();
param.setDateId(dateEntity.getId());
param.setCustomerId(customerEntity.getId());
factOriginTopicMainDailyService.topicCleaning(param);
@ -647,9 +648,50 @@ public class DemoController {
return new Result();
}
@Autowired
private PartyGuideService partyGuideService;
@PostMapping("zxczxc")
public Result getZxcZxc(@RequestBody ScreenExtractFormDTO formDTO){
partyGuideService.partyGuideExtract(formDTO);
return new Result();
}
@PostMapping("centralzonedatacleaning")
public Result centralZoneDataCleaning(@RequestBody ScreenCentralZoneDataFormDTO param){
screenCentralZoneDataAbsorptionService.centralZoneDataHub(param);
return new Result();
}
@PostMapping("governRank")
public Result governRank(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
governRankDataExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId());
governRankDataExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId());
governRankDataExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
@Autowired
private PioneerDataExtractService pioneerDataExtractService;
@PostMapping("insertScreenPioneerData")
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
} else {
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper);
for (DimCustomerEntity customerEntity : customerEntityList) {
pioneerDataExtractService.extractGridPioneerData(customerEntity.getId(), "20200926");
pioneerDataExtractService.extractCommunityPioneerData(customerEntity.getId(), "20200926");
pioneerDataExtractService.extractExceptCommunityPioneerData(customerEntity.getId(), "20200926");
}
}
return new Result();
}
}

55
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java

@ -1,15 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.indexcollect.form.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* 指标采集相关api
@ -27,128 +22,112 @@ public class FactIndexCollectController {
/**
* 1党建能力-党员相关指标上报(按照月份)
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("gridpartymemberdata")
public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyMemberDataFormDTO formDTO) {
factIndexCollectService.insertGridPartyMemberData(formDTO,externalAppRequestParam.getCustomerId() );
public Result gridPartyMemberData(@RequestHeader("CustomerId") String customerId, @RequestBody GridPartyMemberDataFormDTO formDTO) {
factIndexCollectService.insertGridPartyMemberData(formDTO, customerId);
return new Result();
}
/**
* 2党建能力-网格相关指标上报(按照月份)
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("gridpartyability")
public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId());
public Result gridPartyAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridPartyAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridPartyAbility(formDTO, customerId);
return new Result();
}
/**
* 3党建能力-街道及社区相关指标
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("orgpartyability")
public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId());
public Result orgPartyAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgPartyAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgPartyAbility(formDTO, customerId);
return new Result();
}
/**
* 4服务能力-网格相关指标
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("gridserviceability")
public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId());
public Result gridServiceAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridServiceAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridServiceAbility(formDTO, customerId);
return new Result();
}
/**
* 5服务能力-组织街道|社区|全区相关指标
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("orgserviceability")
public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId());
public Result orgServiceAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgServiceAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgServiceAbility(formDTO, customerId);
return new Result();
}
/**
* 6治理能力-网格相关指标
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("gridgovrnability")
public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
public Result gridGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridGovrnAbility(formDTO, customerId);
return new Result();
}
/**
* 7治理能力-街道及社区相关指标
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("orggovrnability")
public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
public Result orgGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgGovrnAbility(formDTO, customerId);
return new Result();
}
/**
* 8治理能力-部门相关指标
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("deptgovrnability")
public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
public Result deptGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertDeptGovrnAbility(formDTO, customerId);
return new Result();
}
}

48
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java

@ -3,7 +3,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.todata.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -38,69 +38,69 @@ public class FactOriginExtractController {
/**
* desc:抽取业务数据到统计库
*
* @param extractFormDTO 默认统计前一天
* @param extractOriginFormDTO 默认统计前一天
* @return
*/
@PostMapping("extractall")
public Result extractAll(@RequestBody ExtractFormDTO extractFormDTO) {
if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())) {
List<String> daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate());
public Result extractAll(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) {
List<String> daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate());
for (int i = 0; i < daysBetween.size(); i++) {
String dateDimId = daysBetween.get(i);
extractFormDTO.setDateId(dateDimId);
factOriginExtractService.extractAll(extractFormDTO);
extractOriginFormDTO.setDateId(dateDimId);
factOriginExtractService.extractAll(extractOriginFormDTO);
}
} else {
factOriginExtractService.extractAll(extractFormDTO);
factOriginExtractService.extractAll(extractOriginFormDTO);
}
return new Result();
}
/**
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 议题抽取(main)
* @author zxc
* @date 2020/9/15 2:02 下午
*/
@PostMapping("issueextractmain")
public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO) {
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class);
issueExtractService.issueExtractMain(extractFormDTO);
public Result issueExtractMain(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class);
issueExtractService.issueExtractMain(extractOriginFormDTO);
return new Result();
}
/**
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 议题抽取(log)
* @author zxc
* @date 2020/9/16 9:41 上午
*/
@PostMapping("issueextractlog")
public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO) {
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class);
issueExtractService.issueExtractLog(extractFormDTO);
public Result issueExtractLog(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class);
issueExtractService.issueExtractLog(extractOriginFormDTO);
return new Result();
}
/**
* @param extractFormDTO
* @param extractOriginFormDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计)
* @Date 2020/9/15 13:39
**/
@PostMapping("topic")
public Result topicDataCleaning(@RequestBody ExtractFormDTO extractFormDTO) {
if (StringUtils.isNotBlank(extractFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractFormDTO.getDateId())) {
factOriginTopicMainDailyService.topicCleaning(extractFormDTO);
public Result topicDataCleaning(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) {
factOriginTopicMainDailyService.topicCleaning(extractOriginFormDTO);
}
return new Result();
}
@PostMapping("project")
public Result projectData(@RequestBody ExtractFormDTO extractFormDTO) {
projectExtractService.saveOriginProjectDaily(extractFormDTO);
public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
projectExtractService.saveOriginProjectDaily(extractOriginFormDTO);
return new Result();
}
@ -112,7 +112,7 @@ public class FactOriginExtractController {
* @date 2020.09.20 16:11
**/
@PostMapping("projectorgperiodcleanning")
public Result projectOrgPeriodCleaning(@RequestBody ExtractFormDTO param) {
public Result projectOrgPeriodCleaning(@RequestBody ExtractOriginFormDTO param) {
projectExtractService.extractProjectPeriodData(param);
return new Result();
}
@ -125,7 +125,7 @@ public class FactOriginExtractController {
* @date 2020.09.20 16:11
**/
@PostMapping("groupdatacleaning")
public Result groupDataCleaning(@RequestBody ExtractFormDTO param) {
public Result groupDataCleaning(@RequestBody ExtractOriginFormDTO param) {
groupExtractService.extractGroupData(param);
return new Result();
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java

@ -1,7 +1,5 @@
package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
@ -20,10 +18,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.PreDestroy;
import java.util.Date;
@ -103,11 +98,8 @@ public class IndexCalculateController {
* @Author zhangyongç
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@PostMapping("all")
public Result<Boolean> indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "epmettest";
public Result<Boolean> indexCalculate(@RequestHeader("CustomerId") String customerId, @RequestBody CalculateCommonFormDTO formDTO) {
formDTO.setCustomerId(customerId);
indexCalculate(formDTO);
return new Result<Boolean>().ok(true);

159
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java

@ -1,16 +1,11 @@
package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.dto.screencoll.form.*;
import com.epmet.service.evaluationindex.screen.KcScreenCollService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* 孔村大屏数据采集api
@ -31,16 +26,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_platform_summary_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("homepage/platformsummary")
public Result platFormSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcHomePageFormDTO> formDTO) {
kcScreenCollService.insertPlatFormSummary(formDTO, externalAppRequestParam.getCustomerId());
public Result platFormSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcHomePageFormDTO> formDTO) {
kcScreenCollService.insertPlatFormSummary(formDTO, customerId);
return new Result();
}
@ -50,16 +45,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_issue_summary_grid_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("issue/summary")
public Result issueSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcIssueSummaryFormDTO> formDTO) {
kcScreenCollService.insertIssueSummary(formDTO, externalAppRequestParam.getCustomerId());
public Result issueSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcIssueSummaryFormDTO> formDTO) {
kcScreenCollService.insertIssueSummary(formDTO, customerId);
return new Result();
}
@ -69,16 +64,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table: screen_kc_issue_trend_grid_monthly
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("issue/trend")
public Result issueTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcIssueTrendFormDTO> formDTO) {
kcScreenCollService.insertIssueTrend(formDTO, externalAppRequestParam.getCustomerId());
public Result issueTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcIssueTrendFormDTO> formDTO) {
kcScreenCollService.insertIssueTrend(formDTO, customerId);
return new Result();
}
@ -88,16 +83,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_user_summary_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("user/summary")
public Result userSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcUserSummaryFormDTO> formDTO) {
kcScreenCollService.insertUserSummary(formDTO, externalAppRequestParam.getCustomerId());
public Result userSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcUserSummaryFormDTO> formDTO) {
kcScreenCollService.insertUserSummary(formDTO, customerId);
return new Result();
}
@ -107,16 +102,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_volunteer_heat_rank_grid_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("volunteer/heartrank")
public Result volunteerHeartRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcVolunteerHeartRankFormDTO> formDTO) {
kcScreenCollService.insertVolunteerHeartRank(formDTO, externalAppRequestParam.getCustomerId());
public Result volunteerHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcVolunteerHeartRankFormDTO> formDTO) {
kcScreenCollService.insertVolunteerHeartRank(formDTO, customerId);
return new Result();
}
@ -126,16 +121,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_user_trend_grid_monthly
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("user/userheartrank")
public Result userHeartRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcUserHeartRankFormDTO> formDTO) {
kcScreenCollService.insertUserHeartRank(formDTO, externalAppRequestParam.getCustomerId());
public Result userHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcUserHeartRankFormDTO> formDTO) {
kcScreenCollService.insertUserHeartRank(formDTO, customerId);
return new Result();
}
@ -145,16 +140,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_act_summary_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("act/summary")
public Result actSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcActSummaryFormDTO> formDTO) {
kcScreenCollService.insertActSummary(formDTO, externalAppRequestParam.getCustomerId());
public Result actSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcActSummaryFormDTO> formDTO) {
kcScreenCollService.insertActSummary(formDTO, customerId);
return new Result();
}
@ -164,16 +159,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_act_trend_monthly
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("act/trend")
public Result actTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcActTrendFormDTO> formDTO) {
kcScreenCollService.insertActTrend(formDTO, externalAppRequestParam.getCustomerId());
public Result actTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcActTrendFormDTO> formDTO) {
kcScreenCollService.insertActTrend(formDTO, customerId);
return new Result();
}
@ -183,16 +178,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_volunteer_summary_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("act/volunteersummary")
public Result volunteerSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcVolunteerSummaryFormDTO> formDTO) {
kcScreenCollService.insertVolunteerSummary(formDTO, externalAppRequestParam.getCustomerId());
public Result volunteerSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcVolunteerSummaryFormDTO> formDTO) {
kcScreenCollService.insertVolunteerSummary(formDTO, customerId);
return new Result();
}
@ -202,16 +197,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_project_summary_grid_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("project/summary")
public Result projectSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcProjectSummaryFormDTO> formDTO) {
kcScreenCollService.insertProjectSummary(formDTO, externalAppRequestParam.getCustomerId());
public Result projectSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcProjectSummaryFormDTO> formDTO) {
kcScreenCollService.insertProjectSummary(formDTO, customerId);
return new Result();
}
@ -221,16 +216,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_project_category_grid_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("project/categorysummary")
public Result categorySummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcCategorySummaryFormDTO> formDTO) {
kcScreenCollService.insertCategorySummary(formDTO, externalAppRequestParam.getCustomerId());
public Result categorySummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcCategorySummaryFormDTO> formDTO) {
kcScreenCollService.insertCategorySummary(formDTO, customerId);
return new Result();
}
@ -240,16 +235,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_project_satis_grid_monthly
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("project/satisanalysis")
public Result projectSatisanalysis(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcProjectSatisanalysisFormDTO> formDTO) {
kcScreenCollService.insertProjectSatisanalysis(formDTO, externalAppRequestParam.getCustomerId());
public Result projectSatisanalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcProjectSatisanalysisFormDTO> formDTO) {
kcScreenCollService.insertProjectSatisanalysis(formDTO, customerId);
return new Result();
}
@ -259,16 +254,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_news_summary_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("news/summary")
public Result newsSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcNewsSummaryFormDTO> formDTO) {
kcScreenCollService.insertNewsSummary(formDTO, externalAppRequestParam.getCustomerId());
public Result newsSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcNewsSummaryFormDTO> formDTO) {
kcScreenCollService.insertNewsSummary(formDTO, customerId);
return new Result();
}
@ -278,16 +273,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_news_trend_monthly
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("news/trend")
public Result newsTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcNewsTrendFormDTO> formDTO) {
kcScreenCollService.insertNewsTrend(formDTO, externalAppRequestParam.getCustomerId());
public Result newsTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcNewsTrendFormDTO> formDTO) {
kcScreenCollService.insertNewsTrend(formDTO, customerId);
return new Result();
}
@ -297,16 +292,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_news_rank
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("news/hotrank")
public Result newsHotRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcNewsHotRankFormDTO> formDTO) {
kcScreenCollService.insertNewsHotRank(formDTO, externalAppRequestParam.getCustomerId());
public Result newsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcNewsHotRankFormDTO> formDTO) {
kcScreenCollService.insertNewsHotRank(formDTO, customerId);
return new Result();
}
@ -316,16 +311,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_news_category_analysis
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("news/categoryanalysis")
public Result newsCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcNewsCategoryAnalysisFormDTO> formDTO) {
kcScreenCollService.insertNewsCategoryAnalysis(formDTO, externalAppRequestParam.getCustomerId());
public Result newsCategoryAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcNewsCategoryAnalysisFormDTO> formDTO) {
kcScreenCollService.insertNewsCategoryAnalysis(formDTO, customerId);
return new Result();
}
@ -335,16 +330,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_group_summary_grid_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("group/summary")
public Result groupSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcGroupSummaryFormDTO> formDTO) {
kcScreenCollService.insertGroupSummary(formDTO, externalAppRequestParam.getCustomerId());
public Result groupSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcGroupSummaryFormDTO> formDTO) {
kcScreenCollService.insertGroupSummary(formDTO, customerId);
return new Result();
}
@ -354,16 +349,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_group_detail_grid_daily
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("group/detail")
public Result groupDetail(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcGroupDetailFormDTO> formDTO) {
kcScreenCollService.insertGroupDetail(formDTO, externalAppRequestParam.getCustomerId());
public Result groupDetail(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcGroupDetailFormDTO> formDTO) {
kcScreenCollService.insertGroupDetail(formDTO, customerId);
return new Result();
}
@ -373,16 +368,16 @@ public class KcScreenCollController {
* 所以如果项目上是分批上传第一次为isFirst=true,后面isFirst应为false
* table:screen_kc_topic_trend_grid_monthly
*
* @param externalAppRequestParam
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 15:57 2020-09-09
**/
@ExternalAppRequestAuth
@PostMapping("group/topictrend")
public Result groupTopicTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO<KcGroupTopicTrendFormDTO> formDTO) {
kcScreenCollService.insertGroupTopicTrend(formDTO, externalAppRequestParam.getCustomerId());
public Result groupTopicTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<KcGroupTopicTrendFormDTO> formDTO) {
kcScreenCollService.insertGroupTopicTrend(formDTO, customerId);
return new Result();
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java

@ -1,7 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -21,14 +21,14 @@ public class ScreenExtractDailyController {
private ScreenExtractService screenExtractService;
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@PostMapping("extractdailyall")
public Result screenExtractDaily(@RequestBody ExtractFormDTO extractFormDTO){
screenExtractService.extractDailyAll(extractFormDTO);
public Result screenExtractDaily(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
screenExtractService.extractDailyAll(extractOriginFormDTO);
return new Result();
}

108
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java

@ -1,15 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.screencoll.form.*;
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
@ -28,144 +23,126 @@ public class ShiBeiScreenCollController {
/**
* 9党建引领|基层治理-居民党员积分排行榜
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("partyuserrankdata")
public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId());
public Result partyUserRankData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyUserRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyUserRankData(formDTO, customerId);
return new Result();
}
/**
* 8党建引领-党员联系群众数据
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("partylinkmassesdata")
public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId());
public Result partyLinkMassesData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyLinkMassesDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, customerId);
return new Result();
}
/**
* 7基层党建-建设情况数据支部联建志愿
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("meetdata")
public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId());
public Result meetData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyBranchDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyBranchData(formDTO, customerId);
return new Result();
}
/**
* 6党建引领-组织排行
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("orgrankdata")
public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId());
public Result orgRankData(@RequestHeader("CustomerId") String customerId, @RequestBody OrgRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertOrgRankData(formDTO, customerId);
return new Result();
}
/**
* 5基层治理-治理能力数据
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("governrankdata")
public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId());
public Result governRankData(@RequestHeader("CustomerId") String customerId, @RequestBody GovernRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertGovernRankData(formDTO, customerId);
return new Result();
}
/**
* 4事件数据
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("eventdata")
public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) {
shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId());
public Result eventData(@RequestHeader("CustomerId") String customerId, @RequestBody EventDataListFormDTO formDTO) {
shiBeiScreenCollService.insertEventData(formDTO, customerId);
return new Result();
}
/**
* 3难点赌点
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("difficultydata")
public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) {
shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId());
public Result difficultyData(@RequestHeader("CustomerId") String customerId, @RequestBody DifficultyDataFormDTO formDTO) {
shiBeiScreenCollService.insertDifficultyData(formDTO, customerId);
return new Result();
}
/**
* 2党员基本情况
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("cpcbasedata")
public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) {
shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId());
public Result cpcbaseData(@RequestHeader("CustomerId") String customerId, @RequestBody CpcBaseDataListFormDTO formDTO) {
shiBeiScreenCollService.insertCpcbaseData(formDTO, customerId);
return new Result();
}
/**
* 1指数_按月统计
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("indexdatamonthly")
public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) {
shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId());
public Result indexDataMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody IndexDataListMonthlyFormDTO formDTO) {
shiBeiScreenCollService.insertIndexDataMonthly(formDTO, customerId);
return new Result();
}
@ -174,112 +151,98 @@ public class ShiBeiScreenCollController {
/**
* 17指数_按年统计
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("indexdatayearly")
public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) {
shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId());
public Result indexDataYearly(@RequestHeader("CustomerId") String customerId, @RequestBody IndexDataListYearlyFormDTO formDTO) {
shiBeiScreenCollService.insertIndexDataYearly(formDTO, customerId);
return new Result();
}
/**
* 16部门信息上传
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("customerdept")
public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId());
public Result customerDept(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerDeptListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerDept(formDTO, customerId);
return new Result();
}
/**
* 15网格信息上传
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("customergrid")
public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId());
public Result customerGrid(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerGridListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerGrid(formDTO, customerId);
return new Result();
}
/**
* 14组织层级
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("customeragency")
public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId());
public Result customerAgency(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerAgencyListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerAgency(formDTO, customerId);
return new Result();
}
/**
* 12中央区各类总数
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("usertotaldata")
public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) {
shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId());
public Result userTotalData(@RequestHeader("CustomerId") String customerId, @RequestBody UserTotalDataListFormDTO formDTO) {
shiBeiScreenCollService.insertUserTotalData(formDTO, customerId);
return new Result();
}
/**
* 11基层治理-公众参与
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("userjoin")
public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) {
shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId());
public Result userJoin(@RequestHeader("CustomerId") String customerId, @RequestBody UserJoinListFormDTO formDTO) {
shiBeiScreenCollService.insertUserJoin(formDTO, customerId);
return new Result();
}
/**
* 10党建引领-先锋模范数据
*
* @param externalAppRequestParam
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@ExternalAppRequestAuth
@PostMapping("pioneerdata")
public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId());
public Result pioneerData(@RequestHeader("CustomerId") String customerId, @RequestBody PioneerDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPioneerData(formDTO, customerId);
return new Result();
}
@ -293,10 +256,9 @@ public class ShiBeiScreenCollController {
* @Author zhangyong
* @Date 09:44 2020-08-25
**/
@ExternalAppRequestAuth
@PostMapping("publicpartitotaldata")
public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId());
public Result publicPartiTotalData(@RequestHeader("CustomerId") String customerId, @RequestBody PublicPartiTotalDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, customerId);
return new Result();
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
@ -137,4 +138,13 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
* @Date 2020/9/20 21:29
**/
List<String> selectGroupMemberList(@Param("list") List<String> groupIdList);
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List<String> gridIds);
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java

@ -72,4 +72,21 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 18:05
**/
int calPartyPartiIssueTotal(@Param("customerId")String customerId,
@Param("gridId")String gridId,
@Param("communityId")String communityId,
@Param("agencyPath")String agencyPath,
@Param("isParty")String isParty);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java

@ -115,4 +115,25 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
**/
List<ProjectParticipatedAgencyResultDTO> selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId,
@Param("dateType")String dateType);
/**
* 网格项目响应度
* @author zhaoqifeng
* @date 2020/9/25 10:01
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridResponse(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织项目响应度
* @author zhaoqifeng
* @date 2020/9/25 10:01
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgResponse(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level);
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -134,4 +134,39 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
int getAgencyClosedProjectTotal(@Param("customerId") String customerId,
@Param("agencyPath")String agencyPath,
@Param("closedStatus")String closedStatus);
/**
* 组织自治项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getSelfProject(@Param("customerId") String customerId, @Param("monthId")String monthId,
@Param("level") String level);
/**
* 组织解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId,
@Param("level") String level);
/**
* 网格解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java

@ -77,4 +77,16 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovr
* @return java.lang.Integer
*/
Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type);
/**
* 根据客户查询组织治理能力
* @author zhaoqifeng
* @date 2020/9/25 14:02
* @param customerId
* @param monthId
* @param type
* @return java.util.List<com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity>
*/
List<FactIndexGovrnAblityOrgMonthlyEntity> selectOrgByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("type") String type);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -19,6 +19,8 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.screen.result.TreeResultDTO;
@ -154,6 +156,17 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
*/
List<PartyBaseInfoFormDTO> selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId);
/**
* @Description 查询客户下所有机关ID
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 10:39 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllAgencyIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId);
List<ScreenPartyBranchDataFormDTO> selectAllAgencyIdToOrganize(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询org名称机关
* @param agencyIds

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -19,9 +19,7 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
@ -143,6 +141,16 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
*/
List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId);
/**
* @Description 查询客户下所有网格ID
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 10:43 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllGridIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId);
List<ScreenPartyBranchDataFormDTO> selectAllGridIdToOrganize(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询org名称
* @param gridIds

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java

@ -75,4 +75,19 @@ public interface ScreenGovernRankDataDao extends BaseDao<ScreenGovernRankDataEnt
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
*/
List<ScreenGovernRankDataEntity> initGridDataList(@Param("customerId") String customerId);
/**
* 删除旧数据
* @author zhaoqifeng
* @date 2020/9/25 10:38
* @param customerId
* @param orgType
* @param deleteSize
* @param orgIds
* @return java.lang.Integer
*/
Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("monthId") String monthId,
@Param("deleteSize") Integer deleteSize,
@Param("orgIds")List<String> orgIds);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -56,4 +57,42 @@ public interface ScreenPartyBranchDataDao extends BaseDao<ScreenPartyBranchDataE
* @Date 10:52 2020-08-18
**/
void batchInsertPartyBranchData(@Param("list") List<PartyBranchDataFormDTO> list, @Param("customerId")String customerId);
/**
* @Description 插入建设情况数据
* @param lists
* @author zxc
* @date 2020/9/25 9:16 上午
*/
void insertScreenPartyBranchData(@Param("lists") List<ScreenPartyBranchDataFormDTO> lists);
/**
* @Description 删除旧的建设情况数据
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/27 9:04 上午
*/
Integer deleteOldScreenPartyBranchData(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
/**
* @Description 根据orgId查询建设情况数据
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/27 9:38 上午
*/
List<ScreenPartyBranchDataFormDTO> selectScreenPartyBranchDataByOrgId(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
/**
* @Description 根据parentId查询建设情况数据
* @Param customerId
* @Param monthId
* @Param parentId
* @author zxc
* @date 2020/9/27 9:38 上午
*/
List<ScreenPartyBranchDataFormDTO> selectScreenPartyBranchDataByParentId(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("parentId") String parentId);
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -55,4 +56,31 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao<ScreenPartyLinkMas
* @Date 10:52 2020-08-18
**/
void batchInsertPartyLinkMassesData(@Param("list") List<PartyLinkMassesDataFormDTO> list, @Param("customerId")String customerId);
/**
* @Description 批量插入党员联系群众数据
* @param lists
* @author zxc
* @date 2020/9/24 6:06 下午
*/
void insertScreenPartyLinkMassesData(@Param("lists")List<ScreenPartyLinkMassesDataFormDTO> lists);
/**
* @Description 删除旧的党员联系群众
* @param customerId
* @param orgIds
* @author zxc
* @date 2020/9/22 3:28 下午
*/
Integer deleteOldPartyLinkInfo(@Param("customerId") String customerId, @Param("orgIds") List<String> orgIds);
/**
* @Description 查询党员联系群众信息
* @Param customerId
* @Param monthId
* @Param agencyId
* @author zxc
* @date 2020/9/25 1:19 下午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyLinkMassesInfo(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("agencyId") String agencyId);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java

@ -17,6 +17,7 @@
package com.epmet.dao.heart;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -50,4 +51,14 @@ public interface ActInfoDao{
* @Date 2020/9/21 13:55
**/
List<String> selectGridRegUserVolunteer(@Param("list") List<String> regUserIds);
/**
* @Description 查询组织次数
* @Param customerId
* @Param monthId
* @Param orgType
* @author zxc
* @date 2020/9/25 4:00 下午
*/
List<ScreenPartyBranchDataFormDTO> selectActInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("orgType") String orgType,@Param("orgIds") List<String> orgIds);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java

@ -0,0 +1,25 @@
package com.epmet.dao.heart;
import com.epmet.dto.extract.result.JoinUserCountResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/25 5:21 下午
*/
@Mapper
public interface ActUserRelationDao {
/**
* @Description 查询参与人数
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 5:19 下午
*/
List<JoinUserCountResultDTO> selectJoinUserCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java

@ -26,7 +26,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 网格议题数量(按月)
* 网格议题数量(按月)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
@ -35,21 +35,25 @@ import java.util.List;
public interface FactIssueGridMonthlyDao extends BaseDao<FactIssueGridMonthlyEntity> {
/**
* 统计网格议题各个指标月度增量
* @author zhaoqifeng
* @date 2020/6/19 10:41
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.FactIssueGridMonthlyDTO>
* @author zhaoqifeng
* @date 2020/6/19 10:41
*/
List<FactIssueGridMonthlyDTO> selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 删除
* @author zhaoqifeng
* @date 2020/6/23 14:02
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/6/23 14:02
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId);
List<FactIssueGridMonthlyEntity> getIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java

@ -59,4 +59,9 @@ public class IndexDictEntity extends BaseEpmetEntity {
* 正相关positive负相关negative
*/
private String correlation;
/**
* 指标值类型 none整数integer小数: decimal;百分比percent
*/
private String valueType;
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java

@ -90,7 +90,7 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity {
/**
* 人均议题
*/
private Integer avgIssue;
private BigDecimal avgIssue;
/**
* 人均议题较上月增长率(采集的时候后台自己计算)
@ -105,7 +105,7 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity {
/**
* 平均参与度
*/
private Integer avgJoin;
private BigDecimal avgJoin;
/**
* 平均参与度较上月增长率(采集的时候后台自己计算)

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java

@ -18,7 +18,6 @@
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -69,12 +68,12 @@ public class DimAgencyEntity extends BaseEpmetEntity {
private String allParentName;
/**
* 机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
* 机关级别社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province
*/
private String level;
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java

@ -42,7 +42,6 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
List<IndexModel> indexModelList = new ArrayList<>();
private String preWheight;
private Integer wheightSum = 0;
/**
* 假设这个是一个DAO当然有业务逻辑这个也可以是一个service当然如果不用存储这个对象没用
*/
@ -104,6 +103,17 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
}
}
//指标值类型 无:none;整数:integer;小数: decimal;百分比:percent
if (StringUtils.isNotBlank(data.getValueType())) {
if ("整数".equals(data.getValueType())) {
data.setValueType("integer");
} else if ("小数".equals(data.getValueType())) {
data.setValueType("decimal");
} else if ("百分比".equals(data.getValueType())) {
data.setValueType("percent");
}
}
IndexDictEntity entity = new IndexDictEntity();
IndexDictEntity entity2 = new IndexDictEntity();
IndexDictEntity entity3 = new IndexDictEntity();
@ -306,6 +316,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity5.setCorrelation(data.getCorrelation());
entity5.setLevel("5");
entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4));
entity.setValueType(data.getValueType());
indexDicMap.put(data.getLevel5Index(), entity5);
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java

@ -26,6 +26,11 @@ public class IndexModel {
//没有阈值:无,有就是百分数
@ExcelProperty(value = "阈值")
private String threshold;
/**
* 指标值类型 none整数integer小数: decimal;百分比percent
*/
@ExcelProperty(value = "五级指标值类型")
private String valueType;
/**
* 正相关positive负相关negative
*/

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java

@ -1,6 +1,6 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
/**
* @author zhaoqifeng
@ -12,7 +12,7 @@ public interface FactOriginExtractService {
/**
* desc:抽取所有业务数据到统计库
*
* @param extractFormDTO
* @param extractOriginFormDTO
*/
void extractAll(ExtractFormDTO extractFormDTO);
void extractAll(ExtractOriginFormDTO extractOriginFormDTO);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
@ -62,4 +63,13 @@ public interface FactOriginGroupMainDailyService extends BaseService<FactOriginG
* @date 2020.09.23 16:30
**/
boolean insertExtractedData(boolean isFirst,String customerId,String dateId,List<FactOriginGroupMainDailyDTO> originGroupData,List<ExtractGroupMemberActionRecordResultDTO> memberList);
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId,String monthId,List<String> gridIds);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java

@ -28,4 +28,16 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
*/
public interface FactOriginIssueLogDailyService extends BaseService<FactOriginIssueLogDailyEntity> {
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 17:57
**/
int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java

@ -197,4 +197,25 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
**/
Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId,String dateType);
/**
* 网格项目响应度
* @author zhaoqifeng
* @date 2020/9/25 9:56
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResponse(String customerId, String monthId);
/**
* 组织项目响应度
* @author zhaoqifeng
* @date 2020/9/25 9:56
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgResponse(String customerId, String monthId, String level);
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -185,4 +185,35 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @Date 2020/9/24 17:37
**/
int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus);
/**
* 自治项目数
* @author zhaoqifeng
* @date 2020/9/25 15:34
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getSelfProject(String customerId, String monthId, String level);
/**
* 已解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:34
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getResolveProject(String customerId, String monthId, String level);
/**
* 网格已解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:34
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java

@ -18,7 +18,7 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
@ -40,7 +40,7 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
* @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计
* @Date 2020/9/15 13:40
**/
Boolean topicCleaning(ExtractFormDTO extractFormDTO);
Boolean topicCleaning(ExtractOriginFormDTO extractOriginFormDTO);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java

@ -1,11 +1,10 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import java.util.List;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @Desc 业务数据抽取 - 组相关
* @Author wangc
@ -24,11 +23,11 @@ public interface GroupExtractService {
/**
* @Description 业务抽取 - 小组数据
* @param param
* @return
* @Description 业务抽取 - 小组数据
* @author wangc
* @date 2020.09.18 21:07
**/
void extractGroupData(ExtractFormDTO param);
**/
void extractGroupData(ExtractOriginFormDTO param);
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java

@ -1,13 +1,11 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.dto.extract.result.ShiftProjectCountResultDTO;
import java.util.List;
import java.util.List;
import java.util.Map;
@ -18,20 +16,20 @@ import java.util.Map;
public interface IssueExtractService {
/**
* @Description 议题抽取(main)
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 议题抽取(main)
* @author zxc
* @date 2020/9/15 2:02 下午
*/
Boolean issueExtractMain(ExtractFormDTO extractFormDTO);
Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO);
/**
* @Description 议题抽取(log)
* @param extractFormDTO
* @Description 议题抽取(log)
* @param extractOriginFormDTO
* @author zxc
* @date 2020/9/16 9:41 上午
*/
Boolean issueExtractLog(ExtractFormDTO extractFormDTO);
Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO);
/**
* @Description 查询网格议题总数网格人均议题数目

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java

@ -1,9 +1,7 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractFormDTO;
import java.util.Date;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
/**
* @author zhaoqifeng
@ -16,19 +14,19 @@ public interface ProjectExtractService {
/**
* 项目主表明细日统计
*
* @param extractFormDTO
* @param extractOriginFormDTO
* @return
* @author zhaoqifeng
* @date 2020/9/15 14:38
*/
void saveOriginProjectDaily(ExtractFormDTO extractFormDTO);
void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO);
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @author wangc
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractFormDTO param);
/**
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractOriginFormDTO param);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java

@ -1,6 +1,6 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
/**
* @Desc 业务数据抽取 - 项目节点历时
@ -8,14 +8,14 @@ import com.epmet.dto.extract.form.ExtractFormDTO;
* @DateTime 2020/9/14 5:07 下午
*/
public interface ProjectPeriodExtractService {
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractFormDTO param);
**/
void extractProjectPeriodData(ExtractOriginFormDTO param);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java

@ -3,7 +3,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator;
@ -44,9 +44,9 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
@Override
public void extractAll(ExtractFormDTO extractFormDTO) {
String dateId = extractFormDTO.getDateId();
String customerId = extractFormDTO.getCustomerId();
public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) {
String dateId = extractOriginFormDTO.getDateId();
String customerId = extractOriginFormDTO.getCustomerId();
if (StringUtils.isBlank(dateId)) {
dateId = DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1));
}
@ -65,7 +65,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
String finalDateId = dateId;
customerIds.forEach(cId -> {
ExtractFormDTO param = new ExtractFormDTO();
ExtractOriginFormDTO param = new ExtractOriginFormDTO();
param.setCustomerId(cId);
param.setDateId(finalDateId);
log.debug("extractAll param:{}", JSON.toJSONString(param));
@ -74,7 +74,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
}
private void submitJob(ExtractFormDTO param) {
private void submitJob(ExtractOriginFormDTO param) {
threadPool.submit(() -> {
try {
groupExtractService.extractGroupData(param);

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java

@ -21,13 +21,16 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -97,4 +100,19 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
return true;
}
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/25 9:46 上午
*/
@Override
public List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId,List<String> gridIds) {
if (!CollectionUtils.isEmpty(gridIds)){
return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds);
}
return new ArrayList<>();
}
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java

@ -36,4 +36,19 @@ import org.springframework.stereotype.Service;
public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOriginIssueLogDailyDao, FactOriginIssueLogDailyEntity> implements FactOriginIssueLogDailyService {
/**
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @return int
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 17:57
**/
@Override
public int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty) {
return baseDao.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty);
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java

@ -267,5 +267,15 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return efficiencyMap;
}
@Override
public List<OrgStatisticsResultDTO> getGridResponse(String customerId, String monthId) {
return baseDao.selectGridResponse(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgResponse(String customerId, String monthId, String level) {
return baseDao.selectOrgResponse(customerId, monthId, level);
}
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -198,4 +198,19 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
public int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) {
return baseDao.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus);
}
@Override
public List<OrgStatisticsResultDTO> getSelfProject(String customerId, String monthId, String level) {
return baseDao.getSelfProject(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getResolveProject(String customerId, String monthId, String level) {
return baseDao.getResolveProject(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId) {
return baseDao.getGridResolveProject(customerId, monthId);
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java

@ -28,7 +28,7 @@ import com.epmet.constant.DimObjectActionConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
@ -77,9 +77,9 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
* @Date 2020/9/15 13:40
**/
@Override
public Boolean topicCleaning(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
public Boolean topicCleaning(ExtractOriginFormDTO extractOriginFormDTO) {
String customerId = extractOriginFormDTO.getCustomerId();
String dateId = extractOriginFormDTO.getDateId();
List<TopicOriginInfoDTO> topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId);
if (CollectionUtils.isEmpty(topicOriginInfoList)) {
log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record", customerId, dateId));

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java

@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
@ -66,17 +66,17 @@ public class GroupExtractServiceImpl implements GroupExtractService {
/**
* @Description 业务抽取 - 小组祥光
* @param param
* @return
* @Description 业务抽取 - 小组祥光
* @author wangc
* @date 2020.09.18 21:07
**/
@Override
public void extractGroupData(ExtractFormDTO param) {
public void extractGroupData(ExtractOriginFormDTO param) {
int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId());
if(StringUtils.isBlank(param.getDateId())){
if (StringUtils.isBlank(param.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java

@ -11,7 +11,7 @@ import com.epmet.constant.ExtractConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dao.stats.DimAgencyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
@ -54,19 +54,19 @@ public class IssueExtractServiceImpl implements IssueExtractService {
private FactOriginIssueLogDailyDao issueLogDailyDao;
/**
* @Description 议题抽取
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 议题抽取
* @author zxc
* @date 2020/9/15 2:02 下午
*/
@Override
public Boolean issueExtractMain(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
public Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO) {
String customerId = extractOriginFormDTO.getCustomerId();
String dateId = extractOriginFormDTO.getDateId();
// 1. 议题信息查询
List<IssueInfoResultDTO> listResult = issueService.selectIssueInfo(customerId, dateId);
List<IssueMainDailyFormDTO> result = new ArrayList<>();
if (CollectionUtils.isEmpty(listResult)){
if (CollectionUtils.isEmpty(listResult)) {
log.warn("issueExtractMain selectIssueInfo return empty,customerId:{},dateId:{}", customerId, dateId);
return true;
}
@ -151,24 +151,24 @@ public class IssueExtractServiceImpl implements IssueExtractService {
}
/**
* @Description 议题抽取(log)
* @param extractFormDTO
* @Description 议题抽取(log)
* @param extractOriginFormDTO
* @author zxc
* @date 2020/9/16 9:41 上午
*/
@Override
public Boolean issueExtractLog(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
public Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO) {
String customerId = extractOriginFormDTO.getCustomerId();
String dateId = extractOriginFormDTO.getDateId();
List<IssueLogDailyFormDTO> result = new ArrayList<>();
// 1. 查询议题process
List<IssueProcessInfoResultDTO> listResult = issueService.selectIssueProcessInfo(customerId, dateId);
if (CollectionUtils.isEmpty(listResult)){
if (CollectionUtils.isEmpty(listResult)) {
log.warn("issueExtractMain issueExtractLog return empty,customerId:{},dateId:{}", customerId, dateId);
return true;
}
Map<String, List<IssueProcessInfoResultDTO>> groupByIssue = listResult.stream().collect(Collectors.groupingBy(IssueProcessInfoResultDTO::getIssueId));
groupByIssue.forEach((issueId,process) -> {
groupByIssue.forEach((issueId, process) -> {
List<IssueProcessInfoResultDTO> descByCreateTime = process.stream().sorted(Comparator.comparing(IssueProcessInfoResultDTO::getCreateTime).reversed()).collect(Collectors.toList());
issueMainDailyDao.updateIssueStatus(issueId,descByCreateTime.get(NumConstant.ZERO).getActionCode());
});

68
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -7,7 +7,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.party.PartyMemberDTO;
@ -71,20 +71,20 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Override
public void saveOriginProjectDaily(ExtractFormDTO extractFormDTO) {
String dateString = extractFormDTO.getDateId();
String customerId = extractFormDTO.getCustomerId();
List<FactOriginProjectMainDailyEntity> list = new LinkedList<>();
//获取已关闭项目列表
List<ProjectProcessEntity> closedList = projectProcessService.getClosedProjectList(customerId, dateString);
List<FactOriginProjectMainDailyDTO> pendingList = factOriginProjectMainDailyService.getPendingList(customerId);
List<FinishOrgDTO> finishOrgList= projectProcessService.getFinishOrg(customerId, dateString);
if (null != closedList && !closedList.isEmpty()) {
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getId());
@Override
public void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO) {
String dateString = extractOriginFormDTO.getDateId();
String customerId = extractOriginFormDTO.getCustomerId();
List<FactOriginProjectMainDailyEntity> list = new LinkedList<>();
//获取已关闭项目列表
List<ProjectProcessEntity> closedList = projectProcessService.getClosedProjectList(customerId, dateString);
List<FactOriginProjectMainDailyDTO> pendingList = factOriginProjectMainDailyService.getPendingList(customerId);
List<FinishOrgDTO> finishOrgList = projectProcessService.getFinishOrg(customerId, dateString);
if (null != closedList && !closedList.isEmpty()) {
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getId());
entity.setProjectStatus("close");
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime());
@ -312,25 +312,25 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}
}
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if(StringUtils.isBlank(param.getDateId())){
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
/**
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractOriginFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if (StringUtils.isBlank(param.getDateId())) {
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest
= ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class);

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java

@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.ProjectPeriodExtractService;
@ -37,23 +37,23 @@ public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractServ
private ProjectProcessService projectProcessService;
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractFormDTO param) {
public void extractProjectPeriodData(ExtractOriginFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if(StringUtils.isBlank(param.getDateId())){
if (StringUtils.isBlank(param.getDateId())) {
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId());
projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java

@ -1,5 +1,7 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.extract.form.ScreenExtractFormDTO;
/**
* @Author zxc
* @DateTime 2020/9/24 5:05 下午
@ -8,11 +10,10 @@ public interface PartyGuideService {
/**
* @Description 党建引领抽取
* @param customerId
* @param dateId
* @param screenExtractFormDTO
* @author zxc
* @date 2020/9/24 5:10 下午
*/
Boolean partyGuideExtract(String customerId,String dateId);
Boolean partyGuideExtract(ScreenExtractFormDTO screenExtractFormDTO);
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java

@ -0,0 +1,34 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
/**
* @desc: 大屏 公众参与抽取服务接口
* @Author: LiuJanJun
* @Date: 2020/9/25 10:03 上午
* @Version: 1.0
*/
public interface PublicPartExtractService {
/**
* desc: 抽取公众参与 人均议题 总次数和平均参与度
* targetscreen_user_join
*
* @param
* @return java.lang.Boolean
* @author LiuJanJun
* @date 2020/9/25 10:24 上午
*/
Boolean extractTotalDataMonthly(ExtractScreenFormDTO formDTO);
/**
* desc: 抽取公众参与 各类总数
* targetscreen_public_parti_total_data
*
* @param
* @return java.lang.Boolean
* @author LiuJanJun
* @date 2020/9/25 10:24 上午
*/
Boolean extractPerTotalDataDaily(ExtractScreenFormDTO formDTO);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java

@ -1,6 +1,6 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
/**
* @Author zxc
@ -9,11 +9,11 @@ import com.epmet.dto.extract.form.ExtractFormDTO;
public interface ScreenExtractService {
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
void extractDailyAll(ExtractFormDTO extractFormDTO);
void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO);
}

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java

@ -0,0 +1,32 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* @desc: 大屏 产品内部客户组织结构数据
* @Author: LiuJanJun
* @Date: 2020/9/25 10:03 上午
* @Version: 1.0
*/
public interface ScreenOrgService {
/**
* desc: 抽取公众参与 人均议题 总次数和平均参与度
* targetscreen_user_join
*
* @param
* @return java.lang.Boolean
* @author LiuJanJun
* @date 2020/9/25 10:24 上午
*/
Boolean getInnerCustomerAgencyTree();
/**
* desc: 抽取公众参与 各类总数
* targetscreen_public_parti_total_data
*
* @param
* @return java.lang.Boolean
* @author LiuJanJun
* @date 2020/9/25 10:24 上午
*/
Boolean extractPerTotalDataDaily();
}

124
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java

@ -1,15 +1,21 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
@ -21,6 +27,7 @@ import java.util.List;
* @dscription
* @date 2020/9/24 14:31
*/
@Service
public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService {
@Autowired
private ScreenGovernRankDataService screenGovernRankDataService;
@ -28,37 +35,138 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Autowired
private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
public static void main(String[] args) {
String monthId = "202006";
System.out.println(monthId.substring(0,4));
}
@Override
public void extractGridData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.GRID, null);
if (CollectionUtils.isEmpty(list)) {
return;
}
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityGridMonthlyEntity> gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
list.forEach(entity -> gridList.stream().filter(gridAblity -> entity.getOrgId().equals(gridAblity.getGridId())).forEach(grid -> {
BigDecimal total = new BigDecimal(grid.getProjectTotal());
entity.setYearId(grid.getYearId());
entity.setMonthId(grid.getMonthId());
//TODO 响应率
//解决率
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> {
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
entity.setResolvedRatio(resolveCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
//自治率
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
entity.setGovernRatio(selfCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
if(grid.getResolveProjectCount()!= NumConstant.ZERO) {
entity.setGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
//满意率
entity.setSatisfactionRatio(grid.getSatisfactionRatio());
}));
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getGridResponse(customerId, monthId);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getGridResolveProject(customerId, monthId);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@Override
public void extractCommunityData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.COMMUNITY);
if (CollectionUtils.isEmpty(list)) {
return;
}
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityOrgMonthlyEntity> orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> {
//满意率
entity.setSatisfactionRatio(org.getSatisfactionRatio());
}));
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.COMMUNITY);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.COMMUNITY);
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.COMMUNITY);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@Override
public void extractStreetData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.STREET);
if (CollectionUtils.isEmpty(list)) {
return;
}
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityOrgMonthlyEntity> orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId,
OrgTypeConstant.STREET);
list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> {
//满意率
entity.setSatisfactionRatio(org.getSatisfactionRatio());
}));
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.STREET);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.STREET);
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.STREET);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java

@ -141,8 +141,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
delAndInsert(result,customerId,dateId,orgIds);
}else {
// 级别为 street,district,city,province
List<String> agencyIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(agencyIds);
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(orgIds);
List<UserCountResultDTO> userCountList = userGridDailyService.selectUserCount(customerId, dateId);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();

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

Loading…
Cancel
Save