Browse Source

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

feature/evaluate
wangchao 5 years ago
parent
commit
e3898bc5a6
  1. 2
      epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java
  2. 6
      epmet-commons/epmet-commons-extapp-auth/pom.xml
  3. 32
      epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/InternalAppRequestAuth.java
  4. 122
      epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java
  5. 41
      epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenProperties.java
  6. 130
      epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenUtils.java
  7. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  8. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  9. 42
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java
  10. 42
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java
  11. 43
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java
  12. 33
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java
  13. 39
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java
  14. 25
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java
  15. 38
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java
  16. 17
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java
  17. 51
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java
  18. 29
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java
  19. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java
  20. 25
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthAblityListResultDTO.java
  21. 48
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthScoreListResultDTO.java
  22. 29
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java
  23. 26
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/RootAgencyResultDTO.java
  24. 33
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScoreListResultDTO.java
  25. 36
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java
  26. 107
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
  27. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  28. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java
  29. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  30. 17
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  31. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java
  32. 50
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java
  33. 51
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java
  34. 41
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java
  35. 51
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java
  36. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java
  37. 31
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java
  38. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java
  39. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  40. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  41. 63
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/FactIndexService.java
  42. 277
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
  43. 10
      epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
  44. 33
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml
  45. 42
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml
  46. 29
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml
  47. 42
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml
  48. 7
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml
  49. 7
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml
  50. 11
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  51. 68
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  52. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  53. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ScreenConstant.java
  54. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java
  55. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java
  56. 132
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyBaseInfoFormDTO.java
  57. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java
  58. 35
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CustomerAgencyInfoResultDTO.java
  59. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java
  60. 85
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyInfoResultDTO.java
  61. 51
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java
  62. 35
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserCountResultDTO.java
  63. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java
  64. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java
  65. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java
  66. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  67. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  68. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java
  69. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java
  70. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSelfSubScoreDao.java
  71. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java
  72. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  73. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  74. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java
  75. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java
  76. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java
  77. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java
  78. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java
  79. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySelfSubScoreEntity.java
  80. 123
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CommunitySelfSubScoreEntity.java
  81. 100
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java
  82. 105
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSelfSubScoreEntity.java
  83. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  84. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  85. 263
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java
  86. 62
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  87. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java
  88. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
  89. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  90. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java
  91. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  92. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  93. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java
  94. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java
  95. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java
  96. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java
  97. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java
  98. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java
  99. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  100. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml

2
epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java

@ -25,7 +25,7 @@ public class DynamicDataSource extends AbstractRoutingDataSource {
@Override
protected Object determineCurrentLookupKey() {
String ds = DynamicContextHolder.peek();
logger.info("动态数据源:{}" + ds);
logger.debug("动态数据源:{}", ds);
return ds;
}

6
epmet-commons/epmet-commons-extapp-auth/pom.xml

@ -27,6 +27,12 @@
</properties>
<dependencies>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

32
epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/InternalAppRequestAuth.java

@ -0,0 +1,32 @@
/**
* Copyright 2018 人人开源 http://www.renren.io
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.epmet.commons.extappauth.annotation;
import java.lang.annotation.*;
/**
* 需要认证的内部请求
* @Author wxz
* @Description
* @Date 2020/4/23 16:17
**/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface InternalAppRequestAuth {
}

122
epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java

@ -1,14 +1,24 @@
package com.epmet.commons.extappauth.aspect;
import cn.hutool.core.bean.BeanUtil;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.extappauth.jwt.JwtTokenUtils;
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.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.Result;
import com.epmet.dto.form.ExternalAppAuthFormDTO;
import com.epmet.dto.result.ExternalAppAuthResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import io.jsonwebtoken.Claims;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
@ -19,12 +29,14 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Parameter;
import java.util.Map;
/**
* 外部应用请求认证切面
@ -36,6 +48,7 @@ public class ExternalAppRequestAuthAspect {
private static Logger logger = LoggerFactory.getLogger(ExternalAppRequestAuthAspect.class);
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";
@ -45,15 +58,121 @@ public class ExternalAppRequestAuthAspect {
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private JwtTokenUtils jwtTokenUtils;
@Autowired
private RedisUtils redisUtils;
/**
* 拦截加了ExternalRequestAuth注解的方法
*
* @param point
* @throws Throwable
*/
@Before("@annotation(com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth)")
@Before("@annotation(com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth) " +
"|| @annotation(com.epmet.commons.extappauth.annotation.InternalAppRequestAuth)")
public void auth(JoinPoint point) throws Throwable {
MethodSignature signature = (MethodSignature) point.getSignature();
HttpServletRequest request = getRequest();
if (signature.getMethod().getAnnotation(ExternalAppRequestAuth.class) != null
&& StringUtils.isNotBlank(request.getHeader(ACCESS_TOKEN_HEADER_KEY))) {
// 走外部应用认证
extAppAuth(signature, point, request);
} else if (signature.getMethod().getAnnotation(InternalAppRequestAuth.class) != null
&& StringUtils.isNotBlank(request.getHeader(AUTHORIZATION_TOKEN_HEADER_KEY))) {
// 走内部应用认证
internalAppAuth(signature, point, request);
} else {
logger.error("根据header无法找到适用的认证方式");
throw new RenException(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg());
}
}
/**
* 内部应用认证
* @param signature
* @param point
* @param request
* @return
*/
private void internalAppAuth(MethodSignature signature, JoinPoint point, HttpServletRequest request) {
String authorization = request.getHeader(AUTHORIZATION_TOKEN_HEADER_KEY);
BaseTokenDto tokenDTO = getTokenDTO(authorization);
Map<String, Object> tokenMap = redisUtils.hGetAll(RedisKeys.getCpUserKey(tokenDTO.getApp(), tokenDTO.getClient(), tokenDTO.getUserId()));
if (CollectionUtils.isEmpty(tokenMap)) {
logger.error("内部应用认证,redis中没有找到登录缓存信息");
throw new RenException(EpmetErrorCode.ERR10006.getCode(), EpmetErrorCode.ERR10006.getMsg());
}
BaseTokenDto baseTokenDto = null;
String customerId;
if ("gov".equals(tokenDTO.getApp())) {
GovTokenDto govTokenDto = BeanUtil.mapToBean(tokenMap, GovTokenDto.class, true);
customerId = govTokenDto.getCustomerId();
baseTokenDto = govTokenDto;
} else {
TokenDto tokenDto = BeanUtil.mapToBean(tokenMap, TokenDto.class, true);
customerId = tokenDto.getCustomerId();
baseTokenDto = tokenDTO;
}
if (baseTokenDto == null) {
logger.error("内部应用认证,redis中没有找到登录缓存信息");
throw new RenException(EpmetErrorCode.ERR10006.getCode(), EpmetErrorCode.ERR10006.getMsg());
}
if (!authorization.equals(baseTokenDto.getToken())) {
logger.error("内部应用认证,redis中找到的token与header里面传入的不一致,可能发生了别处登录");
throw new RenException(EpmetErrorCode.ERR10007.getCode(), EpmetErrorCode.ERR10007.getMsg());
}
// header参数赋值
Parameter[] parameters = signature.getMethod().getParameters();
if (parameters != null && parameters.length != 0) {
for (int i = 0; i < parameters.length; i++) {
if (parameters[i].getType() == ExternalAppRequestParam.class) {
ExternalAppRequestParam requestParam = (ExternalAppRequestParam) point.getArgs()[i];
requestParam.setCustomerId(customerId);
}
}
}
}
private BaseTokenDto getTokenDTO(String authorization) {
if (StringUtils.isBlank(authorization)) {
logger.error("内部应用认证,没有携带authorization头信息");
throw new RenException(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg());
}
//是否过期
Claims claims = jwtTokenUtils.getClaimByToken(authorization);
if (claims == null) {
logger.error("内部应用认证,Claims为空");
throw new RenException(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg());
}
if (jwtTokenUtils.isTokenExpired(claims.getExpiration())) {
logger.error("内部应用认证,token过期");
throw new RenException(EpmetErrorCode.ERR10006.getCode(), EpmetErrorCode.ERR10006.getMsg());
}
//获取用户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, authorization);
}
/**
* 外部应用认证
*
* @param signature
* @param point
*/
public void extAppAuth(MethodSignature signature, JoinPoint point, HttpServletRequest request) {
String token = request.getHeader(ACCESS_TOKEN_HEADER_KEY);
String appId = request.getHeader(APP_ID_HEADER_KEY);
String ts = request.getHeader(APP_ID_TIMESTAMP_KEY);
@ -90,7 +209,6 @@ public class ExternalAppRequestAuthAspect {
// header参数赋值
MethodSignature signature = (MethodSignature) point.getSignature();
Parameter[] parameters = signature.getMethod().getParameters();
if (parameters != null && parameters.length != 0) {
for (int i = 0; i < parameters.length; i++) {

41
epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenProperties.java

@ -0,0 +1,41 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.extappauth.jwt;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* Jwt
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Configuration
@ConfigurationProperties(prefix = "jwt.token")
public class JwtTokenProperties {
private String secret;
private int expire;
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public int getExpire() {
return expire;
}
public void setExpire(int expire) {
this.expire = expire;
}
}

130
epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenUtils.java

@ -0,0 +1,130 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
package com.epmet.commons.extappauth.jwt;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Jwt工具类
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Component
public class JwtTokenUtils {
private static final Logger logger = LoggerFactory.getLogger(JwtTokenUtils.class);
@Autowired
private JwtTokenProperties jwtProperties;
/**
* 生成jwt token 弃用
*/
@Deprecated
public String generateToken(String userId) {
return Jwts.builder()
.setHeaderParam("typ", "JWT")
.setSubject(userId)
.setIssuedAt(new Date())
.setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate())
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret())
.compact();
}
public Claims getClaimByToken(String token) {
try {
return Jwts.parser()
.setSigningKey(jwtProperties.getSecret())
.parseClaimsJws(token)
.getBody();
} catch (Exception e) {
logger.debug("validate is token error, token = " + token, e);
return null;
}
}
/**
* @return java.util.Date
* @param token
* @Author yinzuomei
* @Description 获取token的有效期截止时间
* @Date 2020/3/18 22:17
**/
public Date getExpiration(String token){
try {
return Jwts.parser()
.setSigningKey(jwtProperties.getSecret())
.parseClaimsJws(token)
.getBody().getExpiration();
} catch (Exception e) {
logger.debug("validate is token error, token = " + token, e);
return null;
}
}
/**
* @param map
* @return java.lang.String
* @Author yinzuomei
* @Description 根据app+client+userId生成token
* @Date 2020/3/18 22:29
**/
public String createToken(Map<String, Object> map) {
return Jwts.builder()
.setHeaderParam("typ", "JWT")
.setClaims(map)
.setIssuedAt(new Date())
.setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate())
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret())
.compact();
}
/**
* token是否过期
*
* @return true过期
*/
public boolean isTokenExpired(Date expiration) {
return expiration.before(new Date());
}
public static void main(String[] args) {
Map<String, Object> map=new HashMap<>();
map.put("app","gov");
map.put("client","wxmp");
map.put("userId","100526ABC");
String tokenStr=Jwts.builder()
.setHeaderParam("typ", "JWT")
.setClaims(map)
.setIssuedAt(new Date())
.setExpiration(DateTime.now().plusSeconds(604800).toDate())
.signWith(SignatureAlgorithm.HS512, "7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]")
.compact();
System.out.println(tokenStr);
Claims claims= Jwts.parser()
.setSigningKey("7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]")
.parseClaimsJws(tokenStr)
.getBody();
System.out.println("app="+ claims.get("app"));
System.out.println("client="+ claims.get("client"));
System.out.println("userId="+ claims.get("userId"));
}
}

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

@ -31,8 +31,11 @@ public interface NumConstant {
int FOURTEEN=14;
int TWENTY = 20;
int THIRTY = 30;
int THIRTY_ONE = 31;
int FORTY = 40;
int FORTY_ONE = 41;
int FIFTY = 50;
int FIFTY_ONE = 51;
int SIXTY = 60;
int ONE_HUNDRED = 100;
int ONE_THOUSAND = 1000;

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

@ -107,9 +107,9 @@ public enum EpmetErrorCode {
OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"),
OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"),
OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"),
OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"),
OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"),
OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"),
OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"),
OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"),
OPER_EXT_APP_SECRET_RESET_FAIL(8714, "秘钥更新失败"),
// 党建声音 前端提示 88段
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),

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

@ -0,0 +1,42 @@
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 AblityIndexFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 查询月份的前12个月对应的monthId
*/
private String startMonthId;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String agencyId;
/**
* 月份Id格式202009
*/
@NotBlank(message = "月份ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String monthId;
/**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String indexCode;
public interface AddUserInternalGroup {}
}

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

@ -0,0 +1,42 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 按月查询各项指标数据--接口入参
* @Author sun
*/
@Data
public class AblityListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class})
private String agencyId;
/**
* 月份Id格式202009
*/
@NotBlank(message = "月份ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class})
private String monthId;
/**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
@NotBlank(message = "类型不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class})
private String indexCode;
/**
* 所有有权重的指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
public interface AddUserInternalGroup {}
}

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

@ -0,0 +1,43 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 按月查询各项指标最近12个月数据--接口入参
* @Author sun
*/
@Data
public class MonthAblityListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class})
private String agencyId;
/**
* 月份Id格式202009
*/
@NotBlank(message = "月份ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class})
private String monthId;
/**
* 月份Id格式202009
*/
@NotBlank(message = "类型key不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class})
private String key;
/**
* 查询月份的前12个月对应的monthId
*/
private String startMonthId;
public interface AddUserInternalGroup {}
}

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

@ -0,0 +1,33 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 能力指数--接口入参
* @Author sun
*/
@Data
public class MonthScoreListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class})
private String agencyId;
/**
* 月份Id格式202009
*/
@NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class})
private String monthId;
public interface AddUserInternalGroup {}
}

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

