diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 67aced6dbe..3636e2942d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -96,6 +96,8 @@ public interface Constant { * authorization header */ String AUTHORIZATION_HEADER = "authorization"; + + String ACCESS_TOKEN_HEADER = "AccessToken"; /** * APP用户标识 */ diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index cef4109081..a69f43837e 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -58,6 +58,13 @@ 2.0.0 compile + + + + com.epmet + common-service-client + 2.0.0 + diff --git a/epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java new file mode 100644 index 0000000000..4ef47a2eae --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java @@ -0,0 +1,26 @@ +package com.epmet.auth; + +import com.alibaba.fastjson.JSON; +import org.springframework.cloud.gateway.filter.GatewayFilterChain; +import org.springframework.core.io.buffer.DataBuffer; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.nio.charset.StandardCharsets; + +public abstract class AuthProcessor { + + abstract Mono auth(ServerWebExchange exchange, GatewayFilterChain chain); + + protected Mono response(ServerWebExchange exchange, Object object) { + String json = JSON.toJSONString(object); + DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8)); + exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8); + exchange.getResponse().setStatusCode(HttpStatus.OK); + return exchange.getResponse().writeWith(Flux.just(buffer)); + } + +} diff --git a/epmet-gateway/src/main/java/com/epmet/auth/ExtAppAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/ExtAppAuthProcessor.java new file mode 100644 index 0000000000..507f2dc54d --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/auth/ExtAppAuthProcessor.java @@ -0,0 +1,31 @@ +package com.epmet.auth; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.server.ServerWebExchange; + + +/** + * 外部应用认证处理器父类 + */ +public abstract class ExtAppAuthProcessor { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private int diffMillins = 1000 * 60 * 5; + + public abstract void auth(String appId, String token, Long ts, ServerWebExchange exchange); + + /** + * 时间戳校验 + * @param timestamp + * @return + */ + protected boolean validTimeStamp(Long timestamp) { + long now = System.currentTimeMillis(); + if (Math.abs(now - timestamp) > diffMillins) { + return false; + } + return true; + } +} diff --git a/epmet-gateway/src/main/java/com/epmet/auth/ExtAppJwtAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/ExtAppJwtAuthProcessor.java new file mode 100644 index 0000000000..923e85c441 --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/auth/ExtAppJwtAuthProcessor.java @@ -0,0 +1,92 @@ +package com.epmet.auth; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.jwt.JwtTokenUtils; +import io.jsonwebtoken.Claims; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.server.ServerWebExchange; + +/** + * jwt 认证处理器 + */ +@Component +public class ExtAppJwtAuthProcessor extends ExtAppAuthProcessor { + + private static Logger logger = LoggerFactory.getLogger(ExtAppJwtAuthProcessor.class); + + @Autowired + private JwtTokenUtils jwtTokenUtils; + + @Autowired + private RedisUtils redisUtils; + + @Override + public void auth(String appId, String token, Long ts, ServerWebExchange exchange) { + String secret; + if (StringUtils.isBlank(secret = getTokenFromCache(appId))) { + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), String.format("根据AppId:【%s】没有找到对应的秘钥", appId)); + } + + Claims claim; + try { + claim = jwtTokenUtils.getClaimByToken(token, secret); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error("解析token失败:{}", errorStackTrace); + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "解析token失败"); + } + + String appIdIn = (String)claim.get("appId"); + String customerId = (String)claim.get("customerId"); + Long timestamp = (Long)claim.get("ts"); + + //校验时间戳,允许5分钟误差 + if (StringUtils.isAnyBlank(appIdIn, customerId) || timestamp == null) { + logger.error("access token不完整。{},{},{}", appIdIn, customerId, timestamp); + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken不完整"); + } + + if (!validTimeStamp(timestamp)) { + logger.error("extapp token已经超时,请求被拒绝"); + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken已经超时"); + } + + if (!appId.equals(appIdIn)) { + logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn); + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AppId不匹配"); + } + + // 添加客户ID等到请求头 + exchange.getRequest().mutate().header("CustomerId", customerId); + } + + /** + * 通过APP ID查询对应的秘钥 + * @param appId + * @return + */ + public String getTokenFromCache(String appId) { + String secret = (String)redisUtils.get(RedisKeys.getExternalAppSecretKey(appId)); + if (StringUtils.isBlank(secret)) { + EpmetCommonServiceOpenFeignClient commonService = SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class); + Result result = commonService.getSecret(appId); + if (!result.success()) { + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), result.getInternalMsg()); + } + secret = result.getData(); + redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret); + } + return secret; + } +} diff --git a/epmet-gateway/src/main/java/com/epmet/auth/ExtAppMD5AuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/ExtAppMD5AuthProcessor.java new file mode 100644 index 0000000000..c9fa8e5c2a --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/auth/ExtAppMD5AuthProcessor.java @@ -0,0 +1,75 @@ +package com.epmet.auth; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.Md5Util; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.server.ServerWebExchange; + +/** + * md5 认证处理器 + */ +@Component +public class ExtAppMD5AuthProcessor extends ExtAppAuthProcessor { + + private static Logger logger = LoggerFactory.getLogger(ExtAppMD5AuthProcessor.class); + + //@Autowired + //private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + + @Autowired + private RedisUtils redisUtils; + + @Override + public void auth(String appId, String token, Long ts, ServerWebExchange exchange) { + if (ts == null) { + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "需要传入时间戳参数"); + } + String secret; + if (StringUtils.isBlank(secret = getTokenFromCache(appId))) { + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), String.format("根据AppId:%s没有找到对应的秘钥", appId)); + } + + String localDigest = Md5Util.md5(secret.concat(":") + ts); + if (!localDigest.equals(token)) { + // 调用方生成的摘要跟本地生成的摘要不匹配 + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "签名不匹配,认证失败"); + } + + if (!validTimeStamp(ts)) { + logger.error("AccessToken已经超时,请求被拒绝"); + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken已经超时,请求被拒绝"); + } + } + + /** + * 通过APP ID查询对应的秘钥 + * + * @param appId + * @return + */ + public String getTokenFromCache(String appId) { + String secret = (String) redisUtils.get(RedisKeys.getExternalAppSecretKey(appId)); + if (StringUtils.isBlank(secret)) { + EpmetCommonServiceOpenFeignClient commonService = SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class); + Result result = commonService.getSecret(appId); + if (!result.success()) { + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), result.getInternalMsg()); + } + + secret = result.getData(); + redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret); + } + return secret; + } + +} diff --git a/epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java new file mode 100644 index 0000000000..c2614b488a --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java @@ -0,0 +1,79 @@ +package com.epmet.auth; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.gateway.filter.GatewayFilterChain; +import org.springframework.http.HttpHeaders; +import org.springframework.stereotype.Component; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +/** + * 外部应用认证 + */ +@Component +public class ExternalAuthProcessor extends AuthProcessor { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + // 头s + public static final String AUTHORIZATION_TOKEN_HEADER_KEY = "Authorization"; + public static final String ACCESS_TOKEN_HEADER_KEY = "AccessToken"; + public static final String APP_ID_HEADER_KEY = "appId"; + public static final String APP_ID_TIMESTAMP_KEY = "ts"; + public static final String APP_ID_CUSTOMER_ID_KEY = "CustomerId"; + public static final String APP_ID_AUTY_TYPE_KEY = "AuthType"; + + // 认证方式 + public static final String APP_AUTH_TYPE_JWT = "jwt"; + public static final String APP_AUTH_TYPE_MD5 = "md5"; + + + @Autowired + private ExtAppJwtAuthProcessor jwtAuthProcessor; + + @Autowired + private ExtAppMD5AuthProcessor md5AuthProcessor; + + @Override + public Mono auth(ServerWebExchange exchange, GatewayFilterChain chain) { + HttpHeaders headers = exchange.getRequest().getHeaders(); + + String token = headers.getFirst(ACCESS_TOKEN_HEADER_KEY); + String appId = headers.getFirst(APP_ID_HEADER_KEY); + String ts = headers.getFirst(APP_ID_TIMESTAMP_KEY); + String customerId = headers.getFirst(APP_ID_CUSTOMER_ID_KEY); + String authType = headers.getFirst(APP_ID_AUTY_TYPE_KEY); + + if (StringUtils.isAnyBlank(token, appId)) { + throw new RenException("请求头中的AccessToken和AppId不能为空"); + } + + logger.info("外部应用请求认证拦截Aspect执行,appId:{}, token:{}, ts:{}, customerId:{}, authType:{}", + appId, token, ts, customerId, authType); + + // 没传authType或者传的jwt都用jwtprocessor处理 + try { + if (StringUtils.isBlank(authType) || APP_AUTH_TYPE_JWT.equals(authType)) { + jwtAuthProcessor.auth(appId, token, StringUtils.isNotBlank(ts) ? new Long(ts) : null, exchange); + } else if (APP_AUTH_TYPE_MD5.equals(authType)) { + md5AuthProcessor.auth(appId, token, StringUtils.isNotBlank(ts) ? new Long(ts) : null, exchange); + } else { + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "未知的认证类型"); + } + } catch (RenException e) { + return response(exchange, new Result<>().error(e.getCode(), e.getMsg())); + } catch (Exception e) { + logger.error("外部应用请求认证发生未知错误:" + ExceptionUtils.getErrorStackTrace(e)); + return response(exchange, new Result<>().error("外部应用请求认证发生未知错误")); + } + + return chain.filter(exchange); + } +} diff --git a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java new file mode 100644 index 0000000000..ee247c843b --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -0,0 +1,175 @@ +package com.epmet.auth; + +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.BaseTokenDto; +import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.CpUserDetailRedis; +import com.epmet.commons.tools.utils.Result; +import com.epmet.jwt.JwtTokenUtils; +import io.jsonwebtoken.Claims; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.gateway.filter.GatewayFilterChain; +import org.springframework.http.HttpHeaders; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.stereotype.Component; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +/** + * 内部认证处理器 + */ +@Component +public class InternalAuthProcessor extends AuthProcessor { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private JwtTokenUtils jwtTokenUtils; + + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + + @Override + public Mono auth(ServerWebExchange exchange, GatewayFilterChain chain) { + ServerHttpRequest request = exchange.getRequest(); + String requestUri = request.getPath().pathWithinApplication().value(); + + logger.info("CpAuthGatewayFilterFactory当前requestUri=[" + requestUri + "]CpAuthGatewayFilterFactory拦截成功"); + String token = getTokenFromRequest(request); + //BaseTokenDto baseTokenDto = StringUtils.isNotBlank(token) ? getBaseTokenDto(token, jwtTokenUtils) : null; + BaseTokenDto baseTokenDto; + if(StringUtils.isNotBlank(token)){ + try{ + baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); + }catch(RenException e){ + return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); + } + }else{ + baseTokenDto = null; + } + + String customerId = ""; + + if (baseTokenDto != null) { + if (AppClientConstant.APP_RESI.equals(baseTokenDto.getApp())) { + // 居民端 + TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, TokenDto.class); + if (resiTokenDto != null) { + customerId = resiTokenDto.getCustomerId(); + baseTokenDto = resiTokenDto; + } + } else if (AppClientConstant.APP_GOV.equals(baseTokenDto.getApp())) { + // 政府端 + GovTokenDto govTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, GovTokenDto.class); + if (govTokenDto != null) { + customerId = govTokenDto.getCustomerId(); + baseTokenDto = govTokenDto; + } + } else if(AppClientConstant.APP_OPER.equals(baseTokenDto.getApp())){ + //运营端 + TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, TokenDto.class); + if (resiTokenDto != null) { + customerId = resiTokenDto.getCustomerId(); + baseTokenDto = resiTokenDto; + } + } + } + + // 校验token + if (StringUtils.isBlank(token)) { + return response(exchange,new Result<>().error(EpmetErrorCode.ERR10005.getCode(),EpmetErrorCode.ERR10005.getMsg())); + } + try { + validateTokenDto(baseTokenDto, token); + } catch (RenException e) { + return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); + } + + // 添加header + if (baseTokenDto != null) { + String redisKey = baseTokenDto.getApp() + "-" + baseTokenDto.getClient() + "-" + baseTokenDto.getUserId(); + logger.info("redisKey=" + redisKey); + exchange.getRequest().mutate() + .header(Constant.APP_USER_KEY, redisKey) + .header(AppClientConstant.APP,baseTokenDto.getApp()) + .header(AppClientConstant.CLIENT,baseTokenDto.getClient()) + .header(AppClientConstant.USER_ID,baseTokenDto.getUserId()); + + if (StringUtils.equals(baseTokenDto.getApp(), "gov")) {//工作端 + if(StringUtils.isNotBlank(customerId)){ + exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); + } + } else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端 + exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); + } + ServerHttpRequest build = exchange.getRequest().mutate().build(); + return chain.filter(exchange.mutate().request(build).build()); + } + + return chain.filter(exchange); + } + + /** + * 从请求中获取token + * @param request + * @return + */ + private String getTokenFromRequest(ServerHttpRequest request) { + HttpHeaders headers = request.getHeaders(); + String token = headers.getFirst(Constant.AUTHORIZATION_HEADER); + if (StringUtils.isBlank(token)) { + token = headers.getFirst(Constant.TOKEN_HEADER); + } + if (StringUtils.isBlank(token)) { + token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER); + } + return token; + } + + private BaseTokenDto getBaseTokenDto(String token, JwtTokenUtils jwtTokenUtils) { + //是否过期 + Claims claims = jwtTokenUtils.getClaimByToken(token); + if (claims == null || jwtTokenUtils.isTokenExpired(claims.getExpiration())) { + return null; + } + //获取用户ID + String app = (String) claims.get("app"); + String client = (String) claims.get("client"); + String userId = (String) claims.get("userId"); + return new BaseTokenDto(app, client, userId, token); + } + + private T getLoginUserInfoByToken(String token, JwtTokenUtils jwtTokenUtils, Class clz) { + BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); + //查询Redis + return cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId(), clz); + } + + /** + * 校验Token是否异常 + * @param tokenDto + * @param tokenStr + */ + private void validateTokenDto(BaseTokenDto tokenDto, String tokenStr) { + if (null == tokenDto) { + //说明登录状态时效(超时) + throw new RenException(EpmetErrorCode.ERR10006.getCode()); + }else{ + //Redis中存在数据,取出token,进行比对 + if(StringUtils.equals(tokenDto.getToken(),tokenStr)){ + //用户携带token与Redis中一致 + + }else{ + //用户携带token与Redis中不一致,说明当前用户此次会话失效,提示重新登陆 + throw new RenException(EpmetErrorCode.ERR10007.getCode()); + } + } + } +} diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 7c74fa6763..59f52483b2 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -2,16 +2,12 @@ package com.epmet.filter; import com.alibaba.fastjson.JSON; +import com.epmet.auth.ExternalAuthProcessor; +import com.epmet.auth.InternalAuthProcessor; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.security.dto.BaseTokenDto; -import com.epmet.commons.tools.security.dto.GovTokenDto; -import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; -import com.epmet.jwt.JwtTokenUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,16 +36,25 @@ import java.util.List; * @since 1.0.0 */ @Component("CpAuth") -public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory implements UserTokenFilter { +public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory { + private Logger logger = LoggerFactory.getLogger(getClass()); - @Autowired - private CpProperty cpProperty; + private final AntPathMatcher antPathMatcher = new AntPathMatcher(); + + public static final String AUTH_TYPE_INTERNAL = "internal"; + public static final String AUTH_TYPE_EXTERNAL = "external"; + public static final String AUTH_TYPE_NO_NEED = "no_need"; + public static final String AUTH_TYPE_UNKNOW = "unknow"; + @Autowired - private JwtTokenUtils jwtTokenUtils; + private CpProperty cpProperty; + @Autowired - private CpUserDetailRedis cpUserDetailRedis; + private InternalAuthProcessor internalAuthProcessor; + @Autowired + private ExternalAuthProcessor externalAuthProcessor; @Override public List shortcutFieldOrder() { @@ -67,82 +72,23 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(e.getCode(),e.getMsg())); - } - }else{ - baseTokenDto = null; - } - - String customerId = ""; - - if (baseTokenDto != null) { - if (AppClientConstant.APP_RESI.equals(baseTokenDto.getApp())) { - // 居民端 - TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, TokenDto.class); - if (resiTokenDto != null) { - customerId = resiTokenDto.getCustomerId(); - baseTokenDto = resiTokenDto; - } - } else if (AppClientConstant.APP_GOV.equals(baseTokenDto.getApp())) { - // 政府端 - GovTokenDto govTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, GovTokenDto.class); - if (govTokenDto != null) { - customerId = govTokenDto.getCustomerId(); - baseTokenDto = govTokenDto; - } - } else if(AppClientConstant.APP_OPER.equals(baseTokenDto.getApp())){ - //运营端 - TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, TokenDto.class); - if (resiTokenDto != null) { - customerId = resiTokenDto.getCustomerId(); - baseTokenDto = resiTokenDto; - } - } - } - - //需要认证 - if (needAuth(requestUri)) { - if (StringUtils.isBlank(token)) { - return response(exchange,new Result<>().error(EpmetErrorCode.ERR10005.getCode(),EpmetErrorCode.ERR10005.getMsg())); - } - // 校验token - try { - validateTokenDto(baseTokenDto, token); - } catch (RenException e) { - return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); - } - } //添加流水号 exchange.getRequest().mutate().header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()}); - if (baseTokenDto != null) { - String redisKey = baseTokenDto.getApp() + "-" + baseTokenDto.getClient() + "-" + baseTokenDto.getUserId(); - logger.info("redisKey=" + redisKey); - exchange.getRequest().mutate() - .header(Constant.APP_USER_KEY, redisKey) - .header(AppClientConstant.APP,baseTokenDto.getApp()) - .header(AppClientConstant.CLIENT,baseTokenDto.getClient()) - .header(AppClientConstant.USER_ID,baseTokenDto.getUserId()) - ; - if (StringUtils.equals(baseTokenDto.getApp(), "gov")) {//工作端 - if(StringUtils.isNotBlank(customerId)){ - exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); - } - } else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端 - exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); - } - ServerHttpRequest build = exchange.getRequest().mutate().build(); - return chain.filter(exchange.mutate().request(build).build()); + + ServerHttpRequest request = exchange.getRequest(); + + String authType = getAuthType(request); + + switch (authType) { + case AUTH_TYPE_EXTERNAL: + return externalAuthProcessor.auth(exchange, chain); + case AUTH_TYPE_INTERNAL: + return internalAuthProcessor.auth(exchange, chain); + case AUTH_TYPE_NO_NEED: + break; + default: + return response(exchange, new Result<>().error(EpmetErrorCode.ERR401.getCode(), + EpmetErrorCode.ERR401.getMsg())); } return chain.filter(exchange); @@ -150,85 +96,71 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory response(ServerWebExchange exchange, Object object) { - String json = JSON.toJSONString(object); - DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8)); - exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8); - exchange.getResponse().setStatusCode(HttpStatus.OK); - return exchange.getResponse().writeWith(Flux.just(buffer)); + /** + * 获取请求头 + * @param request + * @return + */ + private String getHeader(ServerHttpRequest request, String headerName) { + HttpHeaders headers = request.getHeaders(); + return headers.getFirst(headerName); } /** - * 是否需要认证 - * @param requestUri + * 获取事务流水号 * @return */ - private boolean needAuth(String requestUri) { - // 优先判断白名单,在白名单中的就直接放行 - for (String url : cpProperty.getUrlWhiteList()) { - if (antPathMatcher.match(url, requestUri)) { - return false; - } - } + public static String getTransactionSerial() { + String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n" + , "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; - for (String url : cpProperty.getSwaggerUrls()) { - if (antPathMatcher.match(url, requestUri)) { - return false; - } + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 2; i++) { + sb.append(letterPool[(int) (Math.random() * 25)]); } - for (String url : cpProperty.getUrls()) { - if (antPathMatcher.match(url, requestUri)) { - return true; - } - } - return false; + sb.append(System.currentTimeMillis()); + return sb.toString(); } public static class CpAuthConfig { @@ -250,45 +182,12 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory response(ServerWebExchange exchange, Object object) { + String json = JSON.toJSONString(object); + DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8)); + exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8); + exchange.getResponse().setStatusCode(HttpStatus.OK); + return exchange.getResponse().writeWith(Flux.just(buffer)); } - /** - * 从请求中获取token - * @param request - * @return - */ - private String getTokenFromRequest(ServerHttpRequest request) { - HttpHeaders headers = request.getHeaders(); - String token = headers.getFirst(Constant.AUTHORIZATION_HEADER); - if (StringUtils.isBlank(token)) { - token = headers.getFirst(Constant.TOKEN_HEADER); - logger.info("token=" + token); - } else { - logger.info("authorization=" + token); - } - if (StringUtils.isBlank(token)) { - token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER); - logger.info("params token:" + token); - } - return token; - } } diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java b/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java index f52d8f13a2..84872c0fb2 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java @@ -17,12 +17,15 @@ import java.util.List; @ConfigurationProperties(prefix = "epmet") public class CpProperty { - private List urls; + /** + * 需要内部认证的url + */ + private List internalAuthUrls; /** - * 白名单 + * 需要外部认证的url */ - private List urlWhiteList; + private List externalAuthUrls; /** * 不处理token,直接通过 diff --git a/epmet-gateway/src/main/java/com/epmet/filter/UserTokenFilter.java b/epmet-gateway/src/main/java/com/epmet/filter/UserTokenFilter.java deleted file mode 100644 index f66b0e6707..0000000000 --- a/epmet-gateway/src/main/java/com/epmet/filter/UserTokenFilter.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.epmet.filter; - -import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.security.dto.BaseTokenDto; -import com.epmet.commons.tools.utils.CpUserDetailRedis; -import com.epmet.jwt.JwtTokenUtils; -import io.jsonwebtoken.Claims; - -/** - * 用户token的过滤器接口,提供通用的默认方法 - */ -public interface UserTokenFilter { - - default BaseTokenDto getBaseTokenDto(String token, JwtTokenUtils jwtTokenUtils) { - //是否过期 - Claims claims = jwtTokenUtils.getClaimByToken(token); - if (claims == null || jwtTokenUtils.isTokenExpired(claims.getExpiration())) { -// throw new RenException(EpmetErrorCode.ERR401.getCode()); - return null; - } - //获取用户ID - String app = (String) claims.get("app"); - String client = (String) claims.get("client"); - String userId = (String) claims.get("userId"); - return new BaseTokenDto(app, client, userId, token); - } - - default T getLoginUserInfoByToken(String token, JwtTokenUtils jwtTokenUtils, CpUserDetailRedis cpUserDetailRedis, Class clz) { - BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); - //查询Redis - return cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId(), clz); - } - -} diff --git a/epmet-gateway/src/main/java/com/epmet/jwt/JwtTokenUtils.java b/epmet-gateway/src/main/java/com/epmet/jwt/JwtTokenUtils.java index 33baf31c52..452627b9a3 100644 --- a/epmet-gateway/src/main/java/com/epmet/jwt/JwtTokenUtils.java +++ b/epmet-gateway/src/main/java/com/epmet/jwt/JwtTokenUtils.java @@ -62,6 +62,18 @@ public class JwtTokenUtils { } } + public Claims getClaimByToken(String token, String secret) { + try { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + } catch (Exception e) { + logger.debug("validate is token error, token = " + token, e); + return null; + } + } + /** * @return java.util.Date * @param token diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 9748b1ca26..750440f69f 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -415,8 +415,8 @@ ribbon: ConnectTimeout: 300000 epmet: - # 党群e事通(校验是否登录) - urls: + # 内部认证,需要Authorization请求头 + internalAuthUrls: - /oper/customize/** - /oper/crm/** - /epmetuser/** @@ -438,8 +438,8 @@ epmet: - /resi/home/** - /data/report/** - # url认证白名单,先判断白名单,在白名单中的url直接放行,不再判断上述需要认证的名单 - urlWhiteList: + # 外部应用认证,使用AccessToken等头进行认证 + externalAuthUrls: - /data/report/test/test - /data/report/screen/** - /data/report/kcscreen/** diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java new file mode 100644 index 0000000000..70a7b6d36b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 组织月度指数得分--接口入参 + * @Author sun + */ +@Data +public class IndexScoreFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 月份Id eg:202009 + */ + @NotBlank(message = "月份Id不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class}) + private String monthId; + public interface AddUserInternalGroup {} + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java new file mode 100644 index 0000000000..33ffff9c5d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 组织月度指数得分--接口返参 + * @Author sun + */ +@Data +public class IndexScoreResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 年度平均指数(保留一位小数) + */ + @JsonIgnore + private String total; + private BigDecimal totalScore; + /** + * 党建能力(保留一位小数) + */ + @JsonIgnore + private String party; + private BigDecimal partyDevAbility; + /** + * 党建能力权重(保留一位小数) + */ + private String partyDevAbilityWeight; + /** + * 治理能力(保留一位小数) + */ + @JsonIgnore + private String govern; + private BigDecimal governAbility; + /** + * 治理能力权重(保留一位小数) + */ + private String governAbilityWeight; + /** + * 服务能力(保留一位小数) + */ + @JsonIgnore + private String service; + private BigDecimal serviceAbility; + /** + * 服务能力权重(保留一位小数) + */ + private String serviceAbilityWeight; + +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 6dd6fefbcb..3f0c56a777 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -62,11 +62,11 @@ 0.3.1 - + com.epmet diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index c7eb8ac820..fbf0e78748 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.fact; -import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 1828f19ac8..035dab63d9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -1,21 +1,13 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; +import org.springframework.web.bind.annotation.*; /** * 组织相关api @@ -31,19 +23,14 @@ public class AgencyController { private AgencyService agencyService; /** - * @Description 1、组织机构树 * @param + * @Description 1、组织机构树 只返回 is_display = '1'的 * @author zxc * @date 2020/8/18 2:04 下午 */ - @ExternalAppRequestAuth @PostMapping("tree") - public Result tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){ - String customerId = request.getHeader("CustomerId"); - if(StringUtils.isBlank(externalAppRequestParam.getCustomerId())){ - externalAppRequestParam.setCustomerId(customerId); - } - return new Result().ok(agencyService.tree(externalAppRequestParam)); + public Result tree(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(agencyService.tree(customerId)); } /** @@ -52,7 +39,6 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:33 下午 */ - @ExternalAppRequestAuth @PostMapping("compartment") public Result compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){ ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 30f0f82584..8c17f03238 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.DistributionService; @@ -33,7 +32,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 10:59 上午 */ - @ExternalAppRequestAuth @PostMapping("branch") public Result> branch(@RequestBody BranchFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class); @@ -46,7 +44,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:10 上午 */ - @ExternalAppRequestAuth @PostMapping("user") public Result user(@RequestBody UserFormDTO userFormDTO){ ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class); @@ -59,7 +56,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:20 上午 */ - @ExternalAppRequestAuth @PostMapping("parymember") public Result parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){ ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class); @@ -72,7 +68,6 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:29 下午 */ - @ExternalAppRequestAuth @PostMapping("project") public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); @@ -85,7 +80,6 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:52 下午 */ - @ExternalAppRequestAuth @PostMapping("topprofile") public Result topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java index 1ee85baeb4..4cec62dc66 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; @@ -39,7 +38,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 11:16 **/ - @ExternalAppRequestAuth @PostMapping("userpointrank") public Result userPointRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -54,7 +52,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 13:55 **/ - @ExternalAppRequestAuth @PostMapping("difficultprojects") public Result> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){ ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class); @@ -69,7 +66,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 14:37 **/ - @ExternalAppRequestAuth @PostMapping("publicpartiprofile") public Result publicPartiProfile(@RequestBody AgencyFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -84,7 +80,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 15:32 **/ - @ExternalAppRequestAuth @PostMapping("publicpartirank") public Result> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -99,7 +94,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 17:46 **/ - @ExternalAppRequestAuth @PostMapping("governcapacityrank") public Result> governCapacityRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java index db7c83089f..f7273b3da8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; @@ -38,7 +37,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 16:59 **/ - @ExternalAppRequestAuth @PostMapping("basicinfo") public Result baseInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -53,7 +51,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 17:54 **/ - @ExternalAppRequestAuth @PostMapping("ageinfo") public Result ageInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -68,7 +65,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 11:02 **/ - @ExternalAppRequestAuth @PostMapping("branchbuildtrend") public Result branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class); @@ -83,7 +79,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 15:25 **/ - @ExternalAppRequestAuth @PostMapping("branchbuildrank") public Result branchBuildRank(@RequestBody BranchBuildRankFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildRankFormDTO.BranchBuildRankGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 162065563b..98e2207514 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -1,8 +1,7 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.eum.OrgTypeEnum; @@ -10,10 +9,7 @@ import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -36,7 +32,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 2:53 下午 */ - @ExternalAppRequestAuth @PostMapping("yearaverageindex") public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); @@ -49,7 +44,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 3:17 下午 */ - @ExternalAppRequestAuth @PostMapping("monthindexanalysis/piechart") public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); @@ -62,7 +56,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 5:27 下午 */ - @ExternalAppRequestAuth @PostMapping("monthindexanalysis/barchart") public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); @@ -75,7 +68,6 @@ public class IndexController { * @author zxc * @date 2020/8/20 10:02 上午 */ - @ExternalAppRequestAuth @PostMapping("subagencyindexrank") public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); @@ -90,8 +82,6 @@ public class IndexController { * @Author zhangyong * @Date 13:39 2020-09-11 **/ - @InternalAppRequestAuth - @ExternalAppRequestAuth @PostMapping("dataclient/subagencyindexrank") public Result> getSubAgencyIndexRank(@RequestBody SubAgencyIndexRankYMFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, SubAgencyIndexRankYMFormDTO.SubAgencyIndexRank.class); @@ -104,13 +94,24 @@ public class IndexController { * @author jianjun.liu * @date 2020/8/20 10:02 上午 */ - @ExternalAppRequestAuth @PostMapping("gridindexrank") - public Result> gridIndexRank(ExternalAppRequestParam extParam, @RequestBody GridIndexRankFormDTO formDTO) { - formDTO.setCustomerId(extParam.getCustomerId()); + public Result> gridIndexRank(@RequestHeader("CustomerId") String customerId, @RequestBody GridIndexRankFormDTO formDTO) { + formDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(formDTO); formDTO.setOrgType(OrgTypeEnum.GRID.getCode()); return new Result>().ok(indexService.selectIndexRankByOrgType(formDTO)); } + /** + * @param tokenDTO + * @Description 组织月度指数得分 + * @author sun + */ + @PostMapping("month/indexscore") + public Result indexScore(@LoginUser TokenDto tokenDTO, @RequestBody IndexScoreFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IndexScoreFormDTO.AddUserInternalGroup.class); + return new Result().ok(indexService.indexScore(formDTO)); + } + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java index 8e9a3d0bfa..855be093c1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java @@ -1,8 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; @@ -17,10 +14,7 @@ import com.epmet.dto.result.issue.KcIssueSummary; import com.epmet.dto.result.issue.KcPartiTrendResultDTO; import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -39,42 +33,37 @@ public class KcScreenController { /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ @PostMapping("homepage/summary") - public Result homepageSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.homepageSummary(externalAppRequestParam)); + public Result homepageSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.homepageSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ @PostMapping("heart/summary") - public Result heartSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartSummary(externalAppRequestParam)); + public Result heartSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ @PostMapping("heart/actcounttrend") - public Result heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartActcounttrend(externalAppRequestParam)); + public Result heartActcounttrend(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartActcounttrend(customerId)); } /** * 议题分析-各类总数 - * @param externalAppRequestParam * @return */ @PostMapping("issue/summary") - public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); + public Result getIssueSummary(@RequestHeader("CustomerId") String customerId) { //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; KcIssueSummary issueSummary = kcScreenService.getIssueSummary(customerId); return new Result().ok(issueSummary); @@ -82,300 +71,247 @@ public class KcScreenController { /** * 参与趋势 - * @param externalAppRequestParam * @return */ @PostMapping("issue/partitrend") - public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + public Result getIssuePartiTrend(@RequestHeader("CustomerId") String customerId) { KcPartiTrendResultDTO trendResultDTO = kcScreenService.getIssuePartiTrend(customerId); return new Result().ok(trendResultDTO); } /** * 按照议题数量排名 - * @param externalAppRequestParam * @return */ @PostMapping("issue/gridtotalrank") - public Result getIssueGridTotalRank(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getIssueGridTotalRank(@RequestHeader("CustomerId") String customerId) { return new Result().ok(kcScreenService.getIssueGridTotalRank(customerId)); } /** * 议题分析-审核效率排名 - * @param externalAppRequestParam * @return */ @PostMapping("issue/avgaudittimerank") - public Result getAvgAuditTimeRank(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getAvgAuditTimeRank(@RequestHeader("CustomerId") String customerId) { return new Result().ok(kcScreenService.getAvgAuditTimeRank(customerId)); } /** * 议题分析-议题效率 - * @param externalAppRequestParam * @return */ @PostMapping("issue/effective") - public Result getIssueEffective(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); + public Result getIssueEffective(@RequestHeader("CustomerId") String customerId) { //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; return new Result().ok(kcScreenService.getIssueEffective(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ @PostMapping("heart/volunteerportrayal") - public Result heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartVolunteerportrayal(externalAppRequestParam)); + public Result heartVolunteerportrayal(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartVolunteerportrayal(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-个人(志愿者)公益时长排名 * @author sun */ @PostMapping("heart/volunteerrank") - public Result> heartVolunteerrank(ExternalAppRequestParam externalAppRequestParam, @RequestBody HeartVolunteerrankFormDTO formDTO){ + public Result> heartVolunteerrank(@RequestHeader("CustomerId") String customerId, @RequestBody HeartVolunteerrankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, HeartVolunteerrankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.heartVolunteerrank(formDTO)); } /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ @PostMapping("group/summary") - public Result groupSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupSummary(externalAppRequestParam)); + public Result groupSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ @PostMapping("group/partitopictrend") - public Result groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupPartitopictrend(externalAppRequestParam)); + public Result groupPartitopictrend(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupPartitopictrend(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ @PostMapping("group/gridgroupcountrank") - public Result groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam)); + public Result groupGridgroupcountrank(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupGridgroupcountrank(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ @PostMapping("group/usercountrank") - public Result> groupUserCountRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupUserCountRankFormDTO formDTO){ + public Result> groupUserCountRank(@RequestHeader("CustomerId") String customerId, @RequestBody GroupUserCountRankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GroupUserCountRankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.groupUserCountRank(formDTO)); } /** - * @param externalAppRequestParam * @Description 邻里党群-话题转化率排名 * @author sun */ @PostMapping("group/topicshiftissueratiorank") - public Result> groupTopicShiftIssueRatioRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ + public Result> groupTopicShiftIssueRatioRank(@RequestHeader("CustomerId") String customerId, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GroupTopicShiftIssueRatioRankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.groupTopicShiftIssueRatioRank(formDTO)); } /** * 项目各类总数汇总 - * @param externalAppRequestParam * @return */ @PostMapping("project/summary") - public Result getProjectSummary(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getProjectSummary(customerId)); } /** * 项目分析-网格下项目数量排名 - * @param externalAppRequestParam * @return */ @PostMapping("project/gridcountrank") - public Result getProjectGridCountRank(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectGridCountRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getGridProjectCountRank(customerId)); } /** * 项目分析-项目类别 - * @param externalAppRequestParam * @return */ @PostMapping("project/categoryanalysis") - public Result> getProjectCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getProjectCategoryAnalysis(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getProjectCategoryAnalysis(customerId)); } /** * 网格项目平均结案时间 - * @param externalAppRequestParam * @return */ @PostMapping("project/avgclosedtimeanalysis") - public Result> getGridProjectAvgClosedTimeAnalysis(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getGridProjectAvgClosedTimeAnalysis(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getGridProjectAvgClosedTimeAnalysis(customerId)); } /** * 项目分析-居民满意度 - * @param externalAppRequestParam * @return */ @PostMapping("project/statis") - public Result getProjectSatisfactionAnalyze(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectSatisfactionAnalyze(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getProjectSatisfactionAnalyze(customerId)); } /** * 用户-summary - * @param externalAppRequestParam * @return */ @PostMapping("user/summary") - public Result getUserSummary(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getUserSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserSummary(customerId)); } /** * 用户量趋势 - * @param externalAppRequestParam * @return */ @PostMapping("user/trend") - public Result getUserTrend(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserTrend(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserTrend(customerId)); } /** * 网格用户数量排名 - * @param externalAppRequestParam * @return */ @PostMapping("user/griduserrank") - public Result getUserRank(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserRank(customerId)); } /** * 用户画像 - * @param externalAppRequestParam * @return */ @PostMapping("user/userportrayal") - public Result getUserPortrayal(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserPortrayal(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserPortrayal(customerId)); } /** * 用户积分排名 - * @param externalAppRequestParam * @return */ @PostMapping("user/pointsrank") - public Result getUserPointsRank(ExternalAppRequestParam externalAppRequestParam, + public Result getUserPointsRank(@RequestHeader("CustomerId") String customerId, @RequestBody PageFormDTO form) { - String customerId = externalAppRequestParam.getCustomerId(); return new Result().ok(kcScreenService.getUserPointsRank(customerId, form.getPageNo(), form.getPageSize())); } /** * 党建声音-各类总数 - * @param externalAppRequestParam * @return */ @PostMapping("news/summary") - public Result getNewsSummary(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsSummary(customerId)); } /** * 新闻阅读参与趋势 - * @param externalAppRequestParam * @return */ @PostMapping("news/partitrend") - public Result getNewsPartiTrend(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsPartiTrend(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsPartiTrend(customerId)); } /** * 党建声音-分类的news数量 - * @param externalAppRequestParam * @return */ @PostMapping("news/category") - public Result> getNewsCountGroupByCategory(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getNewsCountGroupByCategory(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getNewsCountOfCategory(customerId)); } /** * 党建声音-分类的用户参与数排行 - * @param externalAppRequestParam * @return */ @PostMapping("news/userparticategoryrank") - public Result getNewsPartiCategoryRank(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsPartiCategoryRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsPartiCategoryRank(customerId)); } /** * 党建声音-热点新闻排行 - * @param externalAppRequestParam * @return */ @PostMapping("news/hotrank") - public Result> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam, + public Result> listNewsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody PageFormDTO form){ - String customerId = externalAppRequestParam.getCustomerId(); return new Result>().ok(kcScreenService.getNewsHotRank(customerId, form.getPageNo(), form.getPageSize())); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java index 5530fae8b0..ca1104f534 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; @@ -33,7 +32,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 1:56 下午 */ - @ExternalAppRequestAuth @PostMapping("fineexample") public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); @@ -46,7 +44,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 2:35 下午 */ - @ExternalAppRequestAuth @PostMapping("contactmasslinechart") public Result contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){ ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class); @@ -59,7 +56,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 3:19 下午 */ - @ExternalAppRequestAuth @PostMapping("volunteerservice") public Result volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){ ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class); @@ -74,7 +70,6 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 11:05 **/ - @ExternalAppRequestAuth @PostMapping("advancedbranchrank") Result> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -89,7 +84,6 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 14:22 **/ - @ExternalAppRequestAuth @PostMapping("advancedpartymemberrank") Result> advancedPartymemberRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 5417767ee6..483e3edcc1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; @@ -31,7 +30,6 @@ public class ScreenProjectController { * @author zxc * @date 2020/8/19 4:36 下午 */ - @ExternalAppRequestAuth @PostMapping("detail") public Result projectDetail(@RequestBody ProjectDetailFormDTO projectDetailFormDTO){ ValidatorUtils.validateEntity(projectDetailFormDTO, ProjectDetailFormDTO.ProjectDetail.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java index 5e7c544c38..bc6997d45f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -35,7 +34,6 @@ public class ScreenUserController { * @Description 热心市民积分排行列表 * @author sun */ - @InternalAppRequestAuth @PostMapping("userpointrank") public Result> userPointRank(@LoginUser TokenDto tokenDTO, @RequestBody UserPointRankFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); @@ -47,7 +45,6 @@ public class ScreenUserController { * @Description 党员(指标得分)排行 * @author sun */ - @InternalAppRequestAuth @PostMapping("partindexscroerank") public Result> partIndexScroeRank(@LoginUser TokenDto tokenDTO, @RequestBody PartIndexScroeRankFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 9025780837..c042885cc6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -17,10 +17,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.evaluationindex.screen.dto.form.GridIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.PeerComparisonFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO; +import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -84,4 +81,11 @@ public interface ScreenIndexDataMonthlyDao{ * @author sun */ List selectScoreList(PeerComparisonFormDTO formDTO); + + /** + * @param formDTO + * @Description 根据组织或网格Id以及月份Id查询各项月度指数得分 + * @author sun + */ + IndexScoreResultDTO selectMonthData(IndexScoreFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index d633b94ea2..eee423ca41 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -1,6 +1,5 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; @@ -14,12 +13,12 @@ import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; public interface AgencyService { /** - * @Description 1、组织机构树 * @param + * @Description 1、组织机构树 只返回 is_display = '1'的 * @author zxc * @date 2020/8/18 2:04 下午 */ - TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam); + TreeResultDTO tree(String customerId); /** * @Description 2、组织区域查询 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java index 21b6bd2554..a577e666a6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java @@ -62,4 +62,11 @@ public interface IndexService { * @return */ List selectIndexRankByOrgType(GridIndexRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 组织月度指数得分 + * @author sun + */ + IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java index d17df56ba1..480601a129 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java @@ -1,6 +1,5 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.dto.result.issue.*; import com.epmet.dto.result.project.*; import com.epmet.dto.result.user.*; @@ -22,32 +21,28 @@ import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; public interface KcScreenService { /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ - HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam); + HomepageSummaryResultDTO homepageSummary(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ - HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam); + HeartSummaryResultDTO heartSummary(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ - HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam); + HeartActcounttrendResultDTO heartActcounttrend(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ - HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam); + HeartVolunteerportrayalResultDTO heartVolunteerportrayal(String customerId); /** * @param formDTO @@ -67,25 +62,22 @@ public interface KcScreenService { /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ - GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam); + GroupSummaryResultDTO groupSummary(String customerId); /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ - GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam); + GroupPartitopictrendResultDTO groupPartitopictrend(String customerId); /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ - GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam); + GroupGridgroupcountrankResultDTO groupGridgroupcountrank(String customerId); /** * @param formDTO diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index c5bf2bab81..104e941333 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; @@ -13,7 +12,6 @@ import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; -import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.exceptions.TooManyResultsException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -44,15 +42,9 @@ public class AgencyServiceImpl implements AgencyService { */ @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { + public TreeResultDTO tree(String customerId) { // 1. 查询客户根组织ID - String customerId = externalAppRequestParam.getCustomerId(); - - // 验签关闭,customerId无法获取,暂时写死 - if (StringUtils.isBlank(customerId)) { - customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - } TreeResultDTO rootAgency = null; try { rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 087034645d..93276c8725 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.text.NumberFormat; import java.time.LocalDate; import java.util.ArrayList; import java.util.Comparator; @@ -258,4 +259,35 @@ public class IndexServiceImpl implements IndexService { BigDecimal b = bigDecimal.setScale(NumConstant.ONE, BigDecimal.ROUND_HALF_UP); return Double.valueOf(b.toString()); } + + /** + * @param formDTO + * @Description 组织月度指数得分 + * @author sun + */ + @Override + public IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO) { + //screen_index_data_monthly 根据组织id和月份获取月度指标得分 + //1.根据组织或网格Id以及月份Id查询各项月度指数得分 + IndexScoreResultDTO resultDTO = screenIndexDataMonthlyDao.selectMonthData(formDTO); + + //2.将数据改成正确格式 四舍五入保留一位小数 权重转成百分比 + NumberFormat nf = NumberFormat.getPercentInstance(); + nf.setMaximumFractionDigits(1); + + BigDecimal num = new BigDecimal(resultDTO.getTotal()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros(); + resultDTO.setTotalScore(num); + BigDecimal num1 = new BigDecimal(resultDTO.getParty()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros(); + resultDTO.setPartyDevAbility(num1); + resultDTO.setPartyDevAbilityWeight(nf.format(Double.parseDouble(resultDTO.getPartyDevAbilityWeight()))); + BigDecimal num2 = new BigDecimal(resultDTO.getGovern()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros(); + resultDTO.setGovernAbility(num2); + resultDTO.setGovernAbilityWeight(nf.format(Double.parseDouble(resultDTO.getGovernAbilityWeight()))); + BigDecimal num3 = new BigDecimal(resultDTO.getService()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros(); + resultDTO.setServiceAbility(num3); + resultDTO.setServiceAbilityWeight(nf.format(Double.parseDouble(resultDTO.getServiceAbilityWeight()))); + + return resultDTO; + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java index b82d6b654f..6a84e531d7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; @@ -99,37 +98,34 @@ public class KcScreenServiceImpl implements KcScreenService { private ScreenKcNewsRankDao screenKcNewsRankDao; /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ @Override - public HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam) { - return screenKcPlatformSummaryDailyDao.selectSummaryDaily(externalAppRequestParam.getCustomerId()); + public HomepageSummaryResultDTO homepageSummary(String customerId) { + return screenKcPlatformSummaryDailyDao.selectSummaryDaily(customerId); } /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ @Override - public HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam) { - return screenKcActSummaryDailyDao.selectHeartSummary(externalAppRequestParam.getCustomerId()); + public HeartSummaryResultDTO heartSummary(String customerId) { + return screenKcActSummaryDailyDao.selectHeartSummary(customerId); } /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ @Override - public HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam) { + public HeartActcounttrendResultDTO heartActcounttrend(String customerId) { HeartActcounttrendResultDTO resultDTO = new HeartActcounttrendResultDTO(); LinkedList xAxis = new LinkedList<>(); LinkedList actCountDataList = new LinkedList<>(); //1.按客户查询最近十二个月数据 - List list = screenKcActTrendMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId()); + List list = screenKcActTrendMonthlyDao.selectActTrendMonthly(customerId); //2.倒序遍历封装数据 for (int i = list.size() - 1; i >= 0; i--) { xAxis.add(list.get(i).getMonthId()); @@ -142,16 +138,15 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ @Override - public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam) { + public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(String customerId) { HeartVolunteerportrayalResultDTO resultDTO = new HeartVolunteerportrayalResultDTO(); GenderDistributionResultDTO genderDistribution = new GenderDistributionResultDTO(); //1.根据客户Id查询最近日期志愿者统计数据 - AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(externalAppRequestParam.getCustomerId()); + AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(customerId); //2.封装数据并返回 if (null == ageDistribution) { resultDTO.setAgeDistribution(new AgeDistributionResultDTO()); @@ -219,14 +214,13 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ @Override - public GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam) { + public GroupSummaryResultDTO groupSummary(String customerId) { //1.按客户查询最近一天各网格各项数据的汇总值 - GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(externalAppRequestParam.getCustomerId()); + GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(customerId); if (null == resultDTO) { return new GroupSummaryResultDTO(); } @@ -246,17 +240,16 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ @Override - public GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam) { + public GroupPartitopictrendResultDTO groupPartitopictrend(String customerId) { GroupPartitopictrendResultDTO resultDTO = new GroupPartitopictrendResultDTO(); LinkedList xAxis = new LinkedList<>(); LinkedList actCountDataList = new LinkedList<>(); //1.按客户查询最近十二个月所有网格汇总数据 - List list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId()); + List list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(customerId); //2.倒序遍历封装数据 for (int i = list.size() - 1; i >= 0; i--) { xAxis.add(list.get(i).getMonthId()); @@ -269,17 +262,16 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ @Override - public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam) { + public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(String customerId) { GroupGridgroupcountrankResultDTO resultDTO = new GroupGridgroupcountrankResultDTO(); LinkedList gridNameDataList = new LinkedList<>(); LinkedList groupCountDataList = new LinkedList<>(); //1.按日期降序,查询客户最近一天所有网格数据,按每个网格的社区总数降序排列 - LinkedList list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(externalAppRequestParam.getCustomerId()); + LinkedList list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(customerId); //2.封装数据 list.forEach(l -> { gridNameDataList.add(l.getGridName()); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 932149d9c5..969bcea847 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -16,6 +16,7 @@ WHERE del_flag = 0 AND pid = '0' + AND IS_DISPLAY = '1' AND customer_id = #{customerId} @@ -31,6 +32,7 @@ screen_customer_agency WHERE del_flag = '0' + AND IS_DISPLAY = '1' AND pids = #{subAgencyPids} ORDER BY created_time DESC diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 6cafd96036..b17fe0f6a8 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -77,6 +77,7 @@ screen_customer_grid WHERE del_flag = '0' + AND IS_DISPLAY = '1' AND parent_agency_id = #{agencyId} ORDER BY created_time DESC diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index f84ce8c28d..3f7bec2b57 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -165,4 +165,23 @@ LIMIT #{pageSize} + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index ff0ccf9630..b1c3cccd70 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -58,11 +58,11 @@ screen_party_user_rank_data WHERE del_flag = '0' - - + + AND org_id = #{orgId} - + AND grid_id = #{orgId} @@ -85,11 +85,11 @@ WHERE del_flag = '0' AND party_flag = '1' - - + + AND org_id = #{orgId} - + AND grid_id = #{orgId} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java similarity index 87% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java index 0b392c0053..2eb18b8a35 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java @@ -7,11 +7,13 @@ import javax.validation.constraints.NotBlank; import java.io.Serializable; /** + * desc: 从业务数据抽取到统计库 dto + * * @Author zxc * @DateTime 2020/9/16 6:01 下午 */ @Data -public class ExtractFormDTO implements Serializable { +public class ExtractOriginFormDTO implements Serializable { private static final long serialVersionUID = -6180252151765854242L; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java new file mode 100644 index 0000000000..4bcd4fce65 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: 抽取大屏数据dto + * + * @author LiuJanJun + * @date 2020/9/25 2:32 下午 + */ +@Data +public class ExtractScreenFormDTO implements Serializable { + + private static final long serialVersionUID = 7659170440875719461L; + private String customerId; + private String monthId; + private String dateId; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java new file mode 100644 index 0000000000..9766aabc42 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 4:17 下午 + */ +@Data +public class ScreenExtractFormDTO implements Serializable { + + private static final long serialVersionUID = -6092830982601961936L; + + private String customerId; + + private String monthId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java new file mode 100644 index 0000000000..06b95d02d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java @@ -0,0 +1,97 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 9:07 上午 + */ +@Data +public class ScreenPartyBranchDataFormDTO implements Serializable { + + private static final long serialVersionUID = -5521810726686859779L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice + */ + private String type; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 会议分类Id + */ + private String meetCategoryId; + + /** + * 会议分类名称(三会党课、主题党日.....等等) + */ + private String meetCategoryName; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 参加人数 + */ + private Integer joinUserCount; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; + + private String delFlag; + + private Integer revision; + + private String createdBy; + + private String updatedBy; + + public ScreenPartyBranchDataFormDTO() { + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + this.type = "voluntaryservice"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java new file mode 100644 index 0000000000..3ff541a16d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java @@ -0,0 +1,73 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 6:03 下午 + */ +@Data +public class ScreenPartyLinkMassesDataFormDTO implements Serializable { + + private static final long serialVersionUID = -7534140815638694052L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员建群总数 + */ + private Integer createGroupTotal; + + /** + * 群成员总数 + */ + private Integer groupUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + private String delFlag; + + private Integer revision; + + private String createdBy; + + private String updatedBy; + + public ScreenPartyLinkMassesDataFormDTO() { + this.createGroupTotal = NumConstant.ZERO; + this.groupUserTotal = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java new file mode 100644 index 0000000000..0fdff371a6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java @@ -0,0 +1,90 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 3:38 下午 + */ +@Data +public class ActInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 2322961372193392320L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID【gridId或agencyId】 + */ + private String orgId; + + /** + * 组织类型【agency,grid】 + */ + private String orgType; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 年度ID + */ + private String yearId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 父级ID + */ + private String parentId; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 会议分类Id + */ + private String meetCategoryId; + + /** + * 会议分类名称(三会党课、主题党日.....等等) + */ + private String meetCategoryName; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; + + /** + * 删除状态 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java new file mode 100644 index 0000000000..7646ff9567 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.extract.result; + +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 10:10 上午 + */ +@Data +@AllArgsConstructor +public class GridPartyGuideDTO implements Serializable { + + private static final long serialVersionUID = 8986034496647129566L; + + private List orgIds; + + private List result; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java new file mode 100644 index 0000000000..fcaa28d970 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 5:14 下午 + */ +@Data +public class JoinUserCountResultDTO implements Serializable { + + private static final long serialVersionUID = 3961393565082322770L; + + private String orgId; + + /** + * 参与人数 + */ + private Integer joinUserCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java index 9abd6012d6..b160224471 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * 11、基层治理-公众参与 入参 @@ -47,7 +48,7 @@ public class UserJoinFormDTO implements Serializable { /** * 人均议题 */ - private Integer avgIssue; + private BigDecimal avgIssue; /** * 总的参与次数 @@ -57,5 +58,5 @@ public class UserJoinFormDTO implements Serializable { /** * 平均参与度 */ - private Integer avgJoin; + private BigDecimal avgJoin; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 520b6bee09..166ffc241d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -3,8 +3,8 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -202,7 +202,7 @@ public interface DataStatisticalOpenFeignClient { * @author: jianjun liu */ @PostMapping(value = "/data/stats/factorigin/extractall") - Result factOriginExtractAll(@RequestBody(required = false) ExtractFormDTO formDTO); + Result factOriginExtractAll(@RequestBody(required = false) ExtractOriginFormDTO formDTO); /** * ˚ @@ -222,11 +222,11 @@ public interface DataStatisticalOpenFeignClient { Result initAllEIDims(); /** - * @Description 抽取数据到大屏【天】 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 * @author zxc * @date 2020/9/24 10:15 上午 */ @PostMapping(value = "/data/stats/screenextract/extractdailyall") - Result extractDailyAll(@RequestBody(required = false) ExtractFormDTO extractFormDTO); + Result extractDailyAll(@RequestBody(required = false) ExtractOriginFormDTO extractOriginFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 8c5e2eafff..4e7611762d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -4,8 +4,8 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -192,7 +192,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp * @author: jianjun liu */ @Override - public Result factOriginExtractAll(ExtractFormDTO formDTO) { + public Result factOriginExtractAll(ExtractOriginFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO); } @@ -214,7 +214,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp } @Override - public Result extractDailyAll(ExtractFormDTO extractFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll",extractFormDTO); + public Result extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll", extractOriginFormDTO); } } diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index e40e69ed9f..ee196b5cbf 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -70,7 +70,7 @@ com.epmet - epmet-commons-extapp-auth + common-service-client 2.0.0 compile diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 4f136ffc56..8b0dc2156a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -16,7 +16,8 @@ import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -35,14 +36,12 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityS import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; -import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; -import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; +import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -104,6 +103,8 @@ public class DemoController { private IndexCollStreetService indexCollStreetService; @Autowired private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; + @Autowired + private GovernRankDataExtractService governRankDataExtractService; @GetMapping("testAlarm") public void testAlarm() { @@ -526,7 +527,7 @@ public class DemoController { @PostMapping("inserttopicorigin") public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { - ExtractFormDTO param = new ExtractFormDTO(); + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); param.setDateId(dateId); param.setCustomerId(customerId); Boolean aBoolean = factOriginTopicMainDailyService.topicCleaning(param); @@ -537,7 +538,7 @@ public class DemoController { List dimDateEntityList= dimDateDao.selectList(wrapper); for(DimCustomerEntity customerEntity:customerEntityList){ for(DimDateEntity dateEntity:dimDateEntityList) { - ExtractFormDTO param = new ExtractFormDTO(); + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); param.setDateId(dateEntity.getId()); param.setCustomerId(customerEntity.getId()); factOriginTopicMainDailyService.topicCleaning(param); @@ -647,9 +648,50 @@ public class DemoController { return new Result(); } + @Autowired + private PartyGuideService partyGuideService; + + @PostMapping("zxczxc") + public Result getZxcZxc(@RequestBody ScreenExtractFormDTO formDTO){ + partyGuideService.partyGuideExtract(formDTO); + return new Result(); + } + @PostMapping("centralzonedatacleaning") public Result centralZoneDataCleaning(@RequestBody ScreenCentralZoneDataFormDTO param){ screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); return new Result(); } + + @PostMapping("governRank") + public Result governRank(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + governRankDataExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + + @Autowired + private PioneerDataExtractService pioneerDataExtractService; + + @PostMapping("insertScreenPioneerData") + public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { + pioneerDataExtractService.extractGridPioneerData(customerId, dateId); + pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); + pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); + } else { + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper); + for (DimCustomerEntity customerEntity : customerEntityList) { + pioneerDataExtractService.extractGridPioneerData(customerEntity.getId(), "20200926"); + pioneerDataExtractService.extractCommunityPioneerData(customerEntity.getId(), "20200926"); + pioneerDataExtractService.extractExceptCommunityPioneerData(customerEntity.getId(), "20200926"); + } + } + return new Result(); + } + + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 0a8740c63b..77f2ce51ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -1,15 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcollect.form.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 指标采集相关api @@ -27,128 +22,112 @@ public class FactIndexCollectController { /** * 1、党建能力-党员相关指标上报(按照月份) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridpartymemberdata") - public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyMemberDataFormDTO formDTO) { - factIndexCollectService.insertGridPartyMemberData(formDTO,externalAppRequestParam.getCustomerId() ); + public Result gridPartyMemberData(@RequestHeader("CustomerId") String customerId, @RequestBody GridPartyMemberDataFormDTO formDTO) { + factIndexCollectService.insertGridPartyMemberData(formDTO, customerId); return new Result(); } /** * 2、党建能力-网格相关指标上报(按照月份) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridpartyability") - public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridPartyAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridPartyAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridPartyAbility(formDTO, customerId); return new Result(); } /** * 3、党建能力-街道及社区相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orgpartyability") - public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgPartyAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgPartyAbility(formDTO, customerId); return new Result(); } /** * 4、服务能力-网格相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridserviceability") - public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridServiceAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridServiceAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridServiceAbility(formDTO, customerId); return new Result(); } /** * 5、服务能力-组织(街道|社区|全区)相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orgserviceability") - public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgServiceAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgServiceAbility(formDTO, customerId); return new Result(); } /** * 6、治理能力-网格相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridgovrnability") - public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridGovrnAbility(formDTO, customerId); return new Result(); } /** * 7、治理能力-街道及社区相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orggovrnability") - public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgGovrnAbility(formDTO, customerId); return new Result(); } /** * 8、治理能力-部门相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("deptgovrnability") - public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result deptGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertDeptGovrnAbility(formDTO, customerId); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index 10a938fb7a..643a909604 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -3,7 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.todata.*; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -38,69 +38,69 @@ public class FactOriginExtractController { /** * desc:抽取业务数据到统计库 * - * @param extractFormDTO 默认统计前一天 + * @param extractOriginFormDTO 默认统计前一天 * @return */ @PostMapping("extractall") - public Result extractAll(@RequestBody ExtractFormDTO extractFormDTO) { - if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())) { - List daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate()); + public Result extractAll(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) { + List daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate()); for (int i = 0; i < daysBetween.size(); i++) { String dateDimId = daysBetween.get(i); - extractFormDTO.setDateId(dateDimId); - factOriginExtractService.extractAll(extractFormDTO); + extractOriginFormDTO.setDateId(dateDimId); + factOriginExtractService.extractAll(extractOriginFormDTO); } } else { - factOriginExtractService.extractAll(extractFormDTO); + factOriginExtractService.extractAll(extractOriginFormDTO); } return new Result(); } /** - * @param extractFormDTO + * @param extractOriginFormDTO * @Description 议题抽取(main) * @author zxc * @date 2020/9/15 2:02 下午 */ @PostMapping("issueextractmain") - public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO) { - ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); - issueExtractService.issueExtractMain(extractFormDTO); + public Result issueExtractMain(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class); + issueExtractService.issueExtractMain(extractOriginFormDTO); return new Result(); } /** - * @param extractFormDTO + * @param extractOriginFormDTO * @Description 议题抽取(log) * @author zxc * @date 2020/9/16 9:41 上午 */ @PostMapping("issueextractlog") - public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO) { - ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); - issueExtractService.issueExtractLog(extractFormDTO); + public Result issueExtractLog(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class); + issueExtractService.issueExtractLog(extractOriginFormDTO); return new Result(); } /** - * @param extractFormDTO + * @param extractOriginFormDTO * @return com.epmet.commons.tools.utils.Result * @author yinzuomei * @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计) * @Date 2020/9/15 13:39 **/ @PostMapping("topic") - public Result topicDataCleaning(@RequestBody ExtractFormDTO extractFormDTO) { - if (StringUtils.isNotBlank(extractFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractFormDTO.getDateId())) { - factOriginTopicMainDailyService.topicCleaning(extractFormDTO); + public Result topicDataCleaning(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) { + factOriginTopicMainDailyService.topicCleaning(extractOriginFormDTO); } return new Result(); } @PostMapping("project") - public Result projectData(@RequestBody ExtractFormDTO extractFormDTO) { - projectExtractService.saveOriginProjectDaily(extractFormDTO); + public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + projectExtractService.saveOriginProjectDaily(extractOriginFormDTO); return new Result(); } @@ -112,7 +112,7 @@ public class FactOriginExtractController { * @date 2020.09.20 16:11 **/ @PostMapping("projectorgperiodcleanning") - public Result projectOrgPeriodCleaning(@RequestBody ExtractFormDTO param) { + public Result projectOrgPeriodCleaning(@RequestBody ExtractOriginFormDTO param) { projectExtractService.extractProjectPeriodData(param); return new Result(); } @@ -125,7 +125,7 @@ public class FactOriginExtractController { * @date 2020.09.20 16:11 **/ @PostMapping("groupdatacleaning") - public Result groupDataCleaning(@RequestBody ExtractFormDTO param) { + public Result groupDataCleaning(@RequestBody ExtractOriginFormDTO param) { groupExtractService.extractGroupData(param); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index c6e24b6893..ae50deb189 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -1,7 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; @@ -20,10 +18,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.PreDestroy; import java.util.Date; @@ -103,11 +98,8 @@ public class IndexCalculateController { * @Author zhangyongç * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("all") - public Result indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "epmettest"; + public Result indexCalculate(@RequestHeader("CustomerId") String customerId, @RequestBody CalculateCommonFormDTO formDTO) { formDTO.setCustomerId(customerId); indexCalculate(formDTO); return new Result().ok(true); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java index 09d06df653..b64d7855a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -1,16 +1,11 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.KcScreenCollService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 孔村大屏数据采集api @@ -31,16 +26,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_platform_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("homepage/platformsummary") - public Result platFormSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertPlatFormSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result platFormSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertPlatFormSummary(formDTO, customerId); return new Result(); } @@ -50,16 +45,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_issue_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("issue/summary") - public Result issueSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result issueSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertIssueSummary(formDTO, customerId); return new Result(); } @@ -69,16 +64,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table: screen_kc_issue_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("issue/trend") - public Result issueTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result issueTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertIssueTrend(formDTO, customerId); return new Result(); } @@ -88,16 +83,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_user_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("user/summary") - public Result userSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result userSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertUserSummary(formDTO, customerId); return new Result(); } @@ -107,16 +102,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_volunteer_heat_rank_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("volunteer/heartrank") - public Result volunteerHeartRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerHeartRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result volunteerHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertVolunteerHeartRank(formDTO, customerId); return new Result(); } @@ -126,16 +121,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_user_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("user/userheartrank") - public Result userHeartRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserHeartRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result userHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertUserHeartRank(formDTO, customerId); return new Result(); } @@ -145,16 +140,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_act_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/summary") - public Result actSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result actSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertActSummary(formDTO, customerId); return new Result(); } @@ -164,16 +159,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_act_trend_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/trend") - public Result actTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result actTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertActTrend(formDTO, customerId); return new Result(); } @@ -183,16 +178,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_volunteer_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/volunteersummary") - public Result volunteerSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result volunteerSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertVolunteerSummary(formDTO, customerId); return new Result(); } @@ -202,16 +197,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/summary") - public Result projectSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result projectSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertProjectSummary(formDTO, customerId); return new Result(); } @@ -221,16 +216,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_category_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/categorysummary") - public Result categorySummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertCategorySummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result categorySummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertCategorySummary(formDTO, customerId); return new Result(); } @@ -240,16 +235,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_satis_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/satisanalysis") - public Result projectSatisanalysis(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSatisanalysis(formDTO, externalAppRequestParam.getCustomerId()); + public Result projectSatisanalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertProjectSatisanalysis(formDTO, customerId); return new Result(); } @@ -259,16 +254,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/summary") - public Result newsSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsSummary(formDTO, customerId); return new Result(); } @@ -278,16 +273,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_trend_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/trend") - public Result newsTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsTrend(formDTO, customerId); return new Result(); } @@ -297,16 +292,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_rank * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/hotrank") - public Result newsHotRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsHotRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsHotRank(formDTO, customerId); return new Result(); } @@ -316,16 +311,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_category_analysis * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/categoryanalysis") - public Result newsCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsCategoryAnalysis(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsCategoryAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsCategoryAnalysis(formDTO, customerId); return new Result(); } @@ -335,16 +330,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_group_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/summary") - public Result groupSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupSummary(formDTO, customerId); return new Result(); } @@ -354,16 +349,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_group_detail_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/detail") - public Result groupDetail(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupDetail(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupDetail(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupDetail(formDTO, customerId); return new Result(); } @@ -373,16 +368,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_topic_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/topictrend") - public Result groupTopicTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupTopicTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupTopicTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupTopicTrend(formDTO, customerId); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java index 2f81eeadc2..34e8c7ccde 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java @@ -1,7 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -21,14 +21,14 @@ public class ScreenExtractDailyController { private ScreenExtractService screenExtractService; /** - * @Description 抽取数据到大屏【天】 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 * @author zxc * @date 2020/9/24 10:15 上午 */ @PostMapping("extractdailyall") - public Result screenExtractDaily(@RequestBody ExtractFormDTO extractFormDTO){ - screenExtractService.extractDailyAll(extractFormDTO); + public Result screenExtractDaily(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + screenExtractService.extractDailyAll(extractOriginFormDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java index 73d6db7bb6..a55567eb45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java @@ -1,15 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** @@ -28,144 +23,126 @@ public class ShiBeiScreenCollController { /** * 9、党建引领|基层治理-居民(党员)积分排行榜 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("partyuserrankdata") - public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyUserRankData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyUserRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyUserRankData(formDTO, customerId); return new Result(); } /** * 8、党建引领-党员联系群众数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") - public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyLinkMassesData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, customerId); return new Result(); } /** * 7、基层党建-建设情况数据(支部、联建、志愿) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("meetdata") - public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + public Result meetData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyBranchDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyBranchData(formDTO, customerId); return new Result(); } /** * 6、党建引领-组织排行 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("orgrankdata") - public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgRankData(@RequestHeader("CustomerId") String customerId, @RequestBody OrgRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertOrgRankData(formDTO, customerId); return new Result(); } /** * 5、基层治理-治理能力数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("governrankdata") - public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result governRankData(@RequestHeader("CustomerId") String customerId, @RequestBody GovernRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertGovernRankData(formDTO, customerId); return new Result(); } /** * 4、事件数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("eventdata") - public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) { - shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + public Result eventData(@RequestHeader("CustomerId") String customerId, @RequestBody EventDataListFormDTO formDTO) { + shiBeiScreenCollService.insertEventData(formDTO, customerId); return new Result(); } /** * 3、难点赌点 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("difficultydata") - public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { - shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + public Result difficultyData(@RequestHeader("CustomerId") String customerId, @RequestBody DifficultyDataFormDTO formDTO) { + shiBeiScreenCollService.insertDifficultyData(formDTO, customerId); return new Result(); } /** * 2、党员基本情况 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("cpcbasedata") - public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) { - shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + public Result cpcbaseData(@RequestHeader("CustomerId") String customerId, @RequestBody CpcBaseDataListFormDTO formDTO) { + shiBeiScreenCollService.insertCpcbaseData(formDTO, customerId); return new Result(); } /** * 1、指数_按月统计 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("indexdatamonthly") - public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) { - shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody IndexDataListMonthlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataMonthly(formDTO, customerId); return new Result(); } @@ -174,112 +151,98 @@ public class ShiBeiScreenCollController { /** * 17、指数_按年统计 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("indexdatayearly") - public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) { - shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataYearly(@RequestHeader("CustomerId") String customerId, @RequestBody IndexDataListYearlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataYearly(formDTO, customerId); return new Result(); } /** * 16、部门信息上传 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customerdept") - public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerDept(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerDeptListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerDept(formDTO, customerId); return new Result(); } /** * 15、网格信息上传 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customergrid") - public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerGrid(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerGridListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerGrid(formDTO, customerId); return new Result(); } /** * 14、组织层级 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customeragency") - public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerAgency(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerAgencyListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerAgency(formDTO, customerId); return new Result(); } /** * 12、中央区各类总数 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("usertotaldata") - public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) { - shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result userTotalData(@RequestHeader("CustomerId") String customerId, @RequestBody UserTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertUserTotalData(formDTO, customerId); return new Result(); } /** * 11、基层治理-公众参与 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("userjoin") - public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) { - shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + public Result userJoin(@RequestHeader("CustomerId") String customerId, @RequestBody UserJoinListFormDTO formDTO) { + shiBeiScreenCollService.insertUserJoin(formDTO, customerId); return new Result(); } /** * 10、党建引领-先锋模范数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("pioneerdata") - public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + public Result pioneerData(@RequestHeader("CustomerId") String customerId, @RequestBody PioneerDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPioneerData(formDTO, customerId); return new Result(); } @@ -293,10 +256,9 @@ public class ShiBeiScreenCollController { * @Author zhangyong * @Date 09:44 2020-08-25 **/ - @ExternalAppRequestAuth @PostMapping("publicpartitotaldata") - public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result publicPartiTotalData(@RequestHeader("CustomerId") String customerId, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, customerId); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 5844aa19f8..66a156557d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; @@ -137,4 +138,13 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectGroupMemberList(@Param("list") List groupIdList); + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index 1e4ab97477..9ac027b1fa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -72,4 +72,21 @@ public interface FactOriginIssueLogDailyDao extends BaseDao selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); + + /** + * @return int + * @param customerId + * @param gridId + * @param communityId + * @param agencyPath + * @param isParty + * @author yinzuomei + * @description 党员参与议事:支持或者反对的次数 + * @Date 2020/9/26 18:05 + **/ + int calPartyPartiIssueTotal(@Param("customerId")String customerId, + @Param("gridId")String gridId, + @Param("communityId")String communityId, + @Param("agencyPath")String agencyPath, + @Param("isParty")String isParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index d57370166e..422c9f83ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -115,4 +115,25 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId, @Param("dateType")String dateType); + + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridResponse(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectOrgResponse(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 2b5c16dc5e..01bf423d48 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -134,4 +134,39 @@ public interface FactOriginProjectMainDailyDao extends BaseDao + */ + List getSelfProject(@Param("customerId") String customerId, @Param("monthId")String monthId, + @Param("level") String level); + + + /** + * 组织解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId, + @Param("level") String level); + + /** + * 网格解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index c3c85c1ffd..5d172d1e06 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -77,4 +77,16 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao + */ + List selectOrgByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("type") String type); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index bf64ec0495..f7ea7ddb79 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -19,6 +19,8 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; @@ -154,6 +156,17 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId); + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + List selectAllAgencyIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId); + + List selectAllAgencyIdToOrganize(@Param("customerId") String customerId,@Param("monthId") String monthId); + /** * @Description 查询org名称【机关】 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 658b7c4126..b0e405eace 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -19,9 +19,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ScreenCustomerGridDTO; -import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; @@ -143,6 +141,16 @@ public interface ScreenCustomerGridDao extends BaseDao */ List selectAllGridIdToParty(String customerId, String dateId); + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + List selectAllGridIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId); + List selectAllGridIdToOrganize(@Param("customerId") String customerId,@Param("monthId") String monthId); + /** * @Description 查询org名称 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index d40a702dbe..da8d5ea7ef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -75,4 +75,19 @@ public interface ScreenGovernRankDataDao extends BaseDao */ List initGridDataList(@Param("customerId") String customerId); + + + /** + * 删除旧数据 + * @author zhaoqifeng + * @date 2020/9/25 10:38 + * @param customerId + * @param orgType + * @param deleteSize + * @param orgIds + * @return java.lang.Integer + */ + Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("monthId") String monthId, + @Param("deleteSize") Integer deleteSize, + @Param("orgIds")List orgIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 385f27d2f9..9911306d4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -56,4 +57,42 @@ public interface ScreenPartyBranchDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + void insertScreenPartyBranchData(@Param("lists") List lists); + + /** + * @Description 删除旧的建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:04 上午 + */ + Integer deleteOldScreenPartyBranchData(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("orgIds") List orgIds); + + /** + * @Description 根据orgId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + List selectScreenPartyBranchDataByOrgId(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("orgIds") List orgIds); + + /** + * @Description 根据parentId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param parentId + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + List selectScreenPartyBranchDataByParentId(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("parentId") String parentId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 857958ad1c..14e2e781bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -55,4 +56,31 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + void insertScreenPartyLinkMassesData(@Param("lists")List lists); + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyLinkInfo(@Param("customerId") String customerId, @Param("orgIds") List orgIds); + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + List selectPartyLinkMassesInfo(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("agencyId") String agencyId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java index 1381898f01..b8276891d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java @@ -17,6 +17,7 @@ package com.epmet.dao.heart; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -50,4 +51,14 @@ public interface ActInfoDao{ * @Date 2020/9/21 13:55 **/ List selectGridRegUserVolunteer(@Param("list") List regUserIds); + + /** + * @Description 查询组织次数 + * @Param customerId + * @Param monthId + * @Param orgType + * @author zxc + * @date 2020/9/25 4:00 下午 + */ + List selectActInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("orgType") String orgType,@Param("orgIds") List orgIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java new file mode 100644 index 0000000000..32cbbaf408 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java @@ -0,0 +1,25 @@ +package com.epmet.dao.heart; + +import com.epmet.dto.extract.result.JoinUserCountResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 5:21 下午 + */ +@Mapper +public interface ActUserRelationDao { + + /** + * @Description 查询参与人数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 5:19 下午 + */ + List selectJoinUserCount(@Param("customerId") String customerId,@Param("monthId") String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java index 502363d1b0..2a2fc36ed9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java @@ -26,7 +26,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; /** - * 网格议题数量(按月) + * 网格议题数量(按月) * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-17 @@ -35,21 +35,25 @@ import java.util.List; public interface FactIssueGridMonthlyDao extends BaseDao { /** * 统计网格议题各个指标月度增量 - * @author zhaoqifeng - * @date 2020/6/19 10:41 + * * @param customerId * @param monthId * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/19 10:41 */ List selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); /** * 删除 - * @author zhaoqifeng - * @date 2020/6/23 14:02 + * * @param customerId * @param monthId * @return void + * @author zhaoqifeng + * @date 2020/6/23 14:02 */ void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + List getIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java index 149c4c128c..d05a586f76 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java @@ -59,4 +59,9 @@ public class IndexDictEntity extends BaseEpmetEntity { * 正相关:positive;负相关:negative */ private String correlation; + + /** + * 指标值类型 无:none;整数:integer;小数: decimal;百分比:percent + */ + private String valueType; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java index 75668a1215..138e19cd30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java @@ -90,7 +90,7 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity { /** * 人均议题 */ - private Integer avgIssue; + private BigDecimal avgIssue; /** * 人均议题较上月增长率(采集的时候后台自己计算) @@ -105,7 +105,7 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity { /** * 平均参与度 */ - private Integer avgJoin; + private BigDecimal avgJoin; /** * 平均参与度较上月增长率(采集的时候后台自己计算) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java index 28b471f0a2..411c633990 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java @@ -18,7 +18,6 @@ package com.epmet.entity.stats; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -69,12 +68,12 @@ public class DimAgencyEntity extends BaseEpmetEntity { private String allParentName; /** - * 机关级别(社区级:community, -乡(镇、街道)级:street, -区县级: district, -市级: city -省级:province) - */ + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ private String level; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java index fc8ec41c57..ea56c96a37 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -42,7 +42,6 @@ public class IndexExcelDataListener extends AnalysisEventListener { List indexModelList = new ArrayList<>(); private String preWheight; - private Integer wheightSum = 0; /** * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 */ @@ -104,6 +103,17 @@ public class IndexExcelDataListener extends AnalysisEventListener { } } + //指标值类型 无:none;整数:integer;小数: decimal;百分比:percent + if (StringUtils.isNotBlank(data.getValueType())) { + if ("整数".equals(data.getValueType())) { + data.setValueType("integer"); + } else if ("小数".equals(data.getValueType())) { + data.setValueType("decimal"); + } else if ("百分比".equals(data.getValueType())) { + data.setValueType("percent"); + } + } + IndexDictEntity entity = new IndexDictEntity(); IndexDictEntity entity2 = new IndexDictEntity(); IndexDictEntity entity3 = new IndexDictEntity(); @@ -306,6 +316,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); + entity.setValueType(data.getValueType()); indexDicMap.put(data.getLevel5Index(), entity5); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java index b2e124ff09..cc1aed7759 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -26,6 +26,11 @@ public class IndexModel { //没有阈值:无,有就是百分数 @ExcelProperty(value = "阈值") private String threshold; + /** + * 指标值类型 无:none;整数:integer;小数: decimal;百分比:percent + */ + @ExcelProperty(value = "五级指标值类型") + private String valueType; /** * 正相关:positive;负相关:negative */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java index 9966b96619..807fb5067f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.extract.todata; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * @author zhaoqifeng @@ -12,7 +12,7 @@ public interface FactOriginExtractService { /** * desc:抽取所有业务数据到统计库 * - * @param extractFormDTO + * @param extractOriginFormDTO */ - void extractAll(ExtractFormDTO extractFormDTO); + void extractAll(ExtractOriginFormDTO extractOriginFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index bf40ac8388..fdaac9d36e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; @@ -62,4 +63,13 @@ public interface FactOriginGroupMainDailyService extends BaseService originGroupData,List memberList); + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(String customerId,String monthId,List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java index 625804fff9..671888fb14 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java @@ -28,4 +28,16 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; */ public interface FactOriginIssueLogDailyService extends BaseService { + /** + * @return int + * @param customerId + * @param gridId + * @param communityId + * @param agencyPath + * @param isParty + * @author yinzuomei + * @description 党员参与议事:支持或者反对的次数 + * @Date 2020/9/26 17:57 + **/ + int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index d5364a836f..f95de230b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -197,4 +197,25 @@ public interface FactOriginProjectLogDailyService extends BaseService getAgencyWorkPieceRatio(String customerId, String dimId,String dateType); + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridResponse(String customerId, String monthId); + + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgResponse(String customerId, String monthId, String level); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 9440cf9bc8..bc061d6064 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -185,4 +185,35 @@ public interface FactOriginProjectMainDailyService extends BaseService + */ + List getSelfProject(String customerId, String monthId, String level); + /** + * 已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getResolveProject(String customerId, String monthId, String level); + + /** + * 网格已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridResolveProject(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java index df34ed1249..d217e4d3eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java @@ -18,7 +18,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; @@ -40,7 +40,7 @@ public interface FactOriginTopicMainDailyService extends BaseService> diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java index 092402fd8c..f4d59942e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java @@ -1,11 +1,10 @@ package com.epmet.service.evaluationindex.extract.todata; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import java.util.List; -import com.epmet.dto.extract.form.ExtractFormDTO; - /** * @Desc 业务数据抽取 - 组相关 * @Author wangc @@ -24,11 +23,11 @@ public interface GroupExtractService { /** - * @Description 业务抽取 - 小组数据 * @param param * @return + * @Description 业务抽取 - 小组数据 * @author wangc * @date 2020.09.18 21:07 - **/ - void extractGroupData(ExtractFormDTO param); + **/ + void extractGroupData(ExtractOriginFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java index 24bf2ddfce..b169556f73 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java @@ -1,13 +1,11 @@ package com.epmet.service.evaluationindex.extract.todata; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.result.GridProjectCountResultDTO; import com.epmet.dto.extract.result.PartyActiveResultDTO; import com.epmet.dto.extract.result.ShiftProjectCountResultDTO; -import java.util.List; - import java.util.List; import java.util.Map; @@ -18,20 +16,20 @@ import java.util.Map; public interface IssueExtractService { /** - * @Description 议题抽取(main) - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 议题抽取(main) * @author zxc * @date 2020/9/15 2:02 下午 */ - Boolean issueExtractMain(ExtractFormDTO extractFormDTO); + Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO); /** - * @Description 议题抽取(log) - * @param extractFormDTO + * @Description 议题抽取(log) + * @param extractOriginFormDTO * @author zxc * @date 2020/9/16 9:41 上午 */ - Boolean issueExtractLog(ExtractFormDTO extractFormDTO); + Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO); /** * @Description 查询网格议题总数,网格人均议题数目 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java index 972914d5fc..f21e8b3976 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java @@ -1,9 +1,7 @@ package com.epmet.service.evaluationindex.extract.todata; -import com.epmet.dto.extract.form.ExtractFormDTO; - -import java.util.Date; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * @author zhaoqifeng @@ -16,19 +14,19 @@ public interface ProjectExtractService { /** * 项目主表、明细日统计 * - * @param extractFormDTO + * @param extractOriginFormDTO * @return * @author zhaoqifeng * @date 2020/9/15 14:38 */ - void saveOriginProjectDaily(ExtractFormDTO extractFormDTO); + void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO); - /** - * @Description 抽取项目节点历时逻辑 - * @param param - * @return - * @author wangc - * @date 2020.09.17 14:05 - **/ - void extractProjectPeriodData(ExtractFormDTO param); + /** + * @param param + * @return + * @Description 抽取项目节点历时逻辑 + * @author wangc + * @date 2020.09.17 14:05 + **/ + void extractProjectPeriodData(ExtractOriginFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java index f3117a7e40..b30c421b53 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.extract.todata; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * @Desc 业务数据抽取 - 项目节点历时 @@ -8,14 +8,14 @@ import com.epmet.dto.extract.form.ExtractFormDTO; * @DateTime 2020/9/14 5:07 下午 */ public interface ProjectPeriodExtractService { - + /** - * @Description 抽取项目节点历时逻辑 * @param param * @return + * @Description 抽取项目节点历时逻辑 * @author wangc * @date 2020.09.17 14:05 - **/ - void extractProjectPeriodData(ExtractFormDTO param); + **/ + void extractProjectPeriodData(ExtractOriginFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 14a2b1c351..381f6d230d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -3,7 +3,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimCustomerService; import com.epmet.util.DimIdGenerator; @@ -44,9 +44,9 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { @Override - public void extractAll(ExtractFormDTO extractFormDTO) { - String dateId = extractFormDTO.getDateId(); - String customerId = extractFormDTO.getCustomerId(); + public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) { + String dateId = extractOriginFormDTO.getDateId(); + String customerId = extractOriginFormDTO.getCustomerId(); if (StringUtils.isBlank(dateId)) { dateId = DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1)); } @@ -65,7 +65,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { String finalDateId = dateId; customerIds.forEach(cId -> { - ExtractFormDTO param = new ExtractFormDTO(); + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); param.setCustomerId(cId); param.setDateId(finalDateId); log.debug("extractAll param:{}", JSON.toJSONString(param)); @@ -74,7 +74,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } - private void submitJob(ExtractFormDTO param) { + private void submitJob(ExtractOriginFormDTO param) { threadPool.submit(() -> { try { groupExtractService.extractGroupData(param); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index ed5aeca1a1..4cc0ebb248 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -21,13 +21,16 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -97,4 +100,19 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl selectPartyCreateGroupInfo(String customerId, String monthId,List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + } + return new ArrayList<>(); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java index df81cee703..af081dfef5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java @@ -36,4 +36,19 @@ import org.springframework.stereotype.Service; public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl implements FactOriginIssueLogDailyService { + /** + * @param customerId + * @param gridId + * @param communityId + * @param agencyPath + * @param isParty + * @return int + * @author yinzuomei + * @description 党员参与议事:支持或者反对的次数 + * @Date 2020/9/26 17:57 + **/ + @Override + public int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty) { + return baseDao.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 4808614df1..f966247b6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -267,5 +267,15 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getGridResponse(String customerId, String monthId) { + return baseDao.selectGridResponse(customerId, monthId); + } + + @Override + public List getOrgResponse(String customerId, String monthId, String level) { + return baseDao.selectOrgResponse(customerId, monthId, level); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 68bea2819d..6e8c7124e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -198,4 +198,19 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getSelfProject(String customerId, String monthId, String level) { + return baseDao.getSelfProject(customerId, monthId, level); + } + + @Override + public List getResolveProject(String customerId, String monthId, String level) { + return baseDao.getResolveProject(customerId, monthId, level); + } + + @Override + public List getGridResolveProject(String customerId, String monthId) { + return baseDao.getGridResolveProject(customerId, monthId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java index 5d87cc5afc..e55104f01c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java @@ -28,7 +28,7 @@ import com.epmet.constant.DimObjectActionConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; @@ -77,9 +77,9 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId); if (CollectionUtils.isEmpty(topicOriginInfoList)) { log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record", customerId, dateId)); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index 0545cb5345..00e277e27d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; @@ -66,17 +66,17 @@ public class GroupExtractServiceImpl implements GroupExtractService { /** - * @Description 业务抽取 - 小组祥光 * @param param * @return + * @Description 业务抽取 - 小组祥光 * @author wangc * @date 2020.09.18 21:07 **/ @Override - public void extractGroupData(ExtractFormDTO param) { + public void extractGroupData(ExtractOriginFormDTO param) { int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId()); - if(StringUtils.isBlank(param.getDateId())){ + if (StringUtils.isBlank(param.getDateId())) { Date yesterday = DateUtils.addDateDays(new Date(), -1); SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); param.setDateId(format.format(yesterday)); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java index cd765f9199..a222e22cbb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java @@ -11,7 +11,7 @@ import com.epmet.constant.ExtractConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dao.stats.DimAgencyDao; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; @@ -54,19 +54,19 @@ public class IssueExtractServiceImpl implements IssueExtractService { private FactOriginIssueLogDailyDao issueLogDailyDao; /** - * @Description 议题抽取 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 议题抽取 * @author zxc * @date 2020/9/15 2:02 下午 */ @Override - public Boolean issueExtractMain(ExtractFormDTO extractFormDTO) { - String customerId = extractFormDTO.getCustomerId(); - String dateId = extractFormDTO.getDateId(); + public Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO) { + String customerId = extractOriginFormDTO.getCustomerId(); + String dateId = extractOriginFormDTO.getDateId(); // 1. 议题信息查询 List listResult = issueService.selectIssueInfo(customerId, dateId); List result = new ArrayList<>(); - if (CollectionUtils.isEmpty(listResult)){ + if (CollectionUtils.isEmpty(listResult)) { log.warn("issueExtractMain selectIssueInfo return empty,customerId:{},dateId:{}", customerId, dateId); return true; } @@ -151,24 +151,24 @@ public class IssueExtractServiceImpl implements IssueExtractService { } /** - * @Description 议题抽取(log) - * @param extractFormDTO + * @Description 议题抽取(log) + * @param extractOriginFormDTO * @author zxc * @date 2020/9/16 9:41 上午 */ @Override - public Boolean issueExtractLog(ExtractFormDTO extractFormDTO) { - String customerId = extractFormDTO.getCustomerId(); - String dateId = extractFormDTO.getDateId(); + public Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO) { + String customerId = extractOriginFormDTO.getCustomerId(); + String dateId = extractOriginFormDTO.getDateId(); List result = new ArrayList<>(); // 1. 查询议题process List listResult = issueService.selectIssueProcessInfo(customerId, dateId); - if (CollectionUtils.isEmpty(listResult)){ + if (CollectionUtils.isEmpty(listResult)) { log.warn("issueExtractMain issueExtractLog return empty,customerId:{},dateId:{}", customerId, dateId); return true; } Map> groupByIssue = listResult.stream().collect(Collectors.groupingBy(IssueProcessInfoResultDTO::getIssueId)); - groupByIssue.forEach((issueId,process) -> { + groupByIssue.forEach((issueId, process) -> { List descByCreateTime = process.stream().sorted(Comparator.comparing(IssueProcessInfoResultDTO::getCreateTime).reversed()).collect(Collectors.toList()); issueMainDailyDao.updateIssueStatus(issueId,descByCreateTime.get(NumConstant.ZERO).getActionCode()); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index f526570e9f..a9552ed3b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -7,7 +7,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.form.WorkDayFormDTO; import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.party.PartyMemberDTO; @@ -71,20 +71,20 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { @Autowired private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; - @Override - public void saveOriginProjectDaily(ExtractFormDTO extractFormDTO) { - String dateString = extractFormDTO.getDateId(); - String customerId = extractFormDTO.getCustomerId(); - List list = new LinkedList<>(); - //获取已关闭项目列表 - List closedList = projectProcessService.getClosedProjectList(customerId, dateString); - List pendingList = factOriginProjectMainDailyService.getPendingList(customerId); - List finishOrgList= projectProcessService.getFinishOrg(customerId, dateString); - if (null != closedList && !closedList.isEmpty()) { - List closeProjects = - pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { - FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); - entity.setId(process.getId()); + @Override + public void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO) { + String dateString = extractOriginFormDTO.getDateId(); + String customerId = extractOriginFormDTO.getCustomerId(); + List list = new LinkedList<>(); + //获取已关闭项目列表 + List closedList = projectProcessService.getClosedProjectList(customerId, dateString); + List pendingList = factOriginProjectMainDailyService.getPendingList(customerId); + List finishOrgList = projectProcessService.getFinishOrg(customerId, dateString); + if (null != closedList && !closedList.isEmpty()) { + List closeProjects = + pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(process.getId()); entity.setProjectStatus("close"); entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); entity.setUpdatedTime(process.getUpdatedTime()); @@ -312,25 +312,25 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { } } - /** - * @Description 抽取项目节点历时逻辑 - * @param param - * @return - * @author wangc - * @date 2020.09.17 14:05 - **/ - @Override - public void extractProjectPeriodData(ExtractFormDTO param) { - int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); - Boolean isFirst = trace <= NumConstant.ZERO ? true : false; - if(StringUtils.isBlank(param.getDateId())){ - Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); - SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); - param.setDateId(format.format(yesterday)); - } - List extractData = - projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId()); - List formattingData = new LinkedList<>(); + /** + * @param param + * @return + * @Description 抽取项目节点历时逻辑 + * @author wangc + * @date 2020.09.17 14:05 + **/ + @Override + public void extractProjectPeriodData(ExtractOriginFormDTO param) { + int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); + Boolean isFirst = trace <= NumConstant.ZERO ? true : false; + if (StringUtils.isBlank(param.getDateId())) { + Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + param.setDateId(format.format(yesterday)); + } + List extractData = + projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId()); + List formattingData = new LinkedList<>(); extractData.forEach(original -> { FactOriginProjectOrgPeriodDailyEntity dest = ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java index a99f2a5937..dbf1130893 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java @@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.service.evaluationindex.extract.todata.ProjectPeriodExtractService; @@ -37,23 +37,23 @@ public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractServ private ProjectProcessService projectProcessService; /** - * @Description 抽取项目节点历时逻辑 * @param param * @return + * @Description 抽取项目节点历时逻辑 * @author wangc * @date 2020.09.17 14:05 **/ @Override - public void extractProjectPeriodData(ExtractFormDTO param) { + public void extractProjectPeriodData(ExtractOriginFormDTO param) { int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); Boolean isFirst = trace <= NumConstant.ZERO ? true : false; - if(StringUtils.isBlank(param.getDateId())){ + if (StringUtils.isBlank(param.getDateId())) { Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); param.setDateId(format.format(yesterday)); } List extractData = - projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId()); + projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId()); List formattingData = new LinkedList<>(); extractData.forEach(original -> { FactOriginProjectOrgPeriodDailyEntity dest diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java index 09dafb2a6a..2628a50ced 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.extract.toscreen; +import com.epmet.dto.extract.form.ScreenExtractFormDTO; + /** * @Author zxc * @DateTime 2020/9/24 5:05 下午 @@ -8,11 +10,10 @@ public interface PartyGuideService { /** * @Description 党建引领抽取 - * @param customerId - * @param dateId + * @param screenExtractFormDTO * @author zxc * @date 2020/9/24 5:10 下午 */ - Boolean partyGuideExtract(String customerId,String dateId); + Boolean partyGuideExtract(ScreenExtractFormDTO screenExtractFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java new file mode 100644 index 0000000000..efde08faf8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java @@ -0,0 +1,34 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.extract.form.ExtractScreenFormDTO; + +/** + * @desc: 大屏 公众参与抽取服务接口 + * @Author: LiuJanJun + * @Date: 2020/9/25 10:03 上午 + * @Version: 1.0 + */ +public interface PublicPartExtractService { + + /** + * desc: 抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractTotalDataMonthly(ExtractScreenFormDTO formDTO); + + /** + * desc: 抽取公众参与 各类总数 + * target:screen_public_parti_total_data + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractPerTotalDataDaily(ExtractScreenFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java index 70ff60bff3..f61b933bf4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.extract.toscreen; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * @Author zxc @@ -9,11 +9,11 @@ import com.epmet.dto.extract.form.ExtractFormDTO; public interface ScreenExtractService { /** - * @Description 抽取数据到大屏【天】 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 * @author zxc * @date 2020/9/24 10:15 上午 */ - void extractDailyAll(ExtractFormDTO extractFormDTO); + void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java new file mode 100644 index 0000000000..bb177bd877 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java @@ -0,0 +1,32 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @desc: 大屏 产品内部客户组织结构数据 + * @Author: LiuJanJun + * @Date: 2020/9/25 10:03 上午 + * @Version: 1.0 + */ +public interface ScreenOrgService { + + /** + * desc: 抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean getInnerCustomerAgencyTree(); + + /** + * desc: 抽取公众参与 各类总数 + * target:screen_public_parti_total_data + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractPerTotalDataDaily(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 58e149d6fd..05f90029d5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -1,15 +1,21 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; @@ -21,6 +27,7 @@ import java.util.List; * @dscription * @date 2020/9/24 14:31 */ +@Service public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService { @Autowired private ScreenGovernRankDataService screenGovernRankDataService; @@ -28,37 +35,138 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; @Autowired private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + public static void main(String[] args) { + String monthId = "202006"; + System.out.println(monthId.substring(0,4)); + } @Override public void extractGridData(String customerId, String monthId) { List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.GRID, null); if (CollectionUtils.isEmpty(list)) { return; } + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); List gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); - list.forEach(entity -> gridList.stream().filter(gridAblity -> entity.getOrgId().equals(gridAblity.getGridId())).forEach(grid -> { - BigDecimal total = new BigDecimal(grid.getProjectTotal()); - entity.setYearId(grid.getYearId()); - entity.setMonthId(grid.getMonthId()); - //TODO 响应率 - //解决率 + list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> { + BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); - entity.setResolvedRatio(resolveCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); //自治率 BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); - entity.setGovernRatio(selfCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + if(grid.getResolveProjectCount()!= NumConstant.ZERO) { + entity.setGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } //满意率 entity.setSatisfactionRatio(grid.getSatisfactionRatio()); })); + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getGridResponse(customerId, monthId); + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getGridResolveProject(customerId, monthId); + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + + screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, monthId, IndexCalConstant.DELETE_SIZE, list); } @Override public void extractCommunityData(String customerId, String monthId) { + List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isEmpty(list)) { + return; + } + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + List orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, + OrgTypeConstant.COMMUNITY); + list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> { + //满意率 + entity.setSatisfactionRatio(org.getSatisfactionRatio()); + })); + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.COMMUNITY); + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.COMMUNITY); + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId, + OrgTypeConstant.COMMUNITY); + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); } @Override public void extractStreetData(String customerId, String monthId) { + List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.STREET); + if (CollectionUtils.isEmpty(list)) { + return; + } + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + List orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, + OrgTypeConstant.STREET); + list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> { + //满意率 + entity.setSatisfactionRatio(org.getSatisfactionRatio()); + })); + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.STREET); + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.STREET); + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId, + OrgTypeConstant.STREET); + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java index 6dcfe74f8c..f30e987bb9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java @@ -141,8 +141,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { delAndInsert(result,customerId,dateId,orgIds); }else { // 级别为 street,district,city,province - List agencyIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); - List directGridIds = gridService.selectDirectGrid(agencyIds); + List directGridIds = gridService.selectDirectGrid(orgIds); List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { String agencyId = agency.getAgencyId(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java index e820b39396..aac1f632bf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -1,8 +1,36 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.ScreenConstant; +import com.epmet.dto.extract.form.ScreenExtractFormDTO; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; +import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; +import com.epmet.service.heart.ActInfoService; +import com.epmet.service.heart.ActUserRelationService; +import com.epmet.service.stats.DimCustomerService; 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 org.springframework.util.StringUtils; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author zxc @@ -12,15 +40,442 @@ import org.springframework.stereotype.Service; @Slf4j public class PartyGuideServiceImpl implements PartyGuideService { + @Autowired + private ScreenPartyLinkMassesDataService linkMassesDataService; + @Autowired + private ScreenPartyBranchDataService partyBranchDataService; + @Autowired + private FactOriginGroupMainDailyService groupMainService; + @Autowired + private ScreenCustomerAgencyService agencyService; + @Autowired + private ScreenCustomerGridService gridService; + @Autowired + private ActInfoService actInfoService; + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private ActUserRelationService actUserRelationService; + /** * @Description 党建引领抽取 - * @param customerId - * @param dateId + * @param screenExtractFormDTO * @author zxc * @date 2020/9/24 5:10 下午 */ @Override - public Boolean partyGuideExtract(String customerId, String dateId) { - return null; + public Boolean partyGuideExtract(ScreenExtractFormDTO screenExtractFormDTO) { + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIds = new ArrayList<>(); + String customerId = screenExtractFormDTO.getCustomerId(); + if (!StringUtils.isEmpty(customerId)){ + customerIds.add(customerId); + }else { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + } + String monthId = screenExtractFormDTO.getMonthId(); + if (StringUtils.isEmpty(monthId)){ + monthId = LocalDate.now().toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX); + } + if (!CollectionUtils.isEmpty(customerIds)){ + String finalMonthId = monthId; + customerIds.forEach(oneCustomerId -> { + partyGuideExtractParty(oneCustomerId, finalMonthId); + partyGuideExtractOrganize(oneCustomerId,finalMonthId); + }); + } + return true; + } + + /** + * @Description 【党员建群数,群成员数】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 4:26 下午 + */ + public void partyGuideExtractParty(String customerId, String monthId){ + //【党员建群数,群成员数】 + List agencyIdList = agencyService.selectAllAgencyId(customerId); + if (!CollectionUtils.isEmpty(agencyIdList)){ + // 根据组织级别分组 + Map> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); + if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ + // 社区级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); + disPoseParty(customerGridInfoList,true,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); + disPoseParty(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); + disPoseParty(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); + disPoseParty(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); + disPoseParty(customerGridInfoList,false,customerId,monthId); + } + } + } + + /** + * @Description 【参与人数,组织次数】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 4:26 下午 + */ + public void partyGuideExtractOrganize(String customerId, String monthId){ + //【参与人数,组织次数】 + List agencyIdList = agencyService.selectAllAgencyId(customerId); + if (!CollectionUtils.isEmpty(agencyIdList)){ + // 根据组织级别分组 + Map> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); + if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ + // 社区级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); + disPoseOrganize(customerGridInfoList,true,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); + disPoseOrganize(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); + disPoseOrganize(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); + disPoseOrganize(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); + disPoseOrganize(customerGridInfoList,false,customerId,monthId); + } + } + } + + /** + * @Description 处理【党员建群数,群成员数】 + * @Param agencyIdList + * @Param isGrid + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 2:57 下午 + */ + public void disPoseParty(List agencyIdList, Boolean isGrid, String customerId, String monthId) { + List result = new ArrayList<>(); + if (!CollectionUtils.isEmpty(agencyIdList)){ + List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + if (isGrid == true){ + agencyIdList.forEach(agency -> { + GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, monthId, agency); + orgIds.addAll(gridPartyGuideDTO.getOrgIds()); + result.addAll(gridPartyGuideDTO.getResult()); + }); + Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId)); + groupByAgency.forEach((agencyId,gridList) -> { + ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); + List orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (agencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } + form.setOrgId(agencyId); + form.setCustomerId(customerId); + form.setDataEndTime(monthId); + form.setOrgType(ScreenConstant.AGENCY); + form.setCreateGroupTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + form.setGroupUserTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + result.add(form); + }); + delAndInsertLink(result,customerId,monthId,orgIds); + }else { + // 级别为 street,district,city,province + List directGridIds = gridService.selectDirectGrid(orgIds); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + List disGridIds = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + disGridIds.add(grid.getGridId()); + } + }); + // 不为空 存在直属网格 + if (!CollectionUtils.isEmpty(disGridIds)){ + List gridResult = new ArrayList<>(); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyLinkMassesDataList)){ + partyLinkMassesDataList.forEach(party -> { + orgNameList.forEach(org -> { + if (party.getOrgId().equals(org.getGridId())){ + party.setOrgName(org.getGridName()); + } + }); + ScreenPartyLinkMassesDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyLinkMassesDataFormDTO.class); + gridResult.add(copyParty); + }); + } + delAndInsertLink(gridResult,customerId,monthId,disGridIds); + } + List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List screenPartyLinkMassesDataList = linkMassesDataService.selectPartyLinkMassesInfo(customerId, monthId, agencyId); + screenPartyLinkMassesDataList.addAll(screenPartyLinkMassesDataGrid); + if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)){ + ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); + form.setOrgId(agencyId); + form.setOrgType(ScreenConstant.AGENCY); + form.setOrgName(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getOrgName()); + form.setCustomerId(customerId); + form.setDataEndTime(monthId); + form.setParentId(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getParentId()); + form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + result.add(form); + } + }); + delAndInsertLink(result,customerId,monthId,orgIds); + } + } + } + + /** + * @Description 处理【参与人数,组织次数】 + * @Param agencyIdList + * @Param isGrid + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 4:28 下午 + */ + public void disPoseOrganize(List agencyIdList, Boolean isGrid, String customerId, String monthId){ + if (!CollectionUtils.isEmpty(agencyIdList)){ + List result = new ArrayList<>(); + List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + if (isGrid == true){ + List joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + orgIds.addAll(gridIds); + List screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, gridIds); + if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ + screenPartyBranchDataList.forEach(party -> { + joinUserCountList.forEach(join -> { + if (party.getOrgId().equals(join.getOrgId())){ + party.setAverageJoinUserCount(join.getJoinUserCount()); + party.setAverageJoinUserCount(party.getJoinUserCount() / party.getOrganizeCount()); + party.setYearId(DateUtils.getYearId(monthId)); + } + }); + }); + } + result.addAll(screenPartyBranchDataList); + }); + // 社区级别的 + Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getParentId)); + List orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds); + groupByAgency.forEach((agencyId,actList) -> { + ScreenPartyBranchDataFormDTO form = new ScreenPartyBranchDataFormDTO(); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (agencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } + form.setOrgId(agencyId); + form.setCustomerId(customerId); + form.setOrgType(ScreenConstant.AGENCY); + form.setMonthId(monthId); + form.setYearId(DateUtils.getYearId(monthId)); + form.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); + form.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); + form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount()); + result.add(form); + }); + delAndInsertOrganize(result,customerId,monthId,orgIds); + }else { + List directGridIds = gridService.selectDirectGrid(orgIds); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + List disGridIds = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + disGridIds.add(grid.getGridId()); + } + }); + // 存在直属网格 + if (!CollectionUtils.isEmpty(disGridIds)){ + List gridResult = new ArrayList<>(); + List joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId); + List orgNameList = agencyService.selectOrgNameGrid(disGridIds); + List screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds); + if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ + screenPartyBranchDataList.forEach(party -> { + orgNameList.forEach(org -> { + if (party.getOrgId().equals(org.getGridId())){ + party.setOrgName(org.getGridName()); + } + }); + ScreenPartyBranchDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyBranchDataFormDTO.class); + gridResult.add(copyParty); + }); + } + } + List disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds); + List screenPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); + screenPartyBranchDataList.addAll(disPartyBranchDataList); + if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ + ScreenPartyBranchDataFormDTO form = new ScreenPartyBranchDataFormDTO(); + form.setOrgId(agencyId); + form.setOrgType(ScreenConstant.AGENCY); + form.setOrgName(screenPartyBranchDataList.get(NumConstant.ZERO).getOrgName()); + form.setCustomerId(customerId); + form.setMonthId(monthId); + form.setYearId(DateUtils.getYearId(monthId)); + form.setParentId(screenPartyBranchDataList.get(NumConstant.ZERO).getParentId()); + form.setJoinUserCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); + form.setOrganizeCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); + form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount()); + result.add(form); + } + }); + delAndInsertOrganize(result,customerId,monthId,orgIds); + } + } + } + + /** + * @Description 社区级别的处理 + * @Param customerId + * @Param monthId + * @Param agency + * @author zxc + * @date 2020/9/25 10:06 上午 + */ + public GridPartyGuideDTO communityLevelSubGrid(String customerId, String monthId, CustomerAgencyInfoResultDTO agency){ + String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + List orgIds = partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); + List orgNameList = agencyService.selectOrgNameGrid(orgIds); + partyLinkMassesDataList.forEach(party -> { + orgNameList.forEach(orgName -> { + if (party.getOrgId().equals(orgName.getGridId())){ + party.setOrgName(orgName.getGridName()); + } + }); + }); + return new GridPartyGuideDTO(gridIds,partyLinkMassesDataList); } + + /** + * @Description 删除并插入党员联系群众【党员建群数,群成员数】 + * @Param result + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/25 2:57 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertLink(List result, String customerId, String monthId, List orgIds){ + List screenPartyLinkMassesAgencyList = agencyService.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); + List resultList = gridService.selectAllGridIdToPartyLinkMessage(customerId, monthId); + resultList.addAll(screenPartyLinkMassesAgencyList); + List finalResult = new ArrayList<>(); + // 因为是根据级别来删除,插入,所以把需要操作的orgIds单独出来 + 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 = linkMassesDataService.deleteOldPartyLinkInfo(customerId, orgIds); + }while (delNum > NumConstant.ZERO); + List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + linkMassesDataService.insertScreenPartyLinkMassesData(p); + }); + } + + /** + * @Description + * @Param result + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/25 5:50 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertOrganize(List result,String customerId, String monthId, List orgIds){ + List screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId); + List screenPartyBranchDataList = gridService.selectAllGridIdToOrganize(customerId, monthId); + screenPartyBranchDataList.addAll(screenPartyBranchData); + List finalResult = new ArrayList<>(); + screenPartyBranchDataList.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 = partyBranchDataService.deleteOldScreenPartyBranchData(customerId, monthId, orgIds); + }while (delNum > NumConstant.ZERO); + List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + partyBranchDataService.insertScreenPartyBranchData(p); + }); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java index df9d7ab3c8..c4b5964404 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java @@ -4,11 +4,13 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -24,6 +26,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/9/22 11:25 */ +@Slf4j @Service public class PioneerDataExtractServiceImpl implements PioneerDataExtractService { @@ -35,6 +38,9 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService private FactOriginIssueMainDailyService factOriginIssueMainDailyService; @Autowired private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactOriginIssueLogDailyService factOriginIssueLogDailyService; + /** * @param customerId @@ -54,11 +60,15 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService gridList.forEach(entity -> { entity.setDataEndTime(dateId); String gridId = entity.getOrgId(); - //1、党员参与议事 todo - entity.setIssueTotal(NumConstant.ZERO); - //2、党员参与议事占比 todo - entity.setIssueRatio(BigDecimal.ZERO); - + //1、党员参与议事 + entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR)); + if(entity.getIssueTotal()==0){ + entity.setIssueRatio(BigDecimal.ZERO); + }else{ + //2、党员参与议事占比 + int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null); + entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + } //3、党员发布话题: entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); @@ -86,6 +96,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); //8、议题转项目占比 : 占网格内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + }else{ +// log.info("当前网格内所有议题总数="+gridIssueTotal); + entity.setPublishIssueTotal(NumConstant.ZERO); + entity.setPublishIssueRatio(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectRatio(BigDecimal.ZERO); } @@ -102,6 +118,25 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList); } + /** + * @return int + * @param customerId + * @param gridId 网格id + * @param communityId 社区的id + * @param agencyPath 组织的pids包含自己 + * @param isParty 1党员 + * @author yinzuomei + * @description + * @Date 2020/9/26 17:41 + **/ + private int calPartyPartiIssueTotal(String customerId, + String gridId, + String communityId, + String agencyPath, + String isParty) { + return factOriginIssueLogDailyService.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty); + } + @Override public void extractCommunityPioneerData(String customerId, String dateId) { //查询客户下所有的社区,初始数据值为0 @@ -112,11 +147,15 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService communityList.forEach(entity -> { entity.setDataEndTime(dateId); String communityId = entity.getOrgId(); - //1、党员参与议事 todo - entity.setIssueTotal(NumConstant.ZERO); - //2、党员参与议事占比 todo - entity.setIssueRatio(BigDecimal.ZERO); - + //1、党员参与议事 + entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR)); + if(entity.getIssueTotal()==0){ + entity.setIssueRatio(BigDecimal.ZERO); + }else{ + //2、党员参与议事占比 + int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null); + entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + } //3、党员发布话题: entity.setTopicTotal(getTopicTotal(customerId, null, communityId)); @@ -144,6 +183,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId)); //8、议题转项目占比 : 占社区内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + }else{ +// log.info("当前社区内所有议题总数="+communityIssueTotal); + entity.setPublishIssueTotal(NumConstant.ZERO); + entity.setPublishIssueRatio(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectRatio(BigDecimal.ZERO); } @@ -170,17 +215,20 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } agencyList.forEach(entity -> { entity.setDataEndTime(dateId); - String agencyId = entity.getOrgId(); - //1、党员参与议事 todo - entity.setIssueTotal(NumConstant.ZERO); - //2、党员参与议事占比 todo - entity.setIssueRatio(BigDecimal.ZERO); if (StringUtils.isEmpty(entity.getPid()) || NumConstant.ZERO_STR.equals(entity.getPid())) { entity.setAgencyPath(entity.getOrgId()); } else { entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); } - + //1、党员参与议事 + entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),NumConstant.ONE_STR)); + if(entity.getIssueTotal()==0){ + entity.setIssueRatio(BigDecimal.ZERO); + }else{ + //2、党员参与议事占比 + int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null); + entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + } //3、党员发布话题: entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR)); @@ -208,6 +256,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath())); //8、议题转项目占比 : 占网格内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + }else{ +// log.info("当前组织内所有议题总数="+agencyIssueTotal); + entity.setPublishIssueTotal(NumConstant.ZERO); + entity.setPublishIssueRatio(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectRatio(BigDecimal.ZERO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java new file mode 100644 index 0000000000..bb94830ba1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -0,0 +1,173 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.dto.extract.result.GridUserCountResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; +import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; +import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.DimGridService; +import com.epmet.service.stats.FactIssueGridMonthlyService; +import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * desc:公众参与抽取到大屏的接口实现类 + * + * @author: LiuJanJun + * @date: 2020/9/25 10:46 上午 + * @version: 1.0 + */ +@Slf4j +@Service +public class PublicPartExtractServiceImpl implements PublicPartExtractService { + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private DimGridService dimGridService; + @Autowired + private FactIssueGridMonthlyService factIssueGridMonthlyService; + @Autowired + private FactRegUserGridMonthlyService factRegUserGridMonthlyService; + + + /** + * desc: 【月】抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * 总参与:统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数 + * 百人人均议题:统计周期内总的议题数/(注册用户数/100) + * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + * 不考虑市北:人均议题:统计周期内议题总数/发过议题的人数 参与度:各个行为(表决)的总数/发生行为的人数 + * + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + @Override + public Boolean extractTotalDataMonthly(ExtractScreenFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getMonthId())) { + log.warn("extractTotalDataMonthly param is error,param:{}", JSON.toJSONString(formDTO)); + return false; + } + extractGridUserJoin(formDTO); + extractAgencyUserJoin(formDTO); + return null; + } + + private void extractGridUserJoin(ExtractScreenFormDTO formDTO) { + List orgList = dimGridService.getGridListByCustomerId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(orgList)) { + log.warn("抽取【公众参与-人均议题】,获取组织数据失败"); + throw new RenException("抽取【公众参与-人均议题】,获取组织数据失败"); + } + //构建组织数据 + Map insertMap = new HashMap<>(); + orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap)); + //获取议题月份增量 + List issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(issueTotal)) { + log.error("抽取【公众参与-人均议题】,获取议题增量为空"); + return; + } + List userCountList = factRegUserGridMonthlyService.selectGridUserCount(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(issueTotal)) { + log.error("抽取【公众参与-人均议题】,获取注册用户数为空"); + return; + } + Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getGridId, o -> o)); + issueTotal.forEach(issue -> { + String gridId = issue.getGridId(); + ScreenUserJoinEntity entity = insertMap.get(gridId); + entity.setJoinTotal(issue.getIssueIncr()); + GridUserCountResultDTO user = userCountMap.get(gridId); + //百人人均议题:统计周期内总的议题数/(注册用户数/100) + BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getUserCount()).divide(new BigDecimal(NumConstant.ONE_HUNDRED))); + // 需要修改字段类型 + entity.setAvgIssue(avgIssueCount); + + //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + + + entity.setAvgJoin(new BigDecimal(0)); + }); + + + } + + private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) { + List orgList = dimAgencyService.getAgencyListByCustomerId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(orgList)) { + log.warn("抽取【公众参与-人均议题】,获取组织数据失败"); + throw new RenException("抽取【公众参与-人均议题】,获取组织数据失败"); + } + //构建组织数据 + Map insertMap = new HashMap<>(); + orgList.forEach(org -> { + buildUserJoinEntity(formDTO, org, insertMap); + }); + List issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId()); + } + + private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map result) { + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMMDD)); + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(dimIdBean, ScreenUserJoinEntity.class); + if (org instanceof DimGridEntity) { + DimGridEntity grid = (DimGridEntity) org; + entity.setCustomerId(grid.getCustomerId()); + entity.setOrgType(OrgTypeConstant.GRID); + entity.setOrgId(grid.getId()); + entity.setParentId(grid.getAgencyId()); + entity.setOrgName(grid.getGridName()); + } else if (org instanceof DimAgencyEntity) { + DimAgencyEntity agency = (DimAgencyEntity) org; + entity.setCustomerId(agency.getCustomerId()); + entity.setOrgType(agency.getLevel()); + entity.setOrgId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setOrgName(agency.getAgencyName()); + } + + entity.setJoinTotal(0); + entity.setJoinTotalUpRate(new BigDecimal("0")); + entity.setJoinTotalUpFlag(""); + entity.setAvgIssue(new BigDecimal(0)); + entity.setAvgIssueUpRate(new BigDecimal("0")); + entity.setAvgIssueUpFlag(""); + entity.setAvgJoin(new BigDecimal(0)); + entity.setAgvgJoinUpRate(new BigDecimal("0")); + entity.setAgvgJoinUpFlag(""); + result.put(entity.getOrgId(), entity); + } + + /** + * desc: 【日】抽取公众参与 各类总数 累计值 + * target:screen_public_parti_total_data + * + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + @Override + public Boolean extractPerTotalDataDaily(ExtractScreenFormDTO formDTO) { + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index bab236a466..9c8b73e49e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -2,7 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; @@ -33,33 +33,33 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private PioneerDataExtractService pioneerDataExtractService; /** - * @Description 抽取数据到大屏【天】 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 * @author zxc * @date 2020/9/24 10:15 上午 */ @Override - public void extractDailyAll(ExtractFormDTO extractFormDTO) { + public void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) { List customerIds = new ArrayList<>(); - if (StringUtils.isNotBlank(extractFormDTO.getCustomerId())){ - customerIds.add(extractFormDTO.getCustomerId()); - }else { + if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId())) { + customerIds.add(extractOriginFormDTO.getCustomerId()); + } else { int pageNo = NumConstant.ONE; int pageSize = NumConstant.ONE_HUNDRED; customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); } - if (!CollectionUtils.isEmpty(customerIds)){ + if (!CollectionUtils.isEmpty(customerIds)) { customerIds.forEach(customerId -> { - if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())){ - List daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate()); + if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) { + List daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate()); daysBetween.forEach(dateId -> { - extractDaily(customerId,dateId); + extractDaily(customerId, dateId); }); - }else if (StringUtils.isNotBlank(extractFormDTO.getDateId())){ - extractDaily(customerId,extractFormDTO.getDateId()); - }else { + } else if (StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) { + extractDaily(customerId, extractOriginFormDTO.getDateId()); + } else { String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); - extractDaily(customerId,dateId); + extractDaily(customerId, dateId); } }); } @@ -74,7 +74,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { * @date 2020/9/24 10:16 上午 */ public void extractDaily(String customerId,String dateId){ - partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId); +// partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId); pioneerDataExtractService.extractGridPioneerData(customerId,dateId); pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId); pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java index 6e709fa4fb..4c38049785 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java @@ -49,4 +49,15 @@ public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService list); + + /** + * 根据客户查询组织治理能力 + * @author zhaoqifeng + * @date 2020/9/25 13:56 + * @param customerId + * @param monthId + * @param type + * @return java.util.List + */ + List getOrgByCustomer(String customerId, String monthId, String type); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java index 5143882c49..3f9c73afb3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java @@ -1,9 +1,12 @@ package com.epmet.service.evaluationindex.indexcoll.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.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; +import org.springframework.stereotype.Service; import java.util.List; @@ -12,6 +15,8 @@ import java.util.List; * @dscription * @date 2020/9/24 14:36 */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl implements FactIndexGovrnAblityGridMonthlyService { @Override public List getGridByCustomer(String customerId, String monthId) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java index 6f6d5f15a5..a19669e39d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java @@ -46,4 +46,9 @@ public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl list) { insertBatch(list); } + + @Override + public List getOrgByCustomer(String customerId, String monthId, String type) { + return baseDao.selectOrgByCustomer(customerId, monthId, type); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java index 9d74cc81e7..5ff8fdf050 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -18,6 +18,8 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import java.util.List; @@ -78,6 +80,17 @@ public interface ScreenCustomerAgencyService{ */ List selectAllAgencyIdToParty(String customerId,String dateId); + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param dateId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId); + + List selectAllAgencyIdToOrganize(String customerId, String monthId); + /** * @Description 查询org名称【网格】 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index e8a39967e2..82a00909a5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -19,9 +19,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -50,6 +48,16 @@ public interface ScreenCustomerGridService extends BaseService selectAllGridIdToParty(String customerId, String dateId); + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + List selectAllGridIdToPartyLinkMessage(String customerId, String monthId); + List selectAllGridIdToOrganize(String customerId, String monthId); + /** * @Description 查询机关的直属网格 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java index 5c5fb96844..0f9b23b166 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java @@ -32,12 +32,27 @@ import java.util.List; public interface ScreenGovernRankDataService extends BaseService { /** * 构造screen_govern_rank_data 初始数据,先赋值为0 - * @author zhaoqifeng - * @date 2020/9/24 14:41 + * * @param customerId * @param orgType * @param agencyLevel * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 14:41 */ List initList(String customerId, String orgType, String agencyLevel); + + /** + * 保存抽取结果 + * + * @param customerId + * @param orgType + * @param monthId + * @param deleteSize + * @param entityList + * @return void + * @author zhaoqifeng + * @date 2020/9/25 10:32 + */ + void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List entityList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java index 657faf457d..1fc80f30ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; +import java.util.List; + /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 * @@ -28,4 +31,42 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; */ public interface ScreenPartyBranchDataService extends BaseService { + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + void insertScreenPartyBranchData(List lists); + + /** + * @Description 删除旧的建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:04 上午 + */ + Integer deleteOldScreenPartyBranchData(String customerId, String monthId, List orgIds); + + /** + * @Description 根据orgId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + List selectScreenPartyBranchDataByOrgId(String customerId, String monthId, List orgIds); + + /** + * @Description 根据parentId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param parentId + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + List selectScreenPartyBranchDataByParentId(String customerId, String monthId, String parentId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java index 669e20f18d..77b8cdb3eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; +import java.util.List; + /** * 党建引领-党员联系群众数据 * @@ -28,4 +31,31 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; */ public interface ScreenPartyLinkMassesDataService extends BaseService { + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + void insertScreenPartyLinkMassesData(List lists); + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyLinkInfo(String customerId, List orgIds); + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + List selectPartyLinkMassesInfo(String customerId, String monthId,String agencyId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index 13d056ced5..d506856d0e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -22,13 +22,15 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; +import com.epmet.constant.ScreenConstant; 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.form.ScreenPartyBranchDataFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; -import com.epmet.constant.ScreenConstant; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; @@ -39,10 +41,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import java.util.stream.Collectors; /** @@ -114,7 +112,7 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ @Transactional(rollbackFor = Exception.class) @Override public void initAgencies(List agencies2Add, List agencies2Update) { - String dateEndTime = DateUtils.format(new Date(), "YYYYmmdd"); + String dateEndTime = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); if (!CollectionUtils.isEmpty(agencies2Add)) { // 添加 for (CustomerAgencyEntity e : agencies2Add) { @@ -163,6 +161,23 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectAllAgencyIdToParty(customerId,dateId); } + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + @Override + public List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId) { + return screenCustomerAgencyDao.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); + } + + @Override + public List selectAllAgencyIdToOrganize(String customerId, String monthId) { + return screenCustomerAgencyDao.selectAllAgencyIdToOrganize(customerId, monthId); + } + /** * @Description 查询org名称 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 344fe266e4..f0a47885ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -24,9 +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.GovernAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -109,6 +107,23 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectAllGridIdToPartyLinkMessage(String customerId, String monthId) { + return screenCustomerGridDao.selectAllGridIdToPartyLinkMessage(customerId, monthId); + } + + @Override + public List selectAllGridIdToOrganize(String customerId, String monthId) { + return screenCustomerGridDao.selectAllGridIdToOrganize(customerId, monthId); + } + /** * @Description 查询机关的直属网格 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java index e4fea260dc..4679187995 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java @@ -18,13 +18,19 @@ 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.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDao; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -37,6 +43,7 @@ import java.util.List; */ @Service @Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl implements ScreenGovernRankDataService { @@ -58,4 +65,23 @@ public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl entityList) { + if (CollectionUtils.isEmpty(entityList)) { + return; + } + List orgIds = new ArrayList<>(); + for (ScreenGovernRankDataEntity entity : entityList) { + orgIds.add(entity.getOrgId()); + } + int deleteNum; + do { + deleteNum = baseDao.deleteRankData(customerId, orgType, monthId, deleteSize, orgIds); + } while (deleteNum != NumConstant.ZERO); + + insertBatch(entityList); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java index 8c1f8e9182..afd2e8aee3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java @@ -18,11 +18,19 @@ 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.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenPartyBranchDataDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 @@ -31,7 +39,64 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-09-22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenPartyBranchDataServiceImpl extends BaseServiceImpl implements ScreenPartyBranchDataService { + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + @Override + public void insertScreenPartyBranchData(List lists) { + if (!CollectionUtils.isEmpty(lists)){ + baseDao.insertScreenPartyBranchData(lists); + } + } + + /** + * @Description 删除旧的建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:04 上午 + */ + @Override + public Integer deleteOldScreenPartyBranchData(String customerId, String monthId, List orgIds) { + if (!CollectionUtils.isEmpty(orgIds)){ + return baseDao.deleteOldScreenPartyBranchData(customerId, monthId, orgIds); + } + return NumConstant.ZERO; + } + + /** + * @Description 根据orgId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + @Override + public List selectScreenPartyBranchDataByOrgId(String customerId, String monthId, List orgIds) { + if (!CollectionUtils.isEmpty(orgIds)){ + return baseDao.selectScreenPartyBranchDataByOrgId(customerId, monthId, orgIds); + } + return new ArrayList<>(); + } + /** + * @Description 根据parentId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param parentId + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + @Override + public List selectScreenPartyBranchDataByParentId(String customerId, String monthId, String parentId) { + return baseDao.selectScreenPartyBranchDataByParentId(customerId, monthId, parentId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java index 256246ad11..2915297086 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java @@ -18,11 +18,17 @@ 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.ScreenPartyLinkMassesDataDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 党建引领-党员联系群众数据 @@ -31,7 +37,45 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-09-22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenPartyLinkMassesDataServiceImpl extends BaseServiceImpl implements ScreenPartyLinkMassesDataService { + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + @Override + public void insertScreenPartyLinkMassesData(List lists) { + if (!CollectionUtils.isEmpty(lists)){ + baseDao.insertScreenPartyLinkMassesData(lists); + } + } + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + @Override + public Integer deleteOldPartyLinkInfo(String customerId, List orgIds) { + return baseDao.deleteOldPartyLinkInfo(customerId, orgIds); + } + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + @Override + public List selectPartyLinkMassesInfo(String customerId, String monthId, String agencyId) { + return baseDao.selectPartyLinkMassesInfo(customerId, monthId, agencyId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 4a5e9697fb..9438f4c3ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -413,15 +413,35 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { * @Author zhangyong * @Date 15:38 2020-08-21 **/ - private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){ - if (NumConstant.ZERO == old){ + private BigDecimal calculateGrowthRateNumber(Integer old, Integer now) { + if (NumConstant.ZERO == old) { return new BigDecimal(now * NumConstant.ONE_HUNDRED); } BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); - BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP); + BigDecimal bignum2 = bignum1.divide(new BigDecimal(old), 2, BigDecimal.ROUND_HALF_UP); return bignum2; } + /** + * 计算 本月数值 相较于 上月数值,的增长率 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.math.BigDecimal + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private BigDecimal calculateGrowthRateNumber(BigDecimal old, BigDecimal now) { + BigDecimal oneHundred = new BigDecimal(NumConstant.ONE_HUNDRED); + if (old.compareTo(new BigDecimal(NumConstant.ZERO)) == NumConstant.ZERO) { + return now.multiply(oneHundred); + } + BigDecimal bignum1 = now.subtract(old).multiply(oneHundred); + BigDecimal bignum2 = bignum1.divide(old, 2, BigDecimal.ROUND_HALF_UP); + return bignum2; + } + + /** * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 * @@ -431,10 +451,29 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { * @Author zhangyong * @Date 15:38 2020-08-21 **/ - private String calculateGrowthRateFlag(Integer old, Integer now){ - if (old > now){ + private String calculateGrowthRateFlag(Integer old, Integer now) { + if (old > now) { + return CompareConstant.DECR_STR; + } else if (old < now) { + return CompareConstant.INCR_STR; + } else { + return CompareConstant.EQ_STR; + } + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.util.String + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private String calculateGrowthRateFlag(BigDecimal old, BigDecimal now) { + if (old.compareTo(now) == 1) { return CompareConstant.DECR_STR; - } else if (old < now){ + } else if (old.compareTo(now) == -1) { return CompareConstant.INCR_STR; } else { return CompareConstant.EQ_STR; @@ -448,7 +487,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId,IndexCalConstant.DELETE_SIZE); + deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId, IndexCalConstant.DELETE_SIZE); } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java index 4caa64828f..959b237c75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java @@ -1,5 +1,7 @@ package com.epmet.service.heart; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; + import java.util.List; import java.util.Map; @@ -28,4 +30,14 @@ public interface ActInfoService { * @Date 2020/9/21 16:43 **/ Map calActivityCountMap(String customerId, String monthId); + + /** + * @Description 查询组织次数 + * @Param customerId + * @Param monthId + * @Param orgType + * @author zxc + * @date 2020/9/25 4:00 下午 + */ + List selectActInfo(String customerId, String monthId, String orgType, List orgIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java new file mode 100644 index 0000000000..7875323b3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java @@ -0,0 +1,22 @@ +package com.epmet.service.heart; + +import com.epmet.dto.extract.result.JoinUserCountResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 5:17 下午 + */ +public interface ActUserRelationService { + + /** + * @Description 查询参与人数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 5:19 下午 + */ + List selectJoinUserCount(String customerId,String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java index f56ecc918c..7e65f078e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java @@ -3,11 +3,14 @@ package com.epmet.service.heart.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.heart.ActInfoDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.service.heart.ActInfoService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -58,4 +61,20 @@ public class ActInfoServiceImpl implements ActInfoService { } return resultMap; } + + /** + * @Description 查询组织次数 + * @Param customerId + * @Param monthId + * @Param orgType + * @author zxc + * @date 2020/9/25 4:00 下午 + */ + @Override + public List selectActInfo(String customerId, String monthId, String orgType, List orgIds) { + if (!CollectionUtils.isEmpty(orgIds)){ + return baseDao.selectActInfo(customerId, monthId, orgType, orgIds); + } + return new ArrayList<>(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java new file mode 100644 index 0000000000..570967a3c0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java @@ -0,0 +1,35 @@ +package com.epmet.service.heart.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.heart.ActUserRelationDao; +import com.epmet.dto.extract.result.JoinUserCountResultDTO; +import com.epmet.service.heart.ActUserRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 5:17 下午 + */ +@Service +@DataSource(DataSourceConstant.EPMET_HEART) +public class ActUserRelationServiceImpl implements ActUserRelationService { + + @Autowired + private ActUserRelationDao actUserRelationDao; + + /** + * @Description 查询参与人数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 5:19 下午 + */ + @Override + public List selectJoinUserCount(String customerId, String monthId) { + return actUserRelationDao.selectJoinUserCount(customerId, monthId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java index a40b8c7236..736a6e348c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java @@ -18,12 +18,10 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.FactIssueGridMonthlyDTO; import com.epmet.entity.stats.FactIssueGridMonthlyEntity; import java.util.List; -import java.util.Map; /** * 网格议题数量(按月) @@ -32,57 +30,6 @@ import java.util.Map; * @since v1.0.0 2020-06-17 */ public interface FactIssueGridMonthlyService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-06-17 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-06-17 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return FactIssueGridMonthlyDTO - * @author generator - * @date 2020-06-17 - */ - FactIssueGridMonthlyDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-06-17 - */ - void save(FactIssueGridMonthlyDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-06-17 - */ - void update(FactIssueGridMonthlyDTO dto); - /** * 批量删除 * @@ -115,10 +62,22 @@ public interface FactIssueGridMonthlyService extends BaseService list); + + /** + * desc: 获取该客户下某月的 议题数量 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/25 5:00 下午 + */ + List getIssueCount(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java index 97d6f29242..c002e0e3ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -17,25 +17,18 @@ package com.epmet.service.stats.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactIssueGridMonthlyDao; import com.epmet.dto.stats.FactIssueGridMonthlyDTO; import com.epmet.entity.stats.FactIssueGridMonthlyEntity; import com.epmet.service.stats.FactIssueGridMonthlyService; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; -import java.util.Map; /** * 网格议题数量(按月) @@ -47,51 +40,6 @@ import java.util.Map; @DataSource(DataSourceConstant.STATS) public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl implements FactIssueGridMonthlyService { - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, FactIssueGridMonthlyDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, FactIssueGridMonthlyDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public FactIssueGridMonthlyDTO get(String id) { - FactIssueGridMonthlyEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, FactIssueGridMonthlyDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(FactIssueGridMonthlyDTO dto) { - FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(FactIssueGridMonthlyDTO dto) { - FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); - updateById(entity); - } - @Override @Transactional(rollbackFor = Exception.class) public void delete(String[] ids) { @@ -116,4 +64,18 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl + * @author LiuJanJun + * @date 2020/9/25 5:00 下午 + */ + @Override + public List getIssueCount(String customerId, String monthId) { + return baseDao.getIssueCount(customerId, monthId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index 134c359fd2..a6c9b62bee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -238,4 +238,30 @@ m.GROUP_ID =#{groupId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 23659b879a..734f088d09 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -93,4 +93,30 @@ AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 00e1e590bb..38fa735f61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -187,4 +187,69 @@ ORDER BY project.ID,score DESC + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 6129ab0f2f..5b9c58b5ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -178,4 +178,108 @@ and t1.CLOSED_STATUS=#{closedStatus} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml index e29b35bfb5..0c1010e48c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -48,7 +48,8 @@ SELECT f.CUSTOMER_ID, f.ORG_ID AS "agencyId", - SUM( TOTAL_PERIOD ) AS "sum", + SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( f.INFORMED_DATE, '%Y-%m-%d %H:%i' )), + ( DATE_FORMAT( f.PERIOD_TILL_REPLY_FIRSTLY, '%Y-%m-%d %H:%i' )) ) ) AS "sum", COUNT( f.ID ) AS "count" FROM fact_origin_project_org_period_daily f @@ -57,7 +58,7 @@ WHERE f.ORG_TYPE = #{orgType} AND DATE_FORMAT(INFORMED_DATE, '%Y%m') = #{monthId} - AND TOTAL_PERIOD != 0 + AND PERIOD_TILL_REPLY_FIRSTLY IS NOT NULL AND f.CUSTOMER_ID = #{customerId} GROUP BY f.CUSTOMER_ID, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml index 31b2bc1772..4e6dd8a925 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml @@ -106,7 +106,7 @@ WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} - AND m.CREATE_TOPIC_USER_IS_PARTY='1' + AND t1.CREATE_TOPIC_USER_IS_PARTY='1' AND T1.GRID_ID=#{gridId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 4644c01b11..dfdf6c3b59 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -115,4 +115,17 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml index 343deb4dd1..9de96650b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml @@ -194,6 +194,7 @@ org_id = #{orgId} ) + LIMIT 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index e5d5305639..1c1907e4a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -304,4 +304,36 @@ ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 19d1947e11..ae09cefb52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -296,4 +296,35 @@ DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml index a85df25770..2b70609ca3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml @@ -8,6 +8,23 @@ where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} limit 1000; + + delete from screen_govern_rank_data + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + + and ORG_TYPE=#{orgType} + + + and + ( + + ORG_ID = #{orgId} + + ) + + limit #{deleteSize} + + SELECT + ORG_ID, + ORGANIZE_COUNT, + JOIN_USER_COUNT + FROM + screen_party_branch_data + WHERE + DEL_FLAG = '0' + AND TYPE = 'voluntaryservice' + AND CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND + ( + + ORG_ID = #{gridId} + + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index f6760538d1..f2c7adcb3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml @@ -9,6 +9,40 @@ limit 1000; + + + delete from screen_party_link_masses_data + where CUSTOMER_ID = #{customerId} + and + ( + + org_id = #{orgId} + + ) + LIMIT 1000 + + + + + insert into screen_party_link_masses_data ( @@ -49,4 +83,29 @@ + + + INSERT INTO screen_party_link_masses_data ( ID, CUSTOMER_ID, ORG_TYPE, ORG_ID, PARENT_ID, ORG_NAME, CREATE_GROUP_TOTAL, GROUP_USER_TOTAL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DATA_END_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.createGroupTotal}, + #{item.groupUserTotal}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW(), + #{item.dataEndTime} + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml index ea26569ba8..3b5bc0edcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml @@ -32,4 +32,32 @@ vi.USER_ID =#{userId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml new file mode 100644 index 0000000000..ae81f1cbe2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml index 35ca051fa1..e02c95dcfb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml @@ -67,7 +67,7 @@ SUM(IFNULL(CLOSED_CASE_UNRESOLVED_INCR, 0)) AS "closedCaseUnresolvedIncr" FROM dim_grid dg - LEFT JOIN fact_issue_grid_daily figd ON figd.GRID_ID = dg.ID AND figd.DEL_FLAG = 0 + LEFT JOIN fact_issue_grid_daily figd ON figd.GRID_ID = dg.ID AND figd.DEL_FLAG = '0' AND figd.MONTH_ID = #{monthId} WHERE dg.DEL_FLAG = 0 @@ -75,4 +75,14 @@ GROUP BY dg.AGENCY_ID, dg.ID + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx index 592e740466..7f624f10bb 100644 Binary files a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx differ diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index caa9bd6301..7ed9ff3f18 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -46,4 +46,11 @@ public interface EpmetCommonServiceOpenFeignClient { */ @PostMapping("/commonservice/externalapp/getcustomerids") Result> getExternalCustomerIds(); + + /** + * 查询秘钥(仅限内部使用) + * @return + */ + @PostMapping("/commonservice/externalapp/get-secret") + Result getSecret(@RequestBody String appId); } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java index f21808fc8c..4640f13b45 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -34,4 +34,9 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer public Result> getExternalCustomerIds() { return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getExternalCustomerIds", null); } + + @Override + public Result getSecret(String appId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getSecret", appId); + } } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java index ffab33bbbe..f1229c7902 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java @@ -2,6 +2,7 @@ package com.epmet.controller; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -10,6 +11,7 @@ import com.epmet.dto.form.ExternalAppFormDTO; import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; import com.epmet.service.ExternalAppAuthService; +import com.epmet.service.ExternalAppSecretService; import com.epmet.service.ExternalAppService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -34,6 +36,9 @@ public class ExternalAppController { @Autowired private ExternalAppService externalAppService; + @Autowired + private ExternalAppSecretService externalAppSecretService; + /** * 外部请求认证 * @param formDTO @@ -128,4 +133,17 @@ public class ExternalAppController { return new Result().ok(newSecret); } + /** + * 查询秘钥(仅限内部使用) + * @return + */ + @PostMapping("/get-secret") + public Result getSecret(@RequestBody String appId) { + if (StringUtils.isBlank(appId)) { + throw new ValidateException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(), "缺少应用ID参数"); + } + String secret = externalAppSecretService.getSecretByAppId(appId); + return new Result().ok(secret); + } + } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java index fd2342c7c6..7faeae8ed4 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java @@ -41,4 +41,6 @@ public interface ExternalAppSecretDao extends BaseDao { ExternalAppSecretEntity getSecretsByAppId(@Param("appId") String appId); int updateSecret(@Param("appId") String appId, @Param("secret") String secret); + + String getSecretByAppId(String appId); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppSecretService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppSecretService.java index 7f6be4bd5a..3a68251684 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppSecretService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppSecretService.java @@ -25,4 +25,5 @@ package com.epmet.service; * @since v1.0.0 2020-08-18 */ public interface ExternalAppSecretService { + String getSecretByAppId(String appId); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppSecretServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppSecretServiceImpl.java index 567baf3fb2..da89e8ce1c 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppSecretServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppSecretServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.impl; +import com.epmet.dao.ExternalAppSecretDao; import com.epmet.service.ExternalAppSecretService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * 外部应用秘钥列表 @@ -28,4 +30,11 @@ import org.springframework.stereotype.Service; @Service public class ExternalAppSecretServiceImpl implements ExternalAppSecretService { + @Autowired + private ExternalAppSecretDao externalAppSecretDao; + + @Override + public String getSecretByAppId(String appId) { + return externalAppSecretDao.getSecretByAppId(appId); + } } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 490b2445e8..0f1674b319 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -80,14 +80,13 @@ public class ExtAppJwtTokenUtils { //String appId = "acc4ad66c82a7b46e741364b4c62dce2"; // String customrId = "b09527201c4409e19d1dbc5e3c3429a1"; //孔村 - String secret = "657cd46d385a4c2ba6d9355aee24654ac3951deab7e6436e91201561b94969b5"; - String appId = "5efcfb775125d656f39583b8110a3d7d"; + String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8"; + String appId = "f358d63a89f3670c197c62ca4c3a0366"; String customrId = "2fe0065f70ca0e23ce4c26fca5f1d933"; claim.put("customerId", customrId); claim.put("appId", appId); - claim.put("customerId", customrId); - long ts = System.currentTimeMillis() - 1000 * 60 * 4; + long ts = System.currentTimeMillis() + 1000 * 60 * 1; System.out.println("时间戳:" + ts); claim.put("ts", ts); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml index a192df36b1..f363e43d7c 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml @@ -40,5 +40,13 @@ AND DEL_FLAG = 0 + + + \ No newline at end of file diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java index 59ce874166..b41295af10 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java @@ -2,7 +2,7 @@ package com.epmet.service; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * desc: 业务数据抽取到统计库服务类 @@ -19,5 +19,5 @@ public interface FactOriginExtractTaskService { * @date: 2020/6/22 9:09 * @author: jianjun liu */ - Result factOriginExtractJob(ExtractFormDTO formDTO); + Result factOriginExtractJob(ExtractOriginFormDTO formDTO); } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java index 9dfed79a57..41244194c0 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java @@ -1,7 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.service.FactOriginExtractTaskService; import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +24,7 @@ public class FactOriginExtractTaskServiceImpl implements FactOriginExtractTaskSe * @author: jianjun liu */ @Override - public Result factOriginExtractJob(ExtractFormDTO formDTO) { + public Result factOriginExtractJob(ExtractOriginFormDTO formDTO) { return dataStatisticalOpenFeignClient.factOriginExtractAll(formDTO); } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java index 0566277dc5..963045ec79 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java @@ -2,7 +2,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.service.ScreenExtractTaskService; import lombok.extern.slf4j.Slf4j; @@ -24,10 +24,10 @@ public class ScreenExtractTaskServiceImpl implements ScreenExtractTaskService { @Override public Result screenExtractDaily(String params) { - ExtractFormDTO extractFormDTO = new ExtractFormDTO(); + ExtractOriginFormDTO extractOriginFormDTO = new ExtractOriginFormDTO(); if (StringUtils.isNotBlank(params)) { - extractFormDTO = JSON.parseObject(params, ExtractFormDTO.class); + extractOriginFormDTO = JSON.parseObject(params, ExtractOriginFormDTO.class); } - return dataStatisticalOpenFeignClient.extractDailyAll(extractFormDTO); + return dataStatisticalOpenFeignClient.extractDailyAll(extractOriginFormDTO); } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java index 51d4a847bc..92f58cf22b 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java @@ -3,7 +3,7 @@ package com.epmet.task; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.FactOriginExtractTaskService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -24,18 +24,18 @@ public class FactOriginExtractTask implements ITask { @Override public void run(String params) { - logger.info("FactOriginExtractTask定时任务正在执行,参数为:{}", params); - ExtractFormDTO formDTO = new ExtractFormDTO(); - if (StringUtils.isNotBlank(params)) { - formDTO = JSON.parseObject(params, ExtractFormDTO.class); - } - Result result = factOriginExtractTaskService.factOriginExtractJob(formDTO); - if (result.success()) { - logger.info("FactOriginExtractTask定时任务执行成功"); - } else { - logger.error("FactOriginExtractTask定时任务执行失败:" + result.getMsg()); - } - } + logger.info("FactOriginExtractTask定时任务正在执行,参数为:{}", params); + ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class); + } + Result result = factOriginExtractTaskService.factOriginExtractJob(formDTO); + if (result.success()) { + logger.info("FactOriginExtractTask定时任务执行成功"); + } else { + logger.error("FactOriginExtractTask定时任务执行失败:" + result.getMsg()); + } + } public static void main(String[] args) { StatsFormDTO formDTO = new StatsFormDTO();