@ -0,0 +1,39 @@
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 PeerComparisonFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class})
private String agencyId;
/**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
@NotBlank(message = "数据类型不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class})
private String indexCode;
/**
* 查询条数
*/
@Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class })
private Integer pageSize;
public interface AddUserInternalGroup {}
}

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

@ -0,0 +1,25 @@
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 RootAgencyFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class})
private String agencyId;
public interface AddUserInternalGroup {}
}

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

@ -0,0 +1,38 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 按月份查询各项能力分数--接口入参
* @Author sun
*/
@Data
public class ScoreListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class})
private String agencyId;
/**
* 月份Id格式202009
*/
@NotBlank(message = "月份ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class})
private String monthId;
/**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String indexCode;
public interface AddUserInternalGroup {}
}

17
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java → epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java

@ -8,20 +8,22 @@ import java.io.Serializable;
/**
* 5下级部门指数排行安宁数据段用 入参
*
* @Author zhangyong
* @DateTime 2020/09/08 9:54
*/
@Data
public class AnNingSubAgencyIndexRankFormDTO implements Serializable {
public class SubAgencyIndexRankYMFormDTO implements Serializable {
private static final long serialVersionUID = -2920561669035794486L;
public interface SubAgencyIndexRank{}
public interface SubAgencyIndexRank {
}
/**
* 机关ID
*/
@NotBlank(message = "组织id不能为空",groups = {SubAgencyIndexRank.class})
@NotBlank(message = "组织id不能为空", groups = {SubAgencyIndexRank.class})
private String agencyId;
/**
@ -33,12 +35,17 @@ public class AnNingSubAgencyIndexRankFormDTO implements Serializable {
/**
* asc 正序 desc 降序
*/
@NotNull(message = "排序方式不能为空",groups = {SubAgencyIndexRank.class})
@NotNull(message = "排序方式不能为空", groups = {SubAgencyIndexRank.class})
private String sort;
/**
* 年度year 月度month
*/
@NotNull(message = "年度、月度不能为空",groups = {SubAgencyIndexRank.class})
@NotNull(message = "年度、月度不能为空", groups = {SubAgencyIndexRank.class})
private String type;
/**
* 月份Id
*/
private String monthId;
}

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

@ -0,0 +1,51 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 能力指数--接口返参
* @Author sun
*/
@Data
public class AblityIndexResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String indexCode;
/**
* 每项能力最近12月各项分数对象
*/
private List<AblityIndexResultDTO.ScoreListResultDTO> scoreList;
@Data
public static class ScoreListResultDTO implements Serializable {
/**
* 能力总分
*/
private Double indexTotal;
/**
* 本级能力分
*/
private Double agencyScore;
/**
* 下级能力分
*/
private Double subAgencyScore;
/**
* 横坐标202009
*/
private String monthId;
}
}

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

@ -0,0 +1,29 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 按月查询各项指标数据--接口返参
* @Author sun
*/
@Data
public class AblityListResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 各项指标名称
*/
private String name;
/**
* 指标对应值数值或百分比
*/
private String value = "0";
/**
* 各项指标对应key值(index_dict字典表)
*/
private String key;
}

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

@ -42,4 +42,9 @@ public class AnNingSubAgencyIndexRankResultDTO implements Serializable {
* 组织id或者网格id
*/
private String orgId = "";
/**
* 组织类型
*/
private String orgType = "";
}

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

@ -0,0 +1,25 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 按月查询各项指标最近12个月数据--接口返参
* @Author sun
*/
@Data
public class MonthAblityListResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 横坐标(202009)
*/
private String monthId;
/**
* 指标对应值数值或百分比
*/
private String ablity;
}

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

@ -0,0 +1,48 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 按月份查询各项能力最近12个月得分--接口返参
* @Author sun
*/
@Data
public class MonthScoreListResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String indexCode;
/**
* 每项能力最近12月各项分数对象
*/
private List<MonthScoreListResultDTO.ScoreListResultDTO> scoreList;
@Data
public static class ScoreListResultDTO implements Serializable {
/**
* 能力总分
*/
private Double indexTotal;
/**
* 本级能力分
*/
private Double agencyScore;
/**
* 下级能力分
*/
private Double subAgencyScore;
/**
* 横坐标202009
*/
private String monthId;
}
}

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

@ -0,0 +1,29 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 同级对比各项数据查询--接口返参
* @Author sun
*/
@Data
public class PeerComparisonResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织名称
*/
private String agencyName;
/**
* 能力分值(保留一位小数)
*/
private Double score;
}

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

@ -0,0 +1,26 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 是否根组织--接口返参
* @Author sun
*/
@Data
public class RootAgencyResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 是否根组织true false
*/
private Boolean isRoot = true;
/**
* 数据更新至上月月末时间
*/
private String date;
}

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

@ -0,0 +1,33 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 按月份查询各项能力分数--接口返参
* @Author sun
*/
@Data
public class ScoreListResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String indexCode;
/**
* 总分(保留一位小数)
*/
private Double indexTotal;
/**
* 本级分数(保留一位小数)
*/
private Double agencyScore;
/**
* 下级分数(保留一位小数)
*/
private Double subAgencyScore;
}

36
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java

@ -0,0 +1,36 @@
package com.epmet.datareport.constant;
/**
* @author sun
* @dscription 数据
*/
public interface FactConstant {
/**
* 能力指标
*/
String NLZB = "nenglizhibiao";
/**
* 党建能力
*/
String DJNL = "dangjiannengli";
/**
* 治理能力
*/
String ZLNL = "zhilinengli";
/**
* 服务能力
*/
String FWNL = "fuwunengli";
/**
* 全区相关
*/
String QUAN_QU_XIANG_GUAN = "quanquxiangguan";
/**
* 街道相关
*/
String JIE_DAO_XIANG_GUAN = "jiedaoxiangguan";
/**
* 社区相关
*/
String SHE_QU_XIANG_GUAN = "shequxiangguan";
}

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

@ -0,0 +1,107 @@
package com.epmet.datareport.controller.fact;
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.service.fact.FactIndexService;
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 java.util.List;
/**
* 数据改版api
* @author sun
*/
@RestController
@RequestMapping("fact")
public class FactIndexController {
@Autowired
private FactIndexService factIndexService;
/**
* @param tokenDTO
* @Description 能力指数
* @author sun
*/
@PostMapping("index/ablityindex")
public Result<List<AblityIndexResultDTO>> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class);
return new Result<List<AblityIndexResultDTO>>().ok(factIndexService.ablityIndex(formDTO));
}
/**
* @param tokenDTO
* @Description 按月份查询各项能力分数
* @author sun
*/
@PostMapping("index/scorelist")
public Result<List<ScoreListResultDTO>> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class);
return new Result<List<ScoreListResultDTO>>().ok(factIndexService.scoreList(formDTO));
}
/**
* @param tokenDTO
* @Description 按月份查询各项能力最近12个月得分
* @author sun
*/
@PostMapping("index/monthscorelist")
public Result<List<MonthScoreListResultDTO>> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class);
return new Result<List<MonthScoreListResultDTO>>().ok(factIndexService.monthScoreList(formDTO));
}
/**
* @param tokenDTO
* @Description 按月查询各项指标数据
* @author sun
*/
@PostMapping("index/ablitylist")
public Result<List<AblityListResultDTO>> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class);
return new Result<List<AblityListResultDTO>>().ok(factIndexService.ablityList(formDTO));
}
/**
* @param tokenDTO
* @Description 按月查询各项指标最近12个月数据
* @author sun
*/
@PostMapping("index/monthablitylist")
public Result<List<MonthAblityListResultDTO>> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class);
return new Result<List<MonthAblityListResultDTO>>().ok(factIndexService.monthAblityList(formDTO));
}
/**
* @param tokenDTO
* @Description 同级对比各项数据查询
* @author sun
*/
@PostMapping("index/peercomparison")
public Result<List<PeerComparisonResultDTO>> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class);
return new Result<List<PeerComparisonResultDTO>>().ok(factIndexService.peerComparison(formDTO));
}
/**
* @param tokenDTO
* @Description 是否根组织
* @author sun
*/
@PostMapping("index/rootagency")
public Result<RootAgencyResultDTO> rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class);
return new Result<RootAgencyResultDTO>().ok(factIndexService.rootAgency(formDTO));
}
}

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

@ -1,6 +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.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -82,17 +83,19 @@ public class IndexController {
}
/**
* 5下级部门指数排行安宁数据段用
* 5下级部门指数排行安宁数据段用
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO>>
* @Author zhangyong
* @Date 13:39 2020-09-11
**/
@InternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("dataclient/subagencyindexrank")
public Result<List<AnNingSubAgencyIndexRankResultDTO>> anNingSubAgencyIndexRank(@RequestBody AnNingSubAgencyIndexRankFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AnNingSubAgencyIndexRankFormDTO.SubAgencyIndexRank.class);
return new Result<List<AnNingSubAgencyIndexRankResultDTO>>().ok(indexService.anNingSubAgencyIndexRank(formDTO));
public Result<List<AnNingSubAgencyIndexRankResultDTO>> getSubAgencyIndexRank(@RequestBody SubAgencyIndexRankYMFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, SubAgencyIndexRankYMFormDTO.SubAgencyIndexRank.class);
return new Result<List<AnNingSubAgencyIndexRankResultDTO>>().ok(indexService.getSubAgencyIndexRank(formDTO));
}
/**

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

@ -1,6 +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.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -75,6 +76,7 @@ public class KcScreenController {
* @return
*/
@ExternalAppRequestAuth
@InternalAppRequestAuth
@PostMapping("issue/summary")
public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();

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

@ -80,4 +80,10 @@ public interface ScreenCustomerAgencyDao {
*/
List<ParymemberDistributionResultDTO> selectParymemberDistribution(@Param("parentId")String parentId);
/**
* @param agencyId
* @Description 根据组织ID判断是否根组织
* @author sun
*/
int selectRootAgency(@Param("agencyId") String agencyId);
}

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

@ -17,13 +17,11 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO;
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.result.AnNingSubAgencyIndexRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult;
import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -70,7 +68,7 @@ public interface ScreenIndexDataMonthlyDao{
* @Author zhangyong
* @Date 09:38 2020-09-08
**/
List<AnNingSubAgencyIndexRankResultDTO> selectAnNingSubAgencyIndexMonthlyRank(AnNingSubAgencyIndexRankFormDTO formDTO);
List<AnNingSubAgencyIndexRankResultDTO> selectSubAgencyOrGridIndexMonthlyRank(SubAgencyIndexRankYMFormDTO formDTO);
/**
* desc获取网格指标排行
@ -79,4 +77,11 @@ public interface ScreenIndexDataMonthlyDao{
* @return
*/
List<SubAgencyIndexRankResultDTO> selectIndexRankByOrgType(GridIndexRankFormDTO formDTO);
/**
* @param formDTO
* @Description 同级对比--根据组织Id的上级组织Id查询同级组织对应类型的得分排名查询最近一个月数据
* @author sun
*/
List<PeerComparisonResultDTO> selectScoreList(PeerComparisonFormDTO formDTO);
}

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

@ -17,7 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -50,5 +50,5 @@ public interface ScreenIndexDataYearlyDao{
* @Author zhangyong
* @Date 09:38 2020-09-08
**/
List<AnNingSubAgencyIndexRankResultDTO> selectAnNingSubAgencyIndexYearlyRank(AnNingSubAgencyIndexRankFormDTO formDTO);
List<AnNingSubAgencyIndexRankResultDTO> selectAnNingSubAgencyIndexYearlyRank(SubAgencyIndexRankYMFormDTO formDTO);
}

50
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java

@ -0,0 +1,50 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
/**
* /街道相关分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface FactIndexAgencyScoreDao {
/**
* @param formDTO
* @Description 分别查询当前组织某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
ScoreListResultDTO selectScore(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectAblityIndex(AblityIndexFormDTO formDTO);
}

51
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
import java.util.List;
/**
* /街道相关分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface FactIndexAgencySubScoreDao {
/**
* @param formDTO
* @Description 查询区县级乡镇街道级组织某月份某项能力对应的各项指标
* @author sun
*/
List<AblityListResultDTO> selectAblityList(AblityListFormDTO formDTO);
/**
* @param formDTO
* @Description 查询区县级乡镇街道级组织某项能力对应的一项指标过去12个月份数据
* @author sun
*/
LinkedList<MonthAblityListResultDTO> selectMonthAblityList(MonthAblityListFormDTO formDTO);
}

41
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
/**
* 社区相关分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface FactIndexCommunityScoreDao {
/**
* @param formDTO
* @Description 分别查询社区过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectCommunityAblityIndex(AblityIndexFormDTO formDTO);
}

51
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
import java.util.List;
/**
* /街道相关分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface FactIndexCommunitySubScoreDao {
/**
* @param formDTO
* @Description 查询社区级组织某一月份某项能力对应的各项指标
* @author sun
*/
List<AblityListResultDTO> selectCommunityAblityList(AblityListFormDTO formDTO);
/**
* @param formDTO
* @Description 查询社区级组织某项能力对应的一项指标过去12个月份数据
* @author sun
*/
LinkedList<MonthAblityListResultDTO> selectCommunityMonthAblityList(MonthAblityListFormDTO formDTO);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java → epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java

@ -15,19 +15,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.indexcal;
package com.epmet.datareport.dao.fact;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.indexcal.FactIndexGridSelfSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格相关自身/下级分值记录表
* 网格相关分值记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface FactIndexGridSelfSubScoreDao extends BaseDao<FactIndexGridSelfSubScoreEntity> {
public interface FactIndexGridScoreDao {
}
}

31
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.fact;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格相关分值记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface FactIndexGridSubScoreDao {
}

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

@ -46,14 +46,14 @@ public interface IndexService {
List<SubAgencyIndexRankResultDTO> subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO);
/**
* 5下级部门指数排行安宁数据段用
* 5按月或年 下级组织指数排行
*
* @param formDTO
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO>
* @Author zhangyong
* @Date 09:38 2020-09-08
**/
List<AnNingSubAgencyIndexRankResultDTO> anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO);
List<AnNingSubAgencyIndexRankResultDTO> getSubAgencyIndexRank(SubAgencyIndexRankYMFormDTO formDTO);
/**
* desc:获取该客户下网格排行

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

@ -3,6 +3,7 @@ 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;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao;
@ -13,6 +14,7 @@ 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;
@ -48,19 +50,24 @@ public class AgencyServiceImpl implements AgencyService {
// 验签关闭,customerId无法获取,暂时写死
if(StringUtils.isBlank(customerId)){
if (StringUtils.isBlank(customerId)) {
customerId = "b09527201c4409e19d1dbc5e3c3429a1";
}
TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId);
if (null == rootAgency){
return new TreeResultDTO();
TreeResultDTO rootAgency = null;
try {
rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId);
if (null == rootAgency) {
return new TreeResultDTO();
}
} catch (TooManyResultsException e) {
throw new RenException("根组织结构数据有误");
}
List<Double> centerMark = this.getCenterMark(rootAgency.getCenterMarkA());
rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark);
if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)){
if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)) {
List<TreeResultDTO> treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue());
rootAgency.setChildren(treeResultDTOS);
}else {
} else {
List<TreeResultDTO> departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue()));
rootAgency.setChildren(departmentList);
}

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

@ -6,7 +6,6 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao;
import com.epmet.datareport.service.evaluationindex.screen.IndexService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
@ -19,6 +18,7 @@ import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -39,7 +39,7 @@ public class IndexServiceImpl implements IndexService {
@Autowired
private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl;
@Autowired
private DateUtils dateUtils;
private com.epmet.datareport.utils.DateUtils dateUtils;
/**
* @Description 1年度平均指数
@ -204,16 +204,20 @@ public class IndexServiceImpl implements IndexService {
return subAgencyIndexRankResultDTOS;
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public List<AnNingSubAgencyIndexRankResultDTO> anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO) {
public List<AnNingSubAgencyIndexRankResultDTO> getSubAgencyIndexRank(SubAgencyIndexRankYMFormDTO formDTO) {
List<AnNingSubAgencyIndexRankResultDTO> subAgencyIndexRankResultDTOS = new ArrayList<>();
if (ScreenConstant.YEAR_ID.equals(formDTO.getType())){
if (ScreenConstant.YEAR_ID.equals(formDTO.getType())) {
// 年 指数排行
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO);
} else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())){
} else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())) {
// 月(上一个月) 指数排行
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO);
if (StringUtils.isBlank(formDTO.getMonthId())) {
String monthId = com.epmet.commons.tools.utils.DateUtils.format(com.epmet.commons.tools.utils.DateUtils.addDateMonths(new Date(), -1), "yyyyMMdd");
formDTO.setMonthId(monthId);
}
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyOrGridIndexMonthlyRank(formDTO);
subAgencyIndexRankResultDTOS.forEach(rank -> {
rank.setPartyDevAbility(getRound(rank.getPartyDevAbility()));
rank.setGovernAbility(getRound(rank.getGovernAbility()));

63
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/FactIndexService.java

@ -0,0 +1,63 @@
package com.epmet.datareport.service.fact;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import java.util.List;
/**
* 数据改版api
* @author sun
*/
public interface FactIndexService {
/**
* @param formDTO
* @Description 能力指数
* @author sun
*/
List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 按月份查询各项能力分数
* @author sun
*/
List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 按月份查询各项能力最近12个月得分
* @author sun
*/
List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 按月查询各项指标数据
* @author sun
*/
List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO);
/**
* @param formDTO
* @Description 按月查询各项指标最近12个月数据
* @author sun
*/
List<MonthAblityListResultDTO> monthAblityList(MonthAblityListFormDTO formDTO);
/**
* @param formDTO
* @Description 同级对比各项数据查询
* @author sun
*/
List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO);
/**
* @param formDTO
* @Description 是否根组织
* @author sun
*/
RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO);
}

277
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java

@ -0,0 +1,277 @@
package com.epmet.datareport.service.fact.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.constant.FactConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao;
import com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao;
import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao;
import com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao;
import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao;
import com.epmet.datareport.service.fact.FactIndexService;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
/**
* 数据改版api
*
* @author sun
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexServiceImpl implements FactIndexService {
@Autowired
private ScreenCustomerAgencyDao screenCustomerAgencyDao;
@Autowired
private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao;
@Autowired
private FactIndexAgencyScoreDao factIndexAgencyScoreDao;
@Autowired
private FactIndexAgencySubScoreDao factIndexAgencySubScoreDao;
@Autowired
private FactIndexCommunityScoreDao factIndexCommunityScoreDao;
@Autowired
private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao;
/**
* @param formDTO
* @Description 能力指数
* @author sun
*/
@Override
public List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO) {
LinkedList<AblityIndexResultDTO> resultDTO = new LinkedList<>();
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> djList = null;
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> zlList = null;
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> fwList = null;
//分别查询过去12个月党建能力、治理能力、服务能力各自总分乘权重后的分值,每个月份三个分值的加和就是当月的能力指数的分值 fact_index_agency_score 按月份升序
//1.计算所查月份前12个月的monthId
formDTO.setStartMonthId(getDate(formDTO.getMonthId()));
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId()));
}
//1.根据组织级别判断查询哪类数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId()));
}
//3.遍历计算每个月能力指数
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> nlList = new LinkedList<>();
for (int i = 0; i < djList.size(); i++) {
AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO();
nldto.setIndexTotal(djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal());
nldto.setAgencyScore(djList.get(i).getAgencyScore() + zlList.get(i).getAgencyScore() + fwList.get(i).getAgencyScore());
nldto.setSubAgencyScore(djList.get(i).getSubAgencyScore() + zlList.get(i).getSubAgencyScore() + fwList.get(i).getSubAgencyScore());
nldto.setMonthId(djList.get(i).getMonthId());
nlList.add(nldto);
}
//5.封装数据并返回
AblityIndexResultDTO nl = new AblityIndexResultDTO();
nl.setIndexCode(FactConstant.NLZB);
nl.setScoreList(djList);
resultDTO.add(nl);
AblityIndexResultDTO dj = new AblityIndexResultDTO();
dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList);
resultDTO.add(dj);
AblityIndexResultDTO zl = new AblityIndexResultDTO();
zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(djList);
resultDTO.add(zl);
AblityIndexResultDTO fw = new AblityIndexResultDTO();
fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(djList);
resultDTO.add(fw);
return resultDTO;
}
/**
* @param formDTO
* @Description 按月份查询各项能力分数
* @author sun
*/
@Override
public List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO) {
//1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.DJNL);
ScoreListResultDTO dj = factIndexAgencyScoreDao.selectScore(formDTO);
//2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
//3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
return null;
}
/**
* @param formDTO
* @Description 按月份查询各项能力最近12个月得分
* @author sun
*/
@Override
public List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO) {
return null;
}
/**
* @param formDTO
* @Description 按月查询各项指标数据
* @author sun
*/
@Override
public List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO) {
List<AblityListResultDTO> resultList = new ArrayList<>();
//按月份查询当前组织各项指标数据 fact_index_agency_sub_score
//1.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId()));
}
//2.根据组织级别拼接查询条件,判断查询不同数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
if ("district".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
} else {
formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode());
}
resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId()));
}
//3.调用方法判断各项指标是数字指标还是百分比指标 //TODO
return resultList;
}
/**
* @param formDTO
* @Description 按月查询各项指标最近12个月数据
* @author sun
*/
@Override
public List<MonthAblityListResultDTO> monthAblityList(MonthAblityListFormDTO formDTO) {
LinkedList<MonthAblityListResultDTO> resultList = new LinkedList<>();
//1.计算所查月份前12个月的monthId
formDTO.setStartMonthId(getDate(formDTO.getMonthId()));
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId());
if (null == agency) {
throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getAgencyId()));
}
//3.根据组织级别拼接查询条件,判断查询不同数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId()));
}
//3.调用方法判断各项指标是数字指标还是百分比指标//TODO
return resultList;
}
/**
* @param newDate
* @Description 计算monthId对应一年前的monthId
* @author sun
*/
public String getDate(String newDate) {
String date = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyymm");
try {
Calendar ds = Calendar.getInstance();
ds.setTime(sdf.parse(newDate));
ds.add(Calendar.YEAR, -1);
date = sdf.format(ds.getTime());
} catch (RenException | ParseException e) {
e.printStackTrace();
}
return date;
}
/**
* @param formDTO
* @Description 同级对比各项数据查询
* @author sun
*/
@Override
public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) {
//1.根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据)
List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO);
return resultList;
}
/**
* @param formDTO
* @Description 是否根组织
* @author sun
*/
@Override
public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) {
RootAgencyResultDTO resultDTO = new RootAgencyResultDTO();
//1.根据agencyId查询是否为根级组织
int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId());
if (num < NumConstant.ONE) {
resultDTO.setIsRoot(false);
}
//2.计算统计数据更新时间
SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
//获取当前月第一天日期
calendar.add(Calendar.MONTH, 0);
calendar.set(Calendar.DAY_OF_MONTH, 1);
//获取上月最后一天日期
calendar.set(Calendar.HOUR, -24);
resultDTO.setDate(d.format(calendar.getTime()));
return resultDTO;
}
}

10
epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml

@ -140,4 +140,12 @@ pagehelper:
dingTalk:
robot:
webHook: @dingTalk.robot.webHook@
secret: @dingTalk.robot.secret@
secret: @dingTalk.robot.secret@
jwt:
token:
#秘钥
secret: 7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]
#token有效时长,默认7天,单位秒
expire: 604800

33
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao">
<select id="selectScore" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
</select>
<select id="selectAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score * fact.weight, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
FROM
fact_index_agency_score fact
INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{agencyId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
</mapper>

42
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao">
<select id="selectAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_agency_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
AND dict.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode}
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND month_id = #{monthId}
</select>
<select id="selectMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
FROM
fact_index_agency_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
AND dict.del_flag = '0'
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND month_id &lt;= #{monthId}
AND month_id &gt; #{startMonthId}
AND fact.index_code = #{key}
ORDER BY
fact.month_id ASC
</select>
</mapper>

29
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao">
<select id="selectCommunityAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score * fact.weight, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
FROM
fact_index_community_score fact
INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{agencyId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
</mapper>

42
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao">
<select id="selectCommunityAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
AND dict.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode}
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND month_id = #{monthId}
</select>
<select id="selectCommunityMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
FROM
fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
AND dict.del_flag = '0'
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND month_id &lt;= #{monthId}
AND month_id &gt; #{startMonthId}
AND fact.index_code = #{key}
ORDER BY
fact.month_id ASC
</select>
</mapper>

7
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridScoreDao">
</mapper>

7
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao">
</mapper>

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

@ -101,4 +101,15 @@
AND sutd.parent_id = #{parentId}
</select>
<select id="selectRootAgency" resultType="java.lang.Integer">
SELECT
COUNT(id)
FROM
screen_customer_agency
WHERE
del_flag = '0'
AND pid = '0'
AND agency_id = #{agencyId}
</select>
</mapper>

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

@ -61,21 +61,23 @@
LIMIT #{topNum}
</select>
<!-- 下级部门指数排行 安宁 --->
<select id="selectAnNingSubAgencyIndexMonthlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO"
<!-- 下级部门指数排行(不包含部门) 安宁 --->
<select id="selectSubAgencyOrGridIndexMonthlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO"
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT
org_name AS `NAME`,
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility,
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility,
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility,
ORG_ID orgId
ORG_ID orgId,
ORG_TYPE orgType
FROM
screen_index_data_monthly
WHERE
del_flag = '0'
AND parent_id = #{agencyId}
AND month_id = left(replace(DATE_SUB( CURDATE(),INTERVAL 1 MONTH),'-',''),6)
AND month_id = #{monthId,jdbcType=VARCHAR}
AND ORG_TYPE != 'department'
<if test="sort == 'asc'">
ORDER BY index_total ASC
</if>
@ -105,4 +107,62 @@
ORDER BY index_total DESC
LIMIT #{topNum}
</select>
<select id="selectScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.PeerComparisonResultDTO">
SELECT
org_id AS "agencyId",
org_name AS "agencyName",
<if test="indexCode != null and indexCode != '' and indexCode == 'dangjiannengli'">
round((party_dev_ablity * party_dev_weight),1) AS "score"
</if>
<if test="indexCode != null and indexCode != '' and indexCode == 'zhilinengli'">
round((govern_ablity * govern_ablity_weight),1) AS "score"
</if>
<if test="indexCode != null and indexCode != '' and indexCode == 'fuwunengli'">
round((service_ablity * service_ablity_weight),1) AS "score"
</if>
FROM
screen_index_data_monthly
WHERE
del_flag = '0'
AND org_type = 'agency'
AND customer_id = #{customerId}
AND parent_id = (
select
parent_id
from
screen_index_data_monthly
where
del_flag = '0'
and org_type = 'agency'
and customer_id = #{customerId}
and org_id = #{agencyId}
order by
created_time desc
limit 1
)
AND MONTH_ID = (
select
month_id
from
screen_index_data_monthly
where
del_flag = '0'
and customer_id = #{customerId}
order by
month_id desc
limit 1
)
ORDER BY
<if test="indexCode != null and indexCode != '' and indexCode == 'dangjiannengli'">
(party_dev_ablity * party_dev_weight) DESC
</if>
<if test="indexCode != null and indexCode != '' and indexCode == 'zhilinengli'">
(govern_ablity * govern_ablity_weight) DESC
</if>
<if test="indexCode != null and indexCode != '' and indexCode == 'fuwunengli'">
(service_ablity * service_ablity_weight) DESC
</if>
LIMIT #{pageSize}
</select>
</mapper>

5
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

@ -19,14 +19,15 @@
</select>
<!-- 下级部门指数排行 安宁 --->
<select id="selectAnNingSubAgencyIndexYearlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO"
<select id="selectAnNingSubAgencyIndexYearlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO"
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT
org_name AS `NAME`,
govern_ablity AS governAbility,
party_dev_ablity AS partyDevAbility,
service_ablity AS serviceAbility,
ORG_ID orgId
ORG_ID orgId,
ORG_TYPE orgType
FROM
screen_index_data_yearly
WHERE

12
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ScreenConstant.java

@ -8,10 +8,22 @@ public interface ScreenConstant {
String COMMUNITY = "community";
String STREET = "street";
String DISTRICT = "district";
String CITY = "city";
String PROVINCE = "province";
String LEVEL = "level";
String STR_NULL = "";
String ENGLISH_COMMA = ",";
String GRID = "grid";
String AGENCY = "agency";
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java

@ -33,6 +33,8 @@ public class IssueLogDailyFormDTO implements Serializable {
*/
private String pid;
private String pids;
/**
* 机关ID
*/

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java

@ -79,6 +79,8 @@ public class IssueMainDailyFormDTO implements Serializable {
*/
private String pid;
private String pids;
/**
* 议题组织ID网格所属组织ID
*/

132
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyBaseInfoFormDTO.java

@ -0,0 +1,132 @@
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/22 3:19 下午
*/
@Data
public class PartyBaseInfoFormDTO implements Serializable {
private static final long serialVersionUID = 1685776533893300943L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/
private String dataEndTime;
/**
* 注册用户数
*/
private Integer registerUserCount;
/**
* 群众用户数
*/
private Integer resiTotal;
/**
* 注册党员数
*/
private Integer partyMemberCount;
/**
* 小于20岁的党员总人数
*/
private Integer ageLevel1;
/**
* 20-30岁的党员总人数
*/
private Integer ageLevel2;
/**
* 31-40岁的党员总人数
*/
private Integer ageLevel3;
/**
* 41-50岁的党员总人数
*/
private Integer ageLevel4;
/**
* 51-60岁的党员总人数
*/
private Integer ageLevel5;
/**
* 60+岁的党员总人数
*/
private Integer ageLevel6;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
public PartyBaseInfoFormDTO() {
this.registerUserCount = NumConstant.ZERO;
this.resiTotal = NumConstant.ZERO;
this.partyMemberCount = NumConstant.ZERO;
this.ageLevel1 = NumConstant.ZERO;
this.ageLevel2 = NumConstant.ZERO;
this.ageLevel3 = NumConstant.ZERO;
this.ageLevel4 = NumConstant.ZERO;
this.ageLevel5 = NumConstant.ZERO;
this.ageLevel6 = NumConstant.ZERO;
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java

@ -22,4 +22,6 @@ public class AgencyInfoResultDTO implements Serializable {
* 机关的父ID
*/
private String pid;
private String pids;
}

35
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CustomerAgencyInfoResultDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/22 4:21 下午
*/
@Data
public class CustomerAgencyInfoResultDTO implements Serializable {
private static final long serialVersionUID = -584952326059903779L;
/**
* 机关ID
*/
private String agencyId;
/**
* 机关名称
*/
private String agencyName;
/**
* 机关父级ID
*/
private String pid;
/**
* 机关级别
*/
private String level;
}

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
@ -42,4 +43,6 @@ public class IssueProcessInfoResultDTO implements Serializable {
* 用户ID
*/
private String userId;
private Date createTime;
}

85
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyInfoResultDTO.java

@ -0,0 +1,85 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/23 1:58 下午
*/
@Data
public class PartyInfoResultDTO implements Serializable {
private static final long serialVersionUID = -5275089831499409888L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 注册用户数
*/
private Integer registerUserCount;
/**
* 群众用户数
*/
private Integer resiTotal;
/**
* 注册党员数
*/
private Integer partyMemberCount;
/**
* 小于20岁的党员总人数
*/
private Integer ageLevel1;
/**
* 20-30岁的党员总人数
*/
private Integer ageLevel2;
/**
* 31-40岁的党员总人数
*/
private Integer ageLevel3;
/**
* 41-50岁的党员总人数
*/
private Integer ageLevel4;
/**
* 51-60岁的党员总人数
*/
private Integer ageLevel5;
/**
* 60+岁的党员总人数
*/
private Integer ageLevel6;
}

51
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java

@ -0,0 +1,51 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2020/9/22 5:23 下午
*/
@Data
public class PartyMemberInfoResultDTO implements Serializable {
private static final long serialVersionUID = 6591845785373556485L;
/**
* 网格ID
*/
private String gridId;
/**
* 机关ID
*/
private String agencyId;
/**
* 父级ID
*/
private String parentId;
/**
* 生日
*/
private Date birthday;
/**
* 年龄
*/
private Integer age;
/**
* 网格名称
*/
private String gridName;
/**
* 机关名称
*/
private String agencyName;
}

35
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserCountResultDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/23 9:54 上午
*/
@Data
public class UserCountResultDTO implements Serializable {
private static final long serialVersionUID = -6349371693110337172L;
/**
* 群众用户数
*/
private Integer resiTotal;
/**
* 注册用户数
*/
private Integer registerUserCount;
/**
* 注册党员数
*/
private Integer partyMemberCount;
/**
* 网格ID / 机关ID
*/
private String orgId;
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java

@ -32,4 +32,9 @@ public class GridInfoDTO implements Serializable {
* 客户id
*/
private String customerId;
/**
* 所有上级组织ID,英文:隔开
*/
private String pids;
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java

@ -35,6 +35,8 @@ public class DimCustomerPartyMemberFormDTO implements Serializable {
*/
private String parentId;
private String pids;
/**
* 党员认证成功的日期yyyyMMdd
*/

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java

@ -27,4 +27,6 @@ public class GridBelongAgencyResultDTO implements Serializable {
* 机关的上级ID
*/
private String parentId;
private String pids;
}

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

@ -178,13 +178,13 @@ public class DemoController {
@PostMapping("zxc2")
public Result getZxc2(){
indexCalculateCommunityService.calCommunityAll("b09527201c4409e19d1dbc5e3c3429a1","202008");
indexCalculateCommunityService.calCommunityAll("epmettest", "202008");
return new Result();
}
@PostMapping("testcalculategridcorrelation")
public Result testcalculateGridCorreLation(){
CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008");
CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO("epmettest", "202008");
gridCorreLationService.calculateGridCorreLation(formDTO);
return new Result();
}
@ -637,8 +637,8 @@ public class DemoController {
private PartyBaseInfoService partyBaseInfoService;
@PostMapping("zxczxczxc")
public Result getZxcZxcZxc(){
partyBaseInfoService.statsPartyMemberBaseInfoToScreen("45687aa479955f9d06204d415238f7cc","20200922");
public Result getZxcZxcZxc(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
partyBaseInfoService.statsPartyMemberBaseInfoToScreen(formDTO.getCustomerId(),formDTO.getDateId());
return new Result();
}

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

@ -110,4 +110,14 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
* @Date 2020/9/20 22:54
**/
Integer selectIssueTotalTwoMonth(@Param("list") List<String> topicIdList);
/**
* @Description 更新议题状态
* @param issueId
* @param status
* @author zxc
* @date 2020/9/23 5:08 下午
*/
void updateIssueStatus(@Param("issueId")String issueId,@Param("status")String status);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java

@ -18,8 +18,11 @@
package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.indexcal.FactIndexAgencySelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* /街道相关 自身和下级分数表
@ -28,6 +31,9 @@ import org.apache.ibatis.annotations.Mapper;
* @since v1.0.0 2020-09-21
*/
@Mapper
public interface FactIndexAgencySelfSubScoreDao extends BaseDao<FactIndexAgencySelfSubScoreEntity> {
public interface AgencySelfSubScoreDao extends BaseDao<AgencySelfSubScoreEntity> {
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId);
int insertBatch(@Param("list") List<AgencySelfSubScoreEntity> list);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java

@ -18,7 +18,7 @@
package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.CommunitySelfSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
/**
@ -28,6 +28,6 @@ import org.apache.ibatis.annotations.Mapper;
* @since v1.0.0 2020-09-21
*/
@Mapper
public interface FactIndexCommunitySelfSubScoreDao extends BaseDao<FactIndexCommunitySelfSubScoreEntity> {
public interface CommunitySelfSubScoreDao extends BaseDao<CommunitySelfSubScoreEntity> {
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSelfSubScoreDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 网格相关自身/下级分值记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Mapper
public interface GridSelfSubScoreDao extends BaseDao<GridSelfSubScoreEntity> {
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode);
int insertBatch(@Param("list") List<GridSelfSubScoreEntity> list);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java

@ -18,6 +18,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.result.PartyInfoResultDTO;
import com.epmet.dto.screencoll.form.CpcBaseDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -55,4 +57,32 @@ public interface ScreenCpcBaseDataDao extends BaseDao<ScreenCpcBaseDataEntity> {
* @Date 10:52 2020-08-18
**/
void batchInsertCpcBaseData(@Param("list") List<CpcBaseDataFormDTO> list, @Param("customerId")String customerId);
/**
* @Description 插入党员基本信息
* @param baseInfos
* @author zxc
* @date 2020/9/22 3:28 下午
*/
void insertPartyBaseInfo(@Param("baseInfos") List<PartyBaseInfoFormDTO> baseInfos);
/**
* @Description 删除旧的党员基本信息
* @param customerId
* @param dateId
* @param orgIds
* @author zxc
* @date 2020/9/22 3:28 下午
*/
Integer deleteOldPartyBaseInfo(@Param("customerId") String customerId,@Param("dateId") String dateId,@Param("orgIds")List<String> orgIds);
/**
* @Description 查询党员信息根据agencyId来查
* @param customerId
* @param dateId
* @param agencyId
* @author zxc
* @date 2020/9/23 2:01 下午
*/
List<PartyInfoResultDTO> selectPartyInfo(@Param("customerId") String customerId,@Param("dateId") String dateId, String agencyId);
}

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

@ -18,6 +18,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.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.screen.result.TreeResultDTO;
import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
@ -120,9 +122,34 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
*/
List<TreeResultDTO> selectSubAgencyList(@Param("pids") String pids);
/**
* @Description 查询客户下所有机关ID
* @param customerId
* @author zxc
* @date 2020/9/22 4:06 下午
*/
List<CustomerAgencyInfoResultDTO> selectAllAgencyId(@Param("customerId") String customerId);
ScreenCustomerAgencyEntity getLastAddedAgency();
ScreenCustomerAgencyEntity getLastUpdatedAgency();
ScreenCustomerAgencyEntity selectByAgencyId(String agencyId);
/**
* @Description 查询下一级机关的ID即以agencyId为pid的agency
* @param agencyId
* @param customerId
* @author zxc
* @date 2020/9/23 11:11 上午
*/
List<String> selectSubAgencyId(@Param("agencyId") String agencyId,@Param("customerId") String customerId);
/**
* @Description 查询客户下所有机关ID
* @param customerId
* @author zxc
* @date 2020/9/23 3:10 下午
*/
List<PartyBaseInfoFormDTO> selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId);
}

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

@ -19,6 +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.PartyBaseInfoFormDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.screencoll.form.CustomerGridFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
@ -128,4 +129,13 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
ScreenCustomerGridEntity getLastUpdateGrid();
ScreenCustomerGridEntity getByGridId(String gridId);
/**
* @Description 查询客户下所有网格ID
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 3:10 下午
*/
List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.PartyMemberInfoResultDTO;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.entity.stats.DimCustomerPartymemberEntity;
@ -60,4 +61,13 @@ public interface DimCustomerPartymemberDao extends BaseDao<DimCustomerPartymembe
* @Date 2020/9/18 9:00
**/
List<FactIndexPartyAblityCpcMonthlyEntity> selectPartyMemberList(String customerId);
/**
* @Description 查询党员信息
* @param customerId
* @param gridIds
* @author zxc
* @date 2020/9/22 5:26 下午
*/
List<PartyMemberInfoResultDTO> selectPartyMemberInfo(@Param("customerId")String customerId,@Param("gridIds") List<String> gridIds);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO;
import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -38,4 +39,13 @@ public interface FactParticipationUserAgencyDailyDao extends BaseDao<FactPartici
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
/**
* @Description 查询机关下用户信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 9:57 上午
*/
List<UserCountResultDTO> selectUserCount(String customerId, String dateId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO;
import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -38,4 +39,13 @@ public interface FactParticipationUserGridDailyDao extends BaseDao<FactParticipa
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
/**
* @Description 查询网格下用户信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 9:57 上午
*/
List<UserCountResultDTO> selectUserCount(String customerId, String dateId);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java

@ -112,5 +112,8 @@ public class FactOriginTopicLogDailyEntity extends BaseEpmetEntity {
* 原始业务发生时间
*/
private Date originalBusinessTime;
/**
* 所有上级组织ID,英文:隔开
*/
private String pids;
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java

@ -18,13 +18,10 @@
package com.epmet.entity.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 话题主表_日统计
*
@ -102,5 +99,8 @@ public class FactOriginTopicMainDailyEntity extends BaseEpmetEntity {
* 话题发布人是否是党员1是党员0不是 默认0
*/
private Boolean createTopicUserIsParty;
/**
* 所有上级组织ID,英文:隔开
*/
private String pids;
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySelfSubScoreEntity.java

@ -28,12 +28,12 @@ import java.math.BigDecimal;
* /街道相关 自身和下级分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
* @since v1.0.0 2020-09-23
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_agency_self_sub_score")
public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity {
public class AgencySelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
@ -73,19 +73,19 @@ public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity {
private String dataType;
/**
* 分数类型self自身得分sub下级得分
* 自身指标得分
*/
private String scoreType;
private BigDecimal selfScore;
/**
*
* 下级指标得
*/
private BigDecimal score;
private BigDecimal subScore;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli街道相关jiedaoxiangguan全区相关:quanquxiangguan
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String indexCode;
private String parentIndexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
@ -93,8 +93,13 @@ public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity {
private String allParentIndexCode;
/**
* 权重
* 自身指标权重
*/
private BigDecimal weight;
private BigDecimal selfWeight;
/**
* 下级指标权重
*/
private BigDecimal subWeight;
}

123
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CommunitySelfSubScoreEntity.java

@ -28,68 +28,73 @@ import java.math.BigDecimal;
* 社区相关 自身/下级分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
* @since v1.0.0 2020-09-23
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_community_self_sub_score")
public class FactIndexCommunitySelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织id
*/
private String agencyId;
/**
* 社区上一级组织id
*/
private String parentAgencyId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 分数类型self自身得分sub下级得分
*/
private String scoreType;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli社区相关shequxiangguan
*/
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 权重
*/
private BigDecimal weight;
public class CommunitySelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织id
*/
private String agencyId;
/**
* 社区上一级组织id
*/
private String parentAgencyId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 自身指标得分
*/
private BigDecimal selfScore;
/**
* 下级指标得分
*/
private BigDecimal subScore;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String parentIndexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 自身指标权重
*/
private BigDecimal selfWeight;
/**
* 下级指标权重
*/
private BigDecimal subWeight;
}

100
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java

@ -1,100 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 网格相关自身/下级分值记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_grid_self_sub_score")
public class FactIndexGridSelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id
*/
private String gridId;
/**
* 网格所属的机关Id
*/
private String agencyId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 分数类型self自身得分sub下级得分
*/
private String scoreType;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli网格相关wanggexiangguan
*/
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 权重
*/
private BigDecimal weight;
}

105
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSelfSubScoreEntity.java

@ -0,0 +1,105 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 网格相关自身/下级分值记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_grid_self_sub_score")
public class GridSelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id
*/
private String gridId;
/**
* 网格所属的机关Id
*/
private String agencyId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 自身指标得分
*/
private BigDecimal selfScore;
/**
* 下级指标得分
*/
private BigDecimal subScore;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String parentIndexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 自身指标权重
*/
private BigDecimal selfWeight;
/**
* 下级指标权重
*/
private BigDecimal subWeight;
}

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

@ -173,7 +173,8 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
mainDailyEntity.setAgencyId(gridInfoDTO.getAgencyId());
//网格的上上级组织id=街道id
mainDailyEntity.setPid(gridInfoDTO.getPid());
//TODO
mainDailyEntity.setPids(gridInfoDTO.getPids());
//判断用户是否是党员,调用相成写的方法
//话题发布人是否是党员:1是党员0不是。 默认0
if (null != userIsPartyMap && null != userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId())) {
mainDailyEntity.setCreateTopicUserIsParty(userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId()) == NumConstant.ONE ? true : false);
@ -190,7 +191,8 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
logDailyEntity.setQuarterId(quarterId);
logDailyEntity.setAgencyId(gridInfoDTO.getAgencyId());
logDailyEntity.setPid(gridInfoDTO.getPid());
//TODO
logDailyEntity.setPids(gridInfoDTO.getPids());
//判断用户是否是党员,调用相成写的方法
if (null != userIsPartyMap && null != userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId())) {
logDailyEntity.setOperateUserIsParty(userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId()) == NumConstant.ONE ? true : false);
} else {

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

@ -1,6 +1,7 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.TimeListResultDTO;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -26,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -126,6 +128,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(pid -> {
if (r.getAgencyId().equals(pid.getAgencyId())){
r.setPid(pid.getPid());
r.setPids(pid.getPids());
}
});
});
@ -164,6 +167,11 @@ public class IssueExtractServiceImpl implements IssueExtractService {
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) -> {
List<IssueProcessInfoResultDTO> descByCreateTime = process.stream().sorted(Comparator.comparing(IssueProcessInfoResultDTO::getCreateTime).reversed()).collect(Collectors.toList());
issueMainDailyDao.updateIssueStatus(issueId,descByCreateTime.get(NumConstant.ZERO).getActionCode());
});
listResult.forEach(issueProcess -> {
IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class);
issueLogDailyFormDTO.setOperationUserId(issueProcess.getUserId());
@ -219,6 +227,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(agency -> {
if (r.getAgencyId().equals(agency.getAgencyId())){
r.setPid(agency.getPid());
r.setPids(agency.getPids());
}
});
});

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

@ -1,12 +1,34 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.dto.extract.result.PartyMemberInfoResultDTO;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import com.epmet.service.stats.user.FactParticipationUserAgencyDailyService;
import com.epmet.service.stats.user.FactParticipationUserGridDailyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.epmet.constant.ScreenConstant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Desciption 党员基本情况
@ -19,6 +41,16 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
@Autowired
private ScreenCustomerAgencyService agencyService;
@Autowired
private ScreenCustomerGridService gridService;
@Autowired
private DimCustomerPartymemberService partyMemberService;
@Autowired
private FactParticipationUserGridDailyService userGridDailyService;
@Autowired
private FactParticipationUserAgencyDailyService userAgencyDailyService;
@Autowired
private ScreenCpcBaseDataService cpcBaseDataService;
/**
* @Description 统计基层党建-党员基本情况
@ -29,9 +61,232 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
*/
@Override
public Boolean statsPartyMemberBaseInfoToScreen(String customerId, String dateId) {
String agencyId = "cyagstrbee8711eaa1fac03fd56f7847";
Map<String, Object> stringObjectMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
System.out.println(stringObjectMap);
return null;
List<CustomerAgencyInfoResultDTO> agencyIdList = agencyService.selectAllAgencyId(customerId);
if (!CollectionUtils.isEmpty(agencyIdList)){
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY);
disPose(customerGridInfoList,true,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.STREET);
disPose(customerGridInfoList,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT);
disPose(customerGridInfoList,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.CITY);
disPose(customerGridInfoList,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE);
disPose(customerGridInfoList,false,customerId,dateId);
}
}
return true;
}
/**
* @Description
* @param isGrid true:level = community
* @author zxc
* @date 2020/9/22 4:48 下午
*/
public void disPose(List<CustomerAgencyInfoResultDTO> agencyIdList, Boolean isGrid, String customerId, String dateId){
if (!CollectionUtils.isEmpty(agencyIdList)){
List<String> orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
List<PartyBaseInfoFormDTO> result = new ArrayList<>();
if (isGrid == true){
List<UserCountResultDTO> userCountList = userGridDailyService.selectUserCount(customerId, dateId);
agencyIdList.forEach(agency -> {
// 1. 处理社区下的所有网格中的党员信息
String agencyId = agency.getAgencyId();
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(agencyId);
orgIds.addAll(gridIds);
List<PartyMemberInfoResultDTO> partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds);
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
// 为每个人赋值年龄
partyMemberInfoList.forEach(party -> {
party.setAge(getAge(party.getBirthday()));
});
Map<String, List<PartyMemberInfoResultDTO>> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId));
groupByGridId.forEach((gridId,partyInfos) -> {
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgType(ScreenConstant.GRID);
form.setOrgId(gridId);
form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName());
form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false));
form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY));
form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY));
form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY));
form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY));
form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true));
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId());
if (!CollectionUtils.isEmpty(userCountList)){
userCountList.forEach(user -> {
if (gridId.equals(user.getOrgId())){
form.setResiTotal(user.getResiTotal());
form.setRegisterUserCount(user.getRegisterUserCount());
form.setPartyMemberCount(user.getPartyMemberCount());
}
});
}
result.add(form);
});
}
});
// 2. 处理社区级别的党员信息
Map<String, List<PartyBaseInfoFormDTO>> groupByAgency = result.stream().collect(Collectors.groupingBy(PartyBaseInfoFormDTO::getParentId));
groupByAgency.forEach((commAgencyId,party) -> {
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgName(party.get(NumConstant.ZERO).getOrgName());
form.setOrgId(commAgencyId);
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setOrgType(ScreenConstant.AGENCY);
form.setParentId(party.get(NumConstant.ZERO).getParentId());
form.setAgeLevel1(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel1)));
form.setAgeLevel2(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel2)));
form.setAgeLevel3(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel3)));
form.setAgeLevel4(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel4)));
form.setAgeLevel5(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel5)));
form.setAgeLevel6(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel6)));
form.setPartyMemberCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getPartyMemberCount)));
form.setResiTotal(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getResiTotal)));
form.setRegisterUserCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getRegisterUserCount)));
result.add(form);
});
delAndInsert(result,customerId,dateId,orgIds);
}else {
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
List<PartyInfoResultDTO> partyInfoList = cpcBaseDataService.selectPartyInfo(customerId, dateId, agencyId);
if (!CollectionUtils.isEmpty(partyInfoList)){
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgName(partyInfoList.get(NumConstant.ZERO).getOrgName());
form.setOrgId(agencyId);
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setOrgType(ScreenConstant.AGENCY);
form.setParentId(partyInfoList.get(NumConstant.ZERO).getParentId());
form.setAgeLevel1(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel1)));
form.setAgeLevel2(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel2)));
form.setAgeLevel3(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel3)));
form.setAgeLevel4(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel4)));
form.setAgeLevel5(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel5)));
form.setAgeLevel6(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel6)));
form.setPartyMemberCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getPartyMemberCount)));
form.setResiTotal(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getResiTotal)));
form.setRegisterUserCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getRegisterUserCount)));
result.add(form);
}
});
delAndInsert(result,customerId,dateId,orgIds);
}
}
}
/**
* @Description 根据生日计算年龄
* @param birthday
* @author zxc
* @date 2020/9/22 5:34 下午
*/
public Integer getAge(Date birthday){
LocalDate now = LocalDate.now();
int nowYear = now.getYear();
int nowMonth = now.getMonthValue();
int nowDayOfMonth = now.getDayOfMonth();
LocalDate birth = birthday.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
int birthDayYear = birth.getYear();
int birthDayMonth = birth.getMonthValue();
int birthDayOfMonth = birth.getDayOfMonth();
int age = nowYear - birthDayYear;
if (nowMonth < birthDayMonth || (nowMonth == birthDayMonth && nowDayOfMonth < birthDayOfMonth)) {
age--;
}
return age;
}
/**
* @Description 处理年龄段之间的人数
* @param partyMemberInfoList
* @param startAge
* @param endAge
* @author zxc
* @date 2020/9/22 5:45 下午
*/
public Integer disposeAgeArea(List<PartyMemberInfoResultDTO> partyMemberInfoList, Integer startAge,Integer endAge ){
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
List<PartyMemberInfoResultDTO> collect = partyMemberInfoList.stream().filter(p -> p.getAge() >= startAge).filter(p -> p.getAge() <= endAge).collect(Collectors.toList());
return collect.size();
}
return NumConstant.ZERO;
}
/**
* @Description 计算 大于/小于 年龄的人数
* @param partyMemberInfoList
* @param age
* @param isGreater 是否是 大于
* @author zxc
* @date 2020/9/22 5:49 下午
*/
public Integer disposeAge(List<PartyMemberInfoResultDTO> partyMemberInfoList, Integer age , Boolean isGreater){
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
List<PartyMemberInfoResultDTO> collect = new ArrayList<>();
if (isGreater == true){
collect = partyMemberInfoList.stream().filter(p -> p.getAge() > age).collect(Collectors.toList());
}else {
collect = partyMemberInfoList.stream().filter(p -> p.getAge() < age).collect(Collectors.toList());
}
return collect.size();
}
return NumConstant.ZERO;
}
/**
* @Description
* @param result
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 10:13 上午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsert(List<PartyBaseInfoFormDTO> result, String customerId, String dateId, List<String> orgIds){
List<PartyBaseInfoFormDTO> partyBaseInfoList = agencyService.selectAllAgencyIdToParty(customerId,dateId);
List<PartyBaseInfoFormDTO> resultList = gridService.selectAllGridIdToParty(customerId, dateId);
resultList.addAll(partyBaseInfoList);
List<PartyBaseInfoFormDTO> finalResult = new ArrayList<>();
resultList.forEach(rl -> {
orgIds.forEach(orgId -> {
if (rl.getOrgId().equals(orgId)){
finalResult.add(rl);
}
});
});
if (!CollectionUtils.isEmpty(result)){
finalResult.forEach(fr -> {
result.forEach(r -> {
if (fr.getOrgId().equals(r.getOrgId())){
BeanUtils.copyProperties(r,fr);
}
});
});
}
Integer delNum;
do {
delNum = cpcBaseDataService.deleteOldPartyBaseInfo(customerId, dateId, orgIds);
}while (delNum > NumConstant.ZERO);
List<List<PartyBaseInfoFormDTO>> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
cpcBaseDataService.insertPartyBaseInfo(p);
});
}
}

62
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -11,6 +11,7 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao;
import com.epmet.dao.evaluationindex.indexcal.GridScoreDao;
import com.epmet.dao.evaluationindex.indexcal.GridSelfSubScoreDao;
import com.epmet.dao.evaluationindex.indexcal.GridSubScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao;
@ -20,6 +21,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.*;
import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
import com.epmet.eum.IndexCodeEnum;
@ -74,6 +76,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
private GridSubScoreDao gridSubScoreDao;
@Autowired
private IndexGroupDetailDao indexGroupDetailDao;
@Autowired
private GridSelfSubScoreDao gridSelfSubScoreDao;
/**
@ -110,16 +114,68 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
indexList.forEach(index -> {
String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode());
//获取出指标之间的关系
List<IndexGroupDetailEntity> slefsubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath);
if (CollectionUtils.isEmpty(slefsubIndexList)) {
log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
List<IndexGroupDetailEntity> selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath);
if (CollectionUtils.isEmpty(selfSubIndexList)) {
log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId());
return;
}
//获取该能力下的分数
List<GridSubScoreEntity> subScore = gridSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath);
if (CollectionUtils.isEmpty(subScore)) {
log.error("calculateSelfSubScore gridSubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId());
return;
}
Map<String, Set<String>> selfSubParentMap = new HashMap<>();
selfSubParentMap.put("zishen", new HashSet<>());
selfSubParentMap.put("xiaji", new HashSet<>());
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf("xiaji") > -1) {
selfSubParentMap.get("xiaji").add(o.getIndexCode());
} else {
selfSubParentMap.get("zishen").add(o.getIndexCode());
}
});
Map<String, GridSelfSubScoreEntity> insertMap = new HashMap<>();
subScore.forEach(score -> {
String key = score.getGridId().concat(index.getIndexCode());
GridSelfSubScoreEntity scoreEntity = insertMap.get(key);
if (scoreEntity == null) {
scoreEntity = ConvertUtils.sourceToTarget(score, GridSelfSubScoreEntity.class);
insertMap.put(key, scoreEntity);
scoreEntity.setSelfScore(new BigDecimal(0));
scoreEntity.setSubScore(new BigDecimal(0));
scoreEntity.setParentIndexCode(index.getIndexCode());
scoreEntity.setSelfWeight(new BigDecimal(0));
scoreEntity.setSubWeight(new BigDecimal(0));
}
BigDecimal partScore = score.getScore().multiply(score.getWeight());
BigDecimal partWeight = score.getScore().multiply(score.getWeight());
if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) {
scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore));
scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight()));
} else {
scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore));
scoreEntity.setSelfWeight(scoreEntity.getSelfWeight().add(score.getWeight()));
}
log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getGridId(), score.getScore(), score.getWeight(), partScore);
System.out.println("=====grid:" + score.getGridId() + ",originScore:" + score.getScore() + ",weight:" + score.getWeight() + ",finalScore:" + partScore + " ,selftotal:" + scoreEntity.getSelfScore() + ",subScore:" + scoreEntity.getSubScore());
});
deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap);
});
}
@Transactional(rollbackFor = Exception.class)
public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map<String, GridSelfSubScoreEntity> insertMap) {
int effectRow = 0;
do {
gridSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode);
} while (effectRow > 0);
gridSelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values()));
}
/**
* @param formDTO
* @return void

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java

@ -18,8 +18,12 @@
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity;
import java.util.List;
/**
* 基层党建-党员基本情况
*
@ -28,4 +32,32 @@ import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity;
*/
public interface ScreenCpcBaseDataService extends BaseService<ScreenCpcBaseDataEntity> {
/**
* @Description 插入党员基本信息
* @param baseInfoFormDTOS
* @author zxc
* @date 2020/9/22 3:28 下午
*/
void insertPartyBaseInfo(List<PartyBaseInfoFormDTO> baseInfoFormDTOS);
/**
* @Description 删除旧的党员基本信息
* @param customerId
* @param dateId
* @param orgIds
* @author zxc
* @date 2020/9/22 3:28 下午
*/
Integer deleteOldPartyBaseInfo(String customerId, String dateId, List<String> orgIds);
/**
* @Description 查询党员信息根据agencyId来查
* @param customerId
* @param dateId
* @param agencyId
* @author zxc
* @date 2020/9/23 2:01 下午
*/
List<PartyInfoResultDTO> selectPartyInfo(String customerId, String dateId,String agencyId);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java

@ -17,10 +17,13 @@
package com.epmet.service.evaluationindex.screen;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import java.util.List;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
import java.util.List;
import java.util.Map;
/**
@ -42,9 +45,34 @@ public interface ScreenCustomerAgencyService{
*/
Map<String,Object> selectAllSubAgencyId(String agencyId, String customerId);
/**
* @Description 查询客户下所有机关ID
* @param customerId
* @author zxc
* @date 2020/9/22 4:06 下午
*/
List<CustomerAgencyInfoResultDTO> selectAllAgencyId(String customerId);
ScreenCustomerAgencyEntity getLastAddedAgency();
ScreenCustomerAgencyEntity getLastUpdatedAgency();
void initAgencies(List<CustomerAgencyEntity> agencies2Add, List<CustomerAgencyEntity> agencies2Update);
/**
* @Description 查询下一级机关的ID即以agencyId为pid的agency
* @param agencyId
* @param customerId
* @author zxc
* @date 2020/9/23 11:11 上午
*/
List<String> selectSubAgencyId(String agencyId, String customerId);
/**
* @Description 查询客户下所有机关ID
* @param customerId
* @author zxc
* @date 2020/9/23 3:10 下午
*/
List<PartyBaseInfoFormDTO> selectAllAgencyIdToParty(String customerId,String dateId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
@ -36,4 +37,13 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
ScreenCustomerGridEntity getLastUpdateGrid();
void addAndUpdateGrids(List<CustomerGridEntity> grids2Add, List<CustomerGridEntity> grids2Update);
/**
* @Description 查询客户下所有网格ID
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 3:10 下午
*/
List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId);
}

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java

@ -17,12 +17,18 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCpcBaseDataDao;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 基层党建-党员基本情况
@ -31,7 +37,38 @@ import org.springframework.stereotype.Service;
* @since v1.0.0 2020-09-22
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenCpcBaseDataServiceImpl extends BaseServiceImpl<ScreenCpcBaseDataDao, ScreenCpcBaseDataEntity> implements ScreenCpcBaseDataService {
@Override
public void insertPartyBaseInfo(List<PartyBaseInfoFormDTO> baseInfoFormDTOS) {
baseDao.insertPartyBaseInfo(baseInfoFormDTOS);
}
/**
* @Description 删除旧的党员基本信息
* @param customerId
* @param dateId
* @param orgIds
* @author zxc
* @date 2020/9/22 3:28 下午
*/
@Override
public Integer deleteOldPartyBaseInfo(String customerId, String dateId, List<String> orgIds) {
return baseDao.deleteOldPartyBaseInfo(customerId, dateId,orgIds);
}
/**
* @Description 查询党员信息根据agencyId来查
* @param customerId
* @param dateId
* @param agencyId
* @author zxc
* @date 2020/9/23 2:01 下午
*/
@Override
public List<PartyInfoResultDTO> selectPartyInfo(String customerId, String dateId, String agencyId) {
return baseDao.selectPartyInfo(customerId, dateId, agencyId);
}
}

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java

@ -22,6 +22,8 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.screen.result.TreeResultDTO;
import com.epmet.constant.ScreenConstant;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
@ -77,18 +79,18 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
resultMap.put(agencyId,gridIdList);
}else {
resultMap.put(ScreenConstant.LEVEL,rootAgency.getLevel());
resultMap.put(agencyId,getDepartmentList((ScreenConstant.STR_NULL.equals(rootAgency.getPids())||rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getAgencyId() : rootAgency.getPids().concat(ScreenConstant.ENGLISH_COMMA).concat(rootAgency.getAgencyId())));
resultMap.put(agencyId,getSubList((ScreenConstant.STR_NULL.equals(rootAgency.getPids())||rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getAgencyId() : rootAgency.getPids().concat(ScreenConstant.ENGLISH_COMMA).concat(rootAgency.getAgencyId())));
}
return resultMap;
}
private List<String> getDepartmentList(String subAgencyPids) {
private List<String> getSubList(String subAgencyPids) {
List<String> result = new ArrayList<>();
List<TreeResultDTO> subAgencyList = screenCustomerAgencyDao.selectSubAgencyList(subAgencyPids);
if (!CollectionUtils.isEmpty(subAgencyList)) {
result.addAll(subAgencyList.stream().map(sub -> sub.getAgencyId()).collect(Collectors.toList()));
subAgencyList.forEach(sub -> {
List<String> subAgency = getDepartmentList(sub.getPids() + "," + sub.getAgencyId());
List<String> subAgency = getSubList(sub.getPids() + "," + sub.getAgencyId());
result.addAll(subAgency);
});
}
@ -134,6 +136,29 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
}
}
/**
* @Description 查询下一级机关的ID即以agencyId为pid的agency
* @param agencyId
* @param customerId
* @author zxc
* @date 2020/9/23 11:11 上午
*/
@Override
public List<String> selectSubAgencyId(String agencyId, String customerId) {
return screenCustomerAgencyDao.selectSubAgencyId(agencyId, customerId);
}
/**
* @Description 查询客户下所有机关ID
* @param customerId
* @author zxc
* @date 2020/9/23 3:10 下午
*/
@Override
public List<PartyBaseInfoFormDTO> selectAllAgencyIdToParty(String customerId,String dateId) {
return screenCustomerAgencyDao.selectAllAgencyIdToParty(customerId,dateId);
}
private void updateAgency(ScreenCustomerAgencyEntity exists) {
screenCustomerAgencyDao.updateById(exists);
}
@ -157,4 +182,15 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
cae.setSourceType(OrgSourceTypeConstant.INTERNAL);
screenCustomerAgencyDao.insert(cae);
}
/**
* @Description 查询客户下所有机关ID
* @param customerId
* @author zxc
* @date 2020/9/22 4:06 下午
*/
@Override
public List<CustomerAgencyInfoResultDTO> selectAllAgencyId(String customerId) {
return screenCustomerAgencyDao.selectAllAgencyId(customerId);
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
@ -89,4 +90,16 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
}
}
}
/**
* @Description 查询客户下所有网格ID
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 3:10 下午
*/
@Override
public List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId) {
return screenCustomerGridDao.selectAllGridIdToParty(customerId, dateId);
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java

@ -19,6 +19,7 @@ package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.result.PartyMemberInfoResultDTO;
import com.epmet.dto.stats.DimCustomerPartymemberDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
@ -111,4 +112,13 @@ public interface DimCustomerPartymemberService extends BaseService<DimCustomerPa
* @Date 2020/9/18 9:03
**/
List<FactIndexPartyAblityCpcMonthlyEntity> selectPartyMemberList(String customerId);
/**
* @Description 查询党员信息
* @param customerId
* @param gridIds
* @author zxc
* @date 2020/9/22 5:26 下午
*/
List<PartyMemberInfoResultDTO> selectPartyMemberInfo(String customerId,List<String> gridIds);
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.StatsConstant;
import com.epmet.dao.stats.DimCustomerPartymemberDao;
import com.epmet.dto.extract.result.PartyMemberInfoResultDTO;
import com.epmet.dto.stats.DimCustomerPartymemberDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
@ -153,6 +154,7 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
if (party.getGridId().equals(agency.getGridId())){
party.setAgencyId(agency.getAgencyId());
party.setParentId(agency.getParentId());
party.setPids(agency.getPids());
}
});
});
@ -174,6 +176,18 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
return baseDao.selectPartyMemberList(customerId);
}
/**
* @Description 查询党员信息
* @param customerId
* @param gridIds
* @author zxc
* @date 2020/9/22 5:26 下午
*/
@Override
public List<PartyMemberInfoResultDTO> selectPartyMemberInfo(String customerId, List<String> gridIds) {
return baseDao.selectPartyMemberInfo(customerId, gridIds);
}
/**
* @Description 删除旧纪录插入新纪录
* @param partyMemberList

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java

@ -19,6 +19,7 @@ package com.epmet.service.stats.user;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO;
import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity;
@ -93,4 +94,13 @@ public interface FactParticipationUserAgencyDailyService extends BaseService<Fac
* @date 2020-06-17
*/
void delete(String[] ids);
/**
* @Description 查询机关下用户信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 9:57 上午
*/
List<UserCountResultDTO> selectUserCount(String customerId, String dateId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java

@ -19,6 +19,7 @@ package com.epmet.service.stats.user;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO;
import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity;
@ -93,4 +94,13 @@ public interface FactParticipationUserGridDailyService extends BaseService<FactP
* @date 2020-06-17
*/
void delete(String[] ids);
/**
* @Description 查询网格下用户信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 9:57 上午
*/
List<UserCountResultDTO> selectUserCount(String customerId,String dateId);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.user.FactParticipationUserAgencyDailyDao;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO;
import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity;
import com.epmet.service.stats.user.FactParticipationUserAgencyDailyService;
@ -98,4 +99,16 @@ public class FactParticipationUserAgencyDailyServiceImpl extends BaseServiceImpl
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 查询机关下用户信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 9:57 上午
*/
@Override
public List<UserCountResultDTO> selectUserCount(String customerId, String dateId) {
return baseDao.selectUserCount(customerId, dateId);
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.user.FactParticipationUserGridDailyDao;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO;
import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity;
import com.epmet.service.stats.user.FactParticipationUserGridDailyService;
@ -99,4 +100,16 @@ public class FactParticipationUserGridDailyServiceImpl extends BaseServiceImpl<F
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 查询网格下用户信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/23 9:57 上午
*/
@Override
public List<UserCountResultDTO> selectUserCount(String customerId, String dateId) {
return baseDao.selectUserCount(customerId, dateId);
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

@ -189,7 +189,7 @@ thread:
queueCapacity: @thread.pool.queue-capacity@
keepAlive: @thread.pool.keep-alive@
dingTalk:
robot:
webHook: @dingTalk.robot.webHook@
secret: @dingTalk.robot.secret@
#dingTalk:
# robot:
# webHook: @dingTalk.robot.webHook@
# secret: @dingTalk.robot.secret@

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml

@ -10,6 +10,7 @@
CUSTOMER_ID,
GRID_ID,
PID,
PIDS,
AGENCY_ID,
DATE_ID,
WEEK_ID,
@ -33,6 +34,7 @@
#{item.customerId},
#{item.gridId},
#{item.pid},
#{item.pids},
#{item.agencyId},
#{item.dateId},
#{item.weekId},

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

Loading…
Cancel
Save