diff --git a/epmet-auth/deploy/docker-compose-prod.yml b/epmet-auth/deploy/docker-compose-prod.yml index b9387658c5..1556650965 100644 --- a/epmet-auth/deploy/docker-compose-prod.yml +++ b/epmet-auth/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.69 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.70 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 7a7fcd5f9c..3f434e01da 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.69 + 0.3.70 com.epmet epmet-cloud diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 49dbbb94d5..bfea2783f9 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_gov_project?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java index 62939c595f..a70cac86ae 100644 --- a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java @@ -25,7 +25,7 @@ public class DynamicDataSource extends AbstractRoutingDataSource { @Override protected Object determineCurrentLookupKey() { String ds = DynamicContextHolder.peek(); - logger.info("动态数据源:{}" + ds); + logger.debug("动态数据源:{}", ds); return ds; } diff --git a/epmet-commons/epmet-commons-extapp-auth/pom.xml b/epmet-commons/epmet-commons-extapp-auth/pom.xml index de7060d57f..b563afcb7d 100644 --- a/epmet-commons/epmet-commons-extapp-auth/pom.xml +++ b/epmet-commons/epmet-commons-extapp-auth/pom.xml @@ -27,6 +27,12 @@ + + io.jsonwebtoken + jjwt + 0.7.0 + + org.springframework.boot spring-boot-starter-web diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/InternalAppRequestAuth.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/InternalAppRequestAuth.java new file mode 100644 index 0000000000..921860627c --- /dev/null +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/InternalAppRequestAuth.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 http://www.renren.io + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.epmet.commons.extappauth.annotation; + +import java.lang.annotation.*; + +/** + * 需要认证的内部请求 + * @Author wxz + * @Description + * @Date 2020/4/23 16:17 + **/ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface InternalAppRequestAuth { + +} diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java index ec98b35d7b..060b882cf5 100644 --- a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java @@ -1,13 +1,24 @@ package com.epmet.commons.extappauth.aspect; +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; +import com.alibaba.fastjson.JSON; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.extappauth.jwt.JwtTokenUtils; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.security.dto.BaseTokenDto; +import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.ExternalAppAuthFormDTO; import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import io.jsonwebtoken.Claims; import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; @@ -18,12 +29,14 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import java.lang.reflect.Parameter; +import java.util.Map; /** * 外部应用请求认证切面 @@ -35,6 +48,7 @@ public class ExternalAppRequestAuthAspect { private static Logger logger = LoggerFactory.getLogger(ExternalAppRequestAuthAspect.class); + public static final String AUTHORIZATION_TOKEN_HEADER_KEY = "Authorization"; public static final String ACCESS_TOKEN_HEADER_KEY = "AccessToken"; public static final String APP_ID_HEADER_KEY = "appId"; public static final String APP_ID_TIMESTAMP_KEY = "ts"; @@ -44,15 +58,121 @@ public class ExternalAppRequestAuthAspect { @Autowired private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private JwtTokenUtils jwtTokenUtils; + + @Autowired + private RedisUtils redisUtils; + /** * 拦截加了ExternalRequestAuth注解的方法 * * @param point * @throws Throwable */ - @Before("@annotation(com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth)") + @Before("@annotation(com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth) " + + "|| @annotation(com.epmet.commons.extappauth.annotation.InternalAppRequestAuth)") public void auth(JoinPoint point) throws Throwable { + MethodSignature signature = (MethodSignature) point.getSignature(); HttpServletRequest request = getRequest(); + + if (signature.getMethod().getAnnotation(ExternalAppRequestAuth.class) != null + && StringUtils.isNotBlank(request.getHeader(ACCESS_TOKEN_HEADER_KEY))) { + // 走外部应用认证 + extAppAuth(signature, point, request); + } else if (signature.getMethod().getAnnotation(InternalAppRequestAuth.class) != null + && StringUtils.isNotBlank(request.getHeader(AUTHORIZATION_TOKEN_HEADER_KEY))) { + // 走内部应用认证 + internalAppAuth(signature, point, request); + } else { + logger.error("根据header无法找到适用的认证方式"); + throw new RenException(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg()); + } + } + + /** + * 内部应用认证 + * @param signature + * @param point + * @param request + * @return + */ + private void internalAppAuth(MethodSignature signature, JoinPoint point, HttpServletRequest request) { + String authorization = request.getHeader(AUTHORIZATION_TOKEN_HEADER_KEY); + BaseTokenDto tokenDTO = getTokenDTO(authorization); + + Map tokenMap = redisUtils.hGetAll(RedisKeys.getCpUserKey(tokenDTO.getApp(), tokenDTO.getClient(), tokenDTO.getUserId())); + if (CollectionUtils.isEmpty(tokenMap)) { + logger.error("内部应用认证,redis中没有找到登录缓存信息"); + throw new RenException(EpmetErrorCode.ERR10006.getCode(), EpmetErrorCode.ERR10006.getMsg()); + } + BaseTokenDto baseTokenDto = null; + String customerId; + if ("gov".equals(tokenDTO.getApp())) { + GovTokenDto govTokenDto = BeanUtil.mapToBean(tokenMap, GovTokenDto.class, true); + customerId = govTokenDto.getCustomerId(); + baseTokenDto = govTokenDto; + } else { + TokenDto tokenDto = BeanUtil.mapToBean(tokenMap, TokenDto.class, true); + customerId = tokenDto.getCustomerId(); + baseTokenDto = tokenDTO; + } + + if (baseTokenDto == null) { + logger.error("内部应用认证,redis中没有找到登录缓存信息"); + throw new RenException(EpmetErrorCode.ERR10006.getCode(), EpmetErrorCode.ERR10006.getMsg()); + } + + if (!authorization.equals(baseTokenDto.getToken())) { + logger.error("内部应用认证,redis中找到的token与header里面传入的不一致,可能发生了别处登录"); + throw new RenException(EpmetErrorCode.ERR10007.getCode(), EpmetErrorCode.ERR10007.getMsg()); + } + + // header参数赋值 + Parameter[] parameters = signature.getMethod().getParameters(); + if (parameters != null && parameters.length != 0) { + for (int i = 0; i < parameters.length; i++) { + if (parameters[i].getType() == ExternalAppRequestParam.class) { + ExternalAppRequestParam requestParam = (ExternalAppRequestParam) point.getArgs()[i]; + requestParam.setCustomerId(customerId); + } + } + } + + } + + private BaseTokenDto getTokenDTO(String authorization) { + if (StringUtils.isBlank(authorization)) { + logger.error("内部应用认证,没有携带authorization头信息"); + throw new RenException(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg()); + } + + //是否过期 + Claims claims = jwtTokenUtils.getClaimByToken(authorization); + if (claims == null) { + logger.error("内部应用认证,Claims为空"); + throw new RenException(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg()); + } + + if (jwtTokenUtils.isTokenExpired(claims.getExpiration())) { + logger.error("内部应用认证,token过期"); + throw new RenException(EpmetErrorCode.ERR10006.getCode(), EpmetErrorCode.ERR10006.getMsg()); + } + + //获取用户ID + String app = (String) claims.get("app"); + String client = (String) claims.get("client"); + String userId = (String) claims.get("userId"); + return new BaseTokenDto(app, client, userId, authorization); + } + + /** + * 外部应用认证 + * + * @param signature + * @param point + */ + public void extAppAuth(MethodSignature signature, JoinPoint point, HttpServletRequest request) { String token = request.getHeader(ACCESS_TOKEN_HEADER_KEY); String appId = request.getHeader(APP_ID_HEADER_KEY); String ts = request.getHeader(APP_ID_TIMESTAMP_KEY); @@ -89,14 +209,14 @@ public class ExternalAppRequestAuthAspect { // header参数赋值 - MethodSignature signature = (MethodSignature) point.getSignature(); Parameter[] parameters = signature.getMethod().getParameters(); if (parameters != null && parameters.length != 0) { for (int i = 0; i < parameters.length; i++) { if (parameters[i].getType() == ExternalAppRequestParam.class) { ExternalAppRequestParam requestParam = (ExternalAppRequestParam) point.getArgs()[i]; requestParam.setAppId(appId); - requestParam.setCustomerId(authResult.getCustomerId() == null ? customerId : authResult.getCustomerId()); + requestParam.setCustomerId(StringUtils.isBlank(authResult.getCustomerId()) ? customerId : authResult.getCustomerId()); + logger.info("auth ExternalAppRequestParam:{}", JSON.toJSONString(requestParam)); } } } diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenProperties.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenProperties.java new file mode 100644 index 0000000000..8c7dcc2636 --- /dev/null +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenProperties.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.commons.extappauth.jwt; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * Jwt + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +@ConfigurationProperties(prefix = "jwt.token") +public class JwtTokenProperties { + private String secret; + private int expire; + + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + public int getExpire() { + return expire; + } + + public void setExpire(int expire) { + this.expire = expire; + } +} diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenUtils.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenUtils.java new file mode 100644 index 0000000000..bd5eff1beb --- /dev/null +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/jwt/JwtTokenUtils.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.extappauth.jwt; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import org.joda.time.DateTime; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Jwt工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class JwtTokenUtils { + private static final Logger logger = LoggerFactory.getLogger(JwtTokenUtils.class); + + @Autowired + private JwtTokenProperties jwtProperties; + + /** + * 生成jwt token 弃用 + */ + @Deprecated + public String generateToken(String userId) { + return Jwts.builder() + .setHeaderParam("typ", "JWT") + .setSubject(userId) + .setIssuedAt(new Date()) + .setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate()) + .signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret()) + .compact(); + } + + public Claims getClaimByToken(String token) { + try { + return Jwts.parser() + .setSigningKey(jwtProperties.getSecret()) + .parseClaimsJws(token) + .getBody(); + } catch (Exception e) { + logger.debug("validate is token error, token = " + token, e); + return null; + } + } + + /** + * @return java.util.Date + * @param token + * @Author yinzuomei + * @Description 获取token的有效期截止时间 + * @Date 2020/3/18 22:17 + **/ + public Date getExpiration(String token){ + try { + return Jwts.parser() + .setSigningKey(jwtProperties.getSecret()) + .parseClaimsJws(token) + .getBody().getExpiration(); + } catch (Exception e) { + logger.debug("validate is token error, token = " + token, e); + return null; + } + } + + /** + * @param map + * @return java.lang.String + * @Author yinzuomei + * @Description 根据app+client+userId生成token + * @Date 2020/3/18 22:29 + **/ + public String createToken(Map map) { + return Jwts.builder() + .setHeaderParam("typ", "JWT") + .setClaims(map) + .setIssuedAt(new Date()) + .setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate()) + .signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret()) + .compact(); + } + + /** + * token是否过期 + * + * @return true:过期 + */ + public boolean isTokenExpired(Date expiration) { + return expiration.before(new Date()); + } + + public static void main(String[] args) { + Map map=new HashMap<>(); + map.put("app","gov"); + map.put("client","wxmp"); + map.put("userId","100526ABC"); + String tokenStr=Jwts.builder() + .setHeaderParam("typ", "JWT") + .setClaims(map) + .setIssuedAt(new Date()) + .setExpiration(DateTime.now().plusSeconds(604800).toDate()) + .signWith(SignatureAlgorithm.HS512, "7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]") + .compact(); + System.out.println(tokenStr); + Claims claims= Jwts.parser() + .setSigningKey("7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]") + .parseClaimsJws(tokenStr) + .getBody(); + System.out.println("app="+ claims.get("app")); + System.out.println("client="+ claims.get("client")); + System.out.println("userId="+ claims.get("userId")); + } + +} diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 1a21a9a30e..e2fd786edf 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -49,6 +49,13 @@ org.springframework.boot spring-boot-starter-data-redis + + + org.redisson + redisson + 3.12.5 + + com.fasterxml.jackson.core jackson-databind diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/RedissonConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/RedissonConfig.java new file mode 100644 index 0000000000..8a96e5ccbd --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/RedissonConfig.java @@ -0,0 +1,56 @@ +package com.epmet.commons.tools.config; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.redisson.Redisson; +import org.redisson.api.RedissonClient; +import org.redisson.codec.JsonJacksonCodec; +import org.redisson.config.Config; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * redisson 配置类 + */ +@Slf4j +@Configuration +public class RedissonConfig { + + @Value("${spring.redis.host}") + private String host; + @Value("${spring.redis.port}") + private String port; + @Value("${spring.redis.password}") + private String password; + + + @Bean + public RedissonClient getRedisson() { + if (StringUtils.isBlank(host)) { + log.warn("getRedisson redis param is null,don't need to init redissonClient"); + return null; + } + + try { + Config config = new Config(); + config.setCodec(new JsonJacksonCodec()); + config.setThreads(NumConstant.FOUR); + config.setNettyThreads(NumConstant.FOUR); + //redis://ip:port + //redis的部署方式有单节点部署、主从方式部署、哨兵方式部署、集群方式部署 + config.useSingleServer().setAddress("redis://".concat(host).concat(StrConstant.COLON).concat(port)); + config.useSingleServer().setPassword(password); + config.useSingleServer().setConnectTimeout(NumConstant.ONE_THOUSAND * NumConstant.FIVE); + config.useSingleServer().setDatabase(NumConstant.TEN); + return Redisson.create(config); + } catch (Exception e) { + log.error("初始化redisson失败", e); + return null; + } + + } + +} \ No newline at end of file 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-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index e906535166..01af04ae04 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -31,13 +31,19 @@ public interface NumConstant { int FOURTEEN=14; int TWENTY = 20; int THIRTY = 30; + int THIRTY_ONE = 31; int FORTY = 40; + int FORTY_ONE = 41; int FIFTY = 50; + int FIFTY_ONE = 51; int SIXTY = 60; int ONE_HUNDRED = 100; + BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100); + BigDecimal ZERO_DECIMAL = new BigDecimal(0); int ONE_THOUSAND = 1000; int MAX = 99999999; int EIGHTY_EIGHT = 88; + int EIGHTY = 80; double ZERO_DOT_ZERO = 0.0; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java new file mode 100644 index 0000000000..89aed6547c --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.commons.tools.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 5:41 下午 + */ +@Data +public class TimeListResultDTO implements Serializable { + + private static final long serialVersionUID = 1482639109300981626L; + + private String dateId; + private String weekId; + private String monthId; + private String quarterId; + private String yearId; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java index 1dc0b571c5..e38a14a21f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java @@ -11,6 +11,8 @@ public enum CommonOperateTypeEnum { ADD("add", "添加"), EDIT("edit", "编辑"), DEL("del", "删除"), + DESC("DESC", "降序"), + ASC("ASC", "升序"), ; private String code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java index ed782790e8..d0df724665 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java @@ -11,21 +11,23 @@ import org.springframework.core.env.Environment; * @date 2020-07-03 11:14 **/ public enum EnvEnum { - LOCAL("local", "本地环境"), - DEV("dev", "开发环境"), - TEST("test", "体验环境"), - PROD("prod", "生产环境"), - UN_KNOWN("un_known", "未知"), + LOCAL("local", "本地环境","http://localhost:8080/api/"), + DEV("dev", "开发环境","http://192.168.1.130:8080/api/"), + TEST("test", "体验环境","https://epmet-dev.elinkservice.cn/api/"), + PROD("prod", "生产环境","https://epmet-cloud.elinkservice.cn/api/"), + UN_KNOWN("un_known", "未知","https://epmet-dev.elinkservice.cn/api/"), ; private String code; private String name; + private String url; - EnvEnum(String code, String name) { + EnvEnum(String code, String name, String url) { this.code = code; this.name = name; + this.url = url; } public static EnvEnum getEnum(String code) { @@ -59,4 +61,8 @@ public enum EnvEnum { public String getName() { return name; } + + public String getUrl(){ + return url; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index a61c25d8cf..e4832a1c8b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -107,9 +107,9 @@ public enum EpmetErrorCode { OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"), OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"), OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"), - OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"), - OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"), - OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"), + OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"), + OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"), + OPER_EXT_APP_SECRET_RESET_FAIL(8714, "秘钥更新失败"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java index 0e99c52316..f7ae3265d0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java @@ -8,8 +8,10 @@ package com.epmet.commons.tools.feign; +import feign.Logger; import feign.RequestInterceptor; import feign.RequestTemplate; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; @@ -18,6 +20,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import java.util.Enumeration; + /** * Feign调用,携带header * @@ -47,4 +50,9 @@ public class FeignConfig implements RequestInterceptor { } } + + @Bean + Logger.Level feignLoggerLevel() { + return Logger.Level.FULL;//控制台会输出debug日志 + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index ea8f100f6c..9de850cdfd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -313,7 +313,7 @@ public class RedisKeys { * @return */ public static String getIndexCodeWeightKey(String customerId) { - return rootPrefix.concat("stats:indexcal:indexcode:weight").concat(customerId); + return rootPrefix.concat("stats:indexcal:indexcode:weight").concat(StrConstant.COLON).concat(customerId); } /** @@ -330,9 +330,17 @@ public class RedisKeys { /** * 获取计算标记的key前缀 + * * @return */ public static String getCustomerStatsCalKeyPrefix() { return rootPrefix.concat("stats:calflag"); } + + /** + * 插入大屏指标数据分布式锁 key + */ + public static String getScreenIndexDataLockKey() { + return rootPrefix.concat("stats:indexcal:lock"); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 75174f4216..a7a768b095 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -10,6 +10,7 @@ package com.epmet.commons.tools.utils; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.TimeListResultDTO; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -18,7 +19,11 @@ import org.joda.time.format.DateTimeFormatter; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.DateTimeException; +import java.time.ZoneId; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * 日期处理工具类 @@ -593,4 +598,87 @@ public class DateUtils { } return StrConstant.EPMETY_STR; } + + /** + * @Description 根据dateId获取时间集合 + * @param dateId + * @author zxc + * @date 2020/9/22 9:06 上午 + */ + public static TimeListResultDTO getTimeList(String dateId){ + TimeListResultDTO result = new TimeListResultDTO(); + result.setDateId(dateId); + String monthId = dateId.substring(NumConstant.ZERO, NumConstant.SIX); + result.setMonthId(monthId); + result.setQuarterId(getQuarterId(monthId)); + result.setYearId(getYearId(monthId)); + SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); + try { + Date date = formatter.parse(dateId); + int weekOfYear = getWeekOfYear(date); + String weekId = dateId.substring(NumConstant.ZERO,NumConstant.FOUR).concat("W").concat(String.valueOf(weekOfYear)); + result.setWeekId(weekId); + } catch (ParseException e) { + e.printStackTrace(); + } + return result; + } + + /** + * @Description 根据monthId【yyyyMM】获取上一个月份ID + * @param monthId + * @author zxc + * @date 2020/9/21 2:43 下午 + */ + public static String minusMonthId(String monthId){ + String minusMonthId = null; + SimpleDateFormat sft = new SimpleDateFormat("yyyyMM"); + try { + Date parse = sft.parse(monthId); + java.time.LocalDate birth = parse.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + java.time.LocalDate localDate = birth.minusMonths(NumConstant.ONE); + minusMonthId = localDate.toString().substring(NumConstant.ZERO, NumConstant.FOUR).concat(localDate.toString().substring(NumConstant.FIVE, NumConstant.SEVEN)); + } catch (ParseException e) { + e.printStackTrace(); + } + return minusMonthId; + } + + /** + * @Description 根据传入的时间维度判断格式,日、周、月、季、年 + * @param dimension + * @return + * @author wangc + * @date 2020.09.24 10:11 + **/ + public static String identifyTimeDimension(String dimension){ + //yyyyMMdd DATE_PATTERN_YYYYMMDD + //yyyyMM DATE_PATTERN_YYYYMM + //yyyy DATE_PATTERN_YYYY + //yyyyWcc + //yyyyQc + if(dimension.length() == NumConstant.EIGHT){ + + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMMDD); + try{ df.parse(dimension); }catch (ParseException e){ return null; } + return "date"; + + }else if(dimension.length() == NumConstant.FOUR){ + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYY); + try{df.parse(dimension);}catch (ParseException e){return null;} + return "year"; + }else if(dimension.length() == NumConstant.SEVEN){ + if(dimension.contains("W")){ + return "week"; + }else return null; + }else if(dimension.length() == NumConstant.SIX){ + if(dimension.contains("Q")){ + return "quarter"; + }else{ + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMM); + try{df.parse(dimension);}catch (ParseException e){return null;} + return "month"; + } + }else return null; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 0c6c4cb9ae..d69f319d7b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -159,6 +159,29 @@ public class HttpClientManager { } + public Result sendPostByJSONAndHeader(String url, String jsonStrParam,Map headerMap) { + + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + httppost.addHeader("Content-Type", "application/json; charset=utf-8"); + if (null != headerMap){ + headerMap.forEach((k,v) -> { + httppost.addHeader(k,v); + }); + } + if (StringUtils.isNotEmpty(jsonStrParam)) { + StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + httppost.setEntity(se); + } + return execute(httppost, false); + } catch (Exception e) { + log.error("send exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + } + /** * 上传临时素材 * @author zhaoqifeng diff --git a/epmet-gateway/deploy/docker-compose-prod.yml b/epmet-gateway/deploy/docker-compose-prod.yml index 412df3aa53..ed023d3b8c 100644 --- a/epmet-gateway/deploy/docker-compose-prod.yml +++ b/epmet-gateway/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.33 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.39 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index cef4109081..b8157a9836 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.35 + 0.3.39 com.epmet epmet-cloud @@ -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..baf5151766 --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java @@ -0,0 +1,103 @@ +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 com.epmet.filter.CpProperty; +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.util.AntPathMatcher; +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; + + private final AntPathMatcher antPathMatcher = new AntPathMatcher(); + + @Autowired + private CpProperty cpProperty; + + @Override + public Mono auth(ServerWebExchange exchange, GatewayFilterChain chain) { + ServerHttpRequest request = exchange.getRequest(); + + // 只有在外部应用urls中的url才会允许外部应用访问,否则不允许访问 + String requestUri = request.getPath().pathWithinApplication().value(); + + boolean inPaths = false; + for (String url : cpProperty.getExternalOpenUrls()) { + if (antPathMatcher.match(url, requestUri)) { + inPaths = true; + } + } + + if (!inPaths) { + throw new RenException(EpmetErrorCode.ERR401.getCode(), "所请求的url并未对外部应用开放"); + } + + HttpHeaders headers = request.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(EpmetErrorCode.ERR401.getCode(), "请求头中的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..c87f9dbe6b --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -0,0 +1,198 @@ +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.filter.CpProperty; +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.util.AntPathMatcher; +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; + + private final AntPathMatcher antPathMatcher = new AntPathMatcher(); + + @Autowired + private CpProperty cpProperty; + + @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; + } + } + } + + if (needAuth(requestUri)) { + // 校验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); + } + + /** + * 是否需要认证 + * @param requestUri + * @return + */ + private boolean needAuth(String requestUri) { + for (String url : cpProperty.getInternalAuthUrls()) { + if (antPathMatcher.match(url, requestUri)) { + return true; + } + } + return false; + } + + /** + * 从请求中获取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/constant/AuthTypeConstant.java b/epmet-gateway/src/main/java/com/epmet/constant/AuthTypeConstant.java new file mode 100644 index 0000000000..d2123966f6 --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/constant/AuthTypeConstant.java @@ -0,0 +1,8 @@ +package com.epmet.constant; + +public class AuthTypeConstant { + 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"; +} diff --git a/epmet-gateway/src/main/java/com/epmet/constant/TokenHeaderKeyConstant.java b/epmet-gateway/src/main/java/com/epmet/constant/TokenHeaderKeyConstant.java new file mode 100644 index 0000000000..e7ad2adecd --- /dev/null +++ b/epmet-gateway/src/main/java/com/epmet/constant/TokenHeaderKeyConstant.java @@ -0,0 +1,6 @@ +package com.epmet.constant; + +public class TokenHeaderKeyConstant { + public static final String ACCESS_TOKEN_HEADER_KEY = "AccessToken"; + public static final String AUTHORIZATION_TOKEN_HEADER_KEY = "Authorization"; +} 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..971f4938b1 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,15 @@ 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 com.epmet.constant.AuthTypeConstant; +import com.epmet.constant.TokenHeaderKeyConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,16 +39,15 @@ 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(); - @Autowired - private JwtTokenUtils jwtTokenUtils; - @Autowired - private CpUserDetailRedis cpUserDetailRedis; + private InternalAuthProcessor internalAuthProcessor; + @Autowired + private ExternalAuthProcessor externalAuthProcessor; @Override public List shortcutFieldOrder() { @@ -67,82 +65,24 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(e.getCode(),e.getMsg())); - } - }else{ - baseTokenDto = null; - } + //添加流水号 + exchange.getRequest().mutate().header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()}); - String customerId = ""; + ServerHttpRequest request = exchange.getRequest(); - 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; - } - } - } + String authType = getAuthType(request); - //需要认证 - 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); + try { + switch (authType) { + case AuthTypeConstant.AUTH_TYPE_EXTERNAL: + return externalAuthProcessor.auth(exchange, chain); + case AuthTypeConstant.AUTH_TYPE_INTERNAL: + return internalAuthProcessor.auth(exchange, chain); } - ServerHttpRequest build = exchange.getRequest().mutate().build(); - return chain.filter(exchange.mutate().request(build).build()); + } catch (RenException e) { + return response(exchange, new Result<>().error(e.getCode(), e.getMessage())); + } catch (Exception e) { + return response(exchange, new Result<>().error(e.getMessage())); } return chain.filter(exchange); @@ -150,85 +90,54 @@ 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 +159,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..4b801182fa 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 externalOpenUrls; /** * 不处理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..d78c96140e 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -61,6 +61,7 @@ spring: - Path=${server.servlet.context-path}/message/** filters: - StripPrefix=1 + - CpAuth=true #工作流服务 - id: epmet-activiti-server uri: @gateway.routes.epmet-activiti-server.uri@ @@ -415,8 +416,8 @@ ribbon: ConnectTimeout: 300000 epmet: - # 党群e事通(校验是否登录) - urls: + # 内部认证,需要Authorization请求头 + internalAuthUrls: - /oper/customize/** - /oper/crm/** - /epmetuser/** @@ -438,11 +439,11 @@ epmet: - /resi/home/** - /data/report/** - # url认证白名单,先判断白名单,在白名单中的url直接放行,不再判断上述需要认证的名单 - urlWhiteList: - - /data/report/test/test - - /data/report/screen/** - - /data/report/kcscreen/** + # 外部应用认证,使用AccessToken等头进行认证 + externalOpenUrls: + - /data/report/** + - /data/stats/** + - /epmet/ext/** - /epmetuser/customerstaff/customerlist swaggerUrls: diff --git a/epmet-module/data-report/data-report-client/pom.xml b/epmet-module/data-report/data-report-client/pom.xml index 5bba5f2cb4..8700a85f3b 100644 --- a/epmet-module/data-report/data-report-client/pom.xml +++ b/epmet-module/data-report/data-report-client/pom.xml @@ -17,6 +17,11 @@ epmet-commons-tools 2.0.0 + + com.epmet + gov-project-client + 2.0.0 + diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java index 96005bfcc3..5ea0aa7cbf 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java @@ -16,6 +16,8 @@ public interface ScreenConstant { String COMMA = ","; + String COLON = ":"; + String MONTH_ID = "month"; String YEAR_ID = "year"; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java new file mode 100644 index 0000000000..738f8c88e1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 能力指数--接口入参 + * @Author sun + */ +@Data +public class AblityIndexFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + public interface AddUserInternalGroup {} + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织Id + */ + @NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String customerId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 查询月份的前12个月对应的monthId + */ + private String startMonthId; + /** + * 月份Id(格式:202009) + */ + @NotBlank(message = "月份ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String monthId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java new file mode 100644 index 0000000000..01c49abc54 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 按月查询各项指标数据--接口入参 + * @Author sun + */ +@Data +public class AblityListFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 客户Id + */ + @NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) + private String customerId; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} + /** + * 月份Id(格式:202009) + */ + @NotBlank(message = "月份ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) + private String monthId; + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + @NotBlank(message = "类型不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) + private String indexCode; + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java new file mode 100644 index 0000000000..a6e5ecb9b3 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java @@ -0,0 +1,31 @@ +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 AdvancedBranchRankFormDTO implements Serializable { + private static final long serialVersionUID = -8674763412362557239L; + /** + * 机关Id + * */ + @NotBlank(message = "机关Id不能为空" , groups = AdvancedBranchRankFormDTO.AddUserInternalGroup.class) + private String agencyId; + /** + * 显示多少条 + * */ + @Min(value = 1, message = "查询条数必须大于0", groups = {AdvancedBranchRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + /** + * 月份Id + * */ + private String monthId; + public interface AddUserInternalGroup {} +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenFormDTO.java new file mode 100644 index 0000000000..4d1c87981d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:47 + */ +@Data +public class AnScreenFormDTO implements Serializable { + private static final long serialVersionUID = 5402826635847080766L; + + public interface AnScreenGroup extends CustomerClientShowGroup {} + + /** + * 组织ID + */ + @NotBlank(message = "机关Id不能为空", groups = AnScreenGroup.class) + + private String agencyId; + /** + * 月份ID + */ + @NotBlank(message = "月份Id不能为空", groups = AnScreenGroup.class) + private String monthId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenRankFormDTO.java new file mode 100644 index 0000000000..2b787582dd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenRankFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:47 + */ +@Data +public class AnScreenRankFormDTO implements Serializable { + private static final long serialVersionUID = -766779327034367216L; + + public interface AnScreenRankGroup extends CustomerClientShowGroup {} + + /** + * 组织ID + */ + @NotBlank(message = "机关Id不能为空", groups = AnScreenRankFormDTO.AnScreenRankGroup.class) + private String agencyId; + @NotNull(message = "top值不能为空", groups = AnScreenRankFormDTO.AnScreenRankGroup.class) + private Integer topNum; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java new file mode 100644 index 0000000000..88d0215be4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:48 + */ +@Data +public class AnScreenTrendFormDTO implements Serializable { + private static final long serialVersionUID = -766779327034367216L; + + public interface AnScreenTrendGroup extends CustomerClientShowGroup {} + + /** + * 组织ID + */ + @NotBlank(message = "机关Id不能为空", groups = AnScreenTrendFormDTO.AnScreenTrendGroup.class) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java new file mode 100644 index 0000000000..695255bccc --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/22 + */ +@Data +public class CompartmentByBizTypeFormDTO implements Serializable { + + private static final long serialVersionUID = -3354778434424878413L; + + public interface CompartmentByBizType extends CustomerClientShowGroup {} + + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空",groups = {CompartmentByBizType.class}) + private String agencyId; + + /** + * 业务类型 + */ + @NotBlank(message = "bizType不能为空", groups = {CompartmentByBizType.class}) + private String bizType; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GridIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GridIndexRankFormDTO.java new file mode 100644 index 0000000000..73e2af2337 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GridIndexRankFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 9:54 上午 + */ +@Data +public class GridIndexRankFormDTO implements Serializable { + + + private static final long serialVersionUID = 7865119038417362515L; + /** + * 机关ID + */ + private String agencyId; + + /** + * 默认查询前几名 + */ + @NotNull(message = "默认查询名次不能为空") + private Integer topNum; + /** + * 客户I + */ + @NotBlank(message = "客户Id不能为空") + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + +} 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..e75abb9f63 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java @@ -0,0 +1,36 @@ +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/form/MonthAblityListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java new file mode 100644 index 0000000000..61dcc6ec43 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 按月查询各项指标最近12个月数据--接口入参 + * @Author sun + */ +@Data +public class MonthAblityListFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 客户Id + */ + @NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) + private String customerId; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} + /** + * 月份Id(格式:202009) + */ + @NotBlank(message = "月份ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) + private String monthId; + /** + * 月份Id(格式:202009) + */ + @NotBlank(message = "类型key不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) + private String key; + /** + * 查询月份的前12个月对应的monthId + */ + private String startMonthId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java new file mode 100644 index 0000000000..31dd11e3dd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 能力指数--接口入参 + * @Author sun + */ +@Data +public class MonthScoreListFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + public interface AddUserInternalGroup {} + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织Id + */ + @NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) + private String customerId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 月份Id(格式:202009) + */ + @NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) + private String monthId; + /** + * 查询月份的前12个月对应的monthId + */ + private String startMonthId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java new file mode 100644 index 0000000000..da2d919c2f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java @@ -0,0 +1,35 @@ +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 PartIndexScroeRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java new file mode 100644 index 0000000000..af8291beaa --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 同级对比各项数据查询--接口入参 + * @Author sun + */ +@Data +public class PeerComparisonFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 客户Id + */ + @NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) + private String customerId; + /** + * 月份Id(格式:202009) + */ + //@NotBlank(message = "月份ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) + private String monthId; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + @NotBlank(message = "数据类型不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) + private String indexCode; + /** + * 查询条数 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class }) + private Integer pageSize; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java new file mode 100644 index 0000000000..42a67c936f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 是否根组织--接口入参 + * @Author sun + */ +@Data +public class RootAgencyFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + public interface AddUserInternalGroup {} + + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class}) + private String agencyId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java new file mode 100644 index 0000000000..c07680d6bb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 按月份查询各项能力分数--接口入参 + * @Author sun + */ +@Data +public class ScoreListFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + public interface AddUserInternalGroup {} + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织Id + */ + @NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) + private String customerId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 月份Id(格式:202009) + */ + @NotBlank(message = "月份ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) + private String monthId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java similarity index 59% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java index 683aebbe7c..e973fefa50 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java @@ -8,20 +8,22 @@ import java.io.Serializable; /** * 5、下级部门指数排行(安宁数据段用) 入参 + * * @Author zhangyong * @DateTime 2020/09/08 9:54 */ @Data -public class AnNingSubAgencyIndexRankFormDTO implements Serializable { +public class SubAgencyIndexRankYMFormDTO implements Serializable { private static final long serialVersionUID = -2920561669035794486L; - public interface SubAgencyIndexRank{} + public interface SubAgencyIndexRank { + } /** * 机关ID */ - @NotBlank(message = "组织id不能为空",groups = {SubAgencyIndexRank.class}) + @NotBlank(message = "组织id不能为空", groups = {SubAgencyIndexRank.class}) private String agencyId; /** @@ -33,12 +35,22 @@ public class AnNingSubAgencyIndexRankFormDTO implements Serializable { /** * asc 正序, desc 降序 */ - @NotNull(message = "排序方式不能为空",groups = {SubAgencyIndexRank.class}) + @NotNull(message = "排序方式不能为空", groups = {SubAgencyIndexRank.class}) private String sort; /** * 年度:year 月度:month */ - @NotNull(message = "年度、月度不能为空",groups = {SubAgencyIndexRank.class}) + @NotNull(message = "年度、月度不能为空", groups = {SubAgencyIndexRank.class}) private String type; + + /** + * 月份Id + */ + private String monthId; + + /** + * 组织类型 组织:agency 网格:grid + */ + private String orgType; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubSingleIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubSingleIndexRankFormDTO.java new file mode 100644 index 0000000000..268a66ac55 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubSingleIndexRankFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * desc:下级组织单项排行分数 form + * + * @DateTime 2020/8/20 9:54 上午 + */ +@Data +public class SubSingleIndexRankFormDTO implements Serializable { + + private static final long serialVersionUID = -2920561669035794486L; + @NotBlank(message = "客户ID不能为空") + private String customerId; + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空") + private String agencyId; + @NotBlank(message = "指标code不能为空") + private String indexCode; + + /** + * 默认查询前几名 + */ + private Integer topNum; + + private String monthId; + private String orgType; + private String sort; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TreeByTypeFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TreeByTypeFormDTO.java new file mode 100644 index 0000000000..aa0636363b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TreeByTypeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/22 10:52 上午 + */ +@Data +public class TreeByTypeFormDTO implements Serializable { + + private static final long serialVersionUID = -1438758394814978472L; + + public interface TreeByType extends CustomerClientShowGroup{} + + @NotBlank(message = "bizType不能为空",groups = TreeByType.class) + private String bizType; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java new file mode 100644 index 0000000000..cc1ad2bd36 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java @@ -0,0 +1,35 @@ +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 UserPointRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {UserPointRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {UserPointRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {UserPointRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java new file mode 100644 index 0000000000..2d14b4e42c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 能力指数--接口返参 + * @Author sun + */ +@Data +public class AblityIndexResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli + */ + private String indexCode; + /** + * 每项能力最近12月各项分数对象 + */ + private List scoreList; + + @Data + public static class ScoreListResultDTO implements Serializable { + /** + * 能力总分 + */ + private Double indexTotal; + /** + * 横坐标(202009) + */ + private String monthId; + /** + * 能力类型 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + @JsonIgnore + private String indexCode; + + } + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java new file mode 100644 index 0000000000..d6cc4cd785 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 按月查询各项指标数据--接口返参 + * @Author sun + */ +@Data +public class AblityListResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 各项指标名称 + */ + private String name; + /** + * 指标对应值(数值或百分比) + */ + private String value = "0"; + /** + * 各项指标对应key值(index_dict字典表) + */ + private String key; + /** + * 指标值类型 无:none;整数:integer;小数: decimal;百分比:percent + */ + private String showType; + + /** + * 指标对应的权重 + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java index 753cf368dd..3a91fdfbf7 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java @@ -37,4 +37,9 @@ public class AgencyDistributionResultDTO implements Serializable { * 组织:agency; 网格:grid ; 部门:dept */ private String type; + + public AgencyDistributionResultDTO() { + this.subAreaMarks = ""; + this.subCenterMark = ""; + } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java index f93b98b16d..c4653c9a71 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java @@ -42,4 +42,9 @@ public class AnNingSubAgencyIndexRankResultDTO implements Serializable { * 组织id或者网格id */ private String orgId = ""; + + /** + * 组织类型 + */ + private String orgType = ""; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java new file mode 100644 index 0000000000..94cfb8fc51 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/10/26 3:36 下午 + */ +@Data +@AllArgsConstructor +public class DepartmentNameListResultDTO implements Serializable { + + private static final long serialVersionUID = -801407836277197080L; + + /** + * 部门名 + */ + private String departmentName; + /** + * 工作人员 + */ + private List staffList; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java new file mode 100644 index 0000000000..ac2072d44c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 09、基层治理-治理排行 + * @date 2020/10/9 10:54 + */ +@NoArgsConstructor +@Data +public class GrassRootsGovernRankResultDTO implements Serializable { + + private static final long serialVersionUID = 5175488557393182160L; + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + /** + * 响应度 + */ + private String projectResponseRatio; + /** + * 满意度 + */ + private String projectSatisRatio; + /** + * 办结率 当前界面在社区时才显示 + */ + private String closedProjectRatio; + /** + * 组织名称 + */ + private String orgName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java new file mode 100644 index 0000000000..05b2e6c382 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 07、基层治理-总数 + * @date 2020/10/9 10:36 + */ +@NoArgsConstructor +@Data +public class GrassRootsGovernResultDTO implements Serializable { + + private static final long serialVersionUID = 3455494963816549169L; + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + /** + * 项目响应度 + */ + private String projectResponseRatio; + /** + * 项目满意率 + */ + private String projectSatisRatio; + /** + * 办结率(当前界面是社区时显示) + */ + private String closedProjectRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendDTO.java new file mode 100644 index 0000000000..4c27d422ea --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendDTO.java @@ -0,0 +1,42 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 15:08 + */ +@NoArgsConstructor +@Data +public class GrassRootsGovernTrendDTO implements Serializable { + private static final long serialVersionUID = 4977117178308139861L; + /** + * 月份 + */ + private String monthId; + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + /** + * 项目响应度 + */ + private BigDecimal projectResponseRatio; + /** + * 项目满意率 + */ + private BigDecimal projectSatisRatio; + /** + * 办结率(当前界面是社区时显示) + */ + private BigDecimal closedProjectRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendResultDTO.java new file mode 100644 index 0000000000..1a1daf5cb0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription 08、基层治理-指标月度趋势 + * @date 2020/10/9 10:48 + */ +@NoArgsConstructor +@Data +public class GrassRootsGovernTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 5640652259031475809L; + /** + * 横坐标集合 + */ + private List xAxis; + /** + * 参与项目数 + */ + private List partiProjectTotalList; + /** + * 办结项目数 + */ + private List closedProjectTotalList; + /** + * 项目响应度 + */ + private List projectResponseRatioList; + /** + * 项目满意率 + */ + private List projectSatisRatioList; + /** + * 办结率(当前界面是社区时显示) + */ + private List closedProjectRatioList; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java new file mode 100644 index 0000000000..61b7ab9b74 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 06、基层组织-组织排行榜单 + * @date 2020/10/9 10:32 + */ +@NoArgsConstructor +@Data +public class GrassRootsOrgRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3573854743057339033L; + /** + * 党群数 + */ + private Integer groupTotal; + /** + * 议题数 + */ + private Integer issueTotal; + /** + * 项目数 + */ + private Integer projectTotal; + /** + * 组织名称 + */ + private String orgName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java new file mode 100644 index 0000000000..d01bf5837e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 04、基层组织-党群数、议题数、项目数 + * @date 2020/10/9 10:22 + */ +@NoArgsConstructor +@Data +public class GrassRootsOrgResultDTO implements Serializable { + + private static final long serialVersionUID = 6623022965863266247L; + /** + * 党群数 + */ + private Integer groupTotal; + /** + * 议题数 + */ + private Integer issueTotal; + /** + * 项目数 + */ + private Integer projectTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendDTO.java new file mode 100644 index 0000000000..b8d5e64963 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendDTO.java @@ -0,0 +1,33 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 15:10 + */ +@NoArgsConstructor +@Data +public class GrassRootsOrgTrendDTO implements Serializable { + private static final long serialVersionUID = 6172847581584903056L; + /** + * 月份 + */ + private String monthId; + /** + * 党群数 + */ + private Integer groupTotal; + /** + * 议题数 + */ + private Integer issueTotal; + /** + * 项目数 + */ + private Integer projectTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendResultDTO.java new file mode 100644 index 0000000000..0116ca6309 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription 05、基层组织-指标月度趋势 + * @date 2020/10/9 10:25 + */ +@NoArgsConstructor +@Data +public class GrassRootsOrgTrendResultDTO implements Serializable { + private static final long serialVersionUID = -6911028881641915610L; + /** + * 横坐标集合 + */ + private List xAxis; + /** + * 党群数 + */ + private List groupTotalList; + /** + * 议题数 + */ + private List issueTotalList; + /** + * 项目数 + */ + private List projectTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java index d1068120bf..e4677c0e5d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java @@ -22,9 +22,9 @@ public class GroupTopicShiftIssueRatioRankResultDTO implements Serializable { */ private String groupName = ""; /** - * 话题数量 + * 转为议题的话题数 */ - private Integer topicCount = 0; + private Integer shifitIssueCount = 0; /** * 群主名称 */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexAdvanceBranchRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexAdvanceBranchRankResultDTO.java new file mode 100644 index 0000000000..cbe72572b6 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexAdvanceBranchRankResultDTO.java @@ -0,0 +1,53 @@ +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 IndexAdvanceBranchRankResultDTO implements Serializable { + private static final long serialVersionUID = 330099297596334388L; + + /** + * 名称 XXXX社区党委 + */ + private String name; + /** + * 指标得分 + */ + @JsonIgnore + private String totalScore; + private BigDecimal scroe; + /** + * 党员数 + */ + private Integer partyMemberNum; + + /** + * 议题数 + */ + private Integer issueNum; + + /** + * 项目数 + */ + private Integer projectNum; + + /** + * 满意度 90.64% 返回字符串,前端直接显示 + */ + private String satisfactionRatio; + + /** + * 结案率 94.3% 返回字符串,前端直接显示 + */ + private String closedProjectRatio; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java new file mode 100644 index 0000000000..196837f220 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 评价指标字典表数据--接口返参 + * @Author sun + */ +@Data +public class IndexDictResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 指标名 + */ + private String indexName; + /** + * 指标code + */ + private String indexCode; + /** + * 指标值类型 百分比:percent + */ + private String valueType; + +} 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-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthAblityListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthAblityListResultDTO.java new file mode 100644 index 0000000000..86e9372e78 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthAblityListResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 按月查询各项指标最近12个月数据--接口返参 + * @Author sun + */ +@Data +public class MonthAblityListResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 横坐标(202009) + */ + private String monthId; + /** + * 指标对应值(数值或百分比) + */ + private String ablity; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthScoreListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthScoreListResultDTO.java new file mode 100644 index 0000000000..0acdbf9c73 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthScoreListResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 按月份查询各项能力最近12个月得分--接口返参 + * @Author sun + */ +@Data +public class MonthScoreListResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli + */ + private String indexCode; + /** + * 每项能力最近12月各项分数对象 + */ + private List scoreList; + + @Data + public static class ScoreListResultDTO implements Serializable { + /** + * 能力总分 + */ + private Double indexTotal; + /** + * 本级能力分 + */ + private Double agencyScore; + /** + * 下级能力分 + */ + private Double subAgencyScore; + /** + * 横坐标(202009) + */ + private String monthId; + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + @JsonIgnore + private String indexCode; + + } + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java new file mode 100644 index 0000000000..16ab06acb0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员(指标得分)排行--接口返参 + * @Author sun + */ +@Data +public class PartIndexScroeRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 党员指标得分 + */ + private Double indexScore; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java new file mode 100644 index 0000000000..825571dbd6 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 同级对比(下级单项指数排行)各项数据查询--接口返参 + * + * @Author sun + */ +@Data +public class PeerComparisonResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 组织或网格Id + */ + private String orgId; + /** + * 组织或网格名称 + */ + private String orgName; + /** + * 能力分值(保留一位小数) + */ + private Double score; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmRankResultDTO.java new file mode 100644 index 0000000000..c813fdf694 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmRankResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 03、基层党员-党员排行榜单 + * @date 2020/10/9 10:12 + */ +@NoArgsConstructor +@Data +public class PmRankResultDTO implements Serializable { + + private static final long serialVersionUID = 2939125411579816231L; + /** + * 用户ID + */ + private String userId; + /** + * 姓名 + */ + private String userName; + /** + * 所属支部名称 + */ + private String branchName; + /** + * 所属社区名称 + */ + private String communityName; + /** + * 群成员数 + */ + private Integer groupMemberTotal; + /** + * 话题数 + */ + private Integer topicTotal; + /** + * 参与人次 + */ + private Integer partiUserTotal; + /** + * 议题数 + */ + private Integer issueTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java new file mode 100644 index 0000000000..aa5dcb67b5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 01、基层党员-各类总数 + * @date 2020/10/9 10:04 + */ +@NoArgsConstructor +@Data +public class PmTotalResultDTO implements Serializable { + + private static final long serialVersionUID = 4317234373580733128L; + /** + * 群成员数 + */ + private Integer groupMemberTotal; + /** + * 话题数 + */ + private Integer topicTotal; + /** + * 话题参与人次 + */ + private Integer topicPartiUserTotal; + /** + * 议题数 + */ + private Integer issueTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendDTO.java new file mode 100644 index 0000000000..6ddfd0a5a9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 15:05 + */ +@Data +public class PmTotalTrendDTO implements Serializable { + private static final long serialVersionUID = -6773118646805355171L; + /** + * 月份 + */ + private String monthId; + /** + * 群成员数 + */ + private Integer groupMemberTotal; + /** + * 话题数 + */ + private Integer topicTotal; + /** + * 话题参与人次 + */ + private Integer topicPartiUserTotal; + /** + * 议题数 + */ + private Integer issueTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendResultDTO.java new file mode 100644 index 0000000000..7676688788 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription 02、基层党员-指标月度趋势 + * @date 2020/10/9 10:06 + */ +@NoArgsConstructor +@Data +public class PmTotalTrendResultDTO implements Serializable { + + private static final long serialVersionUID = -5705077703115309896L; + /** + * 横坐标集合 + */ + private List xAxis; + /** + * 群成员数 + */ + private List groupMemberTotalList; + /** + * 话题数 + */ + private List topicTotalList; + /** + * 话题参与人次 + */ + private List topicPartiUserTotalList; + /** + * 议题数 + */ + private List issueTotalList; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java new file mode 100644 index 0000000000..9e6b2d509e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 10、项目 + * @date 2020/10/9 10:57 + */ +@NoArgsConstructor +@Data +public class ProjectProfileResultDTO implements Serializable { + + private static final long serialVersionUID = -6525050844558886157L; + /** + * 组织id + */ + private String orgId; + /** + * 项目数量 + */ + private Integer projectTotal; + /** + * 级别 + */ + private String level; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java index c5744d0cdd..e95933e1c1 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * @Description 3、公众参与概况返参DTO @@ -24,7 +25,7 @@ public class PublicPartiProfileResultDTO implements Serializable { * */ private String monthTrend = ""; - private Integer averageIssue = NumConstant.ZERO; + private BigDecimal averageIssue = new BigDecimal(NumConstant.ZERO); /** * 较上月百分比 @@ -33,14 +34,17 @@ public class PublicPartiProfileResultDTO implements Serializable { /** * 较上月趋势:incr上升,decr下降 - * */ + */ private String issueCompareLatestTrend = ""; /** * 平均参与度 - * */ - private Integer averageJoin = NumConstant.ZERO; + */ + private BigDecimal averageJoin = new BigDecimal(NumConstant.ZERO); + /** + * 较上月百分比 + */ private String joinCompareLatestMonth = ""; private String joinCompareLatestTrend = ""; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/RootAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/RootAgencyResultDTO.java new file mode 100644 index 0000000000..910e56eaa3 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/RootAgencyResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 是否根组织--接口返参 + * @Author sun + */ +@Data +public class RootAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 是否根组织(是:true 否:false) + */ + private Boolean isRoot = true; + + /** + * 数据更新至(上月月末时间) + */ + private String date; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScoreListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScoreListResultDTO.java new file mode 100644 index 0000000000..9672f58bfe --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScoreListResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 按月份查询各项能力分数--接口返参 + * @Author sun + */ +@Data +public class ScoreListResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + private String indexCode; + /** + * 总分(保留一位小数) + */ + private Double indexTotal; + /** + * 本级分数(保留一位小数) + */ + private Double agencyScore; + /** + * 下级分数(保留一位小数) + */ + private Double subAgencyScore; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java index a64f02a279..c72c561c07 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java @@ -24,7 +24,7 @@ public class UserJoinIndicatorGrowthRateResultDTO implements Serializable { * */ private String monthTrend; - private Integer averageIssue; + private BigDecimal averageIssue; /** * 较上月百分比 @@ -38,8 +38,8 @@ public class UserJoinIndicatorGrowthRateResultDTO implements Serializable { /** * 平均参与度 - * */ - private Integer averageJoin; + */ + private BigDecimal averageJoin; private BigDecimal joinCompareLatestMonth; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java new file mode 100644 index 0000000000..d2909faffd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 热心市民积分排行列表--接口返参 + * @Author sun + */ +@Data +public class UserPointRankListResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 用户积分 + */ + private Integer pointTotal; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java index 27d195e832..7b07db5c72 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -20,4 +20,6 @@ public interface ProjectConstant { */ String TYPE_EXCEPTION = "必要参数为空或参数格式错误"; + String PROCESS_FAILURE = "查询项目进展失败......"; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java new file mode 100644 index 0000000000..df2f60b2f2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java @@ -0,0 +1,61 @@ +package com.epmet.project.dto.result; + +import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/10/23 10:13 上午 + */ +@Data +public class ProjectDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 2450826789942547426L; + + /** 【事件 = 项目】 + * 事件标题 + */ + private String eventTitle; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件来源 + */ + private String eventSource; + + /** + * 事件图片集合 + */ + private List imgUrlList; + + /** + * 项目进展 + */ + private List processList; + + /** + * 当前跟进部门 + */ + private List departmentNameList; + /** + * 当前跟进部门 + */ + private List departmentList; + + public ProjectDetailResultDTO() { + this.eventTitle = ""; + this.eventContent = ""; + this.eventSource = ""; + this.imgUrlList = new ArrayList<>(); + this.processList = new ArrayList<>(); + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectProcessResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectProcessResultDTO.java new file mode 100644 index 0000000000..8a0d6e82ac --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectProcessResultDTO.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 项目跟踪-项目处理进展列表-接口返参 + * + * @author sun + */ +@Data +public class ProjectProcessResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 项目Id + */ + private String projectId = ""; + + /** + * 项目处理进展Id + */ + private String processId = ""; + + /** + * 处理进展名称 + */ + private String processName = ""; + + /** + * 处理进展时间 + */ + private Long processTime; + + /** + * 处理进展时间 字符串 + */ + //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + //private String processTimeStr; + + /** + * 处理部门 + */ + private String departmentName = ""; + + /** + * 公开答复 + */ + private String publicReply = ""; + + /** + * 内部备注 + */ + private String internalRemark = ""; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml index 977c852354..d382dfd284 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.37 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.44 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 6dd6fefbcb..4992a47231 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.37 + 0.3.44 data-report-server @@ -29,6 +29,11 @@ epmet-user-client 2.0.0 + + com.epmet + common-service-client + 2.0.0 + org.springframework.boot spring-boot-starter-web @@ -62,11 +67,11 @@ 0.3.1 - + com.epmet diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java new file mode 100644 index 0000000000..d400f023bb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java @@ -0,0 +1,66 @@ +package com.epmet.datareport.constant; + +/** + * @author sun + * @dscription 数据 + */ +public interface FactConstant { + /** + * 组织类型 + */ + String AGENCY = "agency"; + /** + * 网格类型 + */ + String GRID = "grid"; + /** + * 能力指标 + */ + String NLZB = "nenglizhibiao"; + /** + * 党建能力 + */ + String DJNL = "dangjiannengli"; + /** + * 治理能力 + */ + String ZLNL = "zhilinengli"; + /** + * 服务能力 + */ + String FWNL = "fuwunengli"; + /** + * 全区相关 + */ + String QUAN_QU_XIANG_GUAN = "quanquxiangguan"; + /** + * 街道相关 + */ + String JIE_DAO_XIANG_GUAN = "jiedaoxiangguan"; + /** + * 社区相关 + */ + String SHE_QU_XIANG_GUAN = "shequxiangguan"; + /** + * 网格相关 + */ + String WANG_GE_XIANG_GUAN = "wanggexiangguan"; + /** + * 评价指标类型-无 + */ + String NONE = "none"; + /** + * 评价指标类型-整数 + */ + String INTEGER = "integer"; + /** + * 评价指标类型-小数 + */ + String DECIMAL = "decimal"; + /** + * 评价指标类型-百分比 + */ + String PERCENT = "percent"; + + String URL = "https://epmet-dev.elinkservice.cn/api/"; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java new file mode 100644 index 0000000000..e8b373f1b1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java @@ -0,0 +1,37 @@ +package com.epmet.datareport.controller.backdoor; + +import com.epmet.datareport.service.backdoor.BackDoorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Author zxc + * @DateTime 2020/10/21 5:17 下午 + */ +@RestController +@RequestMapping("backdoor") +public class BackDoorController { + + @Autowired + private BackDoorService backDoorService; + + /** + * desc: 重定向到target 方法,适用于外部鉴权接口的查询 比如大屏的查询接口 + * + * @param dataType + * @param appId + * @param target + * @param targetParam + * @return java.lang.String + * @author LiuJanJun + * @date 2020/10/23 1:44 下午 + */ + @PostMapping("redirect/external") + public Object backDoor(@RequestHeader(value = "Data-Type", defaultValue = "real", required = false) String dataType, + @RequestHeader(value = "env", defaultValue = "test", required = false) String env, + @RequestHeader("AppId") String appId, @RequestHeader("target") String target, + @RequestBody(required = false) Object targetParam) { + return backDoorService.redirect(dataType, appId, target, targetParam,env); + } + +} 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 new file mode 100644 index 0000000000..2fe90dbce7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -0,0 +1,106 @@ +package com.epmet.datareport.controller.fact; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.fact.FactIndexService; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 数据改版api + * + * @author sun + */ +@RestController +@RequestMapping("fact") +public class FactIndexController { + + @Autowired + private FactIndexService factIndexService; + + /** + * @param formDTO + * @Description 能力指数 + * @author sun + */ + @PostMapping("index/ablityindex") + public Result> ablityIndex(@RequestBody AblityIndexFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class); + return new Result>().ok(factIndexService.ablityIndex(formDTO)); + } + + /** + * @param formDTO + * @Description 按月份查询本级及下级分数 + * @author sun + */ + @PostMapping("index/scorelist") + public Result> scoreList(@RequestBody ScoreListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class); + return new Result>().ok(factIndexService.scoreList(formDTO)); + } + + /** + * @param formDTO + * @Description 按月份查询各项能力最近12个月得分 + * @author sun + */ + @PostMapping("index/monthscorelist") + public Result> monthScoreList(@RequestBody MonthScoreListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class); + return new Result>().ok(factIndexService.monthScoreList(formDTO)); + } + + /** + * @param formDTO + * @Description 按月查询各项指标数据 + * @author sun + */ + @PostMapping("index/ablitylist") + public Result> ablityList(@RequestBody AblityListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); + return new Result>().ok(factIndexService.ablityList(formDTO)); + } + + /** + * @param formDTO + * @Description 按月查询各项指标最近12个月数据 + * @author sun + */ + @PostMapping("index/monthablitylist") + public Result> monthAblityList(@RequestBody MonthAblityListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class); + return new Result>().ok(factIndexService.monthAblityList(formDTO)); + } + + /** + * @param formDTO + * @Description 同级对比各项数据查询 + * @author sun + */ + @PostMapping("index/peercomparison") + public Result> peerComparison(@RequestBody PeerComparisonFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class); + return new Result>().ok(factIndexService.peerComparison(formDTO)); + } + + /** + * @param formDTO + * @Description 是否根组织 + * @author sun + */ + @PostMapping("index/rootagency") + public Result rootAgency(@RequestBody RootAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); + return new Result().ok(factIndexService.rootAgency(formDTO)); + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java index 47a4765288..9966047056 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.exception.RenException; 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.dto.form.ProcessListFormDTO; import com.epmet.module.project.service.ProjectService; import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; @@ -78,4 +79,16 @@ public class ProjectController { return new Result>().ok(projectService.getProjectIncrTrend(tokenDto, formDTO)); } + /** + * @Description 项目详情 + * @Param processListFormDTO + * @author zxc + * @date 2020/10/23 10:31 上午 + */ + @PostMapping("projectdetail") + public Result projectDetail(@RequestBody ProcessListFormDTO processListFormDTO){ + ValidatorUtils.validateEntity(processListFormDTO); + return new Result().ok(projectService.projectDetail(processListFormDTO)); + } + } 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..86a6f3213e 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,15 @@ 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.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; 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 +25,27 @@ 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)); + } + + /** + * @Description 智慧社区的tree + * @Param customerId + * @Param bizType + * @author zxc + * @date 2020/10/21 2:49 下午 + */ + @PostMapping("treebytype") + public Result treeByType(@RequestHeader("CustomerId") String customerId,@RequestBody TreeByTypeFormDTO bizType){ + ValidatorUtils.validateEntity(bizType, TreeByTypeFormDTO.TreeByType.class); + return new Result().ok(agencyService.treeByType(customerId,bizType)); } /** @@ -52,11 +54,16 @@ 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); return new Result().ok(agencyService.compartment(compartmentFormDTO)); } + @PostMapping("compartmentbybiztype") + public Result compartmentByBizType(@RequestBody CompartmentByBizTypeFormDTO compartmentFormDTO){ + ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentByBizTypeFormDTO.CompartmentByBizType.class); + return new Result().ok(agencyService.compartmentByBizType(compartmentFormDTO)); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AnScreenController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AnScreenController.java new file mode 100644 index 0000000000..3c2871ab67 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AnScreenController.java @@ -0,0 +1,175 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.AnScreenService; +import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 安宁大屏 + * + * @author zhaoqifeng + * @date 2020/10/9 9:32 + */ +@RestController +@RequestMapping("anscreen") +public class AnScreenController { + + @Autowired + private AnScreenService anScreenService; + + /** + * 基层党员-各类总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:55 + */ + @PostMapping("pmtotal") + public Result pmTotal(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + PmTotalResultDTO result = anScreenService.pmTotal(formDTO); + return new Result().ok(result); + } + + /** + * 基层党员-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:57 + */ + @PostMapping("pmtotaltrend") + public Result pmTotalTrend(@RequestBody AnScreenTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenTrendFormDTO.AnScreenTrendGroup.class); + PmTotalTrendResultDTO result = anScreenService.pmTotalTrend(formDTO); + return new Result().ok(result); + } + + /** + * 基层党员-党员排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 13:59 + */ + @PostMapping("pmrank") + public Result> pmRank(@RequestBody AnScreenRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenRankFormDTO.AnScreenRankGroup.class); + List result = anScreenService.pmRank(formDTO); + return new Result>().ok(result); + } + + /** + * 基层组织-党群数、议题数、项目数 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:01 + */ + @PostMapping("grassrootsorg") + public Result grassRootsOrg(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + GrassRootsOrgResultDTO result = anScreenService.grassRootsOrg(formDTO); + return new Result().ok(result); + } + + /** + * 基层组织-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:03 + */ + @PostMapping("grassrootsorgtrend") + public Result grassRootsOrgTrend(@RequestBody AnScreenTrendFormDTO formDTO) { + GrassRootsOrgTrendResultDTO result = anScreenService.grassRootsOrgTrend(formDTO); + return new Result().ok(result); + } + + /** + * 基层组织-组织排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:06 + */ + @PostMapping("grassrootsorgrank") + public Result> grassRootsOrgRank(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + List result = anScreenService.grassRootsOrgRank(formDTO); + return new Result>().ok(result); + } + + /** + * 基层治理-总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:10 + */ + @PostMapping("grassrootsgovern") + public Result grassRootsGovern(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + GrassRootsGovernResultDTO result = anScreenService.grassRootsGovern(formDTO); + return new Result().ok(result); + } + + /** + * 基层治理-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:11 + */ + @PostMapping("grassrootsgoverntrend") + public Result grassRootsGovernTrend(@RequestBody AnScreenTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenTrendFormDTO.AnScreenTrendGroup.class); + GrassRootsGovernTrendResultDTO result = anScreenService.grassRootsGovernTrend(formDTO); + return new Result().ok(result); + } + + /** + * 基层治理-治理排行 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:13 + */ + @PostMapping("grassrootsgovernrank") + public Result> grassRootsGovernRank(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + List result = anScreenService.grassRootsGovernRank(formDTO); + return new Result>().ok(result); + } + + /** + * 项目 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:16 + */ + @PostMapping("projectprofile") + public Result> projectProfile(@RequestHeader("CustomerId") String customerId) { + List result = anScreenService.projectProfile(customerId); + return new Result>().ok(result); + } +} 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..25bf9e5434 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; @@ -28,12 +27,11 @@ public class DistributionController { private DistributionService distributionService; /** - * @Description 1、党支部 * @param formDTO + * @Description 1、党支部分布 【只显示 screen_customer_biz_org 表中存在的orgId的数据】 * @author zxc * @date 2020/8/18 10:59 上午 */ - @ExternalAppRequestAuth @PostMapping("branch") public Result> branch(@RequestBody BranchFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class); @@ -41,12 +39,11 @@ public class DistributionController { } /** - * @Description 2、用户分布 + * @Description 2、用户分布 【只显示 screen_customer_biz_org 表中存在的orgId的数据】 * @param userFormDTO * @author zxc * @date 2020/8/18 11:10 上午 */ - @ExternalAppRequestAuth @PostMapping("user") public Result user(@RequestBody UserFormDTO userFormDTO){ ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class); @@ -54,12 +51,11 @@ public class DistributionController { } /** - * @Description 3、党员分布 + * @Description 3、党员分布 【只显示 screen_customer_biz_org 表中存在的orgId的数据】 * @param parymemberFormDTO * @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 6da1ba9359..00fc8046a5 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,16 +1,13 @@ 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.eum.OrgTypeEnum; 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; @@ -33,7 +30,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); @@ -46,7 +42,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); @@ -59,7 +54,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); @@ -72,7 +66,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); @@ -80,17 +73,70 @@ public class IndexController { } /** - * 5、下级部门指数排行(安宁数据段用) + * 5、下级部门指数排行(安宁数据段用) + * * @param formDTO - * @return com.epmet.commons.tools.utils.Result> + * @return com.epmet.commons.tools.utils.Result> * @Author zhangyong * @Date 13:39 2020-09-11 **/ - @ExternalAppRequestAuth @PostMapping("dataclient/subagencyindexrank") - public Result> anNingSubAgencyIndexRank(@RequestBody AnNingSubAgencyIndexRankFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AnNingSubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); - return new Result>().ok(indexService.anNingSubAgencyIndexRank(formDTO)); + public Result> getSubAgencyIndexRank(@RequestBody SubAgencyIndexRankYMFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyIndexRankYMFormDTO.SubAgencyIndexRank.class); + return new Result>().ok(indexService.getSubAgencyIndexRank(formDTO)); } + /** + * desc: 下级组织单项指数得分排行 + * + * @param customerId + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author LiuJanJun + * @date 2020/10/22 1:49 下午 + */ + @PostMapping("subsingleindexrank") + public Result> getSubSingleIndexRank(@RequestHeader("CustomerId") String customerId, @RequestBody SubSingleIndexRankFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(indexService.getSubSingleIndexRank(formDTO)); + } + + /** + * @param formDTO + * @Description 4、获取该客户下所有网格指标排行 + * @author jianjun.liu + * @date 2020/8/20 10:02 上午 + */ + @PostMapping("gridindexrank") + 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 formDTO + * @Description 组织月度指数得分 + * @author sun + */ + @PostMapping("month/indexscore") + public Result indexScore(@RequestBody IndexScoreFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IndexScoreFormDTO.AddUserInternalGroup.class); + return new Result().ok(indexService.indexScore(formDTO)); + } + + /** + * @param formDTO + * @Description 先进排行-先进支部排行 + * @author sun + */ + @PostMapping("advancedbranchrank") + Result> advancedBranchRank(@RequestBody AdvancedBranchRankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AdvancedBranchRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(indexService.advancedBranchRank(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 db794ca26b..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,7 +1,5 @@ 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.KcScreenService; @@ -16,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; @@ -38,46 +33,37 @@ public class KcScreenController { /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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); @@ -85,326 +71,247 @@ public class KcScreenController { /** * 参与趋势 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 邻里党群-话题数量排名 + * @Description 邻里党群-话题转化率排名 * @author sun */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 */ - @ExternalAppRequestAuth @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 new file mode 100644 index 0000000000..84d586306f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -0,0 +1,56 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 数据改版api + * + * @author sun + */ +@RestController +@RequestMapping("/screen/user") +public class ScreenUserController { + + @Autowired + private ScreenUserService screenUserService; + + /** + * @param formDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + @PostMapping("userpointrank") + public Result> userPointRank(@RequestBody UserPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.userPointRank(formDTO)); + } + + /** + * @param formDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + @PostMapping("partindexscroerank") + public Result> partIndexScroeRank(@RequestBody PartIndexScroeRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.partIndexScroeRank(formDTO)); + } + + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 17c48ae989..7efd4d1853 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -33,51 +33,75 @@ import java.util.List; public interface ScreenCustomerAgencyDao { /** - * @Description 查询客户根组织ID * @param customerId + * @Description 查询客户根组织ID * @author zxc * @date 2020/8/18 2:44 下午 */ - TreeResultDTO selectRootAgencyId(@Param("customerId")String customerId); + TreeResultDTO selectRootAgencyId(@Param("customerId") String customerId); + + TreeResultDTO selectRootAgencyIdByBizType(@Param("customerId") String customerId, @Param("bizType") String bizType); /** - * @Description 查询下级机关的 名称和id * @param subAgencyPids + * @Description 查询下级机关的 名称和id * @author zxc * @date 2020/8/18 4:48 下午 */ List selectSubAgencyList(@Param("subAgencyPids") String subAgencyPids); + List selectSubAgencyListByBizType(@Param("subAgencyPids") String subAgencyPids); + /** - * @Description 查询当前机关的区域信息 * @param agencyId + * @Description 查询当前机关的区域信息 * @author zxc * @date 2020/8/18 4:51 下午 */ - CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId")String agencyId); + CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId") String agencyId); + + CompartmentResultDTO getAgencyAreaInfoByBizType(@Param("agencyId") String agencyId, @Param("bizType") String bizType); /** - * @Description 查询子级区域分布信息【机关级别】 * @param agencyId + * @Description 查询子级区域分布信息【机关级别】 * @author zxc * @date 2020/8/18 5:12 下午 */ - List selectSubDistribution(@Param("agencyId")String agencyId); + List selectSubDistribution(@Param("agencyId") String agencyId); + + List selectSubDistributionByType(@Param("agencyId") String agencyId, @Param("bizType") String bizType); /** - * @Description 查询子级用户分布【机关级别】 * @param parentId + * @Description 查询子级用户分布【机关级别】 * @author zxc * @date 2020/8/19 9:33 上午 */ - List selectUserDistributionAgency(@Param("parentId")String parentId); + List selectUserDistributionAgency(@Param("parentId") String parentId); /** - * @Description 查询子级党员分布【机关级别】 * @param parentId + * @Description 查询子级党员分布【机关级别】 * @author zxc * @date 2020/8/19 10:30 上午 */ - List selectParymemberDistribution(@Param("parentId")String parentId); + List selectParymemberDistribution(@Param("parentId") String parentId); + /** + * @param agencyId + * @Description 根据组织ID判断是否根组织 + * @author sun + */ + int selectRootAgency(@Param("agencyId") String agencyId); + + /** + * desc: 根据orgId获取组织信息 + * + * @param agencyId + * @return com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO + * @author LiuJanJun + * @date 2020/10/23 3:54 下午 + */ + CompartmentResultDTO getAgencyInfoByAegncyId(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 8697ba9adf..5a0a566342 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -18,6 +18,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.evaluationindex.screen.dto.result.DifficultProjectResultDTO; +import com.epmet.project.dto.result.ProjectDetailResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -41,4 +42,6 @@ public interface ScreenDifficultyDataDao { **/ List selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type); + ProjectDetailResultDTO projectDetail(@Param("eventId")String projectId); + } \ No newline at end of file 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 cc6c9e9e2b..93221bd6f0 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,12 +17,8 @@ package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO; -import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult; -import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -69,6 +65,41 @@ public interface ScreenIndexDataMonthlyDao{ * @Author zhangyong * @Date 09:38 2020-09-08 **/ - List selectAnNingSubAgencyIndexMonthlyRank(AnNingSubAgencyIndexRankFormDTO formDTO); + List selectSubAgencyOrGridIndexMonthlyRank(SubAgencyIndexRankYMFormDTO formDTO); + /** + * desc:获取网格指标排行 + * + * @param formDTO + * @return + */ + List selectIndexRankByOrgType(GridIndexRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 同级对比--根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据) + * @author sun + */ + List selectScoreList(PeerComparisonFormDTO formDTO); + + /** + * @param formDTO + * @Description 根据组织或网格Id以及月份Id查询各项月度指数得分 + * @author sun + */ + IndexScoreResultDTO selectMonthData(IndexScoreFormDTO formDTO); + + /** + * @param formDTO + * @Description 先进排行-先进支部排行 + * @author sun + */ + List selectRankList(AdvancedBranchRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 下级单项指标得分排行 + * @author sun + */ + List getSingleIndexRank(SubSingleIndexRankFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java index 70f0f1b5a6..4300b76ea3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java @@ -17,7 +17,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO; import com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -50,5 +50,5 @@ public interface ScreenIndexDataYearlyDao{ * @Author zhangyong * @Date 09:38 2020-09-08 **/ - List selectAnNingSubAgencyIndexYearlyRank(AnNingSubAgencyIndexRankFormDTO formDTO); + List selectAnNingSubAgencyIndexYearlyRank(SubAgencyIndexRankYMFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index bc15ca191f..0f442931b5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -18,7 +18,11 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.user.KcUserPointRankResultDTO; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -53,4 +57,18 @@ public interface ScreenPartyUserRankDataDao{ List selectPartymemberPointOrder(@Param("agencyId")String agencyId); List listUserPoints(String customerId); + + /** + * @param formDTO + * @Description 查询组织下居民积分排行,按积分值降序 + * @author sun + */ + List selectAgencyUserPointList(UserPointRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询组织下党员的积分排行,按积分值降序 + * @author sun + */ + List selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnCommunityProjectProfileDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnCommunityProjectProfileDao.java new file mode 100644 index 0000000000..a8eb3b762d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnCommunityProjectProfileDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.result.ProjectProfileResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-社区-项目概况(数量、颜色) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnCommunityProjectProfileDao { + /** + * 项目 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 17:17 + */ + List selectProjectProfile(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java new file mode 100644 index 0000000000..40609442aa --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java @@ -0,0 +1,69 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-基层治理-各类数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsGovernMonthlyDao { + /** + * 基层治理-总数 + * + * @param agencyId + * @param monthId + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO + * @author zhaoqifeng + * @date 2020/10/9 16:48 + */ + GrassRootsGovernResultDTO selectGrassRootsGovern(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * 基层治理-指标月度趋势 + * + * @param agencyId + * @param yearId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 16:49 + */ + List selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * 基层治理-治理排行 + * + * @param agencyId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 16:49 + */ + List selectGrassRootsGovernRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java new file mode 100644 index 0000000000..9fb38ae91e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-基层组织(党群数|议题数|项目数)-按月 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsOrgMonthlyDao { + + /** + * 基层组织-党群数、议题数、项目数 + * + * @param agencyId + * @param monthId + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgResultDTO + * @author zhaoqifeng + * @date 2020/10/9 16:25 + */ + GrassRootsOrgResultDTO selectGrassRootsOrg(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * 基层组织-指标月度趋势 + * + * @param agencyId + * @param yearId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 16:32 + */ + List selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * 基层组织-组织排行榜单 + * + * @param agencyId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 16:36 + */ + List selectGrassRootsOrgRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmRankDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmRankDao.java new file mode 100644 index 0000000000..141853010d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmRankDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.result.PmRankResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-基层党员-排行榜单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsPmRankDao { + /** + * 基层党员-党员排行榜单 + * + * @param agencyId + * @param topNum + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 15:43 + */ + List selectPmRank(@Param("agencyId") String agencyId, @Param("topNum") Integer topNum); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java new file mode 100644 index 0000000000..3e0c05e93f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PmTotalTrendDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-基层党员-各类总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsPmTotalMonthlyDao { + /** + * 基层党员-各类总数 + * + * @param agencyId + * @param monthId + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO + * @author zhaoqifeng + * @date 2020/10/9 15:14 + */ + PmTotalResultDTO selectPmTotal(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * 基层党员-指标月度趋势 + * + * @param agencyId + * @param yearId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 15:12 + */ + List selectPmTotalTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java index 23e6e5afbd..834a64c0ee 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java @@ -43,7 +43,7 @@ public interface ScreenKcGroupDetailGridDailyDao { /** * @param formDTO - * @Description 按客户查询最近一天所有网格数据 再按话题总数降序排列 + * @Description 按客户查询最近一天所有网格数据 再按转议题数量降序排列 * @author sun */ List selectGroupTopicShiftIssueRatioRankList(GroupTopicShiftIssueRatioRankFormDTO formDTO); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java new file mode 100644 index 0000000000..57a9829f1d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.LinkedList; +import java.util.List; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface FactIndexAgencyScoreDao { + + /** + * @param formDTO + * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月各项乘以权重后的得分数据 + * @author sun + */ + LinkedList selectAgencyAblityWeightScoreIndex(AblityIndexFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + * @author sun + */ + List selectAgencyWeightScoreList(ScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectAgencyMonthWeightScoreList(MonthScoreListFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java new file mode 100644 index 0000000000..0fd8e29c06 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.LinkedList; +import java.util.List; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface FactIndexAgencySubScoreDao { + + /** + * @param formDTO + * @Description 查询区县级、乡镇街道级组织某月份某项能力对应的各项指标 + * @author sun + */ + List selectAblityList(AblityListFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询区县级、乡镇街道级组织某项能力对应的一项指标过去12个月份数据 + * @author sun + */ + LinkedList selectMonthAblityList(MonthAblityListFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java new file mode 100644 index 0000000000..d0bfc62ac5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.LinkedList; +import java.util.List; + +/** + * 社区相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface FactIndexCommunityScoreDao { + + /** + * @param formDTO + * @Description 分别查询社区过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectCommunityAblityWeightScore(AblityIndexFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询社区级组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + * @author sun + */ + List selectCommunityWeightScoreList(ScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查询社区过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectCommunityMonthWeightScoreList(MonthScoreListFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java new file mode 100644 index 0000000000..1689ab0b3c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.LinkedList; +import java.util.List; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface FactIndexCommunitySubScoreDao { + + /** + * @param formDTO + * @Description 查询社区级组织某一月份某项能力对应的各项指标 + * @author sun + */ + List selectCommunityAblityList(AblityListFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询社区级组织某项能力对应的一项指标过去12个月份数据 + * @author sun + */ + LinkedList selectCommunityMonthAblityList(MonthAblityListFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java new file mode 100644 index 0000000000..c94fdb23a3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.LinkedList; +import java.util.List; + +/** + * 网格相关分值记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface FactIndexGridScoreDao { + + /** + * @param formDTO + * @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectGridAblityWeightScore(AblityIndexFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查网格某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + * @author sun + */ + List selectGridWeightScoreList(ScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectGridMonthWeightScoreList(MonthScoreListFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java new file mode 100644 index 0000000000..8900171322 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.LinkedList; +import java.util.List; + +/** + * 网格相关分值记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface FactIndexGridSubScoreDao { + + /** + * @param formDTO + * @Description 查询网格某月份某项能力对应的各项指标 + * @author sun + */ + List selectGridAblityList(AblityListFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询网格层级某项能力对应的一项指标过去12个月份数据 + * @author sun + */ + LinkedList selectGridMonthAblityList(MonthAblityListFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/IndexDictDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/IndexDictDao.java new file mode 100644 index 0000000000..893820cf1c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/IndexDictDao.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 评价指标字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface IndexDictDao { + + /** + * @param + * @Description 查询指标字典表是百分比类型的数据 + * @author sun + */ + List selectList(); + + /** + * @param + * @Description 根据indexCode查询指标字典表具体数据 + * @author sun + */ + IndexDictResultDTO selectIndexDict(@Param("indexCode") String indexCode); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/eum/OrgTypeEnum.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/eum/OrgTypeEnum.java new file mode 100644 index 0000000000..6938746a29 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/eum/OrgTypeEnum.java @@ -0,0 +1,48 @@ +package com.epmet.datareport.eum; + +/** + * 需要组织类型枚举类 + * + * @author jianjun liu + * @date 2020-08-26 11:14 + **/ +public enum OrgTypeEnum { + DEPARTMENT("department", "部门"), + AGENCY("agency", "组织"), + GRID("grid", "网格"), + ; + + /** + * code + */ + private String code; + /** + * name + */ + private String name; + + + OrgTypeEnum(String code, String name) { + this.code = code; + this.name = name; + + } + + public static OrgTypeEnum getEnum(String code) { + OrgTypeEnum[] values = OrgTypeEnum.values(); + for (OrgTypeEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/BackDoorService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/BackDoorService.java new file mode 100644 index 0000000000..381d3874a1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/BackDoorService.java @@ -0,0 +1,11 @@ +package com.epmet.datareport.service.backdoor; + +/** + * @Author zxc + * @DateTime 2020/10/21 5:17 下午 + */ +public interface BackDoorService { + + Object redirect(String dataType, String appId, String target, Object o,String env); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java new file mode 100644 index 0000000000..639d39526f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java @@ -0,0 +1,50 @@ +package com.epmet.datareport.service.backdoor.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.constant.FactConstant; +import com.epmet.datareport.service.backdoor.BackDoorService; +import com.epmet.dto.result.AppIdInfoResultDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2020/10/21 5:17 下午 + */ +@Service +@Slf4j +public class BackDoorServiceImpl implements BackDoorService { + + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + + @Override + public Object redirect(String dataType, String appId, String target, Object targetParam, String env) { + Result appIdInfoResultDTOResult = commonServiceOpenFeignClient.appIdInfo(appId); + if (!appIdInfoResultDTOResult.success()) { + throw new RenException("获取accessToken失败......"); + } + AppIdInfoResultDTO data = appIdInfoResultDTOResult.getData(); + String url = EnvEnum.getEnum(env).getUrl().concat(target); + Map headerMap = new HashMap<>(16); + headerMap.put("AccessToken", data.getAccessToken()); + headerMap.put("AppId", data.getAppId()); + headerMap.put("AuthType", "jwt"); + headerMap.put("Data-Type",dataType); + Result stringResult = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(targetParam), headerMap); + log.info(JSON.toJSONString(stringResult)); + if (!stringResult.success()){ + throw new RenException("请求【"+url+"】失败......"+stringResult.error()); + } + return JSON.parseObject(stringResult.getData()); + } +} 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..046eaccbef 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,7 +1,8 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; @@ -14,12 +15,15 @@ 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); + + + TreeResultDTO treeByType(String customerId, TreeByTypeFormDTO bizType); /** * @Description 2、组织区域查询 @@ -29,4 +33,6 @@ public interface AgencyService { */ CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO); + CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AnScreenService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AnScreenService.java new file mode 100644 index 0000000000..5ed96488cb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AnScreenService.java @@ -0,0 +1,115 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:34 + */ +public interface AnScreenService { + /** + * 基层党员-各类总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:55 + */ + PmTotalResultDTO pmTotal(AnScreenFormDTO formDTO); + + /** + * 基层党员-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:57 + */ + PmTotalTrendResultDTO pmTotalTrend(AnScreenTrendFormDTO formDTO); + + /** + * 基层党员-党员排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 13:59 + */ + List pmRank(AnScreenRankFormDTO formDTO); + + /** + * 基层组织-党群数、议题数、项目数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:01 + */ + GrassRootsOrgResultDTO grassRootsOrg(AnScreenFormDTO formDTO); + + /** + * 基层组织-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:03 + */ + GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO); + + /** + * 基层组织-组织排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:06 + */ + List grassRootsOrgRank(AnScreenFormDTO formDTO); + + /** + * 基层治理-总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:10 + */ + GrassRootsGovernResultDTO grassRootsGovern(AnScreenFormDTO formDTO); + + /** + * 基层治理-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:11 + */ + GrassRootsGovernTrendResultDTO grassRootsGovernTrend(AnScreenTrendFormDTO formDTO); + + /** + * 基层治理-治理排行 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:13 + */ + List grassRootsGovernRank(AnScreenFormDTO formDTO); + + /** + * 项目 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:16 + */ + List projectProfile(String customerId); +} 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 4ff9cf0fd4..0dc99d37bc 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 @@ -46,13 +46,44 @@ public interface IndexService { List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); /** - * 5、下级部门指数排行(安宁数据段用) + * 5、按月或年 下级组织指数排行 * * @param formDTO * @return java.util.List * @Author zhangyong * @Date 09:38 2020-09-08 **/ - List anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO); + List getSubAgencyIndexRank(SubAgencyIndexRankYMFormDTO formDTO); + /** + * desc:获取该客户下网格排行 + * + * @param formDTO + * @return + */ + List selectIndexRankByOrgType(GridIndexRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 组织月度指数得分 + * @author sun + */ + IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO); + + /** + * @param formDTO + * @Description 先进排行-先进支部排行 + * @author sun + */ + List advancedBranchRank(AdvancedBranchRankFormDTO formDTO); + + /** + * desc:下级单项指数排行 + * + * @param formDTO + * @return java.util.List + * @author LiuJanJun + * @date 2020/10/22 10:58 上午 + */ + List getSubSingleIndexRank(SubSingleIndexRankFormDTO 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 f40e8517ae..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 @@ -96,7 +88,7 @@ public interface KcScreenService { /** * @param formDTO - * @Description 邻里党群-话题数量排名 + * @Description 邻里党群-话题转化率排名 * @author sun */ List groupTopicShiftIssueRatioRank(GroupTopicShiftIssueRatioRankFormDTO formDTO); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenDifficultyDataService.java new file mode 100644 index 0000000000..d40e84cb11 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenDifficultyDataService.java @@ -0,0 +1,14 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.project.dto.result.ProjectDetailResultDTO; + +/** + * @Author zxc + * @DateTime 2020/10/23 1:26 下午 + */ +public interface ScreenDifficultyDataService { + + ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java new file mode 100644 index 0000000000..f5e2428f09 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java @@ -0,0 +1,30 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; + +import java.util.List; + +/** + * 数据改版 + * + * @author sun + */ +public interface ScreenUserService { + + /** + * @param formDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + List userPointRank(UserPointRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + List partIndexScroeRank(PartIndexScroeRankFormDTO 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 6d6632dbdf..24a5367d87 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,18 +1,20 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; 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; @@ -42,31 +44,61 @@ 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 = screenCustomerAgencyDao.selectRootAgencyId(customerId); - if (null == rootAgency){ - return new TreeResultDTO(); + TreeResultDTO rootAgency = null; + try { + rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); + if (null == rootAgency) { + return new TreeResultDTO(); + } + } catch (TooManyResultsException e) { + throw new RenException("根组织结构数据有误"); } List centerMark = this.getCenterMark(rootAgency.getCenterMarkA()); rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); - if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)){ + if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)) { List treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue()); rootAgency.setChildren(treeResultDTOS); - }else { + } else { List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue())); rootAgency.setChildren(departmentList); } return rootAgency; } + /** + * @Description 智慧社区的tree + * @Param customerId + * @Param bizType + * @author zxc + * @date 2020/10/21 2:49 下午 + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public TreeResultDTO treeByType(String customerId, TreeByTypeFormDTO bizType) { + TreeResultDTO rootAgency = null; + try { + rootAgency = screenCustomerAgencyDao.selectRootAgencyIdByBizType(customerId,bizType.getBizType()); + if (null == rootAgency) { + return new TreeResultDTO(); + } + } catch (TooManyResultsException e) { + throw new RenException("根组织结构数据有误"); + } + List centerMark = this.getCenterMark(rootAgency.getCenterMarkA()); + rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); + if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)) { + List treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue()); + rootAgency.setChildren(treeResultDTOS); + } else { + List departmentList = this.getDepartmentListByBiz(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue())); + rootAgency.setChildren(departmentList); + } + return rootAgency; + } + /** * @Description 处理centerMark * @param centerMark @@ -106,7 +138,45 @@ public class AgencyServiceImpl implements AgencyService { }); sub.setChildren(treeResultDTOS); }else { - List subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); + List subAgency = new ArrayList<>(); + if (sub.getPids().contains(ScreenConstant.COMMA)){ + subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); + }else { + subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COLON + sub.getValue()); + } + sub.setChildren(subAgency); + } + }); + } + return subAgencyList; + } + + /** + * @Description 智慧社区的tree + * @Param subAgencyPids + * @author zxc + * @date 2020/10/21 2:49 下午 + */ + public List getDepartmentListByBiz(String subAgencyPids) { + List subAgencyList = screenCustomerAgencyDao.selectSubAgencyListByBizType(subAgencyPids); + if (subAgencyList.size() > NumConstant.ZERO) { + subAgencyList.forEach(sub -> { + List centerMark = this.getCenterMark(sub.getCenterMarkA()); + sub.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); + if (sub.getLevel().equals(ScreenConstant.COMMUNITY)){ + List treeResultDTOS = screenCustomerGridDao.selectGridInfo(sub.getValue()); + treeResultDTOS.forEach(tree -> { + List centerMarkTree = this.getCenterMark(tree.getCenterMarkA()); + tree.setCenterMark(centerMarkTree.size() == NumConstant.ZERO ? new ArrayList<>() : centerMarkTree); + }); + sub.setChildren(treeResultDTOS); + }else { + List subAgency = new ArrayList<>(); + if (sub.getPids().contains(ScreenConstant.COMMA)){ + subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); + }else { + subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue()); + } sub.setChildren(subAgency); } }); @@ -137,4 +207,22 @@ public class AgencyServiceImpl implements AgencyService { } return agencyAreaInfo; } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO) { + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfoByBizType(compartmentFormDTO.getAgencyId(),compartmentFormDTO.getBizType()); + if (null == agencyAreaInfo){ + return new CompartmentResultDTO(); + } + if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + // 当level为"community"时,查询screen_customer_grid表 + List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + }else { + List agencyDistributionResultDTOS = screenCustomerAgencyDao.selectSubDistributionByType(compartmentFormDTO.getAgencyId(),compartmentFormDTO.getBizType()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + } + return agencyAreaInfo; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java new file mode 100644 index 0000000000..0d8a064bcb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java @@ -0,0 +1,255 @@ +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screenan.*; +import com.epmet.datareport.service.evaluationindex.screen.AnScreenService; +import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:35 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class AnScreenServiceImpl implements AnScreenService { + + @Autowired + private ScreenAnGrassRootsPmTotalMonthlyDao screenAnGrassRootsPmTotalMonthlyDao; + @Autowired + private ScreenAnGrassRootsPmRankDao screenAnGrassRootsPmRankDao; + @Autowired + private ScreenAnGrassRootsOrgMonthlyDao screenAnGrassRootsOrgMonthlyDao; + @Autowired + private ScreenAnGrassRootsGovernMonthlyDao screenAnGrassRootsGovernMonthlyDao; + @Autowired + private ScreenAnCommunityProjectProfileDao screenAnCommunityProjectProfileDao; + + /** + * 基层党员-各类总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:55 + */ + @Override + public PmTotalResultDTO pmTotal(AnScreenFormDTO formDTO) { + return screenAnGrassRootsPmTotalMonthlyDao.selectPmTotal(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 基层党员-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:57 + */ + @Override + public PmTotalTrendResultDTO pmTotalTrend(AnScreenTrendFormDTO formDTO) { + PmTotalTrendResultDTO resultDTO = new PmTotalTrendResultDTO(); + String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); + List list = screenAnGrassRootsPmTotalMonthlyDao.selectPmTotalTrend(formDTO.getAgencyId(), yearId); + List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); + List groupMemberTotalList = list.stream().map(PmTotalTrendDTO::getGroupMemberTotal).collect(Collectors.toList()); + List topicTotalList = list.stream().map(PmTotalTrendDTO::getTopicTotal).collect(Collectors.toList()); + List topicPartiUserTotalList = list.stream().map(PmTotalTrendDTO::getTopicPartiUserTotal).collect(Collectors.toList()); + List issueTotalList = list.stream().map(PmTotalTrendDTO::getIssueTotal).collect(Collectors.toList()); + resultDTO.setXAxis(xAxis); + resultDTO.setGroupMemberTotalList(groupMemberTotalList); + resultDTO.setTopicTotalList(topicTotalList); + resultDTO.setTopicPartiUserTotalList(topicPartiUserTotalList); + resultDTO.setIssueTotalList(issueTotalList); + return resultDTO; + } + + /** + * 基层党员-党员排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 13:59 + */ + @Override + public List pmRank(AnScreenRankFormDTO formDTO) { + return screenAnGrassRootsPmRankDao.selectPmRank(formDTO.getAgencyId(), formDTO.getTopNum()); + } + + /** + * 基层组织-党群数、议题数、项目数 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:01 + */ + @Override + public GrassRootsOrgResultDTO grassRootsOrg(AnScreenFormDTO formDTO) { + return screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrg(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 基层组织-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:03 + */ + @Override + public GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO) { + GrassRootsOrgTrendResultDTO resultDTO = new GrassRootsOrgTrendResultDTO(); + String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); + List list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), yearId); + List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); + List groupTotalList = list.stream().map(GrassRootsOrgTrendDTO::getGroupTotal).collect(Collectors.toList()); + List issueTotalList = list.stream().map(GrassRootsOrgTrendDTO::getIssueTotal).collect(Collectors.toList()); + List projectTotal = list.stream().map(GrassRootsOrgTrendDTO::getProjectTotal).collect(Collectors.toList()); + resultDTO.setXAxis(xAxis); + resultDTO.setGroupTotalList(groupTotalList); + resultDTO.setIssueTotalList(issueTotalList); + resultDTO.setProjectTotal(projectTotal); + return resultDTO; + } + + /** + * 基层组织-组织排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:06 + */ + @Override + public List grassRootsOrgRank(AnScreenFormDTO formDTO) { + return screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgRank(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 基层治理-总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:10 + */ + @Override + public GrassRootsGovernResultDTO grassRootsGovern(AnScreenFormDTO formDTO) { + return screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovern(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 基层治理-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:11 + */ + @Override + public GrassRootsGovernTrendResultDTO grassRootsGovernTrend(AnScreenTrendFormDTO formDTO) { + GrassRootsGovernTrendResultDTO resultDTO = new GrassRootsGovernTrendResultDTO(); + String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); + List list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), yearId); + List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); + List partiProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getPartiProjectTotal).collect(Collectors.toList()); + List closedProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getClosedProjectTotal).collect(Collectors.toList()); + List projectResponseRatioList = list.stream().map(GrassRootsGovernTrendDTO::getProjectResponseRatio).collect(Collectors.toList()); + List projectSatisRatioList = list.stream().map(GrassRootsGovernTrendDTO::getProjectSatisRatio).collect(Collectors.toList()); + List closedProjectRatioList = list.stream().map(GrassRootsGovernTrendDTO::getClosedProjectRatio).collect(Collectors.toList()); + resultDTO.setXAxis(xAxis); + resultDTO.setPartiProjectTotalList(partiProjectTotalList); + resultDTO.setClosedProjectTotalList(closedProjectTotalList); + resultDTO.setProjectResponseRatioList(projectResponseRatioList); + resultDTO.setProjectSatisRatioList(projectSatisRatioList); + resultDTO.setClosedProjectRatioList(closedProjectRatioList); + return resultDTO; + } + + /** + * 基层治理-治理排行 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:13 + */ + @Override + public List grassRootsGovernRank(AnScreenFormDTO formDTO) { + return screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernRank(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 项目 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:16 + */ + @Override + public List projectProfile(String customerId) { + return screenAnCommunityProjectProfileDao.selectProjectProfile(customerId); + } + + private String getMonth(String monthId) { + String month = monthId.substring(NumConstant.FOUR, NumConstant.SIX); + String name = ""; + switch (month) { + case "01": + name = "1月"; + break; + case "02": + name = "2月"; + break; + case "03": + name = "3月"; + break; + case "04": + name = "4月"; + break; + case "05": + name = "5月"; + break; + case "06": + name = "6月"; + break; + case "07": + name = "7月"; + break; + case "08": + name = "8月"; + break; + case "09": + name = "9月"; + break; + case "10": + name = "10月"; + break; + case "11": + name = "11月"; + break; + case "12": + name = "12月"; + break; + default: + break; + } + return name; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index d750c1ee03..7afd0f4362 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -108,18 +108,17 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); //保证获取公众参与概率数据的最大可能性 int time = NumConstant.TWELVE; - while(null == latest && time > NumConstant.ONE) - { - time --; - monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); - latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); - } + while (null == latest && time > NumConstant.ONE) { + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); + latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + } - if(null == latest) return new PublicPartiProfileResultDTO(); - PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest,PublicPartiProfileResultDTO.class); - result.setMonthIncr(convertPercentStr(latest.getMonthIncr(),NumConstant.ZERO)); - result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth(),NumConstant.ZERO)); - result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth(),NumConstant.ZERO)); + if (null == latest) return new PublicPartiProfileResultDTO(); + PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest, PublicPartiProfileResultDTO.class); + result.setMonthIncr(convertPercentStr(latest.getMonthIncr(), NumConstant.ZERO)); + result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth().abs(), NumConstant.ZERO)); + result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth().abs(), NumConstant.ZERO)); return result; } 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 d9761fcf09..4ff84d3ab6 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 @@ -2,11 +2,12 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.CommonOperateTypeEnum; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao; import com.epmet.datareport.service.evaluationindex.screen.IndexService; -import com.epmet.datareport.utils.DateUtils; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; @@ -16,6 +17,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; @@ -39,7 +41,7 @@ public class IndexServiceImpl implements IndexService { @Autowired private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; @Autowired - private DateUtils dateUtils; + private com.epmet.datareport.utils.DateUtils dateUtils; /** * @Description 1、年度平均指数 @@ -204,16 +206,19 @@ public class IndexServiceImpl implements IndexService { return subAgencyIndexRankResultDTOS; } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override - public List anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO) { + public List getSubAgencyIndexRank(SubAgencyIndexRankYMFormDTO formDTO) { List subAgencyIndexRankResultDTOS = new ArrayList<>(); - if (ScreenConstant.YEAR_ID.equals(formDTO.getType())){ + if (ScreenConstant.YEAR_ID.equals(formDTO.getType())) { // 年 指数排行 subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO); - } else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())){ + } else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())) { // 月(上一个月) 指数排行 - subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO); + if (StringUtils.isBlank(formDTO.getMonthId())) { + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + } + subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyOrGridIndexMonthlyRank(formDTO); subAgencyIndexRankResultDTOS.forEach(rank -> { rank.setPartyDevAbility(getRound(rank.getPartyDevAbility())); rank.setGovernAbility(getRound(rank.getGovernAbility())); @@ -224,15 +229,117 @@ public class IndexServiceImpl implements IndexService { return subAgencyIndexRankResultDTOS; } + @Override + public List selectIndexRankByOrgType(GridIndexRankFormDTO formDTO) { + LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); + int yearId = now.getYear(); + formDTO.setYearId(String.valueOf(yearId)); + List subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectIndexRankByOrgType(formDTO); + if (CollectionUtils.isEmpty(subAgencyIndexRankResultDTOS)) { + return new ArrayList<>(); + } + // 小数四舍五入 + subAgencyIndexRankResultDTOS.forEach(indexRank -> { + indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); + indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); + indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); + indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); + }); + return subAgencyIndexRankResultDTOS; + } + /** - * @Description 小数四舍五入 * @param d + * @Description 小数四舍五入 * @author zxc * @date 2020/9/14 2:01 下午 */ - public Double getRound(Double d){ + public Double getRound(Double d) { BigDecimal bigDecimal = new BigDecimal(d); BigDecimal b = bigDecimal.setScale(NumConstant.ONE, BigDecimal.ROUND_HALF_UP); return Double.valueOf(b.toString()); } + + /** + * @param formDTO + * @Description 组织月度指数得分 + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO) { + //screen_index_data_monthly 根据组织id和月份获取月度指标得分 + //1.大屏接口 orgType和monthId字段不传值,默认查询上一个月数据 + if(null==formDTO.getMonthId()||"".equals(formDTO.getMonthId())){ + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + } + //2.根据组织或网格Id以及月份Id查询各项月度指数得分 + IndexScoreResultDTO resultDTO = screenIndexDataMonthlyDao.selectMonthData(formDTO); + if (null == resultDTO) { + return resultDTO; + } + + //3.将数据改成正确格式 四舍五入保留一位小数 权重转成百分比 + NumberFormat nf = NumberFormat.getPercentInstance(); + nf.setMaximumFractionDigits(1); + + 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()))); + Double db = num1.doubleValue() + num2.doubleValue() + num3.doubleValue(); + BigDecimal num = new BigDecimal(db.toString()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros(); + resultDTO.setTotalScore(num); + + return resultDTO; + } + + /** + * @param formDTO + * @Description 先进排行-先进支部排行 + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List advancedBranchRank(AdvancedBranchRankFormDTO formDTO) { + //根据当前所选组织,查询screen_index_data_monthly中类型为网格的按照总指数倒序,关联screen_org_rank_data表取其他数据 + //1.级联查询组织下所有网格的先进支部排行数据,按总指数降序 + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + List list = screenIndexDataMonthlyDao.selectRankList(formDTO); + //2.遍历数据,小数保留一位小数,百分数添加百分号 + NumberFormat nf = NumberFormat.getPercentInstance(); + nf.setMaximumFractionDigits(1); + list.forEach(l->{ + BigDecimal num = new BigDecimal(l.getTotalScore()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros(); + l.setScroe(num); + BigDecimal num1 = new BigDecimal(l.getSatisfactionRatio()).setScale(1, BigDecimal.ROUND_HALF_UP); + l.setSatisfactionRatio(num1 + "%"); + BigDecimal num2 = new BigDecimal(l.getClosedProjectRatio()).setScale(1, BigDecimal.ROUND_HALF_UP); + l.setClosedProjectRatio(num2 + "%"); + }); + + return list; + } + + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getMonthId())) { + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + } + if (StringUtils.isBlank(formDTO.getSort())) { + formDTO.setSort(CommonOperateTypeEnum.DESC.getCode()); + } + if (formDTO.getTopNum() == null) { + formDTO.setTopNum(NumConstant.FIVE); + } + List list = screenIndexDataMonthlyDao.getSingleIndexRank(formDTO); + return list; + } + } 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 661a43306a..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()); @@ -300,21 +292,21 @@ public class KcScreenServiceImpl implements KcScreenService { public List groupUserCountRank(GroupUserCountRankFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); formDTO.setPageNo(pageIndex); - //按客户查询最近一天所有网格数据 再按社群总数降序排列 + //按客户查询最近一天所有网格数据 再按照群内成员数降序 List list = screenKcGroupDetailGridDailyDao.selectGroupUserCountRankList(formDTO); return list; } /** * @param formDTO - * @Description 邻里党群-话题数量排名 + * @Description 邻里党群-话题转化率排名 * @author sun */ @Override public List groupTopicShiftIssueRatioRank(GroupTopicShiftIssueRatioRankFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); formDTO.setPageNo(pageIndex); - //按客户查询最近一天所有网格数据 再按话题总数降序排列 + //按客户查询最近一天所有网格数据 再按转议题数量降序排列 List list = screenKcGroupDetailGridDailyDao.selectGroupTopicShiftIssueRatioRankList(formDTO); return list; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java new file mode 100644 index 0000000000..e044c24aab --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -0,0 +1,31 @@ +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenDifficultyDataDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataService; +import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.project.dto.result.ProjectDetailResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/10/23 1:26 下午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenDifficultyDataServiceImpl implements ScreenDifficultyDataService { + + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO) { + ProjectDetailResultDTO projectDetailResultDTO = screenDifficultyDataDao.projectDetail(processListFormDTO.getProjectId()); + return projectDetailResultDTO; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java new file mode 100644 index 0000000000..7721876c58 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java @@ -0,0 +1,62 @@ +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.constant.FactConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据改版 + * + * @author sun + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenUserServiceImpl implements ScreenUserService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + + /** + * @param formDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List userPointRank(UserPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下居民积分排行,按积分值降序 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectAgencyUserPointList(formDTO); + } + + /** + * @param formDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下党员的积分排行 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectPartymemberPointList(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/FactIndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/FactIndexService.java new file mode 100644 index 0000000000..475549a522 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/FactIndexService.java @@ -0,0 +1,63 @@ +package com.epmet.datareport.service.fact; + +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; + +import java.util.List; + +/** + * 数据改版api + * @author sun + */ +public interface FactIndexService { + + /** + * @param formDTO + * @Description 能力指数 + * @author sun + */ + List ablityIndex(AblityIndexFormDTO formDTO); + + /** + * @param formDTO + * @Description 按月份查询各项能力分数 + * @author sun + */ + List scoreList(ScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 按月份查询各项能力最近12个月得分 + * @author sun + */ + List monthScoreList(MonthScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 按月查询各项指标数据 + * @author sun + */ + List ablityList(AblityListFormDTO formDTO); + + /** + * @param formDTO + * @Description 按月查询各项指标最近12个月数据 + * @author sun + */ + List monthAblityList(MonthAblityListFormDTO formDTO); + + /** + * @param formDTO + * @Description 同级对比各项数据查询 + * @author sun + */ + List peerComparison(PeerComparisonFormDTO formDTO); + + /** + * @param formDTO + * @Description 是否根组织 + * @author sun + */ + RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java new file mode 100644 index 0000000000..01e0a69ac6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -0,0 +1,495 @@ +package com.epmet.datareport.service.fact.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.constant.FactConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; +import com.epmet.datareport.dao.fact.*; +import com.epmet.datareport.service.fact.FactIndexService; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.LinkedList; +import java.util.List; +import java.util.regex.Pattern; + +/** + * 数据改版api + * + * @author sun + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexServiceImpl implements FactIndexService { + + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private FactIndexAgencyScoreDao factIndexAgencyScoreDao; + @Autowired + private FactIndexAgencySubScoreDao factIndexAgencySubScoreDao; + @Autowired + private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + @Autowired + private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao; + @Autowired + private FactIndexGridScoreDao factIndexGridScoreDao; + @Autowired + private FactIndexGridSubScoreDao factIndexGridSubScoreDao; + @Autowired + private IndexDictDao indexDictDao; + + /** + * @param formDTO + * @Description 能力指数 + * @author sun + */ + @Override + public List ablityIndex(AblityIndexFormDTO formDTO) { + LinkedList resultList = new LinkedList<>(); + LinkedList list = new LinkedList<>(); + LinkedList djList = new LinkedList<>(); + LinkedList zlList = new LinkedList<>(); + LinkedList fwList = new LinkedList<>(); + //1.计算所查月份前12个月的monthId + formDTO.setStartMonthId(getDate(formDTO.getMonthId())); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); + if (null == agency) { + //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //4.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分数据 + list = factIndexAgencyScoreDao.selectAgencyAblityWeightScoreIndex(formDTO); + + //社区级 + } else if ("community".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + list = factIndexCommunityScoreDao.selectCommunityAblityWeightScore(formDTO); + } else { + //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询网格过去12个月党建能力、治理能力、服务能力每月总分数据 + list = factIndexGridScoreDao.selectGridAblityWeightScore(formDTO); + } else { + throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + if (list.size() < NumConstant.ONE) { + return resultList; + } + + //6.遍历计算每个月能力指数 + LinkedList nlList = new LinkedList<>(); + String monthId = list.get(0).getMonthId(); + Double dl = 0.0; + for (AblityIndexResultDTO.ScoreListResultDTO l : list) { + if (l.getMonthId().equals(monthId)) { + dl += l.getIndexTotal(); + } else { + AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); + double num1 = new BigDecimal(dl).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); + nldto.setIndexTotal(num1); + nldto.setMonthId(monthId); + nlList.add(nldto); + monthId = l.getMonthId(); + dl = l.getIndexTotal(); + } + if (FactConstant.DJNL.equals(l.getIndexCode())) { + djList.add(l); + } else if (FactConstant.ZLNL.equals(l.getIndexCode())) { + zlList.add(l); + } else if (FactConstant.FWNL.equals(l.getIndexCode())) { + fwList.add(l); + } + } + //把最后一个月的能力指标数据放入集合 + AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); + double num1 = new BigDecimal(dl).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); + nldto.setIndexTotal(num1); + nldto.setMonthId(monthId); + nlList.add(nldto); + + //7.封装数据并返回 + AblityIndexResultDTO nl = new AblityIndexResultDTO(); + nl.setIndexCode(FactConstant.NLZB); + nl.setScoreList(nlList); + if (null != nlList) { + resultList.add(nl); + } + AblityIndexResultDTO dj = new AblityIndexResultDTO(); + dj.setIndexCode(FactConstant.DJNL); + dj.setScoreList(djList); + if (null != djList) { + resultList.add(dj); + } + AblityIndexResultDTO zl = new AblityIndexResultDTO(); + zl.setIndexCode(FactConstant.ZLNL); + zl.setScoreList(zlList); + if (null != zlList) { + resultList.add(zl); + } + AblityIndexResultDTO fw = new AblityIndexResultDTO(); + fw.setIndexCode(FactConstant.FWNL); + fw.setScoreList(fwList); + if (null != fwList) { + resultList.add(fw); + } + + return resultList; + } + + /** + * @param formDTO + * @Description 按月份查询各项能力分数 + * @author sun + */ + @Override + public List scoreList(ScoreListFormDTO formDTO) { + List resultList = new LinkedList<>(); + //1.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //2.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); + if (null == agency) { + //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //3.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + resultList = factIndexAgencyScoreDao.selectAgencyWeightScoreList(formDTO); + //社区级 + } else if ("community".equals(agency.getLevel())) { + //3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + resultList = factIndexCommunityScoreDao.selectCommunityWeightScoreList(formDTO); + } else { + //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + + //4.网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //4-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + resultList = factIndexGridScoreDao.selectGridWeightScoreList(formDTO); + } else { + throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + + return resultList; + } + + /** + * @param formDTO + * @Description 按月份查询各项能力最近12个月得分 + * @author sun + */ + @Override + public List monthScoreList(MonthScoreListFormDTO formDTO) { + LinkedList resultList = new LinkedList<>(); + LinkedList list = new LinkedList<>(); + LinkedList djList = new LinkedList<>(); + LinkedList zlList = new LinkedList<>(); + LinkedList fwList = new LinkedList<>(); + //1.计算所查月份前12个月的monthId + formDTO.setStartMonthId(getDate(formDTO.getMonthId())); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); + if (null == agency) { + //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //4.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + list = factIndexAgencyScoreDao.selectAgencyMonthWeightScoreList(formDTO); + + //社区级 + } else if ("community".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + list = factIndexCommunityScoreDao.selectCommunityMonthWeightScoreList(formDTO); + } else { + //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + list = factIndexGridScoreDao.selectGridMonthWeightScoreList(formDTO); + } else { + throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + + //5.封装数据并返回 + for (MonthScoreListResultDTO.ScoreListResultDTO l : list) { + if (FactConstant.DJNL.equals(l.getIndexCode())) { + djList.add(l); + } else if (FactConstant.ZLNL.equals(l.getIndexCode())) { + zlList.add(l); + } else if (FactConstant.FWNL.equals(l.getIndexCode())) { + fwList.add(l); + } + } + MonthScoreListResultDTO dj = new MonthScoreListResultDTO(); + dj.setIndexCode(FactConstant.DJNL); + dj.setScoreList(djList); + if (null != djList) { + resultList.add(dj); + } + MonthScoreListResultDTO zl = new MonthScoreListResultDTO(); + zl.setIndexCode(FactConstant.ZLNL); + zl.setScoreList(zlList); + if (null != zlList) { + resultList.add(zl); + } + MonthScoreListResultDTO fw = new MonthScoreListResultDTO(); + fw.setIndexCode(FactConstant.FWNL); + fw.setScoreList(fwList); + if (null != fwList) { + resultList.add(fw); + } + + return resultList; + } + + /** + * @param formDTO + * @Description 按月查询各项指标数据 + * @author sun + */ + @Override + public List ablityList(AblityListFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //2.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); + if (null == agency) { + //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //3.根据组织级别拼接查询条件,判断查询不同数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getLevel())) { + formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); + } else { + formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); + } + resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); + + //社区级 + } else if ("community".equals(agency.getLevel())) { + formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); + resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); + } else { + //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //4.查询网格层级各项能力对应指标数据 + formDTO.setAllParentIndexCode(FactConstant.WANG_GE_XIANG_GUAN + ":" + formDTO.getIndexCode()); + resultList = factIndexGridSubScoreDao.selectGridAblityList(formDTO); + } else { + throw new RenException(String.format("按月查询各项指标数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + + //4.查询指标字典表数据 + List list = indexDictDao.selectList(); + //5.遍历数据,判断数据类型并处理 + resultList.forEach(result -> { + list.stream().filter(dto -> dto.getIndexCode().equals(result.getKey())).forEach(l -> { + result.setShowType(l.getValueType()); + //小数类型,四舍五入保留小数点后一位 + if (FactConstant.DECIMAL.equals(l.getValueType())) { + BigDecimal num = new BigDecimal(result.getValue()).setScale(1, BigDecimal.ROUND_HALF_UP); + result.setValue(num.toString()); + } + //百分数类型,四舍五入保留小数点后一位并转成百分比 + if (FactConstant.PERCENT.equals(l.getValueType())) { + BigDecimal num = new BigDecimal(result.getValue()).setScale(1, BigDecimal.ROUND_HALF_UP); + result.setValue(num + "%"); + } + }); + }); + + return resultList; + } + + /** + * @param formDTO + * @Description 按月查询各项指标最近12个月数据 + * @author sun + */ + @Override + public List monthAblityList(MonthAblityListFormDTO formDTO) { + LinkedList resultList = new LinkedList<>(); + //1.计算所查月份前12个月的monthId + formDTO.setStartMonthId(getDate(formDTO.getMonthId())); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); + if (null == agency) { + //throw new RenException(String.format("查询组织信息失败,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //4.根据组织级别拼接查询条件,判断查询不同数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); + //社区级 + } else if ("community".equals(agency.getLevel())) { + resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); + } else { + //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + return resultList; + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询网格层级某项能力对应的一项指标过去12个月份数据 + resultList = factIndexGridSubScoreDao.selectGridMonthAblityList(formDTO); + } else { + throw new RenException(String.format("按月查询各项指标最近12个月数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + + //6.查询指标字典表具体数据 + IndexDictResultDTO dictDTO = indexDictDao.selectIndexDict(formDTO.getKey()); + if (null == dictDTO) { + throw new RenException(String.format("根据评价指标indexCode未查询到字典表数据,indexCode值:%s", formDTO.getKey())); + } + + //7.遍历数据,判断数据类型并处理 + //小数或百分数类型,四舍五入保留小数点后一位 + if (FactConstant.DECIMAL.equals(dictDTO.getValueType()) || FactConstant.PERCENT.equals(dictDTO.getValueType())) { + resultList.forEach(result -> { + BigDecimal num = new BigDecimal(result.getAblity()).setScale(1, BigDecimal.ROUND_HALF_UP); + result.setAblity(num.toString()); + }); + } + + return resultList; + } + + /** + * @param newDate + * @Description 计算monthId对应一年前的monthId + * @author sun + */ + public String getDate(String newDate) { + if (!validDateEffecitive(newDate)) { + throw new RenException(String.format("monthId格式错误,monthId:%s", newDate)); + } + String date = ""; + SimpleDateFormat sdf = new SimpleDateFormat("yyyymm"); + try { + Calendar ds = Calendar.getInstance(); + ds.setTime(sdf.parse(newDate)); + ds.add(Calendar.YEAR, -1); + date = sdf.format(ds.getTime()); + } catch (RenException | ParseException e) { + e.printStackTrace(); + } + return date; + } + + /** + * @param newDate + * @Description 校验日期格式是否正确 + * @author sun + */ + public boolean validDateEffecitive(String newDate) { + //yyyy-MM-dd格式 + //String DATE_REGEX = "^([1-9]\\d{3}-)(([0]{0,1}[1-9]-)|([1][0-2]-))(([0-3]{0,1}[0-9]))$"; + //yyyymm格式 + String DATE_REGEX = "^([1-9]\\d{3})(([0]{0,1}[1-9])|([1][0-2]))$"; + boolean matches = Pattern.matches(DATE_REGEX, newDate); + if (!matches) { + return matches; + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyymm"); + //设置日期格式转的严谨性 + sdf.setLenient(false); + try { + sdf.parse(newDate); + } catch (ParseException e) { + e.printStackTrace(); + return false; + } + return matches; + } + + /** + * @param formDTO + * @Description 同级对比各项数据查询 + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List peerComparison(PeerComparisonFormDTO formDTO) { + //1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(按月查询) + if (null == formDTO.getMonthId() || "".equals(formDTO.getMonthId())) { + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + } + List resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); + return resultList; + } + + /** + * @param formDTO + * @Description 是否根组织 + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) { + RootAgencyResultDTO resultDTO = new RootAgencyResultDTO(); + //1.根据agencyId查询是否为根级组织 + int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId()); + if (num < NumConstant.ONE) { + resultDTO.setIsRoot(false); + } + //2.计算统计数据更新时间 + SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + //获取当前月第一天日期 + calendar.add(Calendar.MONTH, 0); + calendar.set(Calendar.DAY_OF_MONTH, 1); + //获取上月最后一天日期 + calendar.set(Calendar.HOUR, -24); + resultDTO.setDate(d.format(calendar.getTime())); + + return resultDTO; + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java index baa6e664e0..f4c4afa4d0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java @@ -1,6 +1,7 @@ package com.epmet.module.project.service; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.result.*; @@ -41,4 +42,12 @@ public interface ProjectService { * @Description 数据-项目-日/月数据查询 **/ List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO); + + /** + * @Description 项目详情 + * @Param processListFormDTO + * @author zxc + * @date 2020/10/23 10:33 上午 + */ + ProjectDetailResultDTO projectDetail( ProcessListFormDTO processListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 41af9351ac..45f1f87a0b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -3,11 +3,18 @@ package com.epmet.datareport.service.project.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.datareport.dao.project.ProjectDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataService; import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; +import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.module.project.service.ProjectService; import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.FactAgencyProjectDailyDTO; @@ -35,6 +42,10 @@ public class ProjectServiceImpl implements ProjectService { private ProjectDao projectDao; @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; + @Autowired + private ScreenDifficultyDataService screenDifficultyDataService; /** * @Author sun @@ -168,6 +179,31 @@ public class ProjectServiceImpl implements ProjectService { return resultList; } + /** + * @Description 项目详情 + * @Param processListFormDTO + * @author zxc + * @date 2020/10/23 10:33 上午 + */ + @Override + public ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO) { + ProjectDetailResultDTO projectDetailResultDTO = screenDifficultyDataService.projectDetail(processListFormDTO); + if (null == projectDetailResultDTO) { + return new ProjectDetailResultDTO(); + } + Result processList = govProjectOpenFeignClient.getProcessList(processListFormDTO); + if (!processList.success()) { + throw new RenException(ProjectConstant.PROCESS_FAILURE); + } + ProcessAndCurrentDeptResultDTO data = processList.getData(); + List processResultDTOS = ConvertUtils.sourceToTarget(data.getProcessList(), ProjectProcessResultDTO.class); + projectDetailResultDTO.setProcessList(processResultDTOS); + List departmentNameListResultDTOS = ConvertUtils.sourceToTarget(data.getDepartmentList(), DepartmentNameListResultDTO.class); + projectDetailResultDTO.setDepartmentList(departmentNameListResultDTOS); + projectDetailResultDTO.setDepartmentNameList(data.getDepartmentNameList()); + return projectDetailResultDTO; + } + /** * @author sun * @Description 获取机关ID diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index d3ebec947d..34d40361e4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -140,4 +140,12 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + + +jwt: + token: + #秘钥 + secret: 7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet] + #token有效时长,默认7天,单位秒 + expire: 604800 \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml new file mode 100644 index 0000000000..85ae080a02 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml new file mode 100644 index 0000000000..691f149e1c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml new file mode 100644 index 0000000000..29e6d24277 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml new file mode 100644 index 0000000000..db57d11ee3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml new file mode 100644 index 0000000000..249f24d125 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml new file mode 100644 index 0000000000..0cf826892b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml new file mode 100644 index 0000000000..fffd0604bf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + 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 22a62be6d0..f16395c129 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 @@ -47,6 +49,7 @@ screen_customer_agency WHERE del_flag = 0 + and is_display = 1 AND agency_id = #{agencyId} @@ -62,6 +65,7 @@ screen_customer_agency WHERE del_flag = 0 + AND is_display = 1 AND pid = #{agencyId} @@ -76,7 +80,7 @@ sutd.org_type AS type FROM screen_user_total_data sutd - LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id + LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id AND sca.is_display = 1 WHERE sutd.del_flag = '0' AND sca.del_flag = 0 @@ -94,11 +98,103 @@ sutd.org_type AS type FROM screen_user_total_data sutd - LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id + LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id AND sca.is_display = 1 WHERE sutd.del_flag = '0' AND sca.del_flag = 0 AND sutd.parent_id = #{parentId} + + + + + + + + + + + \ No newline at end of file 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..c072214600 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 @@ -21,14 +21,16 @@ @@ -77,6 +79,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/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 0bb479ed65..9c1325f591 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -30,4 +30,29 @@ DESC + + + + + + + + + + + + \ No newline at end of file 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 be4cf400b4..c5a9a6305d 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 @@ -61,21 +61,30 @@ LIMIT #{topNum} - - SELECT org_name AS `NAME`, service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility, - ORG_ID orgId + ORG_ID orgId, + ORG_TYPE orgType FROM screen_index_data_monthly WHERE del_flag = '0' AND parent_id = #{agencyId} - AND month_id = left(replace(DATE_SUB( CURDATE(),INTERVAL 1 MONTH),'-',''),6) + AND month_id = #{monthId,jdbcType=VARCHAR} + + + AND ORG_TYPE = #{orgType,jdbcType=VARCHAR} + + + AND ORG_TYPE != 'department' + + ORDER BY index_total ASC @@ -84,4 +93,163 @@ LIMIT #{topNum} + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 4aeae5361a..5b445202d5 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -13,26 +13,34 @@ screen_index_data_yearly WHERE del_flag = '0' - AND org_type = 'agency' AND org_id = #{agencyId} AND year_id = DATE_FORMAT(NOW(),'%Y') - + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index cbbc5fe211..42f6d5753c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -7,10 +7,10 @@ + SELECT ORG_ID, + PROJECT_TOTAL, + LEVEL + FROM screen_an_community_project_profile + WHERE DEL_FLAG = 0 + AND CUSTOMER_ID = #{customerId} + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml new file mode 100644 index 0000000000..f88612d078 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml new file mode 100644 index 0000000000..05c17e1378 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml @@ -0,0 +1,38 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmRankDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmRankDao.xml new file mode 100644 index 0000000000..dc13015231 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmRankDao.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml new file mode 100644 index 0000000000..82456904ea --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml index c0d3133d95..76db75d09f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml @@ -5,8 +5,8 @@ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java index f89ede1ba6..064104b9b2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -12,5 +12,7 @@ public interface DataSourceConstant { String RESI_GROUP = "resiGroup"; String EPMET_USER = "epmetuser"; String EVALUATION_INDEX = "evaluationIndex"; - + String PARTY_MEMBER = "partyMember"; + String EPMET_HEART="epmetHeart"; + String EPMET_POINT = "epmetPoint"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java new file mode 100644 index 0000000000..b14cf72156 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java @@ -0,0 +1,39 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/9/16 3:56 下午 + */ +public interface ExtractConstant { + + String PARTY = "党员"; + + String STRANGER = "陌生人"; + + String ISSUE_INFO = "查询议题信息为空"; + + String CREATED_TOPIC_USER_IDENTITY = "查询创建话题用户身份信息为空"; + + String PARENT_AGENCY_ID_LIST = "查询组织上级ID集合为空......"; + + String ISSUE_PROCESS = "查询查询议题process集合为空"; + + String SHIFT_PROJECT = "shift_project"; + + String CLOSE = "close"; + + String CLOSED = "closed"; + + String GRID_ORG_TYPE = "grid"; + + String RETURN_ACTION_CODE = "return"; + + String EVALUATE_BAD = "bad"; + + String EVALUATE_GOOD = "good"; + + String EVALUATE_PERFECT = "perfect"; + + String CUSTOMER_INFO_NULL = "客户【%s】未查出网格信息"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/OrgSourceTypeConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/OrgSourceTypeConstant.java new file mode 100644 index 0000000000..966c3edc80 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/OrgSourceTypeConstant.java @@ -0,0 +1,11 @@ +package com.epmet.constant; + +public interface OrgSourceTypeConstant { + + // 外部 + String EXTERNAL = "external"; + + // 内部 + String INTERNAL = "internal"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ProjectEvaluateConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ProjectEvaluateConstant.java new file mode 100644 index 0000000000..a2c15b100e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ProjectEvaluateConstant.java @@ -0,0 +1,19 @@ +package com.epmet.constant; + +import com.epmet.commons.tools.constant.NumConstant; + +/** + * @Author zxc + * @DateTime 2020/9/18 3:49 下午 + */ +public interface ProjectEvaluateConstant { + +// BigDecimal BAD = new BigDecimal(NumConstant.SIXTY); +// BigDecimal GOOD = new BigDecimal(NumConstant.EIGHTY); +// BigDecimal PERFECT = new BigDecimal(NumConstant.ONE_HUNDRED); + + Integer BAD = NumConstant.SIXTY; + Integer GOOD = NumConstant.EIGHTY; + Integer PERFECT = NumConstant.ONE_HUNDRED; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ScreenConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ScreenConstant.java new file mode 100644 index 0000000000..43c9e08e40 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ScreenConstant.java @@ -0,0 +1,29 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/9/22 2:19 下午 + */ +public interface ScreenConstant { + + String COMMUNITY = "community"; + + String STREET = "street"; + + String DISTRICT = "district"; + + String CITY = "city"; + + String PROVINCE = "province"; + + String LEVEL = "level"; + + String STR_NULL = ""; + + String ENGLISH_COMMA = ","; + + String GRID = "grid"; + + String AGENCY = "agency"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java new file mode 100644 index 0000000000..a5bec0da20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java @@ -0,0 +1,13 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/9/17 2:56 下午 + */ +public interface StatsConstant { + + String PARTY_INFO_LIST = "客户【%s】查询党员信息集合为空......"; + + String CUSTOMER_INFO_NULL = "查询所有客户ID为空"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java new file mode 100644 index 0000000000..fc179c63e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 对象行为动作维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Data +public class DimObjectActionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 行为code + */ + private String actionCode; + + /** + * 行为描述 + */ + private String actionDesc; + + /** + * 行为类型 topic,issue,project,article,group + */ + private String actionType; + + /** + * 父级ID(本表id) + */ + private String pid; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java new file mode 100644 index 0000000000..28128a83ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 对象行为状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Data +public class DimObjectStatusDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 行为code + */ + private String statusCode; + + /** + * 行为描述 + */ + private String statusDesc; + + /** + * 行为类型 topic,issue,project,article,group + */ + private String statusType; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java new file mode 100644 index 0000000000..8292361039 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java @@ -0,0 +1,155 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; +import lombok.Data; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +public class FactOriginGroupMainDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组的Id + */ + private String id; + + private String customerId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String groupState; + + /** + * 小组所在网格Id + */ + private String gridId; + + /** + * 小组所在机关Id + */ + private String agencyId; + + /** + * 小组所在组织的父机关Id + */ + private String parentId; + + /** + * 小组所在组织所有父类Id集合 + */ + private String pids; + + /** + * 建群申请审核通过的时期 + */ + private String dateId; + + /** + * 建群申请审核通过的周期 + */ + private String weekId; + + /** + * 建群申请审核通过的月份 + */ + private String monthId; + + /** + * 建群申请审核通过的季度 + */ + private String quarterId; + + /** + * 建群申请审核通过的年 + */ + private String yearId; + + /** + * 群众人数 + */ + private Integer resiMemberCount; + + /** + * 组内总人数 + */ + private Integer memberTotal; + + /** + * 群主ID + */ + private String groupOwnerId; + + /** + * 群主是否热心居民 可以update + */ + private Integer isOwnerHearted; + + /** + * 群主是否党员 可以update + */ + private Integer isOwnerParty; + + /** + * 删除标识 默认为0 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + + + private List members = new ArrayList(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java new file mode 100644 index 0000000000..433f95177e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题记录附表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +public class FactOriginIssueLogDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织上级ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 党员 热心居民 居民 + */ + private Integer isParty; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java new file mode 100644 index 0000000000..a77815e3ea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java @@ -0,0 +1,152 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题主表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +public class FactOriginIssueMainDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String id; + + /** + * 日ID(指议题创建的yyyymmdd) + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户身份标识 + */ + private Integer isParty; + + /** + * 转议题用户ID + */ + private String userId; + + /** + * 创建话题用户的ID + */ + private String createTopicUserId; + + /** + * 转为议题的话题ID + */ + private String topicId; + + /** + * 议题网格ID + */ + private String gridId; + + /** + * 上级ID + */ + private String pid; + + /** + * 议题组织ID(网格所属组织ID) + */ + private String agencyId; + + /** + * 议题状态 + */ + private String issueStatus; + + /** + * 创建话题用户身份标识 + */ + private Integer topicUserIsParty; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public FactOriginIssueMainDailyDTO() { + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java new file mode 100644 index 0000000000..8f5f1571db --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java @@ -0,0 +1,143 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +public class FactOriginProjectLogDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格grid,部门department + */ + private String orgType; + + /** + * 网格ID + */ + private String orgId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 操作人所在父Id,当orgType不为空时,agencyId与pid一致 + * 当orgType为空时,pid是agencyId的上级,没有上级则默认为0 + * */ + private String pid; + + /** + * 操作人所在所有父机Id集合,当orgType不为空时,pids最后一节一定包含pid + * 当orgType为空时,pids是agencyId的所有上级,没有上级则为空串 + * */ + private String pids; + + /** + * 日期ID + */ + private String dateId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 是否主动发起人 1 是, 0 否 + */ + private Integer isActive; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java new file mode 100644 index 0000000000..f24397f43d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java @@ -0,0 +1,166 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +public class FactOriginProjectMainDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 项目ID + */ + private String id; + + /** + * 项目的发布日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 转议题用户ID + */ + private String issueCreatorId; + + /** + * 转为项目的议题ID + */ + private String issueId; + + /** + * 转为议题的话题ID + */ + private String topicId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 上级ID + */ + private String pid; + + /** + * 所有上级Id集合 (项目来源) + * */ + private String pids; + + /** + * 组织ID(网格所属组织ID) + */ + private String agencyId; + + /** + * 状态 + */ + private String projectStatus; + + /** + * resolved unresolved + * */ + private String isResolved; + + /** + * 创建话题用户的ID + */ + private String topicCreatorId; + + /** + * 是否是党员 1:是 + */ + private String isParty; + + /** + * 是否超期 1:是 + */ + private String isOverdue; + + /** + * 办结组织Ids(:隔开,有可能是社区id可能是网格id,无需区分级别,在统计时模糊查询) + */ + private String finishOrgIds; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java new file mode 100644 index 0000000000..e9bb3e944e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java @@ -0,0 +1,128 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 业务数据抽取-机关项目响应时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +public class FactOriginProjectOrgPeriodDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * + */ + private String orgId; + + /** + * grid agenct dept + */ + private String orgType; + + /** + * 如果是机关,则为父级机关(若已是顶级机关则为0);如果是网格和部门,则为所属机关 + */ + private String pid; + + /** + * 最后一个节点是PID,若无则为空 + */ + private String pids; + + /** + * 流转到的日期 + */ + private Date informedDate; + + /** + * 流转走或结案的日期 + */ + private Date handledDate; + + /** + * 响应时长,从流转到自己到流转走共耗时/小时(不算法定节假日和周末) + */ + private Integer totalPeriod; + + /** + * 截至第一次响应时长,从流转到第一次处理(响应、结案、流转)耗时,大于等于上一项值 + */ + private Integer periodTillReplyFirstly; + + /** + * resloved 、 unresolved + */ + private String isResolved; + + /** + * 办结的操作,return(回退)、transfer(流转)、closed(结案),但是不包括response(响应)! + * */ + private String operation; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date updatedTime; + + /** + * + */ + private String updatedBy; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java new file mode 100644 index 0000000000..c188b64a57 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:抽取指标数据 参数dto + */ +@Data +public class ExtractIndexFormDTO implements Serializable { + + + private static final long serialVersionUID = 1248641210655148366L; + + private String customerId; + + private String monthId; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java new file mode 100644 index 0000000000..2eb18b8a35 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * desc: 从业务数据抽取到统计库 dto + * + * @Author zxc + * @DateTime 2020/9/16 6:01 下午 + */ +@Data +public class ExtractOriginFormDTO implements Serializable { + + private static final long serialVersionUID = -6180252151765854242L; + + public interface ExtractForm extends CustomerClientShowGroup { + } + + @NotBlank(message = "客户ID不能为空", groups = ExtractForm.class) + private String customerId; + + @NotBlank(message = "dateId不能为空", groups = ExtractForm.class) + private String dateId; + + /** + * 开始时间 + */ + private String startDate; + /** + * 结束时间 + */ + private String endDate; +} 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..c4cff4cf5b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java @@ -0,0 +1,25 @@ +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; + private String startMonth; + private String endMonth; + private String startDate; + private String endDate; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java new file mode 100644 index 0000000000..890e663083 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java @@ -0,0 +1,148 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract.form; + +import java.io.Serializable; +import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 治理能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-18 + */ +@Data +public class GovernAbilityGridMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; + + /** + * 网格办结项目数 统计期内办结的项目数目 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public GovernAbilityGridMonthlyFormDTO() { + this.issueTotal = NumConstant.ZERO; + this.avgIssueCount = NumConstant.ZERO; + this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO); + this.projectTotal = NumConstant.ZERO; + this.selfSolveProjectCount = NumConstant.ZERO; + this.resolveProjectCount = NumConstant.ZERO; + this.transferRightRatio = new BigDecimal(NumConstant.ZERO); + this.satisfactionRatio = new BigDecimal(NumConstant.ZERO); + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java new file mode 100644 index 0000000000..f570700d01 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName GridHeartedFormDTO + * @Auth wangc + * @Date 2020-09-20 12:42 + */ +@Data +public class GridHeartedFormDTO implements Serializable { + private static final long serialVersionUID = 9069263069122734316L; + + private String userId; + + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java new file mode 100644 index 0000000000..207cd8e8df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 10:12 上午 + */ +@Data +public class GridIssueCountResultDTO implements Serializable { + + private static final long serialVersionUID = -1222149631076688225L; + + /** + * 网格总议题数目 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格ID + */ + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java new file mode 100644 index 0000000000..7ab1f8d280 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.AllArgsConstructor; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 2:23 下午 + */ +@Data +@AllArgsConstructor +public class IssueInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 8805754438522195653L; + + public interface IssueInfo extends CustomerClientShowGroup{} + + /** + * 客户ID + */ + @NotBlank(message = "customerId",groups = IssueInfo.class) + private String customerId; + + /** + * 日期ID(实际为议题创建的 "yyyymmdd" ) + */ + @NotBlank(message = "dateId",groups = IssueInfo.class) + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java new file mode 100644 index 0000000000..fa2228bbbb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java @@ -0,0 +1,114 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/14 5:42 下午 + */ +@Data +public class IssueLogDailyFormDTO implements Serializable { + + private static final long serialVersionUID = 7036617958351476594L; + + /** + * 议题ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织上级ID + */ + private String pid; + + private String pids; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 党员 热心居民 居民 + */ + private Integer isParty; + + /** + * 是否已删除(0-未删除,1-已删除) + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建者 + */ + private String createdBy; + + /** + * 修改者 + */ + private String updatedBy; + + public IssueLogDailyFormDTO() { + this.delFlag = delFlag = 0; + this.revision = revision = 0; + this.createdBy = createdBy = "APP_USER"; + this.updatedBy = updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java new file mode 100644 index 0000000000..5cbaa9f748 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java @@ -0,0 +1,130 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2020/9/14 5:47 下午 + */ +@Data +public class IssueMainDailyFormDTO implements Serializable { + + private static final long serialVersionUID = -5288003778076157611L; + + /** + * 议题ID + */ + private String id; + + /** + * 日ID(指议题创建的yyyymmdd) + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户身份标识 + */ + private Integer isParty; + + /** + * 转议题用户ID + */ + private String userId; + + /** + * 创建话题用户的ID + */ + private String createTopicUserId; + + /** + * 转为议题的话题ID + */ + private String topicId; + + /** + * 议题网格ID + */ + private String gridId; + + /** + * 上级ID + */ + private String pid; + + private String pids; + + /** + * 议题组织ID(网格所属组织ID) + */ + private String agencyId; + + /** + * 议题状态 + */ + private String issueStatus; + + /** + * 关闭状态 + */ + private String resolveType; + + /** + * 创建话题用户身份标识 + */ + private Integer topicUserIsParty; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public IssueMainDailyFormDTO() { + this.delFlag = 0; + this.revision = 0; + 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/form/PartyAbilityGridMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyAbilityGridMonthlyFormDTO.java new file mode 100644 index 0000000000..de69be568b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyAbilityGridMonthlyFormDTO.java @@ -0,0 +1,178 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract.form; + +import java.io.Serializable; +import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党建能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-19 + */ +@Data +public class PartyAbilityGridMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Idyyyy + */ + private String yearId; + + /** + * 网格群众用户数 + */ + private Integer userCount; + + /** + * 网格党员用户数 + */ + private Integer partyCount; + + /** + * 网格活跃群众用户数 + */ + private Integer activeUserCount; + + /** + * 网格活跃党员用户数 + */ + private Integer activePartyCount; + + /** + * 网格党员人均提出话题数 + */ + private Integer partyAvgTopicCount; + + /** + * 网格群众人均提出话题数 + */ + private Integer userAvgTopicCount; + + /** + * 网格党员人均提出的议题转项目数 + */ + private Integer partyAvgShiftProjectCount; + + /** + * 网格群众人均提出的议题转项目数 + */ + private Integer userAvgShiftProjectCount; + + /** + * 建群党员数(累计值) 去重 + */ + private Integer createGroupPartyCount; + + /** + * 网格发文数 + */ + private Integer publishArticleCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 组织三会一课次数 + */ + private Integer createThreeMeetsCount; + + /** + * 党员参加三会一课人次 + */ + private Integer joinThreeMeetsCount; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public PartyAbilityGridMonthlyFormDTO() { + this.userCount = NumConstant.ZERO; + this.partyCount = NumConstant.ZERO; + this.activeUserCount = NumConstant.ZERO; + this.activePartyCount = NumConstant.ZERO; + this.partyAvgTopicCount = NumConstant.ZERO; + this.userAvgTopicCount = NumConstant.ZERO; + this.partyAvgShiftProjectCount = NumConstant.ZERO; + this.userAvgShiftProjectCount = NumConstant.ZERO; + this.createGroupPartyCount = NumConstant.ZERO; + this.publishArticleCount = NumConstant.ZERO; + this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO); + this.createThreeMeetsCount = NumConstant.ZERO; + this.joinThreeMeetsCount = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyBaseInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyBaseInfoFormDTO.java new file mode 100644 index 0000000000..436208c1e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyBaseInfoFormDTO.java @@ -0,0 +1,132 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/22 3:19 下午 + */ +@Data +public class PartyBaseInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 1685776533893300943L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 注册用户数 + */ + private Integer registerUserCount; + + /** + * 群众用户数 + */ + private Integer resiTotal; + + /** + * 注册党员数 + */ + private Integer partyMemberCount; + + /** + * 小于20岁的党员总人数 + */ + private Integer ageLevel1; + + /** + * 20-30岁的党员总人数 + */ + private Integer ageLevel2; + + /** + * 31-40岁的党员总人数 + */ + private Integer ageLevel3; + + /** + * 41-50岁的党员总人数 + */ + private Integer ageLevel4; + + /** + * 51-60岁的党员总人数 + */ + private Integer ageLevel5; + + /** + * 60+岁的党员总人数 + */ + private Integer ageLevel6; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public PartyBaseInfoFormDTO() { + this.registerUserCount = NumConstant.ZERO; + this.resiTotal = NumConstant.ZERO; + this.partyMemberCount = NumConstant.ZERO; + this.ageLevel1 = NumConstant.ZERO; + this.ageLevel2 = NumConstant.ZERO; + this.ageLevel3 = NumConstant.ZERO; + this.ageLevel4 = NumConstant.ZERO; + this.ageLevel5 = NumConstant.ZERO; + this.ageLevel6 = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ProjectFormDTO.java new file mode 100644 index 0000000000..1089f09988 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ProjectFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/17 16:24 + */ +@Data +public class ProjectFormDTO implements Serializable { + private static final long serialVersionUID = 5875702013226180335L; + private String customerId; + private Date date; +} 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..72f9456cf8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java @@ -0,0 +1,100 @@ +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.organizeCount = NumConstant.ZERO; + this.joinUserCount = NumConstant.ZERO; + this.averageJoinUserCount = NumConstant.ZERO; + 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/AgencyInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java new file mode 100644 index 0000000000..2bc3b897e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 6:13 下午 + */ +@Data +public class AgencyInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 2823049943836552367L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 机关的父ID + */ + private String pid; + + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AutoNoMyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AutoNoMyResultDTO.java new file mode 100644 index 0000000000..234142eb80 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AutoNoMyResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 5:22 下午 + */ +@Data +public class AutoNoMyResultDTO implements Serializable { + + private static final long serialVersionUID = 5812052000386418907L; + + /** + * 动作code + */ + private String actionCode; + + /** + * 网格ID + */ + private String gridId; + + /** + * 项目ID + */ + private String projectId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CalSatisfactionResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CalSatisfactionResultDTO.java new file mode 100644 index 0000000000..811f33c30b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CalSatisfactionResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 4:01 下午 + */ +@Data +public class CalSatisfactionResultDTO implements Serializable { + + private static final long serialVersionUID = -7514945819312915670L; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CreateTopicCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CreateTopicCountResultDTO.java new file mode 100644 index 0000000000..1aa548f014 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CreateTopicCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 1:55 下午 + */ +@Data +public class CreateTopicCountResultDTO implements Serializable { + + private static final long serialVersionUID = 500844515980125608L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 党员/群众 人均提出话题数 + */ + private Integer createTopicCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CustomerAgencyInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CustomerAgencyInfoResultDTO.java new file mode 100644 index 0000000000..5828ead388 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CustomerAgencyInfoResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/22 4:21 下午 + */ +@Data +public class CustomerAgencyInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -584952326059903779L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 机关名称 + */ + private String agencyName; + + /** + * 机关父级ID + */ + private String pid; + + /** + * 机关级别 + */ + private String level; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java new file mode 100644 index 0000000000..c3275dc075 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: 网格级别小组内的组成员数 + * + * @author LiuJanJun + * @date 2020/9/27 2:27 下午 + */ +@Data +public class GridGroupUserCountResultDTO implements Serializable { + + + private static final long serialVersionUID = -4729061928990808187L; + /** + * 客户ID + */ + private String customerId; + + private String orgId; + + private Integer memberCount; + /** + * 网格的pids + */ + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..9555ea578c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 2:59 下午 + */ +@Data +public class GridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -8146474744340303247L; + + private String agencyId; + + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java new file mode 100644 index 0000000000..910ea4759a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.extract.result; + +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/24 2:45 下午 + */ +@Data +@AllArgsConstructor +public class GridPartyDTO implements Serializable { + + private static final long serialVersionUID = -6699064424253966688L; + + private List orgIds; + + private List result; +} 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/GridProjectClosedTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectClosedTotalResultDTO.java new file mode 100644 index 0000000000..512e594ad2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectClosedTotalResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 2:02 下午 + */ +@Data +public class GridProjectClosedTotalResultDTO implements Serializable { + + private static final long serialVersionUID = 5144371528837124674L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格办结项目数 + */ + private Integer resolveProjectCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java new file mode 100644 index 0000000000..6d0a8cf1d7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/18 1:22 下午 + */ +@Data +public class GridProjectCountResultDTO implements Serializable { + + private static final long serialVersionUID = -1348707512443965601L; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java new file mode 100644 index 0000000000..b09fadce99 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.extract.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 10:59 上午 + */ +@Data +public class GridUserCountResultDTO implements Serializable { + + private static final long serialVersionUID = -2912049598149499392L; + + /** + * 注册居民本月增量 + */ + private Integer userCount = NumConstant.ZERO; + + /** + * 注册党员本月增量 + */ + private Integer partyCount = NumConstant.ZERO; + + /** + * 网格ID 或组织Id + */ + private String orgId; + + /** + * 用户总数 + */ + private Integer regTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java new file mode 100644 index 0000000000..b09aefb549 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 2:04 下午 + */ +@Data +public class IssueInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 3097591617162404015L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 议题状态 + */ + private String issueStatus; + + /** + * 话题ID + */ + private String topicId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 用户ID + */ + private String userId; + + /** + * 关闭状态 + */ + private String resolveType; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java new file mode 100644 index 0000000000..f3dd236dee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2020/9/16 1:27 下午 + */ +@Data +public class IssueProcessInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 104679947108492259L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 用户ID + */ + private String userId; + + private Date createTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java new file mode 100644 index 0000000000..01531e3bb1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * desc: 议题投票统计结果DTO + * + * @author LiuJanJun + * @date 2020/9/27 11:22 上午 + */ +@Data +public class IssueVoteStatisticalResultDTO implements Serializable { + + + private static final long serialVersionUID = 2631108929053690349L; + /** + * 主键ID + */ + private String id; + + /** + * 议题ID + */ + private String issueId; + + /** + * 统计日期 yyyy-MM-dd + */ + private Date statisticalDate; + + /** + * 到该日的总赞成数 + */ + private Integer supportCount; + + /** + * 到该日的总反对数 + */ + private Integer oppositionCount; + + /** + * 到该日的总票数 + */ + private Integer totalCount; + + /** + * 该日增量 + */ + private Integer todayIncrement; + + /** + * 该日赞成增量 + */ + private Integer supportIncrement; + + /** + * 该日反对增量 + */ + private Integer oppositionIncrement; + + /** + * 到该日的应表决数 + */ + private Integer votableCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java new file mode 100644 index 0000000000..e26bd0ec2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: 议题投票人数 + * + * @author LiuJanJun + * @date 2020/9/27 2:27 下午 + */ +@Data +public class IssueVoteUserCountResultDTO implements Serializable { + + + private static final long serialVersionUID = -4729061928990808187L; + private String orgId; + private Integer voteCount; + private Integer issueCount; + /** + * 网格的pids + */ + private String pids; +} 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/extract/result/NotReturnProjectResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/NotReturnProjectResultDTO.java new file mode 100644 index 0000000000..70f0efd484 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/NotReturnProjectResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.extract.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/18 2:46 下午 + */ +@Data +public class NotReturnProjectResultDTO implements Serializable { + + private static final long serialVersionUID = -2931817313224740122L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 未被退回的项目 + */ + private Integer notReturnProject = NumConstant.ZERO; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio = new BigDecimal(NumConstant.ZERO); +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java new file mode 100644 index 0000000000..66764c2674 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 1:23 下午 + */ +@Data +public class OrgNameResultDTO implements Serializable { + + private static final long serialVersionUID = -4815327768546033428L; + + private String gridId; + + private String agencyId; + + private String gridName; + + private String agencyName; + + private String parentId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java new file mode 100644 index 0000000000..88735859d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 各机关响应时间 + * @ClassName OrgResponseTimeResultDTO + * @Auth wangc + * @Date 2020-09-21 02:03 + */ +@Data +public class OrgResponseTimeResultDTO implements Serializable { + private static final long serialVersionUID = 6017440139236985959L; + + private String agencyId; + + private BigDecimal responseTime; + + private BigDecimal projectTotal; + + private BigDecimal distinctProjectTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java new file mode 100644 index 0000000000..d7fca3b15d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 14:39 + */ +@Data +public class OrgStatisticsResultDTO implements Serializable { + private static final long serialVersionUID = 9221060553279124719L; + private String customerId; + private String agencyId; + private String orgId; + private Integer count; + private Integer sum; + private BigDecimal ratio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyActiveResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyActiveResultDTO.java new file mode 100644 index 0000000000..53bc3f2658 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyActiveResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/21 9:35 上午 + */ +@Data +public class PartyActiveResultDTO implements Serializable { + + private static final long serialVersionUID = 4694666116463447613L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 动作操作用户ID + */ + private String userId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyCreateGroupCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyCreateGroupCountResultDTO.java new file mode 100644 index 0000000000..c95ae4bad3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyCreateGroupCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 3:30 下午 + */ +@Data +public class PartyCreateGroupCountResultDTO implements Serializable { + + private static final long serialVersionUID = -4193777575465275095L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 建群党员数 + */ + private Integer partyCreateGroupCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyInfoResultDTO.java new file mode 100644 index 0000000000..3fbf004243 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyInfoResultDTO.java @@ -0,0 +1,85 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/23 1:58 下午 + */ +@Data +public class PartyInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -5275089831499409888L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 注册用户数 + */ + private Integer registerUserCount; + + /** + * 群众用户数 + */ + private Integer resiTotal; + + /** + * 注册党员数 + */ + private Integer partyMemberCount; + + /** + * 小于20岁的党员总人数 + */ + private Integer ageLevel1; + + /** + * 20-30岁的党员总人数 + */ + private Integer ageLevel2; + + /** + * 31-40岁的党员总人数 + */ + private Integer ageLevel3; + + /** + * 41-50岁的党员总人数 + */ + private Integer ageLevel4; + + /** + * 51-60岁的党员总人数 + */ + private Integer ageLevel5; + + /** + * 60+岁的党员总人数 + */ + private Integer ageLevel6; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java new file mode 100644 index 0000000000..24e5ec021a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2020/9/22 5:23 下午 + */ +@Data +public class PartyMemberInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 6591845785373556485L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级ID + */ + private String parentId; + + /** + * 生日 + */ + private Date birthday; + + /** + * 年龄 + */ + private Integer age; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 机关名称 + */ + private String agencyName; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectEvaluateResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectEvaluateResultDTO.java new file mode 100644 index 0000000000..1e9c927663 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectEvaluateResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.extract.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/18 3:23 下午 + */ +@Data +public class ProjectEvaluateResultDTO implements Serializable { + + private static final long serialVersionUID = 6042094904405338630L; + + /** + * 动作code + */ + private String actionCode; + + /** + * 网格ID + */ + private String gridId; + + /** + * 满意度评价对应的分数 + */ + private Integer score = NumConstant.ZERO; + + /** + * 项目ID + */ + private String projectId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java new file mode 100644 index 0000000000..f7714ca882 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 参与过项目的agencyDTO + * @ClassName ProjectParticipatedAgencyResultDTO + * @Auth wangc + * @Date 2020-09-20 23:40 + */ +@Data +public class ProjectParticipatedAgencyResultDTO implements Serializable { + private static final long serialVersionUID = 1071619125612033138L; + + private String agencyId; + + private int count; + + private String projectId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PublishCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PublishCountResultDTO.java new file mode 100644 index 0000000000..2044dcd8fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PublishCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 2:41 下午 + */ +@Data +public class PublishCountResultDTO implements Serializable { + + private static final long serialVersionUID = -955208044108055887L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 发文数量 + */ + private Integer publishCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java new file mode 100644 index 0000000000..7d9f03f897 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/16 5:14 下午 + */ +@Data +public class SatisfactionInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1194031573388458848L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 用户ID + */ + private String userId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ShiftProjectCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ShiftProjectCountResultDTO.java new file mode 100644 index 0000000000..7519e32c48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ShiftProjectCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 2:23 下午 + */ +@Data +public class ShiftProjectCountResultDTO implements Serializable { + + private static final long serialVersionUID = -262809191405218048L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 党员/群众 人均提出的议题转项目数 + */ + private Integer shiftProjectCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java new file mode 100644 index 0000000000..4e22a2908f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 4:52 下午 + */ +@Data +public class TopicInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -5902552728088278104L; + + private String topicId; + + private String userId; + + private Integer isParty; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TransferRightRatioResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TransferRightRatioResultDTO.java new file mode 100644 index 0000000000..e284689538 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TransferRightRatioResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/19 2:00 下午 + */ +@Data +public class TransferRightRatioResultDTO implements Serializable { + + private String projectId; + + private String gridId; + + private Boolean status; + + private Integer notReturnProject; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserCountResultDTO.java new file mode 100644 index 0000000000..0d5e34a62d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserCountResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/23 9:54 上午 + */ +@Data +public class UserCountResultDTO implements Serializable { + + private static final long serialVersionUID = -6349371693110337172L; + + /** + * 群众用户数 + */ + private Integer resiTotal; + + /** + * 注册用户数 + */ + private Integer registerUserCount; + + /** + * 注册党员数 + */ + private Integer partyMemberCount; + + /** + * 网格ID / 机关ID + */ + private String orgId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java new file mode 100644 index 0000000000..c0011ab7c0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 4:20 下午 + */ +@Data +public class UserPartyResultDTO implements Serializable { + + private static final long serialVersionUID = 6688297568032159824L; + + private String userId; + + private String roleName; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java new file mode 100644 index 0000000000..a95e36f708 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 数据抽取 - 小组成员DTO 目前查询和插入都使用这一个 + * @ClassName ExtractGroupMemberActionRecordResultDTO + * @Auth wangc + * @Date 2020-09-18 21:18 + */ +@Data +public class ExtractGroupMemberActionRecordResultDTO implements Serializable { + private static final long serialVersionUID = -74883228267461785L; + private String customerId; + + private String groupId; + + private String gridId; + + private String agencyId; + + private String parentId; + + private String pids; + + private String memberId; + + private String leaderFlag; + + private String dateId; + + private String weekId; + + private String monthId; + + private String quarterId; + + private String yearId; + + private Date joinDate; + + /** + * 目前只有join leader入群也是join + * */ + private String actionCode; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/TopicContentResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/TopicContentResultDTO.java new file mode 100644 index 0000000000..28050e24e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/TopicContentResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName TopicContentResultDTO + * @Auth wangc + * @Date 2020-09-28 16:30 + */ +@Data +public class TopicContentResultDTO implements Serializable { + private static final long serialVersionUID = -1720511234376795113L; + + private String topicId; + + private String content; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java index 605f755064..42d0ce8fa3 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -69,12 +69,17 @@ public class AgencyScoreDTO implements Serializable { /** * 月维度Id: yyyyMM */ - private String monthId; + private String monthId; /** * 1:总分;0不是;默认0 */ - private String isTotal; + private String isTotal; + + /** + * 参与计算的原始值 + */ + private String originValue; /** * 分值 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CpcScoreResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CpcScoreResultDTO.java new file mode 100644 index 0000000000..31b115caab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CpcScoreResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 党员指标得分查询DTO + * @ClassName CpcScoreResultDTO + * @Auth wangc + * @Date 2020-09-25 16:52 + */ +@Data +public class CpcScoreResultDTO implements Serializable { + private static final long serialVersionUID = -7129757727997430029L; + + /** + * 用户Id + * */ + private String userId; + + /** + * 党员指标得分 + * */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridSubScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridSubScoreDTO.java new file mode 100644 index 0000000000..a1624409c2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridSubScoreDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 网格相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/31 16:38 + */ +@Data +public class GridSubScoreDTO implements Serializable { + /** + * 网格Id + */ + private String gridId; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + private List detailList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/CustomerBizOrgFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/CustomerBizOrgFormDTO.java new file mode 100644 index 0000000000..f342ac03bd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/CustomerBizOrgFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; + +/** + * 客户业务组织关系 入参 + */ +@Data +public class CustomerBizOrgFormDTO implements Serializable { + + + /** + * 当为true时后台将删除本月数据 + */ + @NotEmpty(message = "客户Id不能为空") + private String customerId; + + /** + * 业务类型:智慧社区: community + */ + @NotEmpty(message = "业务类型不能为空") + private String bizType; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java new file mode 100644 index 0000000000..f697eae86f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员相关用 + * + * @author yinzuomei@elink-cn.com + * @date 2020/10/12 21:57 + */ +@Data +public class CpcIndexCommonDTO implements Serializable { + private static final long serialVersionUID = -424750065699208595L; + private String userId; + private Integer indexValue; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java new file mode 100644 index 0000000000..3cec199149 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格服务能力用 + * + * @author yinzuomei@elink-cn.com + * @date 2020/10/14 10:02 + */ +@Data +public class GridIndexCommonDTO implements Serializable { + private static final long serialVersionUID = -4316054054019675419L; + private String gridId; + private Integer indexValue; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueDTO.java new file mode 100644 index 0000000000..89035c396b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueDTO.java @@ -0,0 +1,147 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String id; + + /** + * 议题状态 表决中:voting 已转项目:shift_project 已关闭:closed + */ + private String issueStatus; + + /** + * 来源类型 eg:resi_topic + */ + private String sourceType; + + /** + * 来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID) + */ + private String sourceId; + + /** + * 关闭理由 【未关闭时可以为空】关闭议题时必填的理由,转项目后而且已经结案,这个字段不回写 + */ + private String closeReason; + + /** + * 解决类型 【未关闭时可以为空】已解决resolved、未解决unresolved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写 + */ + private String resolveType; + + /** + * 议题名称 最多20字 + */ + private String issueTitle; + + /** + * 建议 最多1000字 + */ + private String suggestion; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID 居民端议题对应一个网格Id + */ + private String gridId; + + /** + * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 + */ + private String orgIdPath; + + /** + * 组织ID 【数据权限-非必填】agencyId + */ + private String orgId; + + /** + * 表决截止日期 + */ + private Date votingDeadline; + + /** + * 表决发起日期(转议题日期) + */ + private Date decidedTime; + + /** + * 转项目日期 (服务间调用日期一致性) + */ + private Date shiftedTime; + + /** + * 关闭日期 + */ + private Date closedTime; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java new file mode 100644 index 0000000000..993c4ef354 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.org; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格基本信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/16 14:00 + */ +@Data +public class GridInfoDTO implements Serializable { + private static final long serialVersionUID = -5328705277000477630L; + /** + * 话题所属的网格ID + */ + private String gridId; + + /** + * 所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String pid; + + /** + * 客户id + */ + private String customerId; + + /** + * 所有上级组织ID,英文:隔开 + * agencyId的pids + */ + private String pids; + + /** + * 网格名称 + * */ + private String gridName; + + /** + * 机关名称 + * */ + private String orgName; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/party/PartyMemberDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/party/PartyMemberDTO.java new file mode 100644 index 0000000000..b05a2438b4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/party/PartyMemberDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.party; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/16 10:50 + */ +@Data +public class PartyMemberDTO implements Serializable { + private static final long serialVersionUID = 7326830619481816838L; + private String gridId; + private String userId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/point/UserPointDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/point/UserPointDTO.java new file mode 100644 index 0000000000..067ebbf254 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/point/UserPointDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.point; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 用户积分DTO + * @ClassName UserPointDTO + * @Auth wangc + * @Date 2020-09-25 15:42 + */ +@Data +public class UserPointDTO implements Serializable { + private static final long serialVersionUID = 6976982699085437418L; + + /** + * 用户Id + * */ + private String userId; + + /** + * 用户累计积分 + * */ + private Integer pointTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java new file mode 100644 index 0000000000..9f1b3b3d36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 21:08 + */ +@Data +public class FinishOrgDTO implements Serializable { + + private static final long serialVersionUID = -5684606755705833962L; + + private String departmentId; + private String gridId; + private String projectId; + private String orgIdPath; + private String pIdPath; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java new file mode 100644 index 0000000000..1a0458c5fd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/16 17:00 + */ +@Data +public class ProcessInfoDTO implements Serializable { + private static final long serialVersionUID = 4586424046147127143L; + private String agencyId; + private String departmentId; + private String gridId; //可能是负责人所属的网格Id,也可能是满意度评价的居民所属网格Id + private String projectId; + /** + * 处理:结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + /** + * 负负责人ID + */ + private String staffId; + private Date createdTime; + + /** + * 操作人所在父Id,当orgType不为空时,agencyId与pid一致 + * 当orgType为空时,pid是agencyId的上级,没有上级则默认为0 + * */ + private String pid; + + /** + * 操作人所在所有父机Id集合,当orgType不为空时,pids最后一节一定包含pid + * 当orgType为空时,pids是agencyId的所有上级,没有上级则为空串 + * */ + private String pids; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectInfoDTO.java new file mode 100644 index 0000000000..db144d8323 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectInfoDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/15 15:51 + */ +@Data +public class ProjectInfoDTO implements Serializable { + private static final long serialVersionUID = -143765862167548221L; + /** + * 项目ID + */ + private String id; + /** + * 客户ID + */ + private String customerId; + /** + * 组织ID + */ + private String agencyId; + /** + * 议题ID + */ + private String issueId; + /** + * 状态 + */ + private String status; + /** + * 结案状态 + */ + private String closedStatus; + /** + * 创建时间 + */ + private String createdDate; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectLatestOperationResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectLatestOperationResultDTO.java new file mode 100644 index 0000000000..12750903d1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectLatestOperationResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 项目最近进展结果DTO + * @ClassName ProjectLatestOperationResultDTO + * @Auth wangc + * @Date 2020-09-28 14:19 + */ +@Data +public class ProjectLatestOperationResultDTO implements Serializable { + private static final long serialVersionUID = 3295536551300176323L; + + private String projectId; + + private String operationName; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java new file mode 100644 index 0000000000..b3e101295d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java @@ -0,0 +1,95 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 从数据库中查询出的 项目 - 机关(网格、部门、机关)的响应时长 + * FIXME 注:查询的全都是已经结案的项目!!!!!!!!!!!!如果查询流转中的项目,需要修改逻辑(较为复杂) + * @ClassName ProjectOrgPeriodResultDTO + * @Auth wangc + * @Date 2020-09-16 15:28 + */ +@Data +public class ProjectOrgPeriodResultDTO implements Serializable { + private static final long serialVersionUID = 6216112710806237600L; + + /** + * 节点Id + * */ + private String processId; + + /** + * 项目Id + * */ + private String projectId; + + + /** + * 对这个节点的处理,如果未处理则为null + * created transfer close return response(查不出response,因为response类型的节点不会与process_staff产生关联,需要另取) + * */ + private String operation; + + /** + * 是这个节点的操作,相当于上一个人的操作,而不是对于这个节点的处理 + * created transfer close return response + * */ + private String lastAction; + + /** + * 节点所属的机关,即上个节点推到这个节点的负责部门 + * */ + private String departmentName; + + /** + * 当前节点所属的Agency,如果负责的是部门或者网格则是其所属的机关 + * */ + private String orgId; + + /** + * 如果是部门处理,则有值,否则null + * */ + private String departmentId; + + /** + * 如果是网格处理,则有值,否则null + * */ + private String gridId; + + /** + * 当前所属的机关的所有Pid集合以及当前的机关Id,所以此项不会未null,至少也是它的所属Agency + * */ + private String orgIdPath; + + /** + * 从节点流入到节点流出,且当前负责单位确实解决(包括退回)了的情况下,所耗费的时间(以分钟为单位) + * 如果未当前负责单位一直停留在unresolved状态,即使做出response、或者项目被其他单位结案,该项依旧是0,不参与办结的计时 + * 如果负责单位只是做出回应,但未处理(即没有让节点流走),需要查出其相应的第一次响应时间,另取 + * */ + private Integer totalPeriod; + + /** + * 节点流入时间 + * */ + private Date informedDate; + + /** + * 节点流出时间,如果未解决则未null + * */ + private Date handledDate; + + /** + * 第一次响应时间 + * */ + private Date periodTillReplyFirstly; + + private String customerId; + + private String staffId; + + private String isResolved; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java new file mode 100644 index 0000000000..892e173491 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 查询机关在项目节点上响应的结果 + * 查询的是存在“响应”的所有相关工作人员节点,如果同一个人对同一个项目已经做过一次处理(并未做出响应)而在第二次流转到自己时 + * 做出了响应,也会连带查询出其第一次未响应过的数据 + * @ClassName ProjectOrgRelationWhenResponseResultDTO + * @Auth wangc + * @Date 2020-09-16 17:27 + */ +@Data +public class ProjectOrgRelationWhenResponseResultDTO implements Serializable { + private static final long serialVersionUID = 1962332392048752037L; + + /** + * 项目Id + * */ + private String projectId; + + /** + * 节点Id + * */ + private String processId; + + /** + * 节点动作的发起人 + * */ + private String staffId; + + /** + * 负责人所属的单位名称:xx机关-xx部门 、 xx机关-xx网格 、 xx机关 + * */ + private String departmentName; + + /** + * 动作分类 + * */ + private String operation; + + /** + * 节点创建时间,动作发起时间 + * */ + private Date createdTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java index 2888cc7706..3ca91f2a98 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -67,22 +67,27 @@ public class FactIndexCommunityScoreDTO implements Serializable { /** * 月维度Id: yyyyMM */ - private String monthId; + private String monthId; /** * 1:总分;0不是;默认0 */ - private String isTotal; + private String isTotal; + + /** + * 参与计算指标的原始值 + */ + private String originValue; /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan */ - private String indexCode; + private String indexCode; /** * 所有指标code拼接的字符串 冒号隔开 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ProjectSourceMapFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ProjectSourceMapFormDTO.java new file mode 100644 index 0000000000..3dbbcd7061 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ProjectSourceMapFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ProjectSourceMapFormDTO + * @Auth wangc + * @Date 2020-09-28 15:32 + */ +@Data +public class ProjectSourceMapFormDTO implements Serializable { + private static final long serialVersionUID = 7796386345197572459L; + + private String projectId; + + private String sourceId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java new file mode 100644 index 0000000000..3482e2cab9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screen.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; + +import java.io.Serializable; + +/** + * @Description 大屏中央区数据写入传参DTO + * @ClassName ScreenCentralZoneDataFormDTO + * @Auth wangc + * @Date 2020-09-24 10:02 + */ +@Data +public class ScreenCentralZoneDataFormDTO implements Serializable { + private static final long serialVersionUID = -6621150245370746092L; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 时间维度 不一定是dateId 需要根据其格式进行判断维度的类型 + * */ + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java new file mode 100644 index 0000000000..fe9004f8bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 判断难点赌点是否有数据的返回DTO + * @ClassName DifficultyIfExistedResultDTO + * @Auth wangc + * @Date 2020-09-28 10:45 + */ +@Data +public class DifficultyIfExistedResultDTO implements Serializable { + private static final long serialVersionUID = -2278401165059196896L; + + /** + * 是否有数据 true false + */ + private boolean ifExisted = false; + + /** + * 已经结案的项目Id集合 + */ + private List closedIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java index aa9f471405..d5ca95dab8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.screen.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -18,4 +19,8 @@ public class MaxAndMinBigDecimalResultDTO implements Serializable { private BigDecimal max; + public MaxAndMinBigDecimalResultDTO() { + this.min = new BigDecimal(NumConstant.ZERO); + this.max = new BigDecimal(NumConstant.ZERO); + } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/TreeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/TreeResultDTO.java new file mode 100644 index 0000000000..9a40652c09 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/TreeResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.screen.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/22 2:00 下午 + */ +@Data +public class TreeResultDTO implements Serializable { + + private static final long serialVersionUID = 3860368744336541373L; + + /** + * 显示名称 + */ + private String agencyId; + + /** + * agencyId下拉框value + */ + private String pid; + + private String pids; + + private String level; +} + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java new file mode 100644 index 0000000000..d81ae5cf9e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 安宁-社区-项目概况(数量、颜色) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnCommunityProjectProfileFormDTO implements Serializable { + private static final long serialVersionUID = 1466172677051250092L; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd,项目根据实际情况赋值 + */ + private String dataEndTime; + + /** + * 社区id + */ + private String orgId; + + /** + * 项目数 + */ + private Integer projectTotal; + + /** + * 等级 + */ + private String level; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java new file mode 100644 index 0000000000..adcb9f63b2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 安宁-基层治理-各类数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { + private static final long serialVersionUID = -6947401956711903753L; + + /** + * 网格,街道或社区id + */ + private String orgId; + + /** + * 网格,街道名称或者社区名称 + */ + private String orgName; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + + /** + * 项目响应度 存储的是%前面的数 + */ + private BigDecimal projectResponseRatio; + + /** + * 项目满意率,存储的是%前面的数 + */ + private BigDecimal projectSatisRatio; + + /** + * 办结率 for 社区 + */ + private BigDecimal closedProjectRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java new file mode 100644 index 0000000000..70242f1ad3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 安宁-基层组织(党群数|议题数|项目数)-按月 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnGrassRootsOrgMonthlyFormDTO implements Serializable { + private static final long serialVersionUID = -7389300512268641307L; + /** + * 网格id或者组织(街道或社区)id + */ + private String orgId; + + /** + * 组织名称OR网格名称 + */ + private String orgName; + + /** + * 网格:grid; 组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 党群数 + */ + private Integer groupTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + + /** + * 项目数 + */ + private Integer projectTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java new file mode 100644 index 0000000000..b38f4c8653 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 安宁-基层党员-排行榜单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnGrassRootsPmRankFormDTO implements Serializable { + private static final long serialVersionUID = 3642729389245262928L; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + + /** + * 所属支部id + */ + private String branchId; + + /** + * 所属支部名称 + */ + private String branchName; + + /** + * 所属社区id + */ + private String communityId; + + /** + * 所属社区名称 + */ + private String communityName; + + /** + * 群成员数 + */ + private Integer groupMemberTotal; + + /** + * 话题数 + */ + private Integer topicTotal; + + /** + * 参与人次 + */ + private Integer partiUserTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java new file mode 100644 index 0000000000..4adb2ee168 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 安宁-基层党员-各类总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnGrassRootsPmTotalMonthlyFormDTO implements Serializable { + private static final long serialVersionUID = 8675347783888892404L; + + /** + * 网格id或者组织(街道或社区)id + */ + private String orgId; + + /** + * 组织名称OR网格名称 + */ + private String orgName; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 群成员数 + */ + private Integer groupMemberTotal; + + /** + * 话题数 + */ + private Integer topicTotal; + + /** + * 话题参与人次 + */ + private Integer topicPartiUserTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java index cebf258d31..a9f9d34697 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java @@ -68,4 +68,9 @@ public class CustomerAgencyFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; + + /** + * 是否显示 + */ + private String isDisplay; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java index ab77a2363c..209cc61392 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java @@ -48,6 +48,11 @@ public class DifficultyDataDetailFormDTO implements Serializable { */ private String eventSource; + /** + * 事件标题 + */ + private String eventTitle; + /** * 事件内容 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java index 4adf142a12..5c730099e4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java @@ -41,6 +41,11 @@ public class IndexDataMonthlyFormDTO implements Serializable { */ private String parentId; + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + /** * 组织名称 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java index 5d9f5da32b..3e122dea76 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * 9、党建引领|基层治理-居民(党员)积分排行榜 入参 @@ -64,6 +65,11 @@ public class PartyUserRankDataFormDTO implements Serializable { */ private Integer pointTotal; + /** + * 指标得分 + */ + private BigDecimal indexScore; + /** * 姓 */ 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/dto/stats/DimCustomerPartymemberDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java new file mode 100644 index 0000000000..8e1612fa8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +@Data +public class DimCustomerPartymemberDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 党员认证时的网格id + */ + private String gridId; + + /** + * 所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String parentId; + + /** + * 党员认证成功的日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 用户id + */ + private String userId; + + /** + * 身份证 + */ + private String idCard; + + /** + * 生日 + */ + private Date birthday; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java new file mode 100644 index 0000000000..e811c0aea0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.stats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/17 11:02 上午 + */ +@Data +public class CustomerIdAndDateIdFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + + public interface CustomerIdAndDateId extends CustomerClientShowGroup{} + + private String customerId; + + private String dateId; + + private String startDate; + + private String endDate; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java new file mode 100644 index 0000000000..8ff5479b0f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java @@ -0,0 +1,106 @@ +package com.epmet.dto.stats.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2020/9/17 11:15 上午 + */ +@Data +public class DimCustomerPartyMemberFormDTO implements Serializable { + + private static final long serialVersionUID = -9178779369245037701L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 党员认证时的网格id + */ + private String gridId; + + /** + * 所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String parentId; + + private String pids; + + /** + * 党员认证成功的日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 用户id + */ + private String userId; + + /** + * 身份证 + */ + private String idCard; + + /** + * 生日 + */ + private Date birthday; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public DimCustomerPartyMemberFormDTO() { + 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/stats/result/GridAttributesResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java new file mode 100644 index 0000000000..17fd652a8c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.stats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName GridAttributesResultDTO + * @Auth wangc + * @Date 2020-09-20 12:50 + */ +@Data +public class GridAttributesResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格所属机关ID + */ + private String agencyId; + + /** + * 机关的上级ID + */ + private String parentId; + + /** + * 所有上级Id + * */ + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java new file mode 100644 index 0000000000..16f870e85e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.stats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/17 2:32 下午 + */ +@Data +public class GridBelongAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 6781297915444918432L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格所属机关ID + */ + private String agencyId; + + /** + * 机关的上级ID + */ + private String parentId; + + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/ResiTopicDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/ResiTopicDTO.java new file mode 100644 index 0000000000..4422bc5a74 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/ResiTopicDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-31 + */ +@Data +public class ResiTopicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 小组Id,关联resi_group的ID + */ + private String groupId; + /** + * 网格ID + */ + private String gridId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + private String closedStatus; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人,发布人Id来源于user + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java new file mode 100644 index 0000000000..2abb8309a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 原始话题相关信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/15 18:01 + */ +@Data +public class TopicOriginInfoDTO implements Serializable { + private static final long serialVersionUID = -182136873047614269L; + + /** + * 话题id + */ + private String topicId; + + /** + * 操作类型(发布 - discussing 、 屏蔽 - hidden、 取消屏蔽 - hidden_cancelled、 关闭话题 - closed) + * 补充 转议题:shift_issue 、评论话题:comment + */ + private String actionCode; + + /** + * 本条记录的操作人 resi_topic_operation.CREATED_BY + */ + private String operateUserId; + + /** + * 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyyMMdd + */ + private String dateId; + + /** + * 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyyMM + */ + private String monthId; + + /** + * 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyy + */ + private String yearId; + + /** + * 用户操作时间 resi_topic_operation.CREATED_TIME + */ + private Date originalBusinessTime; + + /** + * 小组id + */ + private String groupId; + + /** + * 话题的状态 + */ + private String topicStatus; + + /** + * 话题关闭时的状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 网格id ( 其实就是小组所属的网格id) + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + + + +} 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 107bc8f478..5020fd3c63 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,12 @@ 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.ExtractIndexFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -22,162 +26,218 @@ import org.springframework.web.bind.annotation.RequestParam; @FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = DataStatisticalOpenFeignClientFallBack.class) public interface DataStatisticalOpenFeignClient { - /** - * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 - * - * @date: 2020/6/22 9:09 - * @author: jianjun liu - */ - @PostMapping(value = "data/stats/statspublicity/articleSummaryDailyStatsjob") - Result articleSummaryDailyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); - - /** - * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 - * - * @return: - * @date: 2020/6/22 9:09 - * @author: jianjun liu - */ - @PostMapping(value = "data/stats/statspublicity/tagUsedDailyStatsjob") - Result tagUsedDailyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); - - /** - * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 - * - * @date: 2020/6/22 9:09 - * @author: jianjun liu - */ - @PostMapping(value = "data/stats/statspublicity/tagUsedMonthlyStatsjob") - Result tagUsedMonthlyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); - - /** - * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 - * - * @date: 2020/6/22 9:09 - * @author: jianjun liu - */ - @PostMapping(value = "data/stats/statspublicity/tagUsedQuarterlyStatsjob") - Result tagUsedQuarterlyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); - - /** - * desc: 【日】 统计阅读最多的标签 包含 机关 网格 - * - * @date: 2020/6/22 9:09 - * @author: jianjun liu - */ - @PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob") - Result tagViewedDailyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); - - /** - * desc: 【月】 统计阅读最多的标签 包含 机关 网格 - * - * @date: 2020/6/22 9:09 - * @author: jianjun liu - */ - @PostMapping(value = "data/stats/statspublicity/tagViewedMonthlyStatsjob") - Result tagViewedMonthlyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); - - /** - * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 - * - * @date: 2020/6/22 9:09 - * @author: jianjun liu - * @param date - */ - @PostMapping(value = "data/stats/statspublicity/tagViewedQuarterlyStatsjob") - Result tagViewedQuarterlyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); - - /** - * @Description 统计 “网格小组”, dim:【网格-日】 - * @param - * @author zxc - */ - @PostMapping("/data/stats/statsgroup/groupgriddaily") - Result groupGridDaily(@RequestBody GroupStatsFormDTO formDTO); - - /** - * @Description 统计 “网格小组”, dim:【机关-日】 - * @param - * @author zxc - */ - @PostMapping("/data/stats/statsgroup/groupagencydaily") - Result groupAgencyDaily(@RequestBody GroupStatsFormDTO formDTO); - - /** - * @Description 统计 “网格小组”, dim:【机关-月】 - * @param - * @author zxc - */ - @PostMapping("/data/stats/statsgroup/groupagencymonthly") - Result groupAgencyMonthly(@RequestBody GroupStatsFormDTO formDTO); - - /** - * 议题统计 - * @author zhaoqifeng - * @date 2020/6/23 14:34 - * @param - * @return com.epmet.commons.tools.utils.Result - */ - @PostMapping("/data/stats/statsissue/issuestats") - Result agencyGridIssueStats(); - - /** - * 指定日期统计 - * @author zhaoqifeng - * @date 2020/7/1 15:29 - * @param fromDTO - * @return com.epmet.commons.tools.utils.Result - */ - @PostMapping("/data/stats/statsissue/issuestatsofdate") - Result agencyGridIssueStatsOfDate(@RequestBody IssueJobFromDTO fromDTO); - - /** - * @Description 数据统计-项目-机关日月统计 - * @Author sun - */ - @PostMapping("/data/stats/statsproject/agencyprojectstats") - Result agencyProjectStats(StatsFormDTO formDTO); - - /** - * @Description 数据统计-项目-网格日月统计 - * @Author sun - */ - @PostMapping("/data/stats/statsproject/gridprojectstats") - Result gridProjectStats(StatsFormDTO formDTO); - - /** - * 初始化所有维度 - * - * @return - */ - @PostMapping("/data/stats/dim/all/init") - Result initAllDims(); - - /** - * @Description 执行用户统计 - * @param - * @return - * @author wangc - * @date 2020.06.29 09:26 - **/ - @PostMapping("/data/stats/statsuser/execute") - Result execUserStatistical(@RequestParam(value = "date",required = false) String date); - - /** - * @Description 执行话题统计 - * @param - * @return - * @author wangc - * @date 2020.06.29 09:27 - **/ - @PostMapping("/data/stats/statstopic/execute") - Result execTopicStatistical(@RequestParam(value = "date",required = false) String date); - - /** - * 处理暂停的计算 - * @return - */ - @PostMapping("/data/stats/indexcalculate/process-pendding-cals") - Result processPenddingCalculate(); - + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/articleSummaryDailyStatsjob") + Result articleSummaryDailyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedDailyStatsjob") + Result tagUsedDailyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); + + /** + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedMonthlyStatsjob") + Result tagUsedMonthlyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedQuarterlyStatsjob") + Result tagUsedQuarterlyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob") + Result tagViewedDailyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedMonthlyStatsjob") + Result tagViewedMonthlyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); + + /** + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @param date + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedQuarterlyStatsjob") + Result tagViewedQuarterlyStatsjob(@RequestBody(required = false) StatsFormDTO formDTO); + + /** + * @param + * @Description 统计 “网格小组”, dim:【网格-日】 + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupgriddaily") + Result groupGridDaily(@RequestBody GroupStatsFormDTO formDTO); + + /** + * @param + * @Description 统计 “网格小组”, dim:【机关-日】 + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupagencydaily") + Result groupAgencyDaily(@RequestBody GroupStatsFormDTO formDTO); + + /** + * @param + * @Description 统计 “网格小组”, dim:【机关-月】 + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupagencymonthly") + Result groupAgencyMonthly(@RequestBody GroupStatsFormDTO formDTO); + + /** + * 议题统计 + * + * @param + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/6/23 14:34 + */ + @PostMapping("/data/stats/statsissue/issuestats") + Result agencyGridIssueStats(); + + /** + * 指定日期统计 + * + * @param fromDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/7/1 15:29 + */ + @PostMapping("/data/stats/statsissue/issuestatsofdate") + Result agencyGridIssueStatsOfDate(@RequestBody IssueJobFromDTO fromDTO); + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @PostMapping("/data/stats/statsproject/agencyprojectstats") + Result agencyProjectStats(StatsFormDTO formDTO); + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @PostMapping("/data/stats/statsproject/gridprojectstats") + Result gridProjectStats(StatsFormDTO formDTO); + + /** + * 初始化所有维度 + * + * @return + */ + @PostMapping("/data/stats/dim/all/init") + Result initAllDims(); + + /** + * @param + * @return + * @Description 执行用户统计 + * @author wangc + * @date 2020.06.29 09:26 + **/ + @PostMapping("/data/stats/statsuser/execute") + Result execUserStatistical(@RequestParam(value = "date", required = false) String date); + + /** + * @param + * @return + * @Description 执行话题统计 + * @author wangc + * @date 2020.06.29 09:27 + **/ + @PostMapping("/data/stats/statstopic/execute") + Result execTopicStatistical(@RequestParam(value = "date", required = false) String date); + + /** + * @param customerIdAndDateIdFormDTO + * @Description 统计党员 + * @author zxc + * @date 2020/9/17 3:10 下午 + */ + @PostMapping("/data/stats/dim/statsparty") + Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO); + + /** + * 处理暂停的计算 + * + * @return + */ + @PostMapping("/data/stats/indexcalculate/process-pendding-cals") + Result processPenddingCalculate(); + + /** + * desc: 【日】抽取业务数据到统计库 小组 话题 议题 项目 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "/data/stats/factorigin/extractall") + Result factOriginExtractAll(@RequestBody(required = false) ExtractOriginFormDTO formDTO); + + /** + * ˚ + * desc: 【月】抽取统计数据到指标库 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "/data/stats/indexorigin/extractall") + Result indexOriginExtractAll(@RequestBody(required = false) ExtractIndexFormDTO formDTO); + + /** + * 初始化维度 + * @return + */ + @PostMapping("/data/stats/eidim/init-all") + Result initAllEIDims(); + + /** + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @PostMapping(value = "/data/stats/screenextract/extractdailyall") + Result extractDailyAll(@RequestBody(required = false) ExtractOriginFormDTO extractOriginFormDTO); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param extractScreenFormDTO + * @author yinzuomei + * @description + * @Date 2020/9/28 11:05 + **/ + @PostMapping("/data/stats/screenextract/extractmonthlyall") + Result extractMonthlyAll(ExtractScreenFormDTO extractScreenFormDTO); } 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 1c79cfc56b..344f0ff7a1 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,12 @@ 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.ExtractIndexFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import org.springframework.stereotype.Component; @@ -171,8 +175,59 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical",date); } + @Override + public Result getPartyInfo(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPartyInfo", customerIdAndDateIdFormDTO); + } + @Override public Result processPenddingCalculate() { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate"); } + + /** + * desc: 【日】抽取业务数据到统计库 小组 话题 议题 项目 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result factOriginExtractAll(ExtractOriginFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO); + } + + /** + * desc: 【月】抽取统计数据到指标库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result indexOriginExtractAll(ExtractIndexFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "indexOriginExtractAll", formDTO); + } + + @Override + public Result initAllEIDims() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllEIDims"); + } + + @Override + public Result extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll", extractOriginFormDTO); + } + + /** + * @param extractScreenFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description + * @Date 2020/9/28 11:05 + **/ + @Override + public Result extractMonthlyAll(ExtractScreenFormDTO extractScreenFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "screenExtractMonthly", extractScreenFormDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/Dockerfile b/epmet-module/data-statistical/data-statistical-server/Dockerfile index 074bc1d2de..55d058c4b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/Dockerfile +++ b/epmet-module/data-statistical/data-statistical-server/Dockerfile @@ -8,4 +8,5 @@ COPY ./target/*.jar ./data-stats.jar EXPOSE 8108 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +#ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] +ENTRYPOINT ["sh","-c","exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml index 03f501aceb..cdcb4fd74b 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.49 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.62 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index a4aaa4ca34..17cc6098a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.49 + 0.3.62 data-statistical com.epmet @@ -70,7 +70,7 @@ com.epmet - epmet-commons-extapp-auth + common-service-client 2.0.0 compile @@ -87,6 +87,12 @@ org.apache.poi poi-ooxml 3.17 + + + poi-ooxml-schemas + org.apache.poi + + com.alibaba @@ -98,6 +104,12 @@ pinyin4j 2.6.0 + + org.apache.commons + commons-collections4 + 4.3 + compile + @@ -192,6 +204,24 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + + + + + epmet_heart_user + EpmEt-db-UsEr + + + + + epmet_point_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -290,6 +320,24 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + + + + + epmet_heart_user + EpmEt-db-UsEr + + + + + epmet_point_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -388,6 +436,24 @@ epmet elink@833066 + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -403,7 +469,7 @@ - true + false 5 @@ -482,6 +548,24 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + + + + + epmet_heart_user + EpmEt-db-UsEr + + + + + epmet_point_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com @@ -497,7 +581,7 @@ - true + false 5 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java new file mode 100644 index 0000000000..5476a93a1b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java @@ -0,0 +1,14 @@ +package com.epmet.constant; + +/** + * 对象行为动作维度表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/16 10:13 + */ +public interface DimObjectActionConstant { + /** + * 发布话题 + */ + String TOPIC_PUBLISH="discussing"; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java new file mode 100644 index 0000000000..97342260a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java @@ -0,0 +1,18 @@ +package com.epmet.constant; + +/** + * 对象行为状态维度表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/16 10:14 + */ +public interface DimObjectStatusConstant { + /** + * 已解决 + */ + String RESOLVED="resolved"; + /** + * 无需解决 + */ + String UNRESOLVED="unresolved"; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 3758d966f1..eac79f016a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -53,4 +53,15 @@ public interface ProjectConstant { */ String STATS_FAILED_PREFIX = "统计数据执行失败:%s 客户ID:%s,统计日期:%s"; + /** + * 自身 + */ + String ZI_SHEN = "zishen"; + + /** + * 下级 + */ + String XIA_JI = "xiaji"; + String GRID_ID = "GRID_ID"; + String AGENCY_ID = "AGENCY_ID"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java new file mode 100644 index 0000000000..62dd550eb0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java @@ -0,0 +1,99 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.ValidateException; +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.AnScreenCollService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Description 安宁数据采集接口 + * @ClassName AnScreenCollController + * @Auth wangc + * @Date 2020-10-09 13:30 + */ +@RestController +@RequestMapping("anscreencoll") +public class AnScreenCollController { + + @Autowired + private AnScreenCollService screenCollService; + + /** + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:20 + */ + @PostMapping("pmtotal") + public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.pmTotal(formDTO,customerId); + return new Result(); + } + + /** + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:19 + */ + @PostMapping("pmrank") + public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.pmRank(formDTO,customerId); + return new Result(); + } + + /** + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:22 + */ + @PostMapping("grassrootsorg") + public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.grassrootsOrg(formDTO,customerId); + return new Result(); + } + + /** + * @Description 安宁大屏数据采集 - 基层治理-各类数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:23 + */ + @PostMapping("grassrootsgovern") + public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.grassrootsGovern(formDTO,customerId); + return new Result(); + } + + /** + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 16:41 + */ + @PostMapping("projectfile") + public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.communityProjectProfile(formDTO,customerId); + return new Result(); + } +} 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 360571a1e4..a7d6eda645 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 @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; @@ -10,27 +11,44 @@ import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; +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.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; +import com.epmet.entity.evaluationindex.screen.ScreenIndexDataMonthlyEntity; import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimCustomerEntity; +import com.epmet.entity.stats.DimDateEntity; +import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.evaluationindex.extract.dataToIndex.*; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +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.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; +import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -57,7 +75,32 @@ public class DemoController { private DeptScoreService deptScoreService; @Autowired private IndexCalculateDistrictService indexCalculateDistrictService; - + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private DimDateDao dimDateDao; + @Autowired + private DimMonthDao dimMonthDao; + @Autowired + private DimCustomerDao dimCustomerDao; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private IndexCollCommunityService indexCollCommunityService; + @Autowired + private IndexCollStreetService indexCollStreetService; + @Autowired + private IndexCollDistrictDepartmentService indexCollDistrictDepartmentService; + @Autowired + private GovernRankDataExtractService governRankDataExtractService; + @Autowired + private OrgRankExtractService orgRankExtractService; @GetMapping("testAlarm") public void testAlarm() { //for (int i = 0; i < 20; i++) { @@ -136,30 +179,17 @@ public class DemoController { @PostMapping("zxc2") public Result getZxc2(){ - indexCalculateCommunityService.calCommunityAll("b09527201c4409e19d1dbc5e3c3429a1","202008"); + indexCalculateCommunityService.calCommunityAll("45687aa479955f9d06204d415238f7cc", "202008"); return new Result(); } @PostMapping("testcalculategridcorrelation") public Result testcalculateGridCorreLation(){ - CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); + CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO("epmettest", "202008"); gridCorreLationService.calculateGridCorreLation(formDTO); return new Result(); } - @Autowired - private GridScoreDao gridScoreDao; - @Autowired - private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; - @Autowired - private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; - @Autowired - private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; - @Autowired - private ScreenCustomerGridDao screenCustomerGridDao; - @Autowired - private CpcIndexCalculateService cpcIndexCalculateService; -// private static Integer testcal=100; @PostMapping("testcal") public Result testCal(){ @@ -459,20 +489,20 @@ public class DemoController { @PostMapping("streetZxc") public void getStreet(){ String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - String monthId = "202008"; + String monthId = "202009"; indexCalculateStreetService.calStreetAll(customerId,monthId); } @PostMapping("districtZxc") public void getDistrict(){ - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - String monthId = "202008"; + String customerId = "45687aa479955f9d06204d415238f7cc"; + String monthId = "202009"; indexCalculateDistrictService.calDistrictAll(customerId,monthId); } @PostMapping("gridZxc") public void getGrid(){ String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - String monthId = "202008"; + String monthId = "202009"; CalculateCommonFormDTO c = new CalculateCommonFormDTO(); c.setCustomerId(customerId); c.setMonthId(monthId); @@ -481,10 +511,235 @@ public class DemoController { @PostMapping("deptZxc") public void getDept(){ String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - String monthId = "202008"; + String monthId = "202009"; CalculateCommonFormDTO c = new CalculateCommonFormDTO(); c.setCustomerId(customerId); c.setMonthId(monthId); deptScoreService.calculateDeptCorreLation(c); } + + + @PostMapping("inserttopicorigin") + public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); + param.setDateId(dateId); + param.setCustomerId(customerId); + Boolean aBoolean = factOriginTopicMainDailyService.topicCleaning(param); + }else{ + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + List dimDateEntityList= dimDateDao.selectList(wrapper); + for(DimCustomerEntity customerEntity:customerEntityList){ + for(DimDateEntity dateEntity:dimDateEntityList) { + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); + param.setDateId(dateEntity.getId()); + param.setCustomerId(customerEntity.getId()); + factOriginTopicMainDailyService.topicCleaning(param); + } + } + } + return new Result(); + } + + @Autowired + private DimCustomerPartymemberService partymemberService; + + @PostMapping("statsparty") + public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO){ + partymemberService.statsPartyMember(customerIdAndDateIdFormDTO); + return new Result(); + } + + @Autowired + private CalGridIndexService calGridIndexService; + + @PostMapping("gridparty") + public void gridParty(){ + String customerId = "45687aa479955f9d06204d415238f7cc"; +// String customerId = "epmettest"; + String monthId = "202009"; + calGridIndexService.calGridIndexPartyAbility(customerId,monthId); + } + + @PostMapping("gridgovern") + public void gridGovern(){ + String customerId = "45687aa479955f9d06204d415238f7cc"; +// String customerId = "epmettest"; + String monthId = "202009"; + calGridIndexService.calGridIndexGovernAbility(customerId,monthId); + } + + @PostMapping("gridservice") + public void gridService(){ + String customerId = "45687aa479955f9d06204d415238f7cc"; + String monthId = "202009"; + calGridIndexService.calGridIndexServiceAbility(customerId,monthId); + } + + @Autowired + private CalCpcIndexService calCpcIndexService; + + @PostMapping("calCpcPartyAbility") + public Result calCpcPartyAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) { + calCpcIndexService.calCpcPartyAbility(customerId,monthId); + }else{ + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + List dimMonthEntityList= dimMonthDao.selectList(wrapper); + for(DimCustomerEntity customerEntity:customerEntityList){ + for(DimMonthEntity monthEntity:dimMonthEntityList) { + calCpcIndexService.calCpcPartyAbility(customerEntity.getId(),monthEntity.getId()); + } + } + } + return new Result(); + } + + @PostMapping("calGridIndexServiceAbility") + public Result calGridIndexServiceAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) { + calGridIndexService.calGridIndexServiceAbility(customerId,monthId); + }else{ + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + List dimMonthEntityList= dimMonthDao.selectList(wrapper); +// for(DimCustomerEntity customerEntity:customerEntityList){ + for(DimMonthEntity monthEntity:dimMonthEntityList) { + calGridIndexService.calGridIndexServiceAbility("3ef7e4bb195eb9e622d68b52509aa940",monthEntity.getId()); + } +// } + } + return new Result(); + } + @PostMapping("indexCollCommunity") + public Result indexCollCommunity(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + indexCollCommunityService.saveCommunityAbility(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + + @PostMapping("indexCollStreet") + public Result indexCollStreet(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + indexCollStreetService.saveStreetAbility(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + + @PostMapping("indexCollDept") + public Result indexCollDept(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + indexCollDistrictDepartmentService.saveDepartmentAbility(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + + @Autowired + private PartyBaseInfoService partyBaseInfoService; + + @PostMapping("zxczxczxc") + public Result getZxcZxcZxc(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + partyBaseInfoService.statsPartyMemberBaseInfoToScreen(formDTO.getCustomerId(),formDTO.getDateId()); + return new Result(); + } + + @Autowired + private PartyGuideService partyGuideService; + + @PostMapping("zxczxc") + public Result getZxcZxc(@RequestBody ExtractScreenFormDTO formDTO){ + partyGuideService.partyGuideExtract(formDTO); + 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; + @Autowired + private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; + @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(); + } + + @PostMapping("extractPublicPartiTotalData") + public Result extractPublicPartiTotalData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId){ + publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId,dateId); + return new Result(); + } + + @PostMapping("orgRank") + public Result orgRank(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + orgRankExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId()); + orgRankExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId()); + orgRankExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + + @Autowired + private PublicPartExtractService publicPartExtractService; + @PostMapping("extractTotalDataMonthly") + public void extractTotalDataMonthly(@RequestBody ExtractScreenFormDTO formDTO){ + publicPartExtractService.extractTotalDataMonthly(formDTO); + + } + + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description screen_index_data_monthly 赋值ALL_PARENT_IDS + * @Date 2020/10/10 17:59 + **/ + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @PostMapping("updateDeptIndexMonthly") + public Result updateDeptIndexMonthly(){ + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("ORG_TYPE", "department"); + List list=screenIndexDataMonthlyDao.selectList(wrapper); + int updateNum=0; + for(ScreenIndexDataMonthlyEntity entity:list){ + if(StringUtils.isNotBlank(entity.getParentId())){ + ScreenCustomerAgencyEntity agencyEntity=screenCustomerAgencyDao.selectByAgencyId(entity.getParentId()); + if(null!=agencyEntity){ + //根组织下的部门 + if("0".equals(agencyEntity.getPid())){ + log.info("根组织下的部门"); + entity.setAllParentIds(agencyEntity.getAgencyId()); + }else{ + entity.setAllParentIds(agencyEntity.getPids().concat(",").concat(agencyEntity.getAgencyId())); + } + updateNum+=screenIndexDataMonthlyDao.updateParentIdsById(entity.getId(),entity.getAllParentIds()); + } + } + } + log.info("影响行数="+updateNum); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java index 3318ef39a0..3e2a78b716 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java @@ -1,8 +1,10 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.AgencySubDeptTreeDto; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.service.StatsDimService; import com.epmet.service.stats.*; import org.slf4j.Logger; @@ -39,6 +41,9 @@ public class DimController { @Autowired private DimAgencyService dimAgencyService; + @Autowired + private DimCustomerPartymemberService partyMemberService; + /** * 初始化所有维度 * @@ -250,4 +255,15 @@ public class DimController { return dimAgencyService.getTopAgencyWithDept(); } + /** + * @Description + * @param customerIdAndDateIdFormDTO + * @author zxc + * @date 2020/9/17 3:01 下午 + */ + @PostMapping("statsparty") + public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { + return new Result().ok(partyMemberService.statsPartyMember(customerIdAndDateIdFormDTO)); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java new file mode 100644 index 0000000000..761c62bb0b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java @@ -0,0 +1,48 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.EIDimService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * epmet_evaluation_index库的维度controller + */ +@RestController +@RequestMapping("eidim") +public class EIDimController { + + Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private EIDimService eiDimService; + + @PostMapping("init-all") + public Result initAllEIDims() { + + try { + eiDimService.initAgencies(); + } catch (Exception e) { + logger.error("初始化epmet_evaluation_index的agency维度失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + try { + eiDimService.initDepartments(); + } catch (Exception e) { + logger.error("初始化epmet_evaluation_index的department维度失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + try { + eiDimService.initGrids(); + } catch (Exception e) { + logger.error("初始化epmet_evaluation_index的grids维度失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + 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 new file mode 100644 index 0000000000..7a6e11f801 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -0,0 +1,131 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +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; +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; + + +/** + * 原始数据清洗 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/15 11:06 + */ +@RestController +@RequestMapping("factorigin") +public class FactOriginExtractController { + @Autowired + private FactOriginExtractService factOriginExtractService; + @Autowired + private IssueExtractService issueExtractService; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private ProjectExtractService projectExtractService; + @Autowired + private GroupExtractService groupExtractService; + + /** + * desc:抽取业务数据到统计库 + * + * @param extractOriginFormDTO 默认统计前一天 + * @return + */ + @PostMapping("extractall") + 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); + extractOriginFormDTO.setDateId(dateDimId); + factOriginExtractService.extractAll(extractOriginFormDTO); + } + } else { + factOriginExtractService.extractAll(extractOriginFormDTO); + }*/ + factOriginExtractService.extractAll(extractOriginFormDTO); + return new Result(); + } + + + /** + * @param extractOriginFormDTO + * @Description 议题抽取(main) + * @author zxc + * @date 2020/9/15 2:02 下午 + */ + @PostMapping("issueextractmain") + public Result issueExtractMain(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class); + issueExtractService.issueExtractMain(extractOriginFormDTO); + return new Result(); + } + + /** + * @param extractOriginFormDTO + * @Description 议题抽取(log) + * @author zxc + * @date 2020/9/16 9:41 上午 + */ + @PostMapping("issueextractlog") + public Result issueExtractLog(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class); + issueExtractService.issueExtractLog(extractOriginFormDTO); + return new Result(); + } + + /** + * @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 ExtractOriginFormDTO extractOriginFormDTO) { + if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) { + factOriginTopicMainDailyService.topicCleaning(extractOriginFormDTO); + } + return new Result(); + } + + @PostMapping("project") + public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + projectExtractService.saveOriginProjectDaily(extractOriginFormDTO); + return new Result(); + } + + /** + * @param param + * @return + * @Description 项目节点历时数据清洗 + * @author wangc + * @date 2020.09.20 16:11 + **/ + @PostMapping("projectorgperiodcleanning") + public Result projectOrgPeriodCleaning(@RequestBody ExtractOriginFormDTO param) { + projectExtractService.extractProjectPeriodData(param); + return new Result(); + } + + /** + * @param + * @return + * @Description 小组数据清洗 + * @author wangc + * @date 2020.09.20 16:11 + **/ + @PostMapping("groupdatacleaning") + 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..11e082057a 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; @@ -65,6 +60,7 @@ public class IndexCalculateController { @PreDestroy public void saveCalStatus() { + log.info("data-statical-server服务被关闭,执行保存计算状态的动作"); // 实例销毁之前,将正在本实例中执行计算的客户列表的计算状态修改为pendding,等待其他实例重新计算 futureMap.forEach((customerId, future) -> { CalculateFlagModel flag = (CalculateFlagModel) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId)); @@ -103,11 +99,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); @@ -148,7 +141,7 @@ public class IndexCalculateController { long start = System.currentTimeMillis(); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); if (aBoolean) { - log.error("客户Id:{},全部指标计算完成,总耗时:{}秒", formDTO.getCustomerId(), (System.currentTimeMillis() - start) / 1000); + log.error("客户Id:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), aBoolean, (System.currentTimeMillis() - start) / 1000); } redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); @@ -173,6 +166,7 @@ public class IndexCalculateController { CalculateFlagModel flag = new CalculateFlagModel(); flag.setStatus(CalculateStatus.CALCULATING); flag.setForm(formDTO); + flag.setStartTime(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)); redisUtils.set(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId()), flag); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java index 03deff604d..0764389e78 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java @@ -8,10 +8,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.model.IndexExcelDataListener; import com.epmet.model.IndexModel; -import com.epmet.service.evaluationindex.screen.IndexDictService; -import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; -import com.epmet.service.evaluationindex.screen.IndexGroupService; -import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; +import com.epmet.service.evaluationindex.screen.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -37,7 +34,8 @@ public class IndexDictController { private IndexGroupService indexGroupService; @Autowired private IndexGroupDetailTemplateService indexGroupDetailTemplateService; - + @Autowired + private IndexGroupDetailService indexGroupDetailService; /** * url:http://localhost:8108/data/stats/indexdict/initFromExcel * desc:从excel初始化指标,分组,权重 @@ -46,7 +44,7 @@ public class IndexDictController { * @return */ @PostMapping("initFromExcel") - public Result testTx(@RequestPart("file") MultipartFile file) { + public Result testTx(@RequestPart("file") MultipartFile file, @RequestParam(value = "customerId", required = false) String customerId) { ExcelReader excelReader = null; try { InputStream inputStream = null; @@ -58,7 +56,9 @@ public class IndexDictController { excelReader = EasyExcel.read(inputStream).build(); // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener ReadSheet readSheet = EasyExcel.readSheet(1).head(IndexModel.class) - .registerReadListener(new IndexExcelDataListener(indexDictService, indexGroupTemplateService, indexGroupDetailTemplateService)) + .registerReadListener(new IndexExcelDataListener(indexDictService, indexGroupTemplateService, indexGroupDetailTemplateService, + customerId, + indexGroupDetailService)) .build(); excelReader.read(readSheet); } finally { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java new file mode 100644 index 0000000000..1f2b86020a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java @@ -0,0 +1,37 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; +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; + + +/** + * 原始数据清洗 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/15 11:06 + */ +@RestController +@RequestMapping("indexorigin") +public class IndexOriginExtractController { + @Autowired + private IndexOriginExtractService indexOriginExtractService; + + + /** + * desc:抽取统计数据到指标库 + * + * @param extractFormDTO 默认统计上一个月 + * @return + */ + @PostMapping("extractall") + public Result extractAll(@RequestBody ExtractIndexFormDTO extractFormDTO) { + indexOriginExtractService.indexOriginExtractAll(extractFormDTO); + return new Result(); + } +} 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 new file mode 100644 index 0000000000..133dc09f8c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java @@ -0,0 +1,48 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; +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; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:42 上午 + */ +@RestController +@RequestMapping("screenextract") +public class ScreenExtractDailyController { + + @Autowired + private ScreenExtractService screenExtractService; + + /** + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @PostMapping("extractdailyall") + public Result screenExtractDaily(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + screenExtractService.extractDailyAll(extractOriginFormDTO); + return new Result(); + } + + /** + * @param formDTO + * @Description 抽取数据到大屏【月】 + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @PostMapping("extractmonthlyall") + public Result screenExtractMonthly(@RequestBody ExtractScreenFormDTO formDTO) { + screenExtractService.extractMonthlyAll(formDTO); + 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..6cdc9ca44a 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,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.indexcollect.form.CustomerBizOrgFormDTO; 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 +24,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 +152,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 +257,17 @@ 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(); } + + /** + * 初始化客户业务组织类型 + **/ + @PostMapping("initbizorg") + public Result initBizOrg(@RequestBody CustomerBizOrgFormDTO formDTO) { + return new Result().ok(shiBeiScreenCollService.initBizOrg(formDTO)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.java new file mode 100644 index 0000000000..090c9b9488 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.DimObjectActionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 对象行为动作维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Mapper +public interface DimObjectActionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.java new file mode 100644 index 0000000000..012d6a15a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.DimObjectStatusEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 对象行为状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Mapper +public interface DimObjectStatusDao extends BaseDao { + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..e5e603a40f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -0,0 +1,186 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; +import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; +import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Mapper +public interface FactOriginGroupMainDailyDao extends BaseDao { + + /** + * @param customerId + * @param monthId + * @Description 查询建群党员数 + * @author zxc + * @date 2020/9/19 3:49 下午 + */ + List selectPartyCreateGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + + /** + * @param customerId + * @return + * @Description 查询是否存在该客户下的数据 + * @author wangc + * @date 2020.09.18 23:30 + **/ + int selectIfExist(@Param("customerId") String customerId); + + /** + * @param customerId + * @return + * @Description 按照客户Id清除组数据 + * @author wangc + * @date 2020.09.20 09:58 + **/ + void deleteBatchByCustomerId(@Param("customerId") String customerId); + + /** + * @param customerId + * @return + * @Description 按照客户Id清除组员数据 + * @author wangc + * @date 2020.09.20 09:58 + **/ + void deleteBatchMemberByCustomerId(@Param("customerId") String customerId, @Param("dimId") String dimId, @Param("dateType") String dateType); + + /** + * @param customerId + * @return + * @Description 按照组Id清除组和组员数据 + * @author wangc + * @date 2020.09.20 12:16 + **/ + void deleteBatchByGroupId(@Param("customerId") String customerId, @Param("list") List list); + + /** + * @param list + * @return + * @Description 更新群主的党员信息 + * @author wangc + * @date 2020.09.20 12:44 + **/ + int updatePartyFlag(@Param("list") List list, @Param("customerId") String customerId); + + /** + * @param list + * @return + * @Description 更新群主的热心居民信息 + * @author wangc + * @date 2020.09.20 12:44 + **/ + int updateHeartedFlag(@Param("list") List list, @Param("customerId") String customerId); + + /** + * @param list + * @return + * @Description 批量插入组主表 + * @author wangc + * @date 2020.09.20 15:37 + **/ + int insertBatchMain(@Param("list") List list); + + /** + * @param list + * @return + * @Description 批量插入组员表 + * @author wangc + * @date 2020.09.20 15:37 + **/ + int insertBatchMembers(List list); + + /** + * @param customerId + * @param groupOwnerId + * @return java.util.List + * @author yinzuomei + * @description 查询当前用户建的所有群id + * @Date 2020/9/20 21:22 + **/ + List selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId); + + /** + * @param groupIdList + * @return java.util.List + * @author yinzuomei + * @description 查询组成员数(去重) + * @Date 2020/9/20 21:29 + **/ + List selectGroupMemberList(@Param("list") List groupIdList); + + /** + * @param customerId + * @param monthId + * @Description 查询党员建组信息 + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridIds") List gridIds); + + /** + * desc: 获取所有网格的组中成员人数 去重 + * + * @param customerId + * @param groupField + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 2:31 下午 + */ + List selectDistinctGroupMemberCount(@Param("customerId") String customerId, @Param("groupField") String groupField); + + /** + * 获取网格内小组数量 + * @author zhaoqifeng + * @date 2020/9/27 14:37 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * 获取组织内网格数量 + * @author zhaoqifeng + * @date 2020/9/27 14:37 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level") String level); +} \ 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 new file mode 100644 index 0000000000..9dd9089d97 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.IssueLogDailyFormDTO; +import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; +import com.epmet.dto.extract.result.PartyActiveResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 议题记录附表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Mapper +public interface FactOriginIssueLogDailyDao extends BaseDao { + + /** + * @param issueLogList + * @Description 议题记录附表插入 + * @author zxc + * @date 2020/9/14 5:53 下午 + */ + void insertIssueLogList(@Param("issueLogList") List issueLogList); + + /** + * @param customerId + * @param dateId + * @Description 删除旧的记录 + * @author zxc + * @date 2020/9/16 9:33 上午 + */ + void deleteOldLogRecord(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param userId 用户id + * @param customerId + * @param monthId + * @return java.lang.Integer + * @author yinzuomei + * @description 查询用户在这个月内表决的总次数 + * @Date 2020/9/20 21:52 + **/ + Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @param customerId + * @param monthId + * @param isParty + * @Description 查询 议题表决【党员/群众】 + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + List selectPartyActiveIssueVote(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("isParty") Integer isParty); + + /** + * @param customerId + * @param gridId + * @param communityId + * @param agencyPath + * @param isParty + * @return int + * @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); + + /** + * @param gridId 网格id + * @param pids 网格的pids + * @return int + * @author yinzuomei + * @description 参与人数: 议题的表决行为的用户数去重的累计值 + * @Date 2020/9/27 14:19 + **/ + int selectCountJoinUserTotal(@Param("customerId") String customerId, + @Param("gridId") String gridId, + @Param("pids") String pids); + + /** + * desc: 获取每个议题的表决人数 + * + * @param customerId + * @param monthId + * @param pids + * @param groupField + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 1:58 下午 + */ + List getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("groupField") String groupField); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java new file mode 100644 index 0000000000..c8969fea56 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -0,0 +1,208 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; +import com.epmet.dto.extract.form.IssueMainDailyFormDTO; +import com.epmet.dto.extract.result.GridProjectCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.ShiftProjectCountResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 议题主表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Mapper +public interface FactOriginIssueMainDailyDao extends BaseDao { + + /** + * @Description 议题主表插入 + * @param issueMainList + * @author zxc + * @date 2020/9/14 5:53 下午 + */ + void insertIssueMainList(@Param("issueMainList") List issueMainList); + + /** + * @Description 删除旧的记录 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 9:33 上午 + */ + void deleteOldMainRecord(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @Description 查询网格议题总数,网格人均议题数目 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotalTwoMonthPlus(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("minusMonthId") String minusMonthId); + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + List selectGridProjectCount(@Param("customerId") String customerId,@Param("monthId") String monthId, @Param("status") String status); + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的话题转议题数 + * @Date 2020/9/18 13:58 + **/ + List selectShiftIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 查询网格 党员/群众 人均提出的议题转项目数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 2:26 下午 + */ + List selectShiftProjectCountPlus(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); + + /** + * @return java.lang.Integer + * @param topicIdList + * @author yinzuomei + * @description 查询本周期和上周期内,自建群内话题转为议题的数量的总和 + * @Date 2020/9/20 22:54 + **/ + Integer selectIssueTotalTwoMonth(@Param("list") List topicIdList); + + /** + * @Description 更新议题状态 + * @param issueId + * @param status + * @author zxc + * @date 2020/9/23 5:08 下午 + */ + void updateIssueStatus(@Param("issueId")String issueId,@Param("status")String status); + + /** + * @return int + * @param customerId + * @author yinzuomei + * @description 查询党员发布议题数 + * @Date 2020/9/23 15:13 + **/ + int getParyPublishIssueTotal(@Param("customerId") String customerId, + @Param("gridId")String gridId, + @Param("agencyId")String agencyId); + + /** + * @param customerId + * @param gridId + * @return int + * @author yinzuomei + * @description 具体某个网格/社区下的议题总数 + * @Date 2020/9/23 15:23 + **/ + int getGridOrCommunityIssueTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId); + + /** + * @return int + * @param customerId + * @param gridId + * @param communityId + * @author yinzuomei + * @description 网格、社区内议题转项目数 + * @Date 2020/9/23 15:45 + **/ + int getGridOrCommunityShiftProjectTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织内: 党员发布议题 + * @Date 2020/9/24 16:23 + **/ + Integer getAgencyParyPublishIssueTotal(@Param("customerId")String customerId, + @Param("agencyPath")String agencyPath); + + /** + * @return int + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织内:所有议题总数 + * @Date 2020/9/24 16:26 + **/ + int getAgencyIssueTotal(@Param("customerId")String customerId, + @Param("agencyPath")String agencyPath); + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织下:议题转项目数 + * @Date 2020/9/24 17:05 + **/ + Integer getAgencyShiftProjectTotal(@Param("customerId")String customerId, + @Param("agencyPath")String agencyPath); + + /** + * 网格内议题总数 + * @author zhaoqifeng + * @date 2020/9/27 14:59 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 组织内议题总数 + * @author zhaoqifeng + * @date 2020/9/27 14:59 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectOrgIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level") String level); +} \ 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 new file mode 100644 index 0000000000..f53ef5b882 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -0,0 +1,240 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.*; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + + +import java.util.List; + +/** + * 项目明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Mapper +public interface FactOriginProjectLogDailyDao extends BaseDao { + /** + * 机关被吹哨次数 + * @author zhaoqifeng + * @date 2020/9/18 14:46 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectAgencyTransferCount(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level); + + /** + * @Description 查询未被退回的项目数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 2:50 下午 + */ + List selectNotReturnProject(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("actionCode") String actionCode,@Param("orgType") String orgType); + + List selectNotReturn(@Param("customerId")String customerId,@Param("monthId")String monthId); + + /** + * @Description 查询项目评价信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 3:28 下午 + */ + List selectProjectEvaluate(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * @Description 网格项目自治率查询 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 5:25 下午 + */ + List selectProjectAutoNoMy(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * 根据日期删除数据 + * @author zhaoqifeng + * @date 2020/9/18 17:32 + * @param customerId + * @param date + * @return void + */ + void deleteByDate(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 办结项目满意度 + * @author zhaoqifeng + * @date 2020/9/20 16:44 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level); + + /** + * 区直部门被吹哨次数 + * @author zhaoqifeng + * @date 2020/9/18 14:46 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectDepTransferCount(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level); + + /** + * @Description 查询各项目处理了多少机关 + * @param agencies + * @return + * @author wangc + * @date 2020.09.20 23:46 + **/ + List selectProjectParticipatedAgency(@Param("agencies") List agencies, @Param("customerId") String customerId,@Param("dimId") String dimId); + + /*** + * @Description 评价周期内被吹哨项目数 + * @param agencies + * @param customerId + * @param dimId + * @return java.util.List + * @author wangc + * @date 2020.10.15 11:20 + */ + List selectAgencyWhistledCount(@Param("agencies") List agencies, @Param("customerId") String customerId,@Param("dimId") String dimId); + /*** + * @Description 评价周期内被吹哨且被办结(无论是哪一级办结)的项目数 + * @param agencies + * @param customerId + * @param dimId + * @return java.util.List + * @author wangc + * @date 2020.10.16 10:43 + */ + List selectWhistledAgencyClosedProjectCount(@Param("agencies") List agencies, @Param("customerId") String customerId,@Param("dimId") String dimId); + /*** + * @Description 查询机关办结次数 + * @param agencies + * @return java.util.List + * @author wangc + * @date 2020.10.14 10:27 + */ + List selectAgencyHandledProjectCount(@Param("agencies") List agencies,@Param("customerId") String customerId,@Param("dimId") String dimId); + /** + * @Description 查询评价周期内各级别机关办结的项目Id + * @param customerId + * @param dimId + * @return java.util.List + * @author wangc + * @date 2020.10.15 17:29 + */ + List selectProjectIdHandledByAgency(@Param("customerId") String customerId,@Param("dimId") String dimId); + + /** + * @Description 计算每个办结项目的总耗时 + * @param projectIds + * @return java.util.List + * @author wangc + * @date 2020.10.15 17:32 + */ + List selectProjectCostTime(@Param("projectIds") List projectIds); + /** + * 网格项目响应度 + * @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); + + /** + * 网格满意率 + * @author zhaoqifeng + * @date 2020/9/27 15:52 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 组织满意率 + * @author zhaoqifeng + * @date 2020/9/27 15:52 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectOrgSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level); + + /** + * 获取部门办结项目数 + * @author zhaoqifeng + * @date 2020/10/16 17:09 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectDeptClosedProject(@Param("customerId") String customerId, @Param("monthId") String monthId); + + + /** + * 部门办结项目满意度 + * @author zhaoqifeng + * @date 2020/9/20 16:44 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectDeptSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 网格结案率统计 + * @author zhaoqifeng + * @date 2020/9/20 16:44 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); +} 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 new file mode 100644 index 0000000000..062c651aaf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -0,0 +1,220 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.TransferRightRatioResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Mapper +public interface FactOriginProjectMainDailyDao extends BaseDao { + + /** + * 获取客户下项目 + * @author zhaoqifeng + * @date 2020/9/17 14:32 + * @param customerId + * @return java.util.List + */ + List getProjectByCustomer(@Param("customerId") String customerId); + + /** + * 获取未结案的项目 + * @author zhaoqifeng + * @date 2020/9/17 14:32 + * @param customerId + * @return java.util.List + */ + List getPendingList(@Param("customerId") String customerId); + + /** + * 项目超期数 + * @author zhaoqifeng + * @date 2020/9/18 16:28 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectOverdueCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 网格办结项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 2:06 下午 + */ + List selectGridClosedProject(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("status") String status); + + List selectTransferRightRatio(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 根据日期删除数据 + * @author zhaoqifeng + * @date 2020/9/18 17:32 + * @param customerId + * @param date + * @return void + */ + void deleteByDate(@Param("customerId") String customerId, @Param("date") String date); + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的议题转项目数 + * @Date 2020/9/18 14:11 + **/ + List selectShiftProjectCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.lang.Integer + * @param customerId + * @param monthId + * @param topicIdList + * @author yinzuomei + * @description 9、自建群活跃度——议题转项目率 用 + * @Date 2020/9/20 22:27 + **/ + Integer selectCountByPartyUser(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("list")List topicIdList); + + /** + * @return java.lang.Integer + * @param customerId + * @param gridId + * @param communityId + * @param closedStatus :resolved unresolved + * @param projectStatus :pending closed + * @author yinzuomei + * @description 具体某个网格或者社区内的项目 + * @Date 2020/9/23 18:18 + **/ + Integer getGridOrCommunityClosedProjectTotal(@Param("customerId")String customerId, + @Param("gridId") String gridId, + @Param("communityId") String communityId, + @Param("closedStatus") String closedStatus, + @Param("projectStatus") String projectStatus); + + /** + * @return int + * @param customerId + * @param agencyPath + * @param closedStatus :resolved unresolved + * @param projectStatus :pending closed + * @author yinzuomei + * @description 组织下:已解决项目 or 已结案项目总数 + * @Date 2020/9/24 17:38 + **/ + int getAgencyClosedProjectTotal(@Param("customerId") String customerId, + @Param("agencyPath")String agencyPath, + @Param("closedStatus")String closedStatus, + @Param("projectStatus") String projectStatus); + + /** + * 组织自治项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + 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); + + /** + * @Description 查询难点赌点的基本信息,要排除之前已经结案过的项目 + * @param customerId + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 10:19 + */ + List selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List list); + + /** + * @Description 查询评价周期内新立的项目,是为了增量新增难点赌点的图片库 + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.09.28 11:15 + */ + List selectNewProject(@Param("customerId") String customerId, @Param("list")List list); + + /** + * 网格解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId); + + /** + * 组织解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId, + @Param("level") String level); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java new file mode 100644 index 0000000000..0007237a2f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.OrgResponseTimeResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * 业务数据抽取-机关项目响应时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Mapper +public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao { + + /** + * @Description 查询是否存在数据,如果没有则视为第一次扫描该表,需要根据业务查询全部数据 + * @param + * @return + * @author wangc + * @date 2020.09.17 13:43 + **/ + int selectIfExisted(@Param("customerId") String customerId); + + /** + * @Description 在插入之前,先删除所有与这个项目相关的历时信息 + * @param list + * @return + * @author wangc + * @date 2020.09.17 14:43 + **/ + void deleteByProjectId(@Param("projectId") String projectId); + + /** + * 获取项目响应度 + * @author zhaoqifeng + * @date 2020/9/18 15:52 + * @param customerId + * @param monthId + * @param level + * @param orgType + * @return java.util.List + */ + List selectResponsiveness(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level, + @Param("orgType")String orgType); + /*** + * @Description 在插入之前,先删除所有与这个项目相关的历时信息 + * @param list + * @return void + * @author wangc + * @date 2020.10.19 16:26 + */ + void deleteByProjectIds(@Param("list") List list); + + /** + * @Description 批量插入 + * @param list + * @return + * @author wangc + * @date 2020.09.18 17:11 + **/ + void insertBatch(@Param("list") List list); + + /** + * @Description 查找网格、部门对项目的办结系数 + * @param customerId + * @return + * @author wangc + * @date 2020.09.21 02:13 + **/ + List selectSubOrgResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType); + + /** + * @Description 查找机关对项目的办结系数 + * @param customerId + * @return + * @author wangc + * @date 2020.09.21 02:13 + **/ + List selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType); + + /** + * 部门处理效率统计 + * @author zhaoqifeng + * @date 2020/10/19 9:31 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectDeptHandle(@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/extract/FactOriginTopicLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java new file mode 100644 index 0000000000..ef3ab5e833 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.PartyActiveResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 话题明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Mapper +public interface FactOriginTopicLogDailyDao extends BaseDao { + /** + * @return int + * @param customerId + * @param dateId + * @param deleteSize + * @author yinzuomei + * @description 批量删除 + * @Date 2020/9/16 12:54 + **/ + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("deleteSize") Integer deleteSize); + /** + * @return int + * @param list + * @author yinzuomei + * @description 批量插入 + * @Date 2020/9/16 12:54 + **/ + int insertBatchEntity(@Param("list") List list); + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询客户下,这个月内,每个党员评论话题的次数 + * @Date 2020/9/18 13:36 + **/ + List selectJoinTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员自建群活跃度——话题数 + * @Date 2020/9/18 15:05 + **/ + List selectGroupTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.lang.Integer + * @param userId + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询当前用户在本月内评论的次数 + * @Date 2020/9/20 21:46 + **/ + Integer selectUserCommentCount(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.List + * @param groupIdList + * @author yinzuomei + * @description 组内的所有话题id + * @Date 2020/9/20 22:18 + **/ + List selectTopicIds(@Param("list") List groupIdList); + + /** + * @Description 查询 话题评论【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + List selectPartyActiveTopic(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer 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/FactOriginTopicMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java new file mode 100644 index 0000000000..ae3ad01fd5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.CreateTopicCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 话题主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Mapper +public interface FactOriginTopicMainDailyDao extends BaseDao { + + /** + * @param customerId + * @param dateId + * @param deleteSize + * @return int + * @author yinzuomei + * @description 批量删除 + * @Date 2020/9/16 11:16 + **/ + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("deleteSize") Integer deleteSize); + + /** + * @return int + * @param list + * @author yinzuomei + * @description 批量插入 + * @Date 2020/9/16 12:48 + **/ + int insertBatchEntity(@Param("list") List list); + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出话题数:返回每个党员这个月内,提出的话题数 + * @Date 2020/9/18 11:05 + **/ + List selectPartyCreateTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 查询网格 党员/群众 人均提出话题数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 1:58 下午 + */ + List selectCreateTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("isParty")Integer isParty); + + /** + * @return int + * @param customerId + * @author yinzuomei + * @description 党员提出的话题总数 + * @Date 2020/9/23 13:46 + **/ + int selectPublishedByPartyTopicCount(@Param("customerId") String customerId, + @Param("gridId")String gridId, + @Param("agencyId")String agencyId); + + /** + * @param customerId + * @param gridId + * @return int + * @author yinzuomei + * @description 具体某个网格的话题数 + * @Date 2020/9/23 14:23 + **/ + int selectGridOrCommunityTopicTotal(@Param("customerId") String customerId, @Param("gridId") String gridId, @Param("agencyId") String agencyId); + + /** + * @return void + * @author yinzuomei + * @description 更新话题主表的TOPIC_STATUS , CLOSED_STATUS + * @Date 2020/9/23 17:59 + **/ + void updateFactOriginTopicMain(@Param("topicId")String topicId,@Param("topicStatus")String topicStatus,@Param("closedStatus")String closedStatus); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description + * @Date 2020/9/24 15:53 + **/ + Integer getAgencyPartyTopicTotal(@Param("customerId") String customerId, + @Param("agencyPath")String agencyPath, + @Param("createTopicUserIsParty") String createTopicUserIsParty); + + /** + * 网格内话题总数 + * @author zhaoqifeng + * @date 2020/9/27 14:59 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 组织内话题总数 + * @author zhaoqifeng + * @date 2020/9/27 14:59 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectOrgTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level") String level); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java new file mode 100644 index 0000000000..366b23af58 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 区/街道相关 自身和下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface AgencySelfSubScoreDao extends BaseDao { + + int insertBatch(@Param("list") List list); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType, @Param("parentIndexCode") String parentIndexCode); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java index 970b671a7f..be812e2ca4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java @@ -19,8 +19,8 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.AgencyScoreDTO; -import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -50,6 +50,8 @@ public interface AgencySubScoreDao extends BaseDao { * @author zxc * @date 2020/9/2 15:47 */ - Integer deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType,@Param("delNum")Integer delNum); + Integer deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType, @Param("delNum") Integer delNum); + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("dataType") String dataType, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java new file mode 100644 index 0000000000..12e8631a77 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.CommunitySelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 社区相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface CommunitySelfSubScoreDao extends BaseDao { + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); + + int insertBatch(@Param("list") List communitySelfSubScoreEntities); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java index a8d5971cc7..c9f7ca35b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java @@ -49,6 +49,8 @@ public interface CommunitySubScoreDao extends BaseDao selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java index c03786ecfe..c1b8e5b479 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CpcScoreResultDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -83,4 +84,13 @@ public interface CpcScoreDao extends BaseDao { List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode, @Param("offset") int offset, @Param("pageSize") int pageSize); int insertBatch(@Param("list") Collection values); + + /** + * @Description 查询客户下的党员指标得分 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 17:13 + **/ + List selectCpcScore(@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/indexcal/DeptSelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java new file mode 100644 index 0000000000..a8b5b90a2b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 社区相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface DeptSelfSubScoreDao extends BaseDao { + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); + + int insertBatch(@Param("list") List deptSelfSubScoreEntities); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java index fe388c6b6b..c9ec728209 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java @@ -22,7 +22,6 @@ import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import javax.annotation.security.PermitAll; import java.util.List; /** @@ -54,7 +53,9 @@ public interface DeptSubScoreDao extends BaseDao { * @Date 2020/9/10 12:28 **/ int deleteBatches(@Param("customerId") String customerId, - @Param("monthId") String monthId, - @Param("allParentIndexCode") String allParentIndexCode, - @Param("deleteSize") Integer deleteSize); + @Param("monthId") String monthId, + @Param("allParentIndexCode") String allParentIndexCode, + @Param("deleteSize") Integer deleteSize); + + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSelfSubScoreDao.java new file mode 100644 index 0000000000..684ad99a31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSelfSubScoreDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 网格相关自身/下级分值记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface GridSelfSubScoreDao extends BaseDao { + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); + + int insertBatch(@Param("list") List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java index 1005fcf781..5c8de8e83f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java @@ -52,7 +52,9 @@ public interface GridSubScoreDao extends BaseDao { * @Date 2020/9/10 13:36 **/ int deleteBatches(@Param("customerId") String customerId, - @Param("monthId") String monthId, - @Param("allParentIndexCode") String allParentIndexCode, - @Param("deleteSize") Integer deleteSize); + @Param("monthId") String monthId, + @Param("allParentIndexCode") String allParentIndexCode, + @Param("deleteSize") Integer deleteSize); + + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 5e0c308c5f..2e047268de 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -18,6 +18,8 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; @@ -101,4 +103,31 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao lists); + + /** + * @Description 删除治理能力旧纪录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:31 下午 + */ + Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId); + + /** + * 查询客户下网格治理能力 + * @author zhaoqifeng + * @date 2020/9/24 15:26 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridByCustomer(@Param("customerId")String customerId, @Param("monthId")String monthId); } 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 ef770f48b5..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 @@ -66,4 +66,27 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + + /** + * 根据组织类型删除数据 + * @author zhaoqifeng + * @date 2020/9/20 20:52 + * @param customerId + * @param monthId + * @param type + * @return java.lang.Integer + */ + Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type); + + /** + * 根据客户查询组织治理能力 + * @author zhaoqifeng + * @date 2020/9/25 14:02 + * @param customerId + * @param monthId + * @param type + * @return java.util.List + */ + 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/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 824b7a04a1..619b621d7a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -62,4 +62,13 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); Map getExtremeValue(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return int + * @param list + * @author yinzuomei + * @description 批量插入 入参为entity + * @Date 2020/9/18 10:30 + **/ + int insertBatchEntity(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index 6e2dbcaee5..e15e5cc90b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; @@ -97,4 +98,21 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao lists); + + /** + * @Description 删除旧的党建能力记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 10:45 上午 + */ + Integer deleteOldPartyAbility(@Param("customerId")String customerId,@Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index 220e9a91f1..f9ab1ba754 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -77,4 +77,15 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + + /** + * 根据组织类型删除数据 + * @author zhaoqifeng + * @date 2020/9/20 20:52 + * @param customerId + * @param monthId + * @param type + * @return java.lang.Integer + */ + Integer deleteByCustomer(@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/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java index 1ef6d38f42..10cabe11f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -96,4 +96,22 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao + * @param customerId + * @author yinzuomei + * @description 查询出所有的网格,初始化好 服务能力-网格相关事实表 各个指标值赋值为0 + * @Date 2020/9/21 9:42 + **/ + List initAllGridList(String customerId); + + /** + * @return void + * @param list + * @author yinzuomei + * @description 批量插入网格相关-服务能力指标表 + * @Date 2020/9/21 10:13 + **/ + void insertBatchEntity(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index e4f1f12898..c7ea1d7795 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -78,4 +78,15 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + + /** + * 根据组织类型删除数据 + * @author zhaoqifeng + * @date 2020/9/20 20:52 + * @param customerId + * @param monthId + * @param type + * @return java.lang.Integer + */ + Integer deleteByCustomer(@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/IndexGroupDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDao.java index 26cb71f2ec..2a3e617b75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDao.java @@ -31,4 +31,6 @@ import org.apache.ibatis.annotations.Mapper; public interface IndexGroupDao extends BaseDao { int inertGroupFromTable(String customerId); + + int deleteByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java index d67b86e887..9429d1a8a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java @@ -22,6 +22,7 @@ import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; /** @@ -36,4 +37,17 @@ public interface IndexGroupDetailDao extends BaseDao { List getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode); List getAllIndexWeightList(String customerId); + + int deleteByCustomerId(@Param("customerId") String customerId); + + /** + * desc:根据获取指标明细 + * + * @param allIndexCodePath + * @param customerId + * @return + */ + List selectSelfSubIndex(@Param("customerId") String customerId, @Param("allIndexCodePath") String allIndexCodePath); + + int updateWeight(@Param("indexCode") String indexCode, @Param("customerId") String customerId, @Param("weight") BigDecimal weight,@Param("allParentIndexCode")String allParentIndexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.java new file mode 100644 index 0000000000..f3c04fc7d6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnCommunityProjectProfileFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnCommunityProjectProfileEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-社区-项目概况(数量、颜色) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnCommunityProjectProfileDao extends BaseDao { + + /** + * @Description 批量删除 + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 15:30 + */ + int deleteBatch(@Param("customerId") String customerId); + + /** + * @Description 批量写入 + * @param list + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 15:30 + */ + int insertBatch(@Param("list") List list,@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.java new file mode 100644 index 0000000000..f029b886b3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnGrassRootsGovernMonthlyFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-基层治理-各类数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsGovernMonthlyDao extends BaseDao { + + /** + * @Description 批量删除 + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 15:30 + */ + int deleteBatch(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 批量新增 + * @param list + * @param customerId + * @param monthId + * @param quarterId + * @param yearId + * @return int + * @author wangc + * @date 2020.10.09 16:08 + */ + int insertBatch(@Param("list") List list, + @Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.java new file mode 100644 index 0000000000..817d5d74b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnGrassRootsOrgMonthlyFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-基层组织(党群数|议题数|项目数)-按月 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsOrgMonthlyDao extends BaseDao { + + /** + * @Description 批量删除 + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 15:30 + */ + int deleteBatch(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 批量新增 + * @param list + * @param customerId + * @param monthId + * @param quarterId + * @param yearId + * @return int + * @author wangc + * @date 2020.10.09 16:07 + */ + int insertBatch(@Param("list") List list, + @Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.java new file mode 100644 index 0000000000..422fb53937 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnGrassRootsPmRankFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnGrassRootsPmRankEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-基层党员-排行榜单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsPmRankDao extends BaseDao { + + /*** + * @Description 批量删除 + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 16:07 + */ + int deleteBatch(@Param("customerId") String customerId); + + /** + * @Description 批量新增 + * @param list + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 16:10 + */ + int insertBatch(@Param("list") List list,@Param("customerId") String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.java new file mode 100644 index 0000000000..f793ba3e44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnGrassRootsPmTotalMonthlyFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 安宁-基层党员-各类总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsPmTotalMonthlyDao extends BaseDao { + + /** + * @Description 批量删除 + * @param customerId + * @param monthId + * @return int + * @author wangc + * @date 2020.10.09 16:25 + */ + int deleteBatch(@Param("customerId")String customerId,@Param("monthId")String monthId); + + /** + * @Description 批量新增 + * @param list + * @param customerId + * @param monthId + * @param quarterId + * @param yearId + * @return int + * @author wangc + * @date 2020.10.09 16:35 + */ + int insertBatch(@Param("list") List list, + @Param("customerId")String customerId, + @Param("monthId")String monthId, + @Param("quarterId")String quarterId, + @Param("yearId")String yearId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index 748d31d161..716d9b2cfb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -18,6 +18,8 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.PartyInfoResultDTO; import com.epmet.dto.screencoll.form.CpcBaseDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -55,4 +57,40 @@ public interface ScreenCpcBaseDataDao extends BaseDao { * @Date 10:52 2020-08-18 **/ void batchInsertCpcBaseData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * @Description 插入党员基本信息 + * @param baseInfos + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + void insertPartyBaseInfo(@Param("baseInfos") List baseInfos); + + /** + * @Description 删除旧的党员基本信息 + * @param customerId + * @param dateId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyBaseInfo(@Param("customerId") String customerId,@Param("dateId") String dateId,@Param("orgIds")List orgIds); + + /** + * @Description 查询党员信息【根据agencyId来查】 + * @param customerId + * @param dateId + * @param agencyId + * @author zxc + * @date 2020/9/23 2:01 下午 + */ + List selectPartyInfo(@Param("customerId") String customerId,@Param("dateId") String dateId, String agencyId); + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + List selectDirectGridPartyInfo(@Param("gridIds") List gridIds,@Param("customerId") String customerId,@Param("dateId") String dateId); } 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 04e5a0027d..3b43d23c4d 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 @@ -18,6 +18,13 @@ 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.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; @@ -102,4 +109,72 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectSubAgencyList(@Param("pids") String pids); + + /** + * @Description 查询客户下所有机关ID + * @param customerId + * @author zxc + * @date 2020/9/22 4:06 下午 + */ + List selectAllAgencyId(@Param("customerId") String customerId); + + ScreenCustomerAgencyEntity getLastAddedAgency(); + + ScreenCustomerAgencyEntity getLastUpdatedAgency(); + + ScreenCustomerAgencyEntity selectByAgencyId(String agencyId); + + /** + * @Description 查询下一级机关的ID【即以agencyId为pid的agency】 + * @param agencyId + * @param customerId + * @author zxc + * @date 2020/9/23 11:11 上午 + */ + List selectSubAgencyId(@Param("agencyId") String agencyId,@Param("customerId") String customerId); + + /** + * @Description 查询客户下所有机关ID + * @param customerId + * @author zxc + * @date 2020/9/23 3:10 下午 + */ + List 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); + + /** + * @param agencyIds + * @Description 查询org名称【机关】 + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameAgency(@Param("agencyIds") List agencyIds); + + Boolean initBizOrg(CustomerBizOrgFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerBizOrgDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerBizOrgDao.java new file mode 100644 index 0000000000..442e7593a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerBizOrgDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerBizOrgEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 组织机构信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenCustomerBizOrgDao extends BaseDao { + + int deleteByBizType(CustomerBizOrgFormDTO formDTO); + + int batchInsert(@Param("list") List list); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index cbe11d059c..3a992c7ca6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -86,4 +86,14 @@ public interface ScreenCustomerDeptDao extends BaseDao * @Date 16:57 2020-09-03 **/ List selectListDeptInfo(@Param("customerId")String customerId); + + /** + * 查询最后一次添加的部门 + * @return + */ + ScreenCustomerDeptEntity getLastAddDept(); + + ScreenCustomerDeptEntity getLastUpdateDept(); + + ScreenCustomerDeptEntity selectByDeptId(String deptId); } 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 c6aac179af..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,6 +19,9 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ScreenCustomerGridDTO; +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; import com.epmet.dto.screencoll.form.CustomerGridFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; @@ -114,4 +117,69 @@ public interface ScreenCustomerGridDao extends BaseDao * @Date 16:57 2020-09-03 **/ List selectListGridInfo(@Param("customerId")String customerId); + + /** + * @Description 根据agencyId查询网格ID + * @param agencyId + * @author zxc + * @date 2020/9/22 2:16 下午 + */ + List selectGridIdByAgencyId(@Param("agencyId")String agencyId); + + ScreenCustomerGridEntity getLastAddGrid(); + + ScreenCustomerGridEntity getLastUpdateGrid(); + + ScreenCustomerGridEntity getByGridId(String gridId); + + /** + * @Description 查询客户下所有网格ID + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/23 3:10 下午 + */ + 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 + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgName(@Param("gridIds") List gridIds); + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + List selectDirectGrid(@Param("agencyIds") List agencyIds); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + List selectAllGridInfoToParty(String customerId); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + List selectAllGridInfo(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index d6dfeac5f8..2b66e785bb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.DifficultyDataDetailFormDTO; import com.epmet.dto.screencoll.form.DifficultyDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -54,4 +55,40 @@ public interface ScreenDifficultyDataDao extends BaseDao list, @Param("customerId")String customerId); + + + /** + * @Description 根据customerId查询是否有难点赌点的数据 + * @param customerId + * @return int + * @author wangc + * @date 2020.09.28 13:29 + */ + int selectCountByCustomerId(@Param("customerId")String customerId); + + /** + * @Description 查找库中已经存在的结案项目Id + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.09.28 13:44 + */ + List selectClosedProjectId(@Param("customerId")String customerId); + + /** + * @Description 全量更新DATA_END_TIME + * @param customerId + * @return int + * @author wangc + * @date 2020.09.28 13:46 + */ + int updateTime(@Param("customerId")String customerId,@Param("dateId")String dateId); + + int deleteBatchDifficulty(@Param("customerId")String customerId,@Param("list")List list); + + int deleteBatchDifficultyImg(@Param("list")List list); + + int insertBatch(@Param("list") List list); + + int insertBatchImg(@Param("list") List list); } 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 24e3d65a09..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 @@ -56,4 +56,38 @@ public interface ScreenGovernRankDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * 组织级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @param level + * @return java.util.List + */ + List initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); + + /** + * 网格级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @return java.util.List + */ + 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/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 925c5c728f..ecb417b9b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -95,4 +95,6 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao { * @Date 10:52 2020-08-18 **/ void batchInsertOrgRankData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * 初始化组织数据 + * @author zhaoqifeng + * @date 2020/9/27 10:14 + * @param customerId + * @param level + * @return java.util.List + */ + List initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); + + /** + * 初始化网格数据 + * @author zhaoqifeng + * @date 2020/9/27 10:14 + * @param customerId + * @return java.util.List + */ + List initGridDataList(@Param("customerId") String customerId); + + /** + * 删除旧数据 + * @author zhaoqifeng + * @date 2020/9/27 10:27 + * @param customerId + * @param orgType + * @param monthId + * @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/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index 518c3fa795..559bb482d9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -45,6 +45,15 @@ public interface ScreenPartyUserRankDataDao extends BaseDao list,@Param("customerId")String customerId); + + /** + * @Description 批量插入 + * @param list + * @return void + * @author wangc + * @date 2020.09.27 10:06 + */ + void insertBatch(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 8789e6edef..daeb4c7443 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -43,7 +43,24 @@ public interface ScreenPioneerDataDao extends BaseDao { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Integer deletePioneerData(@Param("customerId") String customerId); + Integer deletePioneerDataByCustomerId(@Param("customerId") String customerId, + @Param("deleteSize") Integer deleteSize); + + + /** + * @return java.lang.Integer + * @param customerId + * @param orgType + * @param deleteSize + * @param orgIds + * @author yinzuomei + * @description 产品客户采集用删除方法 + * @Date 2020/9/24 14:59 + **/ + Integer deletePioneerData(@Param("customerId") String customerId, + @Param("orgType") String orgType, + @Param("deleteSize") Integer deleteSize, + @Param("orgIds")List orgIds); /** * 10、党建引领-先锋模范数据 @@ -55,4 +72,40 @@ public interface ScreenPioneerDataDao extends BaseDao { * @Date 10:52 2020-08-18 **/ void batchInsertPioneerData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 初始化好orgType="grid"的插入对象 + * @Date 2020/9/22 15:03 + **/ + List initGridPioneerDataList(@Param("customerId") String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 初始化好社区, orgType="agency"的插入对象 + * @Date 2020/9/22 15:03 + **/ + List initCommunityPioneerDataList(@Param("customerId")String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 初始化好非社区的, orgType="agency"的插入对象 + * @Date 2020/9/24 13:45 + **/ + List initExceptCommunityPioneerDataList(@Param("customerId")String customerId); + + /** + * @return void + * @param list + * @author yinzuomei + * @description 插入 entity + * @Date 2020/9/22 15:55 + **/ + void insertBatchEntity(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java index fd2fdac941..26b2464ea7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java @@ -56,4 +56,13 @@ public interface ScreenPublicPartiTotalDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @return void + * @param list + * @author yinzuomei + * @description 批量插入entity + * @Date 2020/9/27 14:00 + **/ + void insertBatchEntity(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index f09189dce0..d877d0042d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -55,4 +55,15 @@ public interface ScreenUserTotalDataDao extends BaseDao list, @Param("customerId")String customerId); + + void insertBatch(@Param("list") List list); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 根据条件查询screen_user_total_data表 + * @Date 2020/9/27 11:22 + **/ + List selectList(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index db1bc08318..32059b58b3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -1,5 +1,6 @@ package com.epmet.dao.group; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; @@ -80,4 +81,13 @@ public interface GroupDataDao { * @author zxc */ List getAgencyGrid(@Param("gridIds")List gridIds); + + /** + * @Description 抽取小组数据 + * @param customerId + * @return + * @author wangc + * @date 2020.09.18 22:45 + **/ + List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); } 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 new file mode 100644 index 0000000000..f9771495df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.heart; + +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActInfoDao{ + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询这个月,各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的 + * @Date 2020/9/21 10:41 + **/ + List selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.List + * @param regUserIds + * @author yinzuomei + * @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 + * @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); + + /** + * 获取机关活动次数 + * @author zhaoqifeng + * @date 2020/9/30 16:53 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectAgencyActCount(@Param("customerId") String customerId, @Param("monthId") String monthId); +} 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..a88a330439 --- /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,@Param("orgType") String orgType); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index f09091487f..190353059f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -1,7 +1,12 @@ package com.epmet.dao.issue; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.IssueInfoResultDTO; +import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; +import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; @@ -25,33 +30,36 @@ public interface StatsIssueDao extends BaseDao { */ List selectAgencyIssueTotal(@Param("customerId") String customerId, @Param("date") String date); - /** - * 获取当前日期组织下议题增量 - * @author zhaoqifeng - * @date 2020/6/18 9:55 - * @param customerId - * @param date - * @return java.util.List - */ + /** + * 获取当前日期组织下议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 9:55 + */ List selectAgencyIssueInc(@Param("customerId") String customerId, @Param("date") String date); - /** - * 已关闭议题统计 - * @author zhaoqifeng - * @date 2020/6/18 14:41 - * @param customerId - * @param date - * @return java.util.List + /** + * 已关闭议题统计 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 */ List selectAgencyClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); - /** - * 已关闭议题增量 - * @author zhaoqifeng - * @date 2020/6/18 14:41 - * @param customerId - * @param date - * @return java.util.List + /** + * 已关闭议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 */ List selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); @@ -62,6 +70,7 @@ public interface StatsIssueDao extends BaseDao { * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 **/ List selectGridProjectList(IssueEntity issueEntity); + /** * 获取当前日期网格下议题统计结果 * @@ -73,43 +82,103 @@ public interface StatsIssueDao extends BaseDao { */ List selectGridIssueTotal(@Param("customerId") String customerId, @Param("date") String date); - /** - * 获取当前日期网格下议题增量 - * @author zhaoqifeng - * @date 2020/6/18 9:55 - * @param customerId - * @param date - * @return java.util.List - */ - List selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date); + /** + * 获取当前日期网格下议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 9:55 + */ + List selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date); - /** - * 网格已关闭议题统计 - * @author zhaoqifeng - * @date 2020/6/18 14:41 - * @param customerId - * @param date - * @return java.util.List - */ - List selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + /** + * 网格已关闭议题统计 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 + */ + List selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); - /** - * 网格已关闭议题增量 - * @author zhaoqifeng - * @date 2020/6/18 14:41 - * @param customerId - * @param date - * @return java.util.List - */ - List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); + /** + * 网格已关闭议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 + */ + List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); - /** - * 查询客户下议题和项目关系 - * @author zhaoqifeng - * @date 2020/6/19 17:34 - * @param customerId - * @return java.util.List + /** + * 查询客户下议题和项目关系 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/19 17:34 */ List selectIssueProjectList(@Param("customerId") String customerId); + /** + * 根据ID获取议题信息 + * + * @param ids + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/15 16:56 + */ + List selectIssueInfoByIds(@Param("ids") List ids); + + /** + * @param customerId + * @param dateId + * @Description 查询议题信息 + * @author zxc + * @date 2020/9/15 2:28 下午 + */ + List selectIssueInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题process信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueProcessInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题满意度评价信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueSatisfactionInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题支持反对信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueVoteInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc: 根据客户id 获取当前议题的情况 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 1:22 下午 + */ + List selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index 9f26b8b98d..b8d9093631 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -67,4 +68,13 @@ public interface CustomerGridDao extends BaseDao { * @return */ List listUpdatedGridsByUpdateTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询客户下的网格的agencyId, 还有pid + * @Date 2020/9/16 14:03 + **/ + List selectListGridInfo(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java new file mode 100644 index 0000000000..18b44ea8e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java @@ -0,0 +1,47 @@ +package com.epmet.dao.partymember; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.IssueInfoResultDTO; +import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; +import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.party.PartyMemberDTO; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.entity.issue.IssueEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface PartyMemberDao{ + + /** + * @Description 查询党员信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 1:58 下午 + */ + List selectPartyMemberInfo(@Param("customerId") String customerId,@Param("dateId") String dateId); + + /** + * 获取客户网格下注册党员 + * @author zhaoqifeng + * @date 2020/9/16 10:56 + * @param customerId + * @return java.util.List + */ + List selectPartyMemberByCustomer(@Param("customerId") String customerId); + + /** + * @return java.util.List + * @param volunteerUserIds + * @author yinzuomei + * @description 志愿者中,同时是党员的人数 + * @Date 2020/9/21 14:13 + **/ + List selectVolunteerPartyUserIds(@Param("list") List volunteerUserIds); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/point/PointDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/point/PointDao.java new file mode 100644 index 0000000000..fe777344aa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/point/PointDao.java @@ -0,0 +1,27 @@ +package com.epmet.dao.point; + +import com.epmet.dto.point.UserPointDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 积分查询DAO + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface PointDao { + + /** + * @Description 查询客户下的用户积分 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 15:51 + **/ + List selectUserPointByCustomerId(@Param("customerId") String customerId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index a50874c99e..df6da92b0b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -18,8 +18,10 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectInfoDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -82,4 +84,23 @@ public interface ProjectDao extends BaseDao { * @return java.util.List */ List selectGridClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 获取项目信息 + * @author zhaoqifeng + * @date 2020/9/15 16:13 + * @param customerId + * @param date + * @return java.util.List + */ + List selectProjectInfo(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 获取用户可滞留天数 + * @author zhaoqifeng + * @date 2020/9/28 10:16 + * @param customerId + * @return java.lang.String + */ + String selectParameterValueByKey(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java index ad0c1ca057..5242a1e4a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -18,6 +18,11 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.FinishOrgDTO; +import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import org.apache.ibatis.annotations.Mapper; @@ -41,4 +46,91 @@ public interface ProjectProcessDao extends BaseDao { **/ List selectProcessList(ProjectEntity projectEntity); + /** + * 根据客户查询项目处理进展 + * @author zhaoqifeng + * @date 2020/9/16 15:18 + * @param customerId + * @param date + * @return java.util.List + */ + List selectProcessListByCustomer(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 根据客户查询响应节点 + * @author zhaoqifeng + * @date 2020/9/16 15:18 + * @param customerId + * @param date + * @return java.util.List + */ + List selectResponseProcessList(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 查询各个节点的受理人 + * @author zhaoqifeng + * @date 2020/9/17 10:54 + * @param customerId + * @param date + * @return java.util.List + */ + List selectProcessStaffByCustomer(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 获取满意度评价记录 + * @author zhaoqifeng + * @date 2020/9/17 14:44 + * @param customerId + * @param date + * @return java.util.List + */ + List selectSatisfactionRecordByCustomer(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 获取已结案的项目列表 + * @author zhaoqifeng + * @date 2020/9/17 14:44 + * @param customerId + * @param date + * @return java.util.List + */ + List selectClosedProjectList(@Param("customerId") String customerId, @Param("date") String date); + /** + * @Description 查询项目-机关各个节点历时详情 + * @param customerId + * @param projectStatus 项目状态 pending closed 如果是null则全查 + * @param dateId + * @return + * @author wangc + * @date 2020.09.17 09:43 + **/ + List selectProjectOrgPeriod(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId); + + /** + * @Description 查询项目-机关各个节点的响应列表 + * @param projects + * @return + * @author wangc + * @date 2020.09.17 17:56 + **/ + List selectResponseTrace(@Param("projects") List projects); + + /** + * 获取办结组织 + * @author zhaoqifeng + * @date 2020/9/18 18:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectFinishOrg(@Param("customerId") String customerId, @Param("date") String date); + + /** + * @Description 查找项目最近一次操作说明 + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 14:45 + */ + List selectLatestOperation(@Param("list") List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java index 8788232a7b..487bc79f97 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java @@ -21,6 +21,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AgencySubDeptTreeDto; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.result.AgencyInfoResultDTO; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.stats.DimAgencyEntity; import org.apache.ibatis.annotations.Mapper; @@ -126,4 +127,22 @@ public interface DimAgencyDao extends BaseDao { DimAgencyEntity getLatestCreatedAgencyDimEntity(); DimAgencyEntity getLatestUpdatedAgencyDimEntity(); + + /** + * @Description 查询pid信息 + * @param agencyIds + * @author zxc + * @date 2020/9/15 6:15 下午 + */ + List selectAgencyInfo(@Param("agencyIds")List agencyIds); + + /** + * 根据级别获取组织信息 + * @author zhaoqifeng + * @date 2020/9/20 17:31 + * @param customerId + * @param level + * @return java.util.List + */ + List selectDimAgencyByLevel(@Param("customerId")String customerId, @Param("level")String level); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java index 8bd2c3cf8d..12244e2076 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java @@ -49,4 +49,11 @@ public interface DimCustomerDao extends BaseDao { DimCustomerEntity getLatestCreatedDimEntity(); DimCustomerEntity getLatestUpdatedDimEntity(); + + /** + * @Description 查询所有客户ID + * @author zxc + * @date 2020/9/17 3:30 下午 + */ + List getAllCustomerId(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java new file mode 100644 index 0000000000..0d614b2e4a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.PartyMemberInfoResultDTO; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.entity.stats.DimCustomerPartymemberEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +@Mapper +public interface DimCustomerPartymemberDao extends BaseDao { + + /** + * @Description 批量插入党员信息 + * @param partyMemberInfos + * @author zxc + * @date 2020/9/17 11:18 上午 + */ + void insertPartyMemberInfo(@Param("partyMemberInfos")List partyMemberInfos); + + /** + * @Description 删除旧党员记录 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 2:43 下午 + */ + void deleteOldPartyRecord(@Param("customerId")String customerId,@Param("dateId")String dateId); + + /** + * @return java.util.List + * @param customerId 客户id + * @author yinzuomei + * @description 查询客户下所有的党员, 构造好党员相关-党建能力初始值 + * @Date 2020/9/18 9:00 + **/ + List selectPartyMemberList(String customerId); + + /** + * @Description 查询党员信息 + * @param customerId + * @param gridIds + * @author zxc + * @date 2020/9/22 5:26 下午 + */ + List selectPartyMemberInfo(@Param("customerId")String customerId,@Param("gridIds") List gridIds); + + /** + * @return java.util.List + * @param customerId + * @param gridId + * @author yinzuomei + * @description 网格内注册的党员 + * @Date 2020/9/23 14:20 + **/ + List selectGridPartyMemberUserIds(@Param("customerId") String customerId, @Param("gridId")String gridId); + + /** + * @return java.util.List + * @param customerId + * @param communityId + * @author yinzuomei + * @description 社区内注册的党员 + * @Date 2020/9/24 10:22 + **/ + List selectCommunityPartyMemberUserIds(@Param("customerId") String customerId, @Param("communityId")String communityId); + + /** + * @return java.util.List + * @param customerId + * @param pids + * @author yinzuomei + * @description 根据pids查询党员 + * @Date 2020/9/24 14:31 + **/ + List selectPartyMemberUserIdsByPids(@Param("customerId") String customerId, @Param("pids")String pids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java index 0b58bc2220..0c24c6d79b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.DimDepartmentDTO; import com.epmet.entity.stats.DimDepartmentEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -44,4 +45,13 @@ public interface DimDepartmentDao extends BaseDao { DimDepartmentEntity getLatestCreatedDimEntity(); DimDepartmentEntity getLatestUpdatedDimEntity(); + + /** + * 获取区直部门 + * @author zhaoqifeng + * @date 2020/9/21 14:51 + * @param customerId + * @return java.util.List + */ + List getDistrictDepByCustomer(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java index c1671131b1..310dbc6ee5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java @@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; +import com.epmet.dto.stats.result.GridAttributesResultDTO; +import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -60,4 +62,21 @@ public interface DimGridDao extends BaseDao { List selectSubAgencyId(@Param("formDTO")List formDTO); DimGridEntity getLastUpdatedGridDim(); + + /** + * @Description 查询网格属于哪个机关 + * @param gridIds + * @author zxc + * @date 2020/9/17 2:34 下午 + */ + List selectGridBelongAgencyInfo(@Param("gridIds") List gridIds); + + /** + * @Description 查询网格的所有所属上级属性 + * @param gridIds + * @return + * @author wangc + * @date 2020.09.20 13:01 + **/ + List selectGridAttributes(@Param("customerId") String customerId,@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/stats/FactAgencyProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java index 2fbabdec6c..87409a6607 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java @@ -19,8 +19,10 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactAgencyProjectDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -46,4 +48,16 @@ public interface FactAgencyProjectDailyDao extends BaseDao selectProjectCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java index 5a7e9dbfc7..3e20141c80 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java @@ -18,10 +18,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 文章发布数量【机关】日统计表 * @@ -38,4 +41,16 @@ public interface FactArticlePublishedAgencyDailyDao extends BaseDao + */ + List selectArticleCount(@Param("customerId")String customerId, @Param("monthId")String monthId, + @Param("level")String level); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java index 1cff4fa1a8..dd48aa0afc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java @@ -18,10 +18,14 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; +import com.epmet.dto.stats.FactArticlePublishedDepartmentDailyDTO; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 文章发布数量【部门】日统计表 * @@ -38,4 +42,14 @@ public interface FactArticlePublishedDepartmentDailyDao extends BaseDao + */ + List selectDeptCount(@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/stats/FactArticlePublishedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java index 24b8ca6115..ddd8ebd63f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.PublishCountResultDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -51,4 +52,13 @@ public interface FactArticlePublishedGridDailyDao extends BaseDao selectArticlePublishCount(@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/stats/FactGroupGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java index c97f5c8120..5dfd4bc79d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java @@ -19,11 +19,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactGroupGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 组-网格日统计数据 @@ -47,5 +49,15 @@ public interface FactGroupGridDailyDao extends BaseDao * @author zxc */ void deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); - + + /** + * @Description 根据机关级别查询小组数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 16:19 + **/ + List selectGroupCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java index 6f9933bf1a..1e686cc690 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java @@ -42,14 +42,26 @@ public interface FactIssueAgencyMonthlyDao extends BaseDao */ List selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); - /** - * 删除 - * @author zhaoqifeng - * @date 2020/6/23 14:02 - * @param customerId - * @param monthId - * @return void - */ - void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * 删除 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/6/23 14:02 + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * desc: 获取各机关某月议题增量和议题总数 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 3:33 下午 + */ + List getIssueIncCountAndTotalByMonthId(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/dao/stats/FactIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java index 595131257d..c26edcd375 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java @@ -18,10 +18,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactIssueGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 网格议题数量(按日) * @@ -39,5 +42,16 @@ public interface FactIssueGridDailyDao extends BaseDao * @return void */ void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 根据机关类型查询议题数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 17:19 + **/ + List selectIssueCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); } \ No newline at end of file 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/dao/stats/topic/FactTopicTotalGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java index 7276945b90..7a0e6439df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.stats.topic; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,15 @@ public interface FactTopicTotalGridDailyDao extends BaseDao list); void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + + /** + * @Description 根据机关类型查询话题数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 17:19 + **/ + List selectTopicCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java index 4a5b254b8f..f74e27ede1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.UserCountResultDTO; import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -38,4 +39,13 @@ public interface FactParticipationUserAgencyDailyDao extends BaseDao selectUserCount(String customerId, String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java index d39a6088e1..687e8650d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java @@ -18,7 +18,9 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.UserCountResultDTO; import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -38,4 +40,11 @@ public interface FactParticipationUserGridDailyDao extends BaseDao selectUserCount(@Param("customerId")String customerId,@Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java index e59f48e8c5..5df37b7ff5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -36,5 +37,20 @@ public interface FactRegUserAgencyMonthlyDao extends BaseDao list); - void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); + void deleteByParams(@Param("monthId") String monthId, @Param("customerId") String customerId); + + List selectAgencyUserCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 查询机关下各用户数量 + * @author zhaoqifeng + * @date 2020/9/27 16:39 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectOrgUserCountByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level") String level); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java index f06c4c1179..ba2c53eb2c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.stats.user.FactRegUserGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -38,4 +39,12 @@ public interface FactRegUserGridDailyDao extends BaseDao selectUserAndPartymemberByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java index 940609d9bc..744f9ffd0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -38,4 +39,23 @@ public interface FactRegUserGridMonthlyDao extends BaseDao selectGridUserCount(String customerId, String monthId); + + /** + * 查询网格下各用户数量 + * @author zhaoqifeng + * @date 2020/9/27 13:59 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridUserCountByCustomer(@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/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 9244b799b1..1d9a6125bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -7,8 +7,14 @@ package com.epmet.dao.topic; * @since v1.0.0 2020-05-11 */ +import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.dto.topic.ResiTopicDTO; +import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -56,4 +62,59 @@ public interface TopicDao { * @date 2020.06.22 11:07 **/ List selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate); + + /** + * 根据ids获取话题信息 + * @author zhaoqifeng + * @date 2020/9/15 17:33 + * @param ids + * @return java.util.List + */ + List selectTopicByIds(@Param("ids") List ids); + + /** + * @Description 查询话题创建者信息 + * @param topicIds + * @author zxc + * @date 2020/9/15 4:55 下午 + */ + List selectTopicInfo(@Param("topicIds")List topicIds); + + /** + * @return java.util.List + * @param customerId + * @param dateId yyyyMMdd + * @author yinzuomei + * @description 根据日期查询resi_topic_operation,返回当前日期这一天内所有话题相关的操作记录 + * @Date 2020/9/15 18:14 + **/ + List selectListTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @return java.util.List + * @param customerId + * @param dateId + * @author yinzuomei + * @description 查询在这一天发生变化的话题记录 + * @Date 2020/9/23 17:52 + **/ + List queryUpdateTopicOriginInfoList(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @Description 查询话题的图片 + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 15:40 + */ + List selectTopicImgs(@Param("list") List list); + + /** + * @Description 得到话题(项目)内容 + * @param list + * @return java.util.Map + * @author wangc + * @date 2020.09.28 16:28 + */ + List selectTopicContent(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index d96d1787e1..b9162c30a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -1,6 +1,9 @@ package com.epmet.dao.user; +import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -97,4 +100,35 @@ public interface UserDao { * @date 2020.06.18 18:50 **/ Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds")List incrUserIds,@Param("gridIds") Set gridIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate); + + /** + * @Description 查询用户是不是党员 + * @param userIds + * @author zxc + * @date 2020/9/15 4:23 下午 + */ + List selectUserIsParty(@Param("userIds") List userIds); + + List selectPartymembersByCustomerId(@Param("customerId")String customerId); + + List selectWarmHeartedByCustomerId(@Param("customerId")String customerId); + + /** + * @param customerId + * @param gridId + * @return java.util.List + * @author yinzuomei + * @description 查询当前网格下,首次注册的用户ids + * @Date 2020/9/21 13:46 + **/ + List selectGridRegUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId); + + /** + * @Description 获取客户下的网格注册居民 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 13:54 + **/ + List selectRegisteredUserByCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java new file mode 100644 index 0000000000..2cf22199a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 对象行为动作维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_object_action") +public class DimObjectActionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 行为code + */ + private String actionCode; + + /** + * 行为描述 + */ + private String actionDesc; + + /** + * 行为类型 topic,issue,project,article,group + */ + private String actionType; + + /** + * 父级ID(本表id) + */ + private String pid; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java new file mode 100644 index 0000000000..121ff1a40e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 对象行为状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_object_status") +public class DimObjectStatusEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 行为code + */ + private String statusCode; + + /** + * 行为描述 + */ + private String statusDesc; + + /** + * 行为类型 topic,issue,project,article,group + */ + private String statusType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java new file mode 100644 index 0000000000..8bb0ba12a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_group_main_daily") +public class FactOriginGroupMainDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String customerId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String groupState; + + /** + * 小组所在网格Id + */ + private String gridId; + + /** + * 小组所在机关Id + */ + private String agencyId; + + /** + * 小组所在组织的父机关Id + */ + private String parentId; + + /** + * 小组所在组织所有父类Id集合 + */ + private String pids; + + /** + * 建群申请审核通过的时期 + */ + private String dateId; + + /** + * 建群申请审核通过的周期 + */ + private String weekId; + + /** + * 建群申请审核通过的月份 + */ + private String monthId; + + /** + * 建群申请审核通过的季度 + */ + private String quarterId; + + /** + * 建群申请审核通过的年 + */ + private String yearId; + + /** + * 群众人数 + */ + private Integer resiMemberCount; + + /** + * 组内总人数 + */ + private Integer memberTotal; + + /** + * 群主ID + */ + private String groupOwnerId; + + /** + * 建组时群主是否热心居民,不更新 + */ + private Integer isOwnerHearted; + + /** + * 建组时群主是否党员,不更新 + */ + private Integer isOwnerParty; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java new file mode 100644 index 0000000000..51f4e58c3a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题记录附表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_issue_log_daily") +public class FactOriginIssueLogDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织上级ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 党员 热心居民 居民 + */ + private String userIdentity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java new file mode 100644 index 0000000000..a64aec4525 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题主表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_issue_main_daily") +public class FactOriginIssueMainDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 日ID(指议题创建的yyyymmdd) + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户身份标识 + */ + private String userIdentity; + + /** + * 转议题用户ID + */ + private String userId; + + /** + * 创建话题用户的ID + */ + private String createTopicUserId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 转为议题的话题ID + */ + private String topicId; + + /** + * 议题网格ID + */ + private String gridId; + + /** + * 上级ID + */ + private String pid; + + /** + * 议题组织ID(网格所属组织ID) + */ + private String agencyId; + + /** + * 议题状态 + */ + private String issueStatus; + + /** + * 创建话题用户身份标识 + */ + private String topicUserIdentity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectLogDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectLogDailyEntity.java new file mode 100644 index 0000000000..a3110e0759 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectLogDailyEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_project_log_daily") +public class FactOriginProjectLogDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + /** + * 网格grid,部门department + */ + private String orgType; + /** + * 网格ID + */ + private String orgId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 操作人所在父Id,当orgType不为空时,agencyId与pid一致 + * 当orgType为空时,pid是agencyId的上级,没有上级则默认为0 + * */ + private String pid; + + /** + * 操作人所在所有父机Id集合,当orgType不为空时,pids最后一节一定包含pid + * 当orgType为空时,pids是agencyId的所有上级,没有上级则为空串 + * */ + private String pids; + + /** + * 日期ID + */ + private String dateId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 议题ID + */ + private String projectId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 是否主动发起人 1 是, 0 否 + */ + private Integer isActive; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java new file mode 100644 index 0000000000..c570c4e453 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_project_main_daily") +public class FactOriginProjectMainDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 项目的发布日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 转议题用户ID + */ + private String issueCreatorId; + + /** + * 转为项目的议题ID + */ + private String issueId; + + /** + * 转为议题的话题ID + */ + private String topicId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 上级ID + */ + private String pid; + + /** + * 所有上级Id集合 (项目来源) + * */ + private String pids; + + /** + * 组织ID(网格所属组织ID) + */ + private String agencyId; + + /** + * 状态 + */ + private String projectStatus; + + /** + * resolved unresolved + * */ + private String isResolved; + + /** + * 创建话题用户的ID + */ + private String topicCreatorId; + + /** + * 是否是党员 1:是 + */ + private String isParty; + + /** + * 是否超期 1:是 + */ + private String isOverdue; + + /** + * 办结组织Ids(:隔开,有可能是社区id可能是网格id,无需区分级别,在统计时模糊查询) + */ + private String finishOrgIds; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java new file mode 100644 index 0000000000..b5f0d2d53b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 业务数据抽取-机关项目响应时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_project_org_period_daily") +public class FactOriginProjectOrgPeriodDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * + */ + private String orgId; + + /** + * grid agenct dept + */ + private String orgType; + + /** + * 如果是机关,则为父级机关(若已是顶级机关则为0);如果是网格和部门,则为所属机关 + */ + private String pid; + + /** + * 最后一个节点是PID,若无则为空 + */ + private String pids; + + /** + * 流转到的日期 + */ + private Date informedDate; + + /** + * 流转走或结案的日期 + */ + private Date handledDate; + + /** + * 响应时长,从流转到自己到流转走共耗时/小时(不算法定节假日和周末) + */ + private Integer totalPeriod; + + /** + * 截至第一次响应时长,从流转到第一次处理(响应、结案、流转)耗时,大于等于上一项值 + */ + private Date periodTillReplyFirstly; + + /** + * resloved 、 unresolved + */ + private String isResolved; + + /** + * 办结的操作,return(回退)、transfer(流转)、closed(结案),但是不包括response(响应)! + * */ + private String operation; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java new file mode 100644 index 0000000000..83a6ec61ad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_topic_log_daily") +public class FactOriginTopicLogDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题所属的网格ID + */ + private String gridId; + + /** + * 网格所属上级组织ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String pid; + + /** + * 业务的发生时间 格式:日期ID + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 话题id + */ + private String topicId; + + /** + * 话题所属小组id + */ + private String groupId; + + /** + * 行为code 来自dim_object_action表 + */ + private String actionCode; + + /** + * 本条数据操作用户Id + */ + private String operateUserId; + + /** + * 本条数据操作用户是否是党员, 1是0不是 + */ + private Boolean operateUserIsParty; + + /** + * 原始业务发生时间 + */ + private Date originalBusinessTime; + /** + * 本表AGENCY_ID的PIDS英文:隔开 + */ + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java new file mode 100644 index 0000000000..917e95863d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 话题主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_topic_main_daily") +public class FactOriginTopicMainDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题所属的网格ID + */ + private String gridId; + + /** + * 所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String pid; + + /** + * 话题的发布日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 话题所属小组id + */ + private String groupId; + + /** + * 话题状态 来自dim_object_status表 + */ + private String topicStatus; + + /** + * 话题发布人id + */ + private String createTopicUserId; + + /** + * 话题发布人是否是党员:1是党员0不是。 默认0 + */ + private Boolean createTopicUserIsParty; + /** + * 本表AGENCY_ID的PIDS英文:隔开 + */ + private String pids; + + /** + * 关闭状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySelfSubScoreEntity.java new file mode 100644 index 0000000000..7a4b3d7d93 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySelfSubScoreEntity.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 区/街道相关 自身和下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_agency_self_sub_score") +public class AgencySelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id(eg:社区或者街道id) + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + + /** + * 自身指标得分 + */ + private BigDecimal selfScore; + + /** + * 下级指标得分 + */ + private BigDecimal subScore; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + private String parentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 自身指标权重 + */ + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java index d5ca30dc0e..3fc2a5888b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java @@ -62,25 +62,30 @@ public class AgencySubScoreEntity extends BaseEpmetEntity { */ private String quarterId; - /** - * 月维度Id: yyyyMM - */ - private String monthId; - - /** - * 1:总分;0不是;默认0 - */ - private String isTotal; - - /** - * 分值 - */ - private BigDecimal score; - - /** - * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan - */ - private String indexCode; + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 计算指标时的原始值 字符串类型 + */ + private String originValue; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; /** * 数据类型 district :全区;street:街道 @@ -91,4 +96,9 @@ public class AgencySubScoreEntity extends BaseEpmetEntity { * 权重(同一组权重总和=1) */ private BigDecimal weight; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CommunitySelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CommunitySelfSubScoreEntity.java new file mode 100644 index 0000000000..ac892b03f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CommunitySelfSubScoreEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 社区相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_community_self_sub_score") +public class CommunitySelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 社区上一级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 自身指标得分 + */ + private BigDecimal selfScore; + + /** + * 下级指标得分 + */ + private BigDecimal subScore; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + private String parentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 自身指标权重 + */ + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java index f1c79068a5..d140aca767 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java @@ -68,6 +68,11 @@ public class CpcSubScoreEntity extends BaseEpmetEntity { */ private String userId; + /** + * 计算指标时的原始值 字符串类型 + */ + private String originValue; + /** * 分值 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java new file mode 100644 index 0000000000..7e5395450f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 区直部门相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_dept_self_sub_score") +public class DeptSelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 自身指标得分 + */ + private BigDecimal selfScore; + + /** + * 下级指标得分 + */ + private BigDecimal subScore; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + private String parentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 自身指标权重 + */ + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java index 191ffb0157..c75fc82847 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java @@ -67,6 +67,11 @@ public class DeptSubScoreEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 计算指标时的原始值 字符串类型 + */ + private String originValue; + /** * 分值 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java index d8938d9018..82f8b0ae74 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java @@ -48,6 +48,11 @@ public class FactIndexCommunitySubScoreEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 计算指标时的原始值 字符串类型 + */ + private String originValue; + /** * 分值 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSelfSubScoreEntity.java new file mode 100644 index 0000000000..472d12074e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSelfSubScoreEntity.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 网格相关自身/下级分值记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_grid_self_sub_score") +public class GridSelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 自身指标得分 + */ + private BigDecimal selfScore; + + /** + * 下级指标得分 + */ + private BigDecimal subScore; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + private String parentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 自身指标权重 + */ + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java index 3404fda77d..fa88df4ba7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java @@ -77,6 +77,11 @@ public class GridSubScoreEntity extends BaseEpmetEntity { */ private String isTotal; + /** + * 计算指标时的原始值 字符串类型 + */ + private String originValue; + /** * 分值 */ 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/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java index 8a1b94fb3c..8db661ce1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java @@ -73,10 +73,15 @@ public class IndexGroupDetailEntity extends BaseEpmetEntity { private BigDecimal threshold; /** - * 所有指标code拼接的字符串 冒号隔开 + * 所有有权重的指标code拼接的字符串 冒号隔开 */ private String allParentIndexCode; + /** + * 所有指标code 冒号隔开 + */ + private String allIndexCodePath; + /** * 正相关:positive;负相关:negative */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java index 0d06fe6955..e75d36927b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java @@ -68,10 +68,15 @@ public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity { private BigDecimal threshold; /** - * 所有指标code拼接的字符串 冒号隔开 + * 所有有权重的指标code拼接的字符串 冒号隔开 */ private String allParentIndexCode; + /** + * 所有指标code 冒号隔开 + */ + private String allIndexCodePath; + /** * 正相关:positive;负相关:negative */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java index dfe57f7d8d..b25f4d1d82 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java @@ -50,14 +50,19 @@ public class IndexGroupEntity extends BaseEpmetEntity { */ private String indexCode; - /** - * 是否启用:启用:enable 禁用:disabled - */ + /** + * 是否启用:启用:enable 禁用:disabled + */ private String status; - /** - * 当前指标关联的上一级指标分组,如果没有上一级,则为0 - */ + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ private String parentIndexGroupId; + /** + * 所有指标code 冒号隔开 + */ + private String allIndexCodePath; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java index e22f7e6f2f..f8cdc843c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java @@ -45,14 +45,19 @@ public class IndexGroupTemplateEntity extends BaseEpmetEntity { */ private String indexCode; - /** - * 是否启用:启用:enable 禁用:disabled - */ + /** + * 是否启用:启用:enable 禁用:disabled + */ private String status; - /** - * 当前指标关联的上一级指标分组,如果没有上一级,则为0 - */ + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ private String parentIndexGroupId; + /** + * 所有指标code 冒号隔开 + */ + private String allIndexCodePath; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnCommunityProjectProfileEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnCommunityProjectProfileEntity.java new file mode 100644 index 0000000000..8f6e954b8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnCommunityProjectProfileEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + + +/** + * 安宁-社区-项目概况(数量、颜色) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_community_project_profile") +public class ScreenAnCommunityProjectProfileEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd,项目根据实际情况赋值 + */ + private String dataEndTime; + + /** + * 社区id + */ + private String orgId; + + /** + * 项目数 + */ + private Integer projectTotal; + + /** + * 等级 + */ + private String level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyEntity.java new file mode 100644 index 0000000000..3b738773e3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyEntity.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 安宁-基层治理-各类数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_grass_roots_govern_monthly") +public class ScreenAnGrassRootsGovernMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格,街道或社区id + */ + private String orgId; + + /** + * 网格,街道名称或者社区名称 + */ + private String orgName; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + + /** + * 项目响应度 存储的是%前面的数 + */ + private BigDecimal projectResponseRatio; + + /** + * 项目满意率,存储的是%前面的数 + */ + private BigDecimal projectSatisRatio; + + /** + * 办结率 for 社区 + */ + private BigDecimal closedProjectRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyEntity.java new file mode 100644 index 0000000000..889650f9b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 安宁-基层组织(党群数|议题数|项目数)-按月 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_grass_roots_org_monthly") +public class ScreenAnGrassRootsOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格id或者组织(街道或社区)id + */ + private String orgId; + + /** + * 组织名称OR网格名称 + */ + private String orgName; + + /** + * 网格:grid; 组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 党群数 + */ + private Integer groupTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + + /** + * 项目数 + */ + private Integer projectTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmRankEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmRankEntity.java new file mode 100644 index 0000000000..721c1106ea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmRankEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 安宁-基层党员-排行榜单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_grass_roots_pm_rank") +public class ScreenAnGrassRootsPmRankEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + + /** + * 所属支部id + */ + private String branchId; + + /** + * 所属支部名称 + */ + private String branchName; + + /** + * 所属社区id + */ + private String communityId; + + /** + * 所属社区名称 + */ + private String communityName; + + /** + * 群成员数 + */ + private Integer groupMemberTotal; + + /** + * 话题数 + */ + private Integer topicTotal; + + /** + * 参与人次 + */ + private Integer partiUserTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyEntity.java new file mode 100644 index 0000000000..9ec3bfdb20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 安宁-基层党员-各类总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_grass_roots_pm_total_monthly") +public class ScreenAnGrassRootsPmTotalMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格id或者组织(街道或社区)id + */ + private String orgId; + + /** + * 组织名称OR网格名称 + */ + private String orgName; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 群成员数 + */ + private Integer groupMemberTotal; + + /** + * 话题数 + */ + private Integer topicTotal; + + /** + * 话题参与人次 + */ + private Integer topicPartiUserTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java index e06907ca84..46903b52b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java @@ -89,13 +89,20 @@ public class ScreenCustomerAgencyEntity extends BaseEpmetEntity { private String level; /** - * 行政地区编码 - */ + * 行政地区编码 + */ private String areaCode; - /** - * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) - */ + private String sourceType; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ private String dataEndTime; + /** + * desc: 是否显示 1显示 0不显示 + */ + private String isDisplay; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerBizOrgEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerBizOrgEntity.java new file mode 100644 index 0000000000..5700d83fe0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerBizOrgEntity.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 组织机构信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("screen_customer_biz_org") +public class ScreenCustomerBizOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织id + */ + private String orgId; + + /** + * 业务类型 community:智慧社区 + */ + private String bizType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java index 6fdb38f4b8..474243815a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java @@ -75,4 +75,6 @@ public class ScreenCustomerDeptEntity extends BaseEpmetEntity { */ private String dataEndTime; + private String sourceType; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java index 19fdd132be..0b98a125eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java @@ -79,4 +79,6 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity { * 所有上级ID,用英文逗号分开(8.26新增) */ private String allParentIds; + + private String sourceType; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java new file mode 100644 index 0000000000..469670b67f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java @@ -0,0 +1,29 @@ +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * @Description 难点赌点 图片列表 + * @ClassName ScreenDifficultyImgDataEntity + * @Auth wangc + * @Date 2020-09-28 10:57 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_difficulty_img_data") +@AllArgsConstructor +public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String eventId; + + private String eventImgUrl; + + private Integer sort; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java index 0a2fdd7455..417e53a0e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java @@ -109,4 +109,6 @@ public class ScreenIndexDataMonthlyEntity extends BaseEpmetEntity { * 治理能力分数,权重 */ private BigDecimal governAblityWeight; + + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java index 4d70bf29ff..93b3a98577 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java @@ -22,6 +22,8 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + /** * 党建引领|基层治理-市民(党员)积分排行榜 * @@ -90,6 +92,10 @@ public class ScreenPartyUserRankDataEntity extends BaseEpmetEntity { */ private Integer pointTotal; + /** + * 党员指标得分 + * */ + private BigDecimal indexScore; /** * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java index a51b8b6449..c03d32f1df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java @@ -117,4 +117,11 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + + /** + * + */ + private String pid; + private String agencyPids; + private String agencyPath; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java index 3f38146cc6..b0c78254e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java @@ -86,7 +86,7 @@ public class ScreenPublicPartiTotalDataEntity extends BaseEpmetEntity { private Integer regUserTotal; /** - * 参与人数 + * 参与人数参与人数: 议题的表决行为的用户数去重的累计值 */ private Integer joinUserTotal; 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/project/ProjectProcessEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java index d6f4cd5467..4ee37ae5df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java @@ -87,4 +87,9 @@ public class ProjectProcessEntity extends BaseEpmetEntity { */ private String costWorkdays; + /** + * 是否解决 + * */ + private String isResolved; + } 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/entity/stats/DimCustomerPartymemberEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java new file mode 100644 index 0000000000..2c84bf98c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_customer_partymember") +public class DimCustomerPartymemberEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 党员认证时的网格id + */ + private String gridId; + + /** + * 所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String pid; + + /** + * 党员认证成功的日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 用户id + */ + private String userId; + + /** + * 身份证 + */ + private String idCard; + + /** + * 生日 + */ + private Date birthday; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/CalculateFlagModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/CalculateFlagModel.java index 95d114ae16..d64fa71dd3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/CalculateFlagModel.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/CalculateFlagModel.java @@ -17,4 +17,11 @@ public class CalculateFlagModel { */ private String status; + /** + * 开始时间 + * CalculateStatus.java + */ + private String startTime; + + } 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 57eead6c35..9870714357 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 @@ -9,6 +9,7 @@ import com.epmet.entity.evaluationindex.screen.IndexDictEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; import com.epmet.service.evaluationindex.screen.IndexDictService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; import com.epmet.support.normalizing.Correlation; @@ -42,7 +43,6 @@ public class IndexExcelDataListener extends AnalysisEventListener { List indexModelList = new ArrayList<>(); private String preWheight; - private Integer wheightSum = 0; /** * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 */ @@ -52,16 +52,25 @@ public class IndexExcelDataListener extends AnalysisEventListener { private IndexGroupDetailTemplateService indexGroupDetailTemplateService; + private IndexGroupDetailService indexGroupDetailService; + /** + * 客户id不为空时,需要修改index_group_detail + */ + private String customerId; /** * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 * * @param indexDictService */ - public IndexExcelDataListener(IndexDictService indexDictService, IndexGroupTemplateService indexGroupTemplateService, IndexGroupDetailTemplateService indexGroupDetailTemplateService) { + public IndexExcelDataListener(IndexDictService indexDictService, IndexGroupTemplateService indexGroupTemplateService, IndexGroupDetailTemplateService indexGroupDetailTemplateService, + String customerId, + IndexGroupDetailService indexGroupDetailService) { this.indexDictService = indexDictService; this.indexGroupTemplateService = indexGroupTemplateService; this.indexGroupDetailTemplateService = indexGroupDetailTemplateService; + this.customerId=customerId; + this.indexGroupDetailService=indexGroupDetailService; } /** @@ -104,6 +113,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(); @@ -139,6 +159,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group1.setParentIndexGroupId("0"); group1.setId(UniqueIdGenerator.generate()); group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), true, 4)); + group1.setAllIndexCodePath(index.getAllIndexCodePath(0)); indexGroupMap.put(index.getLevel1Index(), group1); } StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); @@ -154,6 +175,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group2.setParentIndexGroupId(group1.getId()); group2.setId(UniqueIdGenerator.generate()); group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + group2.setAllIndexCodePath(index.getAllIndexCodePath(3)); indexGroupMap.put(level4IndexDetailKey, group2); //构建 分组明细 templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + level4Index); @@ -164,6 +186,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); + templateEntity.setAllIndexCodePath(index.getAllIndexCodePath(3)); buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); indexGroupDetailMap.put(index.getLevel1Index() + level4Index, templateEntity); } @@ -181,6 +204,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); + templateEntity.setAllIndexCodePath(index.getAllIndexCodePath(4)); buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); indexGroupDetailMap.put(level5IndexDetailKey, templateEntity); } @@ -195,6 +219,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group1.setParentIndexGroupId("0"); group1.setId(UniqueIdGenerator.generate()); group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + group1.setAllIndexCodePath(index.getAllIndexCodePath(0)); indexGroupMap.put(index.getLevel1Index(), group1); } StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); @@ -209,7 +234,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group2.setParentIndexGroupId(group1.getId()); group2.setId(UniqueIdGenerator.generate()); group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); - + group2.setAllIndexCodePath(index.getAllIndexCodePath(1)); indexGroupMap.put(level2IndexGroupKey, group2); //构建 分组明细 templateEntity = indexGroupDetailMap.get(level2IndexGroupKey); @@ -220,6 +245,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); + templateEntity.setAllIndexCodePath(index.getAllIndexCodePath(1)); buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); indexGroupDetailMap.put(level2IndexGroupKey, templateEntity); } @@ -236,6 +262,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); + templateEntity.setAllIndexCodePath(index.getAllIndexCodePath(4)); buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); indexGroupDetailMap.put(level5IndexGroupKey, templateEntity); } @@ -299,6 +326,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); + entity5.setValueType(data.getValueType()); indexDicMap.put(data.getLevel5Index(), entity5); } } @@ -311,10 +339,16 @@ public class IndexExcelDataListener extends AnalysisEventListener { @Override public void doAfterAllAnalysed(AnalysisContext context) { // 这里也要保存数据,确保最后遗留的数据也存储到数据库 - saveData(); + if(StringUtils.isNotBlank(customerId)){ + //修改客户权重信息 + updateCustomerGroupDetail(); + }else{ + saveData(); + } LOGGER.info("所有数据解析完成!total:{}", total.intValue()); } + /** * 加上存储数据库 */ @@ -328,4 +362,11 @@ public class IndexExcelDataListener extends AnalysisEventListener { indexGroupDetailTemplateService.deleteAndInsertBatch(indexGroupDetailMap.values()); LOGGER.info("存储数据库成功!指标:{}个,分组:{}个,详情:{}个", indexDicMap.values().size(), indexGroupMap.values().size(), indexGroupDetailMap.values().size()); } + + /** + * 修改客户权重信息 + */ + private void updateCustomerGroupDetail() { + indexGroupDetailService.updateCustomerIndexGroupDetail(indexGroupDetailMap.values(),customerId); + } } 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 77a0fd3138..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 @@ -1,6 +1,8 @@ package com.epmet.model; import com.alibaba.excel.annotation.ExcelProperty; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.util.Pinyin4jUtil; import lombok.Data; @Data @@ -24,9 +26,54 @@ public class IndexModel { //没有阈值:无,有就是百分数 @ExcelProperty(value = "阈值") private String threshold; + /** + * 指标值类型 无:none;整数:integer;小数: decimal;百分比:percent + */ + @ExcelProperty(value = "五级指标值类型") + private String valueType; /** * 正相关:positive;负相关:negative */ @ExcelProperty(value = "相关性") private String correlation; + + /** + * desc:获取所有codepath 顶级为0 + * + * @param level + * @return + */ + public String getAllIndexCodePath(Integer level) { + StringBuilder result = new StringBuilder(); + switch (level) { + case 1: + result.append(Pinyin4jUtil.getSpellPinYin(level1Index, false, 4)); + break; + case 2: + result.append(Pinyin4jUtil.getSpellPinYin(level1Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level2Index, false, 4)); + break; + case 3: + result.append(Pinyin4jUtil.getSpellPinYin(level1Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level2Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level3Index, false, 4)); + break; + case 4: + result.append(Pinyin4jUtil.getSpellPinYin(level1Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level2Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level3Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level4Index, false, 4)); + break; + case 5: + result.append(Pinyin4jUtil.getSpellPinYin(level1Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level2Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level3Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level4Index, false, 4)) + .append(StrConstant.COLON).append(Pinyin4jUtil.getSpellPinYin(level5Index, false, 4)); + break; + default: + return "0"; + } + return result.toString(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java new file mode 100644 index 0000000000..64ba669caf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java @@ -0,0 +1,13 @@ +package com.epmet.service; + +import org.springframework.stereotype.Service; + +/** + * epmet_evaluation_index 维度的service + */ +@Service +public interface EIDimService { + void initAgencies(); + void initDepartments(); + void initGrids(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index d2a9ef721a..239ad2d8b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -1,6 +1,11 @@ package com.epmet.service.Issue; +import com.epmet.dto.extract.result.IssueInfoResultDTO; +import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; +import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; @@ -109,4 +114,62 @@ public interface IssueService { * @return java.util.List */ List getIssueProjectList(String customerId); + + + /** + * 根据ID获取议题信息 + * @author zhaoqifeng + * @date 2020/9/15 16:56 + * @param ids + * @return java.util.List + */ + List getIssueInfoByIds(List ids); + + /** + * @Description 查询议题信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/15 2:28 下午 + */ + List selectIssueInfo(String customerId,String dateId); + + /** + * @Description 查询议题process信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueProcessInfo(String customerId,String dateId); + + /** + * @Description 查询议题满意度评价信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueSatisfactionInfo(String customerId, String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题支持反对信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueVoteInfo(String customerId, String dateId); + + /** + * desc: 【月】查询议题支持反对及应表决人数 + * 数据由两部分组成 1:本月内已经关闭的话题的支持和反对数据 来自issue,issue_vote_statistical + * + * @param customerId + * @param monthId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 11:20 上午 + */ + List selectIssueVoteStatis(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index 25cd62b30a..e134358618 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -3,7 +3,12 @@ package com.epmet.service.Issue.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; +import com.epmet.dto.extract.result.IssueInfoResultDTO; +import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; +import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; @@ -80,4 +85,62 @@ public class IssueServiceImpl implements IssueService { public List getIssueProjectList(String customerId) { return statsIssueDao.selectIssueProjectList(customerId); } + + @Override + public List getIssueInfoByIds(List ids) { + return statsIssueDao.selectIssueInfoByIds(ids); + } + + /** + * @Description 查询议题信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/15 2:28 下午 + */ + @Override + public List selectIssueInfo(String customerId,String dateId) { + return statsIssueDao.selectIssueInfo(customerId, dateId); + } + + /** + * @Description 查询议题process信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + @Override + public List selectIssueProcessInfo(String customerId, String dateId) { + return statsIssueDao.selectIssueProcessInfo(customerId, dateId); + } + + /** + * @Description 查询议题满意度评价信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + @Override + public List selectIssueSatisfactionInfo(String customerId, String dateId) { + return statsIssueDao.selectIssueSatisfactionInfo(customerId, dateId); + } + + /** + * @Description 查询议题支持反对信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + @Override + public List selectIssueVoteInfo(String customerId, String dateId) { + return statsIssueDao.selectIssueVoteInfo(customerId, dateId); + } + + @Override + public List selectIssueVoteStatis(String customerId, String dateId) { + return statsIssueDao.selectIssueVoteStatis(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java new file mode 100644 index 0000000000..cb9552dd4d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java @@ -0,0 +1,21 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex; + +import java.util.Map; + +/** + * 党员相关 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/17 14:05 + */ +public interface CalCpcIndexService { + /** + * @return void + * @param customerId 客户id + * @param monthId yyyyMM + * @author yinzuomei + * @description 党员相关-党建能力 + * @Date 2020/9/17 14:08 + **/ + void calCpcPartyAbility(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalGridIndexService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalGridIndexService.java new file mode 100644 index 0000000000..d63cb1253a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalGridIndexService.java @@ -0,0 +1,36 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex; + +/** + * @Author zxc + * @DateTime 2020/9/18 9:52 上午 + */ +public interface CalGridIndexService { + + /** + * @Description 计算网格指标党建能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + Boolean calGridIndexPartyAbility(String customerId,String monthId); + + /** + * @Description 计算网格指标治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + Boolean calGridIndexGovernAbility(String customerId,String monthId); + + /** + * @Description 计算网格指标服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + Boolean calGridIndexServiceAbility(String customerId,String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollCommunityService.java new file mode 100644 index 0000000000..83483241a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollCommunityService.java @@ -0,0 +1,21 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex; + +/** + * 社区相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:33 + */ +public interface IndexCollCommunityService { + /** + * 社区能力统计 + * + * @author zhaoqifeng + * @date 2020/9/18 13:52 + * @param customerId + * @param dateId + * @return void + */ + void saveCommunityAbility(String customerId, String dateId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictDepartmentService.java new file mode 100644 index 0000000000..5d7b5c6e9d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictDepartmentService.java @@ -0,0 +1,20 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex; + +/** + * 区直部门相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:43 + */ +public interface IndexCollDistrictDepartmentService { + /** + * 区直部门能力统计 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/21 14:42 + */ + void saveDepartmentAbility(String customerId, String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java new file mode 100644 index 0000000000..bf6957c097 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java @@ -0,0 +1,20 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex; + +/** + * 全区相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:44 + */ +public interface IndexCollDistrictService { + /** + * 区治理能力统计 + * + * @author zhaoqifeng + * @date 2020/9/18 13:52 + * @param customerId + * @param dateId + * @return void + */ + void saveDistrictAbility(String customerId, String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollStreetService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollStreetService.java new file mode 100644 index 0000000000..c51df08dbc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollStreetService.java @@ -0,0 +1,20 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex; + +/** + * 街道相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:35 + */ +public interface IndexCollStreetService { + /** + * 街道治理能力统计 + * + * @author zhaoqifeng + * @date 2020/9/18 13:52 + * @param customerId + * @param dateId + * @return void + */ + void saveStreetAbility(String customerId, String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java new file mode 100644 index 0000000000..773e902e00 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex; + +import com.epmet.dto.extract.form.ExtractIndexFormDTO; + +/** + * desc:将统计库对象数据抽取到指标库 服务接口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/17 14:05 + */ +public interface IndexOriginExtractService { + /** + * desc:从统计库对象抽取指标数据 + * + * @param formDTO + */ + void indexOriginExtractAll(ExtractIndexFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java new file mode 100644 index 0000000000..6c7fad11c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -0,0 +1,395 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; +import com.epmet.service.evaluationindex.extract.todata.*; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import com.epmet.service.stats.DimCustomerPartymemberService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 党员相关 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/17 14:06 + */ +@Slf4j +@Service +public class CalCpcIndexServiceImpl implements CalCpcIndexService { + @Autowired + private DimCustomerPartymemberService dimCustomerPartymemberService; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private FactOriginTopicLogDailyService factOriginTopicLogDailyService; + @Autowired + private IssueExtractService issueExtractService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + + /** + * @param customerId 客户id + * @param monthId yyyyMM + * @return void + * @author yinzuomei + * @description 党员相关-党建能力 + * @Date 2020/9/17 14:08 + **/ + @Override + public void calCpcPartyAbility(String customerId, String monthId) { + //1、构造初始值 + List indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); + if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { + log.info("dim_customer_partymember do not any records customerId="+customerId); + return; + } + String quarterId= DateUtils.getQuarterId(monthId); + String yearId=DateUtils.getYearId(monthId); + + //1、党员提出话题数 + Map createTopicCountMap = calCreateTopicCount(customerId, monthId); + //2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和 + Map joinTopicCountMap = calJoinTopicCount(customerId, monthId); + //3、党员提出的话题转议题数 + Map shiftIssueCountMap = calShiftIssueCount(customerId, monthId); + //4、党员提出的议题转项目数 + Map shiftProjectCountMap = calShiftProjectCount(customerId, monthId); + //5、参加“三会一课”次数 默认0 + + //可以先查询出每个党员的 自建群 + Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); + //6、党员自建群群众人数 :和评价周期无关 + Map groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + //7、党员自建群活跃群众人数 + Map groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + //8、党员自建群活跃度——话题数:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。 + Map groupTopicCountMap = calGroupTopicCount(customerId, monthId); + //9、自建群活跃度——议题转项目率 + Map topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + + //2、计算实际值,更新 + for (FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity : indexPartyAblityCpcList) { + indexPartyAblityCpcEntity.setMonthId(monthId); + indexPartyAblityCpcEntity.setQuarterId(quarterId); + indexPartyAblityCpcEntity.setYearId(yearId); + //1、党员提出话题数 + if (createTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setCreateTopicCount(createTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和 + if (joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setJoinTopicCount(joinTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //3、党员提出的话题转议题数 + if (shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setShiftIssueCount(shiftIssueCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //4、党员提出的议题转项目数 + if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //5、参加“三会一课”次数 目前没有此业务,默认0 + //6、党员自建群群众人数 + if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //7、党员自建群活跃群众人数 + if (groupActiveUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupActiveUserCount(groupActiveUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //8、党员自建群活跃度——话题数 + if (groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupTopicCount(groupTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //9、自建群活跃度——议题转项目率 + if (topicToIssueRatioMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId())); + } + } + //3、删除之前统计过的、批插入批量插入 + factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId,monthId,indexPartyAblityCpcList); + } + + /** + * @param customerId + * @param partyMemberList + * @return java.util.Map> + * @author yinzuomei + * @description 查询每个党员的自建群 + * @Date 2020/9/20 22:07 + **/ + private Map> queryUserCreatedGroups(String customerId, List partyMemberList) { + Map> map = new HashMap<>(); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + //查询当前党员建了多少个组 + List groupIdList=factOriginGroupMainDailyService.selectGroupIds(customerId,partyMember.getUserId()); + if (CollectionUtils.isEmpty(groupIdList)) { + map.put(partyMember.getUserId(), new ArrayList<>()); + continue; + } else { + map.put(partyMember.getUserId(), groupIdList); + } + } + return map; + } + + /** + * @param customerId + * @param monthId + * @return java.lang.Integer + * @author yinzuomei + * @description 1、查询出客户下所有党员对应的-党员提出话题数 + * @Date 2020/9/18 10:59 + **/ + private Map calCreateTopicCount(String customerId, String monthId) { + List list = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO cpcIndexCommonDTO: list) { + resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 2、查询客户下,这个月内,每个党员评论话题的次数 + * @Date 2020/9/18 13:33 + **/ + private Map calJoinTopicCount(String customerId, String monthId) { + List list = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { + resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 3、党员提出的话题转议题数 + * @Date 2020/9/18 13:53 + **/ + private Map calShiftIssueCount(String customerId, String monthId) { + List list = issueExtractService.selectShiftIssueCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { + resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 4、党员提出的议题转项目数 + * @Date 2020/9/18 14:10 + **/ + private Map calShiftProjectCount(String customerId, String monthId) { + //查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_ + List list = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { + resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 6、党员自建群群众人数 + * @Date 2020/9/18 15:38 + **/ + private Map calgroupUserCount(String customerId, String monthId, + List partyMemberList, + Map> userCreatedGroups) { + /*含义:评价周期内,党员自建群中群众成员数。 + 数据来源:用户社群关系表。 + 计算方法:对党员i的所有j个自建群,从用户社群关系表中统计属于每个自建群的群众用户总人数,并对j个群众用户总数进行不重复累加。 + 对评价结果的影响:正向。*/ + Map map = new HashMap<>(); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + //查询当前党员建了多少个组 + List groupIdList = userCreatedGroups.get(partyMember.getUserId()); + if (CollectionUtils.isEmpty(groupIdList)) { + log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0"); + map.put(partyMember.getUserId(), NumConstant.ZERO); + continue; + } + //去重组里面的成员 + List memberIdList=factOriginGroupMainDailyService.selectGroupMemberList(groupIdList); + if (CollectionUtils.isEmpty(memberIdList)) { + //memberIdList肯定不会为空,因为起码会有群主一个人 + map.put(partyMember.getUserId(), NumConstant.ZERO); + continue; + } else { + map.put(partyMember.getUserId(), memberIdList.size()); + } + } + return map; + } + + /** + * @param customerId + * @param monthId + * @param partyMemberList + * @return java.util.Map + * @author yinzuomei + * @description 7、党员自建群活跃群众人数 + * @Date 2020/9/20 21:36 + **/ + private Map calGroupActiveUserCount(String customerId, String monthId, + List partyMemberList, + Map> userCreatedGroups) { + /*含义:评价周期内,党员自建群中活跃群众成员数。所谓活跃群成员,即评价周期内参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。 + 数据来源:话题用户阅读表、话题评论用户表态表、话题评论表、事件点赞点踩表、事件评论点赞点踩表、事件评论表、用户信息表。 + 计算方法: + a)判断群中的群众成员是否活跃 + for each 群众成员 i + 统计i的话题阅读次数、话题评论次数、话题评论表态次数、事件点赞点踩次数、事件评论点赞点踩次数、事件评论总次数。 + If 总次数>阈值 + 成员i为活跃群众成员 + b)不重复累加活跃群众成员数 + 对评价结果的影响:正向。*/ + //结合目前产品,数据来源:话题评论、议题表决 + Map map = new HashMap<>(); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + int groupActiveUserCount = 0; + //1、查询当前党员建了多少个组 + List groupIdList = userCreatedGroups.get(partyMember.getUserId()); + if (CollectionUtils.isEmpty(groupIdList)) { + log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0"); + map.put(partyMember.getUserId(), NumConstant.ZERO); + continue; + } + //2、去重组里面的成员 + List memberIdList = factOriginGroupMainDailyService.selectGroupMemberList(groupIdList); + if (CollectionUtils.isEmpty(memberIdList)) { + map.put(partyMember.getUserId(), NumConstant.ZERO); + continue; + } + //3、判断每个成员是否 “活跃” + for (String memberId : memberIdList) { + //1、判断成员在本月内是否评论过 + Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId); + if (topicCommentCount > 0) { + groupActiveUserCount++; + continue; + } + //2、判断成员在本月内是否表决过(支持or反对)议题 + Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId); + if (voteCount > 0) { + groupActiveUserCount++; + } + } + //赋值每个党员的 -- 党员自建群活跃群众人数 + map.put(partyMember.getUserId(), groupActiveUserCount); + } + return map; + } + + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 8、党员自建群活跃度——话题数 + * @Date 2020/9/18 14:31 + **/ + private Map calGroupTopicCount(String customerId, String monthId) { + /*含义:评价周期内,党员自建群中话题发布数。 + 数据来源:话题表。 + 计算方法:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。 + 对评价结果的影响:正向。*/ + List list = factOriginTopicLogDailyService.selectGroupTopicCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO dto : list) { + resultMap.put(dto.getUserId(), dto.getIndexValue()); + } + return resultMap; + } + + /** + * @param userCreatedGroups 党员自建群 + * @return java.util.Map + * @author yinzuomei + * @description 9、自建群活跃度——议题转项目率 + * @Date 2020/9/20 22:11 + **/ + private Map caltopicToIssueRatio(String customerId, + String monthId, + List partyMemberList, + Map> userCreatedGroups) { + Map map = new HashMap<>(); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + //如果党员自建群为空,直接赋值0 + if (CollectionUtils.isEmpty(userCreatedGroups.get(partyMember.getUserId()))) { + map.put(partyMember.getUserId(), BigDecimal.ZERO); + continue; + } + //自建群出来的话题 + List groupIdList = userCreatedGroups.get(partyMember.getUserId()); + List topicIdList = factOriginTopicLogDailyService.selectTopicIds(groupIdList); + if (CollectionUtils.isEmpty(topicIdList)) { + map.put(partyMember.getUserId(), BigDecimal.ZERO); + continue; + } + //分子 + //本月内新增的项目(and 源于自建群中的话题) + Integer projectTotal = factOriginProjectMainDailyService.selectCountByPartyUser(customerId, monthId, topicIdList); + if (null == projectTotal || projectTotal == NumConstant.ZERO) { + map.put(partyMember.getUserId(), BigDecimal.ZERO); + continue; + } + //分母 + //本评价周期+上一个评价周期内自建群中的议题数 + Integer issueTotal = issueExtractService.selectIssueTotalTwoMonth(topicIdList); + if (null == issueTotal || issueTotal == NumConstant.ZERO) { + map.put(partyMember.getUserId(), BigDecimal.ZERO); + continue; + } + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal); + BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + map.put(partyMember.getUserId(), topicToIssueRatio); + } + return map; + } + + + + + + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java new file mode 100644 index 0000000000..22dfccc44e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -0,0 +1,569 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.ExtractConstant; +import com.epmet.constant.ProjectEvaluateConstant; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService; +import com.epmet.service.evaluationindex.extract.todata.*; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.heart.ActInfoService; +import com.epmet.service.partymember.PartyMemberService; +import com.epmet.service.stats.FactArticlePublishedGridDailyService; +import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/18 9:53 上午 + */ +@Service +@Slf4j +public class CalGridIndexServiceImpl implements CalGridIndexService { + + @Autowired + private IssueExtractService issueExtractService; + @Autowired + private FactOriginProjectMainDailyService projectMainService; + @Autowired + private FactOriginProjectLogDailyService projectLogService; + @Autowired + private FactRegUserGridMonthlyService userGridMonthlyService; + @Autowired + private FactOriginTopicMainDailyService topicMainService; + @Autowired + private FactArticlePublishedGridDailyService articlePublishedGridDailyService; + @Autowired + private GroupExtractService groupExtractService; + @Autowired + private FactOriginTopicLogDailyService topicLogService; + @Autowired + private FactIndexPartyAblityOrgMonthlyService partyAbilityOrgMonthlyService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService governAbilityOrgMonthlyService; + @Autowired + private FactIndexServiceAblityGridMonthlyService factIndexServiceAbilityGridMonthlyService; + @Autowired + private ActInfoService actInfoService; + @Autowired + private UserService userService; + @Autowired + private PartyMemberService partyMemberService; + @Autowired + private ScreenCustomerGridService gridService; + + /** + * @Description 计算网格指标党建能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + @Override + public Boolean calGridIndexPartyAbility(String customerId, String monthId) { + List result = gridService.selectAllGridInfoToParty(customerId); + if (CollectionUtils.isEmpty(result)){ + log.warn(String.format(ExtractConstant.CUSTOMER_INFO_NULL,customerId)); + return true; + } + // 网格群众用户数 , 网格党员用户数 + List gridUserCountList = userGridMonthlyService.selectGridUserCount(customerId, monthId); + // 网格党员人均提出话题数 + List partyCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ONE); + // 网格群众人均提出话题数 + List massCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ZERO); + // 网格党员人均提出的议题转项目数 + List partyShiftProjectCountList = issueExtractService.selectShiftProjectCountPlus(customerId, monthId, NumConstant.ONE); + // 网格群众人均提出的议题转项目数 + List massShiftProjectCountList = issueExtractService.selectShiftProjectCountPlus(customerId, monthId, NumConstant.ZERO); + // 网格的发文数量 + List publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId); + // 网格议题转项目率 + List gridIssueTotalList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, DateUtils.minusMonthId(monthId)); + List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); + List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); + // 建群党员数 + List partyCreateGroupCountList = groupExtractService.selectPartyCreateGroupCount(customerId, monthId); + //结合目前产品,数据来源:话题评论、议题表决 + //网格活跃群众用户数 + Map gridMassActiveMap = new HashMap<>(16); + List massActiveList = topicLogService.selectPartyActiveTopic(customerId, monthId, NumConstant.ZERO); + List massActiveIssueVote = issueExtractService.selectPartyActiveIssueVote(customerId, monthId, NumConstant.ZERO); + massActiveList.addAll(massActiveIssueVote); + if (!CollectionUtils.isEmpty(massActiveList)) { + Map> collectMap = massActiveList.stream().collect(Collectors.groupingBy(PartyActiveResultDTO::getGridId)); + collectMap.forEach((gridId, massActive) -> { + List userIds = massActive.stream().map(mass -> mass.getUserId()).distinct().collect(Collectors.toList()); + gridMassActiveMap.put(gridId, userIds.size()); + }); + } + //网格活跃党员用户数 + Map gridPartyActiveMap = new HashMap<>(16); + List partyActiveList = topicLogService.selectPartyActiveTopic(customerId, monthId, NumConstant.ONE); + List partyActiveIssueVote = issueExtractService.selectPartyActiveIssueVote(customerId, monthId, NumConstant.ONE); + partyActiveList.addAll(partyActiveIssueVote); + if (!CollectionUtils.isEmpty(partyActiveList)){ + Map> collectMap = massActiveList.stream().collect(Collectors.groupingBy(PartyActiveResultDTO::getGridId)); + collectMap.forEach((gridId, partyActive) -> { + List userIds = partyActive.stream().map(party -> party.getUserId()).distinct().collect(Collectors.toList()); + gridPartyActiveMap.put(gridId, userIds.size()); + }); + } + + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); + result.forEach(r -> { + r.setMonthId(monthId); + r.setQuarterId(quarterId); + r.setYearId(yearId); + // 1. 网格群众用户数 , 网格党员用户数 + if (!CollectionUtils.isEmpty(gridUserCountList)){ + gridUserCountList.forEach(count -> { + if (r.getGridId().equals(count.getOrgId())) { + r.setUserCount(count.getUserCount()); + r.setPartyCount(count.getPartyCount()); + } + }); + } + // 2. 网格党员人均提出话题数 + if (!CollectionUtils.isEmpty(partyCreateTopicCountList)){ + partyCreateTopicCountList.forEach(party -> { + if (r.getGridId().equals(party.getGridId())){ + r.setPartyAvgTopicCount(party.getCreateTopicCount()); + } + }); + } + // 3. 网格群众人均提出话题数 + if (!CollectionUtils.isEmpty(massCreateTopicCountList)){ + massCreateTopicCountList.forEach(mass -> { + if (r.getGridId().equals(mass.getGridId())){ + r.setUserAvgTopicCount(mass.getCreateTopicCount()); + } + }); + } + // 4. 网格党员人均提出的议题转项目数 + if (!CollectionUtils.isEmpty(partyShiftProjectCountList)){ + partyShiftProjectCountList.forEach(party -> { + if (r.getGridId().equals(party.getGridId())){ + r.setPartyAvgShiftProjectCount(party.getShiftProjectCount()); + } + }); + } + // 5. 网格群众人均提出的议题转项目数 + if (!CollectionUtils.isEmpty(massShiftProjectCountList)){ + massShiftProjectCountList.forEach(mass -> { + if (r.getGridId().equals(mass.getGridId())){ + r.setPartyAvgShiftProjectCount(mass.getShiftProjectCount()); + } + }); + } + // 6. 网格的发文数量 + if (!CollectionUtils.isEmpty(publishCountList)){ + publishCountList.forEach(publish -> { + if (r.getGridId().equals(publish.getGridId())){ + r.setPublishArticleCount(publish.getPublishCount()); + } + }); + } + // 7. 网格议题转项目率 + if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio)){ + gridIssueShiftProjectRatio.forEach(ratio -> { + if (r.getGridId().equals(ratio.getGridId())){ + r.setIssueToProjectRatio(ratio.getIssueToProjectRatio()); + } + }); + } + // 8. 建群党员数 + if (!CollectionUtils.isEmpty(partyCreateGroupCountList)){ + partyCreateGroupCountList.forEach(party -> { + if (r.getGridId().equals(party.getGridId())){ + r.setCreateGroupPartyCount(party.getPartyCreateGroupCount()); + } + }); + } + // 9. 网格活跃群众用户数 + if (null != gridMassActiveMap){ + gridMassActiveMap.forEach((k,v) -> { + if (r.getGridId().equals(k)){ + r.setActiveUserCount(v); + } + }); + } + // 10. 网格活跃党员用户数 + if (null != gridPartyActiveMap){ + gridPartyActiveMap.forEach((k,v) -> { + if (r.getGridId().equals(k)){ + r.setActivePartyCount(v); + } + }); + } + }); + delPartyAbility(customerId, monthId); + List> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + partition.forEach(r -> { + insertPartyAbility(r); + }); + return true; + } + + /** + * @Description 计算网格指标治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + @Override + public Boolean calGridIndexGovernAbility(String customerId, String monthId) { + + List result = gridService.selectAllGridInfo(customerId); + if (CollectionUtils.isEmpty(result)){ + log.warn(String.format(ExtractConstant.CUSTOMER_INFO_NULL,customerId)); + return true; + } + //网格总议题数目,网格人均议题数目 + List gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); + //网格总项目数 + List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); + //网格议题转项目率 + List gridIssueCountList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, DateUtils.minusMonthId(monthId)); + List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridProjectTotalList); + //网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格 + List projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId); + Map autoMap = new HashMap<>(16); + if (!CollectionUtils.isEmpty(projectAutoNoMyList)){ + Map> groupByGrid = projectAutoNoMyList.stream().collect(Collectors.groupingBy(AutoNoMyResultDTO::getGridId)); + groupByGrid.forEach((gridId,projectList) -> { + Map> groupByProject = projectList.stream().collect(Collectors.groupingBy(AutoNoMyResultDTO::getProjectId)); + AtomicReference autoSelf = new AtomicReference<>(true); + AtomicReference count = new AtomicReference<>(NumConstant.ZERO); + groupByProject.forEach((projectId,projects) -> { + String disposeGrid = projects.get(NumConstant.ZERO).getGridId(); + projects.forEach(p -> { + if (!disposeGrid.equals(p.getGridId())){ + autoSelf.set(false); + } + }); + if (autoSelf.get()) { + count.getAndSet(count.get() + NumConstant.ONE); + } + }); + autoMap.put(gridId,count.get()); + }); + } + //网格办结项目数 + List gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED); + //网格吹哨部门准确率 【没被退回的项目数/项目总数 】 + List transferRightRatioResultDTOS = projectMainService.selectTransferRightRatio(customerId, monthId); + List transferRightRatioResultDTOS1 = projectLogService.selectNotReturn(customerId, monthId); + if (!CollectionUtils.isEmpty(transferRightRatioResultDTOS1)){ + transferRightRatioResultDTOS.forEach(r -> { + transferRightRatioResultDTOS1.forEach(t -> { + r.setStatus(r.getProjectId().equals(t.getProjectId()) ? true : false); + }); + }); + }else { + transferRightRatioResultDTOS.forEach(r -> { + r.setStatus(false); + }); + } + Map> groupByGridProject = transferRightRatioResultDTOS.stream().collect(Collectors.groupingBy(TransferRightRatioResultDTO::getGridId)); + Map notReturnMap = new HashMap<>(16); + groupByGridProject.forEach((grid,project) -> { + AtomicReference count = new AtomicReference<>(NumConstant.ZERO); + project.forEach(p -> { + if (p.getStatus().equals(false)){ + count.getAndSet(count.get() + NumConstant.ONE); + } + }); + notReturnMap.put(grid,getRound(new BigDecimal(count.get()/project.size()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); + }); + //网格内解决的项目的满意度 + //项目评价(分值定义下非常满意100,满意80,不满意(一般)60)的人数的平均分(每个项目的参加人数的分数和/评论人数=一个项目的平均分)+其他项目得分/已关闭项目总数 + List projectEvaluateList = projectLogService.selectProjectEvaluate(customerId, monthId); + Map resultSatisfactionScore = new HashMap<>(16); + if (!CollectionUtils.isEmpty(projectEvaluateList)){ + Map> groupByGrid = projectEvaluateList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getGridId)); + groupByGrid.forEach((gridId,projectEvaluateInfoList) -> { + Map scoreMap = new HashMap<>(16); + Map> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId)); + groupByProject.forEach((projectId,projectList) -> { + projectList.forEach(project -> { + switch (project.getActionCode()) { + case ExtractConstant.EVALUATE_BAD: + project.setScore(ProjectEvaluateConstant.BAD); + break; + case ExtractConstant.EVALUATE_GOOD: + project.setScore(ProjectEvaluateConstant.GOOD); + break; + case ExtractConstant.EVALUATE_PERFECT: + project.setScore(ProjectEvaluateConstant.PERFECT); + break; + default: + log.warn("calGridIndexGovernAbility other projectEvaluate,actionCode:{}", project.getActionCode()); + } + }); + Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum(); + scoreMap.put(projectId,projectAllScore/projectList.size()); + }); + AtomicReference allScore = new AtomicReference<>(0); + scoreMap.forEach((k,v) -> { + allScore.set(++v); + }); + resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()))); + }); + } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); + result.forEach(r -> { + r.setMonthId(monthId); + r.setQuarterId(quarterId); + r.setYearId(yearId); + // 1. 网格总议题数目,网格人均议题数目 + if (!CollectionUtils.isEmpty(gridIssueTotalList)) { + gridIssueTotalList.forEach(total -> { + if (r.getGridId().equals(total.getGridId())) { + r.setIssueTotal(total.getIssueTotal()); + r.setAvgIssueCount(total.getAvgIssueCount()); + } + }); + } + // 2. 网格总项目数,网格议题转项目率 + if (!CollectionUtils.isEmpty(gridIssueTotalList)){ + gridIssueShiftProjectRatio.forEach(projectTotal -> { + if (r.getGridId().equals(projectTotal.getGridId())){ + r.setProjectTotal(projectTotal.getProjectTotal()); + r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio()); + } + }); + } + // 3. 网格办结项目数 + if (!CollectionUtils.isEmpty(gridProjectClosedTotalList)){ + gridProjectClosedTotalList.forEach(closed -> { + if (r.getGridId().equals(closed.getGridId())){ + r.setResolveProjectCount(closed.getResolveProjectCount()); + } + }); + } + // 4. 网格吹哨部门准确率 + if(notReturnMap != null){ + notReturnMap.forEach((grid,transferRightRatio) -> { + if (r.getGridId().equals(grid)){ + r.setTransferRightRatio(transferRightRatio); + } + }); + } + // 5. 网格内解决的项目的满意度 + resultSatisfactionScore.forEach((k, v) -> { + if (r.getGridId().equals(k)) { + r.setSatisfactionRatio(v); + } + }); + // 6. 网格自治项目数 + autoMap.forEach((k, v) -> { + if (r.getGridId().equals(k)) { + r.setSelfSolveProjectCount(v); + } + }); + }); + delGovernAbility(customerId, monthId); + List> resultList = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + resultList.forEach(r -> { + insertGovernAbility(r); + }); + return true; + } + + /** + * @Description 计算网格指标服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + @Override + public Boolean calGridIndexServiceAbility(String customerId, String monthId) { + //1、构造好初始数据,各指标赋值0 + List entityList=factIndexServiceAbilityGridMonthlyService.initAllGridList(customerId); + if(CollectionUtils.isEmpty(entityList)){ + log.info("customerId:"+customerId+",screen_customer_grid do not any records"); + return true; + } + String quarterId= DateUtils.getQuarterId(monthId); + String yearId=DateUtils.getYearId(monthId); + //各个网格这个月举办的活动 :活动状态已结束并且实际结束时间在评价周期内的 + Map activityCountMap=actInfoService.calActivityCountMap(customerId,monthId); + //2、遍历网格,赋值每个网格指标 + for(FactIndexServiceAblityGridMonthlyEntity entity:entityList){ + entity.setMonthId(monthId); + entity.setQuarterId(quarterId); + entity.setYearId(yearId); + //网格活动组织次数 爱心活动 : 活动状态已结束并且实际结束时间在评价周期内的 + if(activityCountMap.containsKey(entity.getGridId())){ + entity.setActivityCount(activityCountMap.get(entity.getGridId())); + } + + List volunteerUserIds=new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + //网格志愿者占比 : 所有注册用户中,注册了志愿者的用户占比 + //(1)网格内的注册用户有哪些? + List regUserIds=userService.getGridRegUserIds(customerId,entity.getGridId()); + if(CollectionUtils.isEmpty(regUserIds)){ + log.info(String.format("当前网格%s下没有注册用户,所以【网格志愿者占比】volunteerRatio赋值0",entity.getGridId())); + entity.setVolunteerRatio(BigDecimal.ZERO); + }else{ + //(2)网格内注册用户中,那些人注册了志愿者? + volunteerUserIds=actInfoService.getGridRegUserVolunteer(regUserIds); + if(CollectionUtils.isEmpty(volunteerUserIds)){ + log.info(String.format("当前网格%s下注册用户%s个,其中志愿者为0个,所以【网格志愿者占比】volunteerRatio赋值0",entity.getGridId(),regUserIds.size())); + entity.setVolunteerRatio(BigDecimal.ZERO); + }else{ + int volunteerTotal=volunteerUserIds.size(); + int regUserTotal=regUserIds.size(); + String volunteerRatioStr = numberFormat.format((float) volunteerTotal / regUserTotal); + BigDecimal volunteerRatio = new BigDecimal(volunteerRatioStr); + entity.setVolunteerRatio(volunteerRatio.multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); + } + } + //网格党员志愿者率 : 所有志愿者中,同时是党员的占比 + if(CollectionUtils.isEmpty(volunteerUserIds)){ + log.info(String.format("当前网格%s下志愿者人数0个,所以【网格党员志愿者率】partyVolunteerRatio赋值为0",entity.getGridId())); + entity.setPartyVolunteerRatio(BigDecimal.ZERO); + }else{ + List paryUserIds=partyMemberService.getVolunteerPartyUserIds(volunteerUserIds); + if(CollectionUtils.isEmpty(paryUserIds)){ + log.info(String.format("当前网格%s下志愿者%s个,同时是党员的0个,所以【网格党员志愿者率】partyVolunteerRatio赋值为0",entity.getGridId(),volunteerUserIds.size())); + entity.setPartyVolunteerRatio(BigDecimal.ZERO); + }else{ + int volunteerCount=volunteerUserIds.size(); + int partyUserCount=paryUserIds.size(); + String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount); + BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr); + entity.setPartyVolunteerRatio(partyVolunteerRatio.multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); + } + } + + } + //3、批量删、批量增 + factIndexServiceAbilityGridMonthlyService.delAndSaveServiceAbilityGridMonthly(customerId,monthId,entityList); + return true; + } + + /*public static void main(String[] args) { + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + int volunteerCount=7; + int partyUserCount=6; + String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount); + BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr); + System.out.println(partyVolunteerRatio); + }*/ + + /** + * @Description 小数四舍五入【保留六位小数】 + * @param d + * @author zxc + * @date 2020/9/18 2:01 下午 + */ + public BigDecimal getRound(BigDecimal d){ + return d.setScale(NumConstant.SIX, BigDecimal.ROUND_HALF_UP); + } + + /** + * @Description + * @param gridIssueTotalList + * @param gridProjectTotalList + * @author zxc + * @date 2020/9/19 2:53 下午 + */ + public List getGridIssueShiftProjectRatio(List gridIssueTotalList,List gridProjectTotalList){ + if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridProjectTotalList)) { + gridProjectTotalList.forEach(project -> { + gridIssueTotalList.forEach(issue -> { + if (project.getGridId().equals(issue.getGridId())) { + project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); + } + }); + }); + } + return gridProjectTotalList; + } + + /** + * @Description 插入党建能力的记录 + * @param result + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void insertPartyAbility(List result){ + if (!CollectionUtils.isEmpty(result)){ + partyAbilityOrgMonthlyService.insertPartyAbility(result); + } + } + + /** + * @Description 删除党建能力的记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delPartyAbility(String customerId,String monthId){ + Integer delNum; + do { + delNum = partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId); + }while (delNum > NumConstant.ZERO); + } + + /** + * @Description 插入治理能力的记录 + * @param result + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void insertGovernAbility(List result){ + if (!CollectionUtils.isEmpty(result)){ + governAbilityOrgMonthlyService.insertGovernAbilityRecord(result); + } + } + + /** + * @Description 删除治理能力的记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delGovernAbility(String customerId,String monthId){ + Integer delNum; + do { + delNum = governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); + }while (delNum > NumConstant.ZERO); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java new file mode 100644 index 0000000000..062990b4ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java @@ -0,0 +1,209 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectOrgPeriodDailyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyService; +import com.epmet.service.heart.ActInfoService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:34 + */ +@Service +@Slf4j +public class IndexCollCommunityServiceImpl implements IndexCollCommunityService { + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectOrgPeriodDailyService factOriginProjectOrgPeriodDailyService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; + @Autowired + private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; + @Autowired + private FactIndexServiceAblityOrgMonthlyService factIndexServiceAblityOrgMonthlyService; + @Autowired + private ActInfoService actInfoService; + + @Override + public void saveCommunityAbility(String customerId, String dateId) { + //当前日期前一天 + Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取社区列表 + ListagencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.COMMUNITY); + //社区数据初始化 + List list = agencyList.stream().map(agency ->{ + FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.COMMUNITY); + entity.setTransferedCount(NumConstant.ZERO); + entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO)); + entity.setClosedProjectCount(NumConstant.ZERO); + entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO)); + return entity; + }).collect(Collectors.toList()); + //1.治理能力 + //被吹哨次数统计 + List transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(), + OrgTypeConstant.COMMUNITY); + if (null != transferCount && !transferCount.isEmpty()) { + list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count -> { + entity.setTransferedCount(count.getCount()); + })); + } + + //社区项目响应度 + List responsiveness = factOriginProjectOrgPeriodDailyService.getResponsiveness(customerId, dimId.getMonthId(), + OrgTypeConstant.COMMUNITY, OrgTypeConstant.AGENCY); + if (null != responsiveness && !responsiveness.isEmpty()) { + list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> { + if (response.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(response.getCount()); + BigDecimal sum = new BigDecimal(response.getSum()); + entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //社区超期项目率 + List overdueCount = factOriginProjectMainDailyService.getOverdueCount(customerId, dimId.getMonthId()); + if (null != overdueCount && !overdueCount.isEmpty()) { + list.forEach(entity -> overdueCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(overdue -> { + if (overdue.getSum() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(overdue.getCount()); + BigDecimal sum = new BigDecimal(overdue.getSum()); + entity.setOverdueProjectRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //社区办结项目满意度 + List satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); + if (null != satisfaction && !satisfaction.isEmpty()) { + list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> { + if (sa.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(sa.getCount()); + BigDecimal sum = sa.getRatio(); + entity.setSatisfactionRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + + List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + //办结数 + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + //办结率 + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + //处理效率 + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); + list.forEach(entity ->{ + //办结数 + entity.setClosedProjectCount(Optional.ofNullable(agencyHandleCount.get(entity.getAgencyId())).orElse(NumConstant.ZERO)); + //办结率 + entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + //办结效率 + entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + + }); + + factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); + factIndexGovrnAblityOrgMonthlyService.saveList(list); + + //2.党建能力 + //获取社区发文数量 + List articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(), + OrgTypeConstant.COMMUNITY); + + List partyList = agencyList.stream().map(agency ->{ + FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.COMMUNITY); + entity.setPublishArticleCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + if (null != articles && !articles.isEmpty()) { + partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> { + entity.setPublishArticleCount(dto.getArticleTotalCount()); + })); + } + factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); + factIndexPartyAblityOrgMonthlyService.saveList(partyList); + + + //3. 服务能力 + List serviceList = agencyList.stream().map(agency ->{ + FactIndexServiceAblityOrgMonthlyEntity entity = new FactIndexServiceAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.COMMUNITY); + entity.setActivityCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + + //获取活动组织次数 + List actList = actInfoService.getAgencyActCount(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(actList)) { + serviceList.forEach(entity -> actList.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> { + entity.setActivityCount(dto.getCount()); + })); + } + factIndexServiceAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); + factIndexServiceAblityOrgMonthlyService.saveList(serviceList); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java new file mode 100644 index 0000000000..328a7c694a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java @@ -0,0 +1,134 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimDepartmentDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictDepartmentService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyService; +import com.epmet.service.stats.DimDepartmentService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:43 + */ +@Service +@Slf4j +public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrictDepartmentService { + @Autowired + private DimDepartmentService dimDepartmentService; + @Autowired + private FactIndexGovrnAblityDeptMonthlyService factIndexGovrnAblityDeptMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; + + @Override + public void saveDepartmentAbility(String customerId, String dateId) { + { + //当前日期前一天 + Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM)); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取区直部门列表 + List departmentList = dimDepartmentService.getDistrictDepByCustomer(customerId); + //区直部门数据初始化 + List list = departmentList.stream().map(department ->{ + FactIndexGovrnAblityDeptMonthlyEntity entity = new FactIndexGovrnAblityDeptMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(department.getAgencyId()); + entity.setDeptId(department.getId()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setTransferedCount(NumConstant.ZERO); + entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO)); + entity.setClosedProjectCount(NumConstant.ZERO); + entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO)); + return entity; + }).collect(Collectors.toList()); + //1.治理能力 + //被吹哨次数统计 + List transferCount = factOriginProjectLogDailyService.getDepTransferCount(customerId, dimId.getMonthId(), + OrgTypeConstant.DISTRICT); + if (null != transferCount && !transferCount.isEmpty()) { + list.forEach(entity -> transferCount.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(count -> { + entity.setTransferedCount(count.getCount()); + })); + } + + //区直部门项目响应度 + List responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(customerId, dimId.getMonthId(), + OrgTypeConstant.DISTRICT, "dept"); + if (null != responsiveness && !responsiveness.isEmpty()) { + list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getDeptId())).forEach(response -> { + if (response.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(response.getCount()); + BigDecimal sum = new BigDecimal(response.getSum()); + entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //办结项目数 办结率 + List closedList = factOriginProjectLogDailyService.getDeptClosedProject(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(closedList)) { + list.forEach(entity -> closedList.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { + entity.setClosedProjectCount(item.getCount()); + if (item.getSum() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + entity.setClosedProjectRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //部门办结项目满意度 + List satisfactions = factOriginProjectLogDailyService.getDeptSatisfaction(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(satisfactions)) { + list.forEach(entity -> satisfactions.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { + if (item.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(item.getCount()); + entity.setClosedProjectRatio(item.getRatio().divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //部门办结项目的处理效率 + List handle = factOriginProjectOrgPeriodDailyDao.selectDeptHandle(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(handle)) { + list.forEach(entity -> handle.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { + if (item.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + BigDecimal one = new BigDecimal(NumConstant.ONE); + entity.setClosedProjectRatio(one.divide(sum.divide(count), NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + + factIndexGovrnAblityDeptMonthlyService.deleteByCustomer(customerId, dimId.getMonthId()); + factIndexGovrnAblityDeptMonthlyService.saveList(list); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java new file mode 100644 index 0000000000..aeaa04000c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java @@ -0,0 +1,199 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectOrgPeriodDailyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyService; +import com.epmet.service.heart.ActInfoService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:45 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollDistrictServiceImpl implements IndexCollDistrictService { + + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectOrgPeriodDailyService factOriginProjectOrgPeriodDailyService; + @Autowired + private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; + @Autowired + private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; + @Autowired + private FactIndexServiceAblityOrgMonthlyService factIndexServiceAblityOrgMonthlyService; + @Autowired + private ActInfoService actInfoService; + + @Override + public void saveDistrictAbility(String customerId, String dateId) { + + //当前日期前一天 + Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取社区列表 + ListagencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.DISTRICT); + //社区数据初始化 + List list = agencyList.stream().map(agency ->{ + FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.DISTRICT); + entity.setTransferedCount(NumConstant.ZERO); + //办结项目数 + entity.setClosedProjectCount(NumConstant.ZERO); + //项目响应度 + entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO)); + //办结项目率 + entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO)); + //街道办结项目的处理效率 + entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO)); + return entity; + }).collect(Collectors.toList()); + + //被吹哨次数统计 + List transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(), + OrgTypeConstant.DISTRICT); + if (null != transferCount && !transferCount.isEmpty()) { + list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count -> + entity.setTransferedCount(count.getCount()) + )); + } + + //社区项目响应度 + List responsiveness = factOriginProjectOrgPeriodDailyService.getResponsiveness(customerId, dimId.getMonthId(), + OrgTypeConstant.DISTRICT, OrgTypeConstant.AGENCY); + if (null != responsiveness && !responsiveness.isEmpty()) { + list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> { + if (response.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(response.getCount()); + BigDecimal sum = new BigDecimal(response.getSum()); + entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //社区办结项目满意度 + List satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(satisfaction)) { + list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> { + if (sa.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(sa.getCount()); + BigDecimal sum = sa.getRatio(); + entity.setSatisfactionRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + //办结数 + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + //办结率 + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + //处理效率 + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); + list.forEach(entity ->{ + //办结数 + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); + //办结率 + entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + //办结效率 + entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + }); + + factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT); + factIndexGovrnAblityOrgMonthlyService.saveList(list); + + + //2.党建能力 + //获取社区发文数量 + List articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(), + OrgTypeConstant.DISTRICT); + List partyList = agencyList.stream().map(agency ->{ + FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.DISTRICT); + entity.setPublishArticleCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + if (null != articles && !articles.isEmpty()) { + partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> + entity.setPublishArticleCount(dto.getArticleTotalCount()) + )); + } + factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT); + factIndexPartyAblityOrgMonthlyService.saveList(partyList); + + //3. 服务能力 + List serviceList = agencyList.stream().map(agency ->{ + FactIndexServiceAblityOrgMonthlyEntity entity = new FactIndexServiceAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.DISTRICT); + entity.setActivityCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + + //获取活动组织次数 + List actList = actInfoService.getAgencyActCount(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(actList)) { + serviceList.forEach(entity -> actList.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> { + entity.setActivityCount(dto.getCount()); + })); + } + factIndexServiceAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT); + factIndexServiceAblityOrgMonthlyService.saveList(serviceList); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java new file mode 100644 index 0000000000..8331905d41 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java @@ -0,0 +1,197 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectOrgPeriodDailyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyService; +import com.epmet.service.heart.ActInfoService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:35 + */ +@Service +@Slf4j +public class IndexCollStreetServiceImpl implements IndexCollStreetService { + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectOrgPeriodDailyService factOriginProjectOrgPeriodDailyService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; + @Autowired + private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; + @Autowired + private FactIndexServiceAblityOrgMonthlyService factIndexServiceAblityOrgMonthlyService; + @Autowired + private ActInfoService actInfoService; + + @Override + public void saveStreetAbility(String customerId, String dateId) { + //当前日期前一天 + Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取社区列表 + ListagencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.STREET); + //社区数据初始化 + List list = agencyList.stream().map(agency ->{ + FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.STREET); + entity.setTransferedCount(NumConstant.ZERO); + //办结项目数 + entity.setClosedProjectCount(NumConstant.ZERO); + //项目响应度 + entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO)); + //办结项目率 + entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO)); + //街道办结项目的处理效率 + entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO)); + return entity; + }).collect(Collectors.toList()); + + //被吹哨次数统计 + List transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(), + OrgTypeConstant.STREET); + if (null != transferCount && !transferCount.isEmpty()) { + list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count -> { + entity.setTransferedCount(count.getCount()); + })); + } + + //社区项目响应度 + List responsiveness = factOriginProjectOrgPeriodDailyService.getResponsiveness(customerId, dimId.getMonthId(), + OrgTypeConstant.STREET, OrgTypeConstant.AGENCY); + if (null != responsiveness && !responsiveness.isEmpty()) { + list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> { + if (response.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(response.getCount()); + BigDecimal sum = new BigDecimal(response.getSum()); + entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //社区办结项目满意度 + List satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); + if (null != satisfaction && !satisfaction.isEmpty()) { + list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> { + if (sa.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(sa.getCount()); + BigDecimal sum = sa.getRatio(); + entity.setSatisfactionRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + //办结数 + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + //办结率 + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + //处理效率 + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); + list.forEach(entity ->{ + //办结数 + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); + //办结率 + entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + //办结效率 + entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + }); + + factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); + factIndexGovrnAblityOrgMonthlyService.saveList(list); + + + //2.党建能力 + //获取社区发文数量 + List articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(), + OrgTypeConstant.STREET); + List partyList = agencyList.stream().map(agency ->{ + FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.STREET); + entity.setPublishArticleCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + if (null != articles && !articles.isEmpty()) { + partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> { + entity.setPublishArticleCount(dto.getArticleTotalCount()); + })); + } + factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); + factIndexPartyAblityOrgMonthlyService.saveList(partyList); + + //3. 服务能力 + List serviceList = agencyList.stream().map(agency ->{ + FactIndexServiceAblityOrgMonthlyEntity entity = new FactIndexServiceAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.STREET); + entity.setActivityCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + + //获取活动组织次数 + List actList = actInfoService.getAgencyActCount(customerId, dimId.getMonthId()); + if (CollectionUtils.isNotEmpty(actList)) { + serviceList.forEach(entity -> actList.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> { + entity.setActivityCount(dto.getCount()); + })); + } + factIndexServiceAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); + factIndexServiceAblityOrgMonthlyService.saveList(serviceList); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java new file mode 100644 index 0000000000..77ac5f2fc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -0,0 +1,126 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex.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.ExtractIndexFormDTO; +import com.epmet.service.evaluationindex.extract.dataToIndex.*; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.util.DimIdGenerator; +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.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.concurrent.*; + +/** + * desc:指标原始数据抽取服务实现类 + */ +@Slf4j +@Service +public class IndexOriginExtractServiceImpl implements IndexOriginExtractService { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("indexOriginExtract-pool-%d").build(); + ExecutorService threadPool = new ThreadPoolExecutor(1, 1, + 10L, TimeUnit.MINUTES, + new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); + + @Autowired + private CalCpcIndexService calCpcIndexService; + @Autowired + private CalGridIndexService calGridIndexService; + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private IndexCollStreetService indexCollStreetService; + @Autowired + private IndexCollCommunityService indexCollCommunityService; + @Autowired + private IndexCollDistrictService indexCollDistrictService; + + /** + * desc:从统计库对象抽取指标数据 + * + * @param formDTO + */ + @Override + public void indexOriginExtractAll(ExtractIndexFormDTO formDTO) { + String monthId = formDTO.getMonthId(); + String customerId = formDTO.getCustomerId(); + if (StringUtils.isBlank(monthId)) { + monthId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX); + } + List customerIds = new ArrayList<>(); + if (StringUtils.isNotBlank(customerId)) { + customerIds.add(customerId); + } else { + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + if (CollectionUtils.isEmpty(customerIds)) { + log.error("indexOriginExtractAll 获取客户Id为空"); + return; + } + } + + String finalMonthId = monthId; + customerIds.forEach(cId -> { + ExtractIndexFormDTO param = new ExtractIndexFormDTO(); + param.setCustomerId(cId); + param.setMonthId(finalMonthId); + submitJob(param); + }); + } + + + private void submitJob(ExtractIndexFormDTO param) { + final String customerId = param.getCustomerId(); + final String monthId = param.getMonthId(); + threadPool.submit(() -> { + try { + calCpcIndexService.calCpcPartyAbility(customerId, monthId); + } catch (Exception e) { + log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + }); + threadPool.submit(() -> { + try { + calGridIndexService.calGridIndexGovernAbility(customerId, monthId); + } catch (Exception e) { + log.error("抽取【网格治理能力数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + try { + calGridIndexService.calGridIndexPartyAbility(customerId, monthId); + } catch (Exception e) { + log.error("抽取【网格党建能力数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + try { + calGridIndexService.calGridIndexServiceAbility(customerId, monthId); + } catch (Exception e) { + log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + try{ + indexCollStreetService.saveStreetAbility(customerId, monthId); + }catch (Exception e){ + log.error("抽取【街道治理能力-街道党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); + } + try{ + indexCollCommunityService.saveCommunityAbility(customerId, monthId); + }catch (Exception e){ + log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); + } + try{ + indexCollDistrictService.saveDistrictAbility(customerId, monthId); + }catch (Exception e){ + log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); + } + }); + } +} 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 new file mode 100644 index 0000000000..807fb5067f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.dto.extract.form.ExtractOriginFormDTO; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/15 14:00 + */ +public interface FactOriginExtractService { + + /** + * desc:抽取所有业务数据到统计库 + * + * @param extractOriginFormDTO + */ + 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 new file mode 100644 index 0000000000..f6fc9f2dc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.extract.result.GridGroupUserCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; + +import java.util.List; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +public interface FactOriginGroupMainDailyService extends BaseService { + + /** + * @return java.util.List + * @param customerId + * @param userId + * @author yinzuomei + * @description 查询当前用户建了多少个组 + * @Date 2020/9/21 16:12 + **/ + List selectGroupIds(String customerId, String userId); + + /** + * @return java.util.List + * @param groupIdList + * @author yinzuomei + * @description 根据组,查询组里面的成员(去重) + * @Date 2020/9/21 16:13 + **/ + List selectGroupMemberList(List groupIdList); + + /** + * @Description 插入组相关业务抽取数据 ,为了保证原子性操作,封装到一个方法中 + * @param isFirst + * @param customerId + * @param originGroupData + * @return + * @author wangc + * @date 2020.09.23 16:30 + **/ + boolean insertExtractedData(boolean isFirst, String customerId, String dateId, List originGroupData, List memberList); + + /** + * @param customerId + * @param monthId + * @Description 查询党员建组信息 + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds); + + /** + * desc: 获取客户下每个网格小组内的 去重人数 + * + * @param customerId + * @param groupField + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 2:24 下午 + */ + List selectDistinctGroupMemberCount(String customerId, String groupField); + + /** + * 获取网格内小组数量 + * @author zhaoqifeng + * @date 2020/9/27 14:35 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridGroupCount(String customerId, String monthId); + + /** + * 获取组织内小组数量 + * @author zhaoqifeng + * @date 2020/9/27 14:35 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgGroupCount(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/FactOriginIssueLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java new file mode 100644 index 0000000000..591ff23f55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; + +import java.util.List; + +/** + * 议题记录附表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +public interface FactOriginIssueLogDailyService extends BaseService { + + /** + * @param customerId + * @param gridId + * @param communityId + * @param agencyPath + * @param isParty + * @return int + * @author yinzuomei + * @description 党员参与议事:支持或者反对的次数 + * @Date 2020/9/26 17:57 + **/ + int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty); + + /** + * @param orgType 组织类别 agency:组织;网格:grid;部门:department; + * @param orgId 组织Id 可以为网格id + * @return int + * @author yinzuomei + * @description 参与人数参与人数: 议题的表决行为的用户数去重的累计值 + * @Date 2020/9/27 14:06 + **/ + int queryJoinUserTotal(String customerId, String orgType, String orgId); + + /** + * desc: 获取每个议题的表决人数 + * + * @param customerId + * @param monthId + * @param groupField + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 1:58 下午 + */ + List getVoteCount(String customerId, String monthId, String groupField); +} \ 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/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java new file mode 100644 index 0000000000..de2ac6f8c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; + +import java.util.List; + +/** + * 议题主表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +public interface FactOriginIssueMainDailyService extends BaseService { + + /** + * @return int + * @param customerId + * @author yinzuomei + * @description 根据党员ids,查询党员发布议题数 + * @Date 2020/9/23 15:11 + **/ + int getParyPublishIssueTotal(String customerId,String gridId,String agencyId); + + /** + * @return java.lang.Integer + * @param customerId + * @param gridId + * @author yinzuomei + * @description 网格内议题转项目数 + * @Date 2020/9/23 15:39 + **/ + Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId); + + /** + * @return int + * @param customerId + * @param communityId + * @author yinzuomei + * @description 某个网格内或者社区内议题总数 + * @Date 2020/9/24 10:45 + **/ + int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织内: 党员发布议题 + * @Date 2020/9/24 16:23 + **/ + Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath); + + /** + * @return int + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织内:所有议题总数 + * @Date 2020/9/24 16:26 + **/ + int getAgencyIssueTotal(String customerId, String agencyPath); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织下:议题转项目数 + * @Date 2020/9/24 17:04 + **/ + Integer getAgencyShiftProjectTotal(String customerId, String agencyPath); + + /** + * 网格内议题数 + * @author zhaoqifeng + * @date 2020/9/27 15:11 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridIssueCount(String customerId, String monthId); + + /** + * 组织内议题数 + * @author zhaoqifeng + * @date 2020/9/27 15:11 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgIssueCount(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/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java new file mode 100644 index 0000000000..d473e0aabe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -0,0 +1,270 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +/** + * 项目明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +public interface FactOriginProjectLogDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactOriginProjectLogDailyDTO + * @author generator + * @date 2020-09-16 + */ + FactOriginProjectLogDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-16 + */ + void save(FactOriginProjectLogDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-16 + */ + void update(FactOriginProjectLogDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-16 + */ + void delete(String[] ids); + + /** + * 机关被吹哨次数 + * @author zhaoqifeng + * @date 2020/9/18 14:53 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getAgencyTransferCount(String customerId, String monthId, String level); + + /** + * @Description 查询未被退回的项目数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 2:50 下午 + */ + List selectNotReturnProject(String customerId,String monthId,String actionCode,String orgType); + + List selectNotReturn(String customerId,String monthId); + + /** + * @Description 查询项目评价信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 3:28 下午 + */ + List selectProjectEvaluate(String customerId,String monthId); + + /** + * 根据日期删除数据 + * @author zhaoqifeng + * @date 2020/9/18 17:30 + * @param customerId + * @param date + * @return void + */ + void deleteByDate(String customerId, String date); + + /** + * @Description 网格项目自治率查询 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 5:25 下午 + */ + List selectProjectAutoNoMy(String customerId,String monthId); + + /** + * 办结项目满意度 + * @author zhaoqifeng + * @date 2020/9/20 16:43 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getSatisfaction(String customerId, String monthId, String level); + + /** + * 机关被吹哨次数 + * @author zhaoqifeng + * @date 2020/9/18 14:53 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getDepTransferCount(String customerId, String monthId, String level); + + /** + * @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目 + * @param agencies + * @return + * @author wangc + * @date 2020.09.20 23:46 + **/ + Map getProjectHandledAgency(List agencies, String customerId, String dimId,String dateType); + + /** + * @Description 办结率 + * @param agencies + * @param dimId + * @param dateType - 日期维度类型 month date week quarter year + * @return + * @author wangc + * @date 2020.09.23 10:06 + **/ + Map getHandlingRatio(List agencies, String customerId,String dimId,String dateType); + + /** + * @Description 计算机关办结项目效率 + * @param customerId + * @return + * @author wangc + * @date 2020.09.21 02:16 + **/ + Map 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); + + /** + * 网格满意率 + * @author zhaoqifeng + * @date 2020/9/27 16:06 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridSatisfaction(String customerId, String monthId); + + /** + * 组织满意率 + * @author zhaoqifeng + * @date 2020/9/27 16:06 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgSatisfaction(String customerId, String monthId, String level); + + /** + * 获取部门办结项目数 + * @author zhaoqifeng + * @date 2020/10/16 17:08 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getDeptClosedProject(String customerId, String monthId); + + /** + * 部门办结项目满意度 + * @author zhaoqifeng + * @date 2020/10/16 17:50 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getDeptSatisfaction(String customerId, String monthId); + + /** + * 网格结案率统计 + * @author zhaoqifeng + * @date 2020/10/19 11:58 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridClosed(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/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java new file mode 100644 index 0000000000..8f1c0631f7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -0,0 +1,266 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.TransferRightRatioResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +public interface FactOriginProjectMainDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactOriginProjectMainDailyDTO + * @author generator + * @date 2020-09-16 + */ + FactOriginProjectMainDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-16 + */ + void save(FactOriginProjectMainDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-16 + */ + void update(FactOriginProjectMainDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-16 + */ + void delete(String[] ids); + + /** + * 获取客户下项目 + * @author zhaoqifeng + * @date 2020/9/17 14:29 + * @param customerId + * @return java.util.List + */ + List getProjectByCustomer(String customerId); + + /** + * 获取未结案的项目 + * @author zhaoqifeng + * @date 2020/9/17 14:30 + * @param customerId + * @return java.util.List + */ + List getPendingList(String customerId); + + /** + * @Description 网格办结项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 2:06 下午 + */ + List selectGridClosedProject(String customerId,String monthId,String status); + + List selectTransferRightRatio(String customerId,String monthId); + + /** + * 项目超期数 + * @author zhaoqifeng + * @date 2020/9/18 16:29 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getOverdueCount(String customerId, String monthId); + + /** + * 根据日期删除数据 + * @author zhaoqifeng + * @date 2020/9/18 17:30 + * @param customerId + * @param date + * @return void + */ + void deleteByDate(String customerId, String date); + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的议题转项目数 + * @Date 2020/9/18 14:11 + **/ + List selectShiftProjectCount(String customerId, String monthId); + + /** + * @return java.lang.Integer + * @param customerId + * @param monthId + * @param topicIdList + * @author yinzuomei + * @description 9、自建群活跃度——议题转项目率 用 + * @Date 2020/9/20 22:25 + **/ + Integer selectCountByPartyUser(String customerId, String monthId, List topicIdList); + + /** + * @return java.lang.Integer + * @param customerId + * @param gridId + * @param closedStatus :resolved unresolved + * @param projectStatus :pending closed + * @author yinzuomei + * @description 具体某个网格内的项目 + * @Date 2020/9/23 18:17 + **/ + Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId,String closedStatus,String projectStatus); + + /** + * @return int + * @param customerId + * @param agencyPath + * @param closedStatus :resolved unresolved + * @param projectStatus :pending closed + * @author yinzuomei + * @description 组织下:已解决项目 or 已结案项目总数 + * @Date 2020/9/24 17:37 + **/ + int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus,String projectStatus); + + /** + * 自治项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + 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); + + /** + * 网格项目数 + * @author zhaoqifeng + * @date 2020/9/27 15:18 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridProjectCount(String customerId, String monthId); + + /** + * 组织项目数 + * @author zhaoqifeng + * @date 2020/9/27 15:19 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgProjectCount(String customerId, String monthId, String level); + + /** + * @Description 查询难点赌点基础信息 + * @param customerId + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 10:23 + */ + List getDifficultyBaseInfo(String customerId , List list); + + /** + * @Description 得到评价周期内新立项的id + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.09.28 14:10 + */ + List getNewProject(String customerId, List list); +} \ 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/FactOriginProjectOrgPeriodDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectOrgPeriodDailyService.java new file mode 100644 index 0000000000..5820d9c2cf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectOrgPeriodDailyService.java @@ -0,0 +1,36 @@ +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/21 16:46 + */ +public interface FactOriginProjectOrgPeriodDailyService extends BaseService { + /** + * 项目响应度 + * @author zhaoqifeng + * @date 2020/9/21 16:57 + * @param customerId + * @param monthId + * @param level + * @param orgType + * @return java.util.List + */ + List getResponsiveness(String customerId, String monthId, String level, String orgType); + + /** + * 部门处理效率统计 + * @author zhaoqifeng + * @date 2020/10/19 9:38 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getDeptHandle(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java new file mode 100644 index 0000000000..7c43394dea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.result.PartyActiveResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; + +import java.util.List; + +/** + * 话题明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +public interface FactOriginTopicLogDailyService extends BaseService { + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询客户下,这个月内,每个党员评论话题的次数 + * @Date 2020/9/18 13:35 + **/ + List selectJoinTopicCount(String customerId, String monthId); + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员自建群活跃度——话题数 + * @Date 2020/9/18 14:33 + **/ + List selectGroupTopicCount(String customerId, String monthId); + + /** + * @return int + * @param userId + * @param customerId + * @param monthId + * @author yinzuomei + * @description + * @Date 2020/9/20 21:43 + **/ + Integer selectUserCommentCount(String userId,String customerId, String monthId ); + + /** + * @return java.util.List + * @param groupIdList + * @author yinzuomei + * @description 组内的所有话题id + * @Date 2020/9/20 22:17 + **/ + List selectTopicIds(List groupIdList); + + /** + * @Description 查询 话题评论【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + List selectPartyActiveTopic(String customerId, String monthId,Integer 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/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java new file mode 100644 index 0000000000..5c4f8da390 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.result.CreateTopicCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; + +import java.util.List; + + +/** + * 话题主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +public interface FactOriginTopicMainDailyService extends BaseService { + + /** + * @return void + * @author yinzuomei 数据采集:话题本身 + * @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计 + * @Date 2020/9/15 13:40 + **/ + Boolean topicCleaning(ExtractOriginFormDTO extractOriginFormDTO); + + /** + * @param customerId + * @param monthId yyyyMM + * @author yinzuomei + * @description 党员提出话题数:返回每个党员这个月内,提出的话题数 + * @Date 2020/9/18 11:03 + **/ + List selectPartyCreateTopicCount(String customerId, String monthId); + + /** + * @Description 查询网格 党员/群众 人均提出话题数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 1:58 下午 + */ + List selectCreateTopicCount(String customerId, String monthId,Integer isParty); + + /** + * @return int + * @param customerId + * @author yinzuomei + * @description 党员提出的话题总数 + * @Date 2020/9/23 13:36 + **/ + int calPublishedByPartyTopicCount(String customerId,String gridId,String agencyId); + /** + * @return int + * @param customerId + * @param gridId + * @author yinzuomei + * @description 具体某个网格或者社区的话题数 + * @Date 2020/9/23 14:22 + **/ + int calGridOrCommunityTopicTotal(String customerId, String gridId,String communityId); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @param createTopicUserIsParty 1是党员 + * @author yinzuomei + * @description 在当前组织下,话题总数(createTopicUserIsParty=1时查询党员发布的话题总数) + * @Date 2020/9/24 15:49 + **/ + Integer getAgencyPartyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty); + + /** + * 网格内话题数 + * @author zhaoqifeng + * @date 2020/9/27 15:05 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridTopicCount(String customerId, String monthId); + + /** + * 组织内话题数 + * @author zhaoqifeng + * @date 2020/9/27 15:05 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgTopicCount(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/GroupExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java new file mode 100644 index 0000000000..f4d59942e4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java @@ -0,0 +1,33 @@ +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; + +/** + * @Desc 业务数据抽取 - 组相关 + * @Author wangc + * @DateTime 2020/9/14 5:07 下午 + */ +public interface GroupExtractService { + + /** + * @Description 查询建群党员数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 3:49 下午 + */ + List selectPartyCreateGroupCount(String customerId,String monthId); + + + /** + * @param param + * @return + * @Description 业务抽取 - 小组数据 + * @author wangc + * @date 2020.09.18 21:07 + **/ + 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 new file mode 100644 index 0000000000..2ee29acd93 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java @@ -0,0 +1,110 @@ +package com.epmet.service.evaluationindex.extract.todata; + +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 com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/14 5:07 下午 + */ +public interface IssueExtractService { + + /** + * @param extractOriginFormDTO + * @Description 议题抽取(main) + * @author zxc + * @date 2020/9/15 2:02 下午 + */ + Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO); + + /** + * @Description 议题抽取(log) + * @param extractOriginFormDTO + * @author zxc + * @date 2020/9/16 9:41 上午 + */ + Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO); + + /** + * @Description 查询网格议题总数,网格人均议题数目 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotal(String customerId, String monthId); + + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId); + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + List selectGridProjectCount(String customerId, String monthId,String status); + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的话题转议题数 + * @Date 2020/9/18 13:57 + **/ + List selectShiftIssueCount(String customerId, String monthId); + + /** + * @Description 查询网格 党员/群众 人均提出的议题转项目数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 2:26 下午 + */ + List selectShiftProjectCountPlus(String customerId, String monthId,Integer isParty); + + /** + * @return java.lang.Integer + * @param userId 用户id + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询用户在这个月内表决的总次数 + * @Date 2020/9/20 21:50 + **/ + Integer selectCountUserVote(String userId, String customerId, String monthId); + + /** + * @return java.lang.Integer + * @param topicIdList + * @author yinzuomei + * @description + * @Date 2020/9/20 22:50 + **/ + Integer selectIssueTotalTwoMonth(List topicIdList); + + /** + * @Description 查询 议题表决【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + List selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty); +} 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 new file mode 100644 index 0000000000..1011df61f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java @@ -0,0 +1,32 @@ +package com.epmet.service.evaluationindex.extract.todata; + + +import com.epmet.dto.extract.form.ExtractOriginFormDTO; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/15 14:00 + */ +public interface ProjectExtractService { + + + /** + * 项目主表、明细日统计 + * + * @param extractOriginFormDTO + * @return + * @author zhaoqifeng + * @date 2020/9/15 14:38 + */ + void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO); + + /** + * 抽取项目节点历时逻辑 + * @param param + * @return + * @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/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java new file mode 100644 index 0000000000..f44eef01de --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -0,0 +1,225 @@ +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.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.service.evaluationindex.extract.todata.*; +import com.epmet.service.stats.DimCustomerPartymemberService; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.util.DimIdGenerator; +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.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.concurrent.*; + +/** + * desc:抽取业务数据 到 统计库 汇聚类 + */ +@Slf4j +@Service +public class FactOriginExtractServiceImpl implements FactOriginExtractService { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("factOriginExtract-pool-%d").build(); + ExecutorService threadPool = new ThreadPoolExecutor(3, 6, + 10L, TimeUnit.MINUTES, + new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); + + @Autowired + private IssueExtractService issueExtractService; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private ProjectExtractService projectExtractService; + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private GroupExtractService groupExtractService; + @Autowired + private DimCustomerPartymemberService dimCustomerPartymemberService; + + + @Override + public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) { + String customerId = extractOriginFormDTO.getCustomerId(); + if (StringUtils.isBlank(extractOriginFormDTO.getDateId()) && (StringUtils.isBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isBlank(extractOriginFormDTO.getEndDate()))) { + //如果没有设置开始日期、结束日期,默认查询昨天 + extractOriginFormDTO.setDateId(DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1))); + } + List customerIds = new ArrayList<>(); + if (StringUtils.isNotBlank(customerId)) { + //指定某个客户 + customerIds.add(customerId); + } else { + //查询全部客户 + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + if (CollectionUtils.isEmpty(customerIds)) { + log.error("extractAll 获取客户Id为空"); + return; + } + } + customerIds.forEach(cId -> { + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); + param.setCustomerId(cId); + param.setDateId(extractOriginFormDTO.getDateId()); + param.setStartDate(extractOriginFormDTO.getStartDate()); + param.setEndDate(extractOriginFormDTO.getEndDate()); + log.info("extractAll param:{}", JSON.toJSONString(param)); + submitJob(param); + }); + + } + + private void submitJob(ExtractOriginFormDTO param) { + boolean isRange = StringUtils.isBlank(param.getDateId()) ? true : false; + List daysBetween = null; + if (isRange) { + daysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate()); + } + List finalDaysBetween = daysBetween; + threadPool.submit(() -> { + CustomerIdAndDateIdFormDTO formDTO = new CustomerIdAndDateIdFormDTO(); + formDTO.setCustomerId(param.getCustomerId()); + if (!isRange) { + try { + formDTO.setDateId(param.getDateId()); + dimCustomerPartymemberService.statsPartyMember(formDTO); + } catch (Exception e) { + log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(formDTO), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + formDTO.setDateId(dateDimId); + dimCustomerPartymemberService.statsPartyMember(formDTO); + } + } catch (Exception e) { + log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + } + }); + threadPool.submit(() -> { + ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + try { + groupExtractService.extractGroupData(paramNew); + } catch (Exception e) { + log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + groupExtractService.extractGroupData(paramNew); + } + } catch (Exception e) { + log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } + }); + threadPool.submit(() -> { + log.debug("extractAll start param:{}", JSON.toJSONString(param)); + ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + try { + factOriginTopicMainDailyService.topicCleaning(paramNew); + } catch (Exception e) { + log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + log.info("extractAll cal param:{}", JSON.toJSONString(paramNew)); + factOriginTopicMainDailyService.topicCleaning(paramNew); + } + } catch (Exception e) { + log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } + log.debug("extractAll end param:{}", JSON.toJSONString(paramNew)); + }); + threadPool.submit(() -> { + ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + try { + issueExtractService.issueExtractMain(paramNew); + } catch (Exception e) { + log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + try { + issueExtractService.issueExtractLog(paramNew); + } catch (Exception e) { + log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + issueExtractService.issueExtractMain(paramNew); + } + } catch (Exception e) { + log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + issueExtractService.issueExtractLog(paramNew); + } + } catch (Exception e) { + log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } + }); + threadPool.submit(() -> { + ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + try { + projectExtractService.saveOriginProjectDaily(paramNew); + } catch (Exception e) { + log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + try { + projectExtractService.extractProjectPeriodData(paramNew); + } catch (Exception e) { + log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + projectExtractService.saveOriginProjectDaily(paramNew); + } + } catch (Exception e) { + log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + projectExtractService.extractProjectPeriodData(paramNew); + } + } catch (Exception e) { + log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } + }); + } +} 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 new file mode 100644 index 0000000000..093905835b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -0,0 +1,133 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; +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; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Service +public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMainDailyService { + + + /** + * @return java.util.List + * @param customerId + * @param userId + * @author yinzuomei + * @description 查询当前用户建了多少个组 + * @Date 2020/9/21 16:13 + **/ + @Override + public List selectGroupIds(String customerId, String userId) { + List groupIdList = baseDao.selectGroupIds(customerId,userId); + return groupIdList; + } + + /** + * @param groupIdList + * @return java.util.List + * @author yinzuomei + * @description 根据组,查询组里面的成员(去重) + * @Date 2020/9/21 16:13 + **/ + @Override + public List selectGroupMemberList(List groupIdList) { + List memberIdList = baseDao.selectGroupMemberList(groupIdList); + return memberIdList; + } + + /** + * @Description 插入组相关业务抽取数据 ,为了保证原子性操作,封装到一个方法中 + * @param isFirst + * @param customerId + * @param originGroupData + * @return + * @author wangc + * @date 2020.09.23 16:30 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public boolean insertExtractedData(boolean isFirst, String customerId, String dateId,List originGroupData, List memberList) { + if (isFirst) { + //isFirst + baseDao.deleteBatchMemberByCustomerId(customerId,null,null); + } else { + if(StringUtils.isNotBlank(dateId)){ + baseDao.deleteBatchMemberByCustomerId(customerId,dateId,"date"); + } + } + //删除要插入的组主表数据 + baseDao.deleteBatchByGroupId(customerId,originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList())); + baseDao.insertBatchMain(originGroupData); + baseDao.insertBatchMembers(memberList); + return true; + } + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + @Override + public List selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)) { + return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + } + return new ArrayList<>(); + } + + @Override + public List selectDistinctGroupMemberCount(String customerId, String groupField) { + return baseDao.selectDistinctGroupMemberCount(customerId, groupField); + } + + @Override + public List getGridGroupCount(String customerId, String monthId) { + return baseDao.selectGridGroupCount(customerId, monthId); + } + + @Override + public List getOrgGroupCount(String customerId, String monthId, String level) { + return baseDao.selectOrgGroupCount(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/FactOriginIssueLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java new file mode 100644 index 0000000000..b41f762bf4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.commons.tools.constant.StrConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; +import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; +import com.epmet.service.stats.DimAgencyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 议题记录附表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +@Slf4j +@DataSource(DataSourceConstant.STATS) +@Service +public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl implements FactOriginIssueLogDailyService { + @Autowired + private DimAgencyService dimAgencyService; + + /** + * @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); + } + + /** + * @param orgType 组织类别 agency:组织;网格:grid;部门:department; + * @param orgId 组织Id 可以为网格id + * @return int + * @author yinzuomei + * @description 参与人数: 议题的表决行为的用户数去重的累计值 + * @Date 2020/9/27 14:06 + **/ + @Override + public int queryJoinUserTotal(String customerId, String orgType, String orgId) { + if (OrgTypeConstant.GRID.equals(orgType)) { + return baseDao.selectCountJoinUserTotal(customerId, orgId, null); + } else { + //拼接pids, + DimAgencyDTO dimAgencyDTO = dimAgencyService.get(orgId); + if (null == dimAgencyDTO) { + log.error(String.format("根据agencyId=%s,查询dim_agency 返回null", orgId)); + } else { + String pids; + if(NumConstant.ZERO_STR.equals(dimAgencyDTO.getPid())){ + //如果是根基组织,不需要拼接: + pids=dimAgencyDTO.getId(); + }else{ + pids = dimAgencyDTO.getPids().concat(StrConstant.COLON).concat(dimAgencyDTO.getId()); + } + return baseDao.selectCountJoinUserTotal(customerId, null, pids); + } + } + return NumConstant.ZERO; + } + + + @Override + public List getVoteCount(String customerId, String monthId, String groupField) { + return baseDao.getVoteCount(customerId, monthId, groupField); + } +} \ 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/FactOriginIssueMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java new file mode 100644 index 0000000000..0eac851c63 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.extract.FactOriginIssueMainDailyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 议题主表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +@DataSource(DataSourceConstant.STATS) +@Slf4j +@Service +public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl implements FactOriginIssueMainDailyService { + + + /** + * @param customerId + * @return int + * @author yinzuomei + * @description 根据党员ids, 查询党员发布议题数 + * @Date 2020/9/23 15:11 + **/ + @Override + public int getParyPublishIssueTotal(String customerId,String gridId,String agencyId) { + return baseDao.getParyPublishIssueTotal(customerId,gridId,agencyId); + } + + /** + * @param customerId + * @param gridId + * @return java.lang.Integer + * @author yinzuomei + * @description 网格内议题转项目数 + * @Date 2020/9/23 15:39 + **/ + @Override + public Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId) { + return baseDao.getGridOrCommunityShiftProjectTotal(customerId,gridId,communityId); + } + + /** + * @param customerId + * @param communityId + * @return int + * @author yinzuomei + * @description 网格内或者社区内议题总数 + * @Date 2020/9/24 10:45 + **/ + @Override + public int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId) { + return baseDao.getGridOrCommunityIssueTotal(customerId,gridId,communityId); + } + + /** + * @param customerId + * @param agencyPath + * @return java.lang.Integer + * @author yinzuomei + * @description 组织内: 党员发布议题 + * @Date 2020/9/24 16:23 + **/ + @Override + public Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath) { + return baseDao.getAgencyParyPublishIssueTotal(customerId,agencyPath); + } + + /** + * @param customerId + * @param agencyPath + * @return int + * @author yinzuomei + * @description 组织内:所有议题总数 + * @Date 2020/9/24 16:26 + **/ + @Override + public int getAgencyIssueTotal(String customerId, String agencyPath) { + return baseDao.getAgencyIssueTotal(customerId,agencyPath); + } + + /** + * @param customerId + * @param agencyPath + * @return java.lang.Integer + * @author yinzuomei + * @description 组织下:议题转项目数 + * @Date 2020/9/24 17:04 + **/ + @Override + public Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { + return baseDao.getAgencyShiftProjectTotal(customerId,agencyPath); + } + + @Override + public List getGridIssueCount(String customerId, String monthId) { + return baseDao.selectGridIssueCount(customerId, monthId); + } + + @Override + public List getOrgIssueCount(String customerId, String monthId, String level) { + return baseDao.selectOrgIssueCount(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/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java new file mode 100644 index 0000000000..ec1429618d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -0,0 +1,346 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.naming.LinkLoopException; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 项目明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl implements FactOriginProjectLogDailyService { + + @Autowired + private FactOriginProjectOrgPeriodDailyDao projectOrgPeriodDailyDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactOriginProjectLogDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactOriginProjectLogDailyDTO.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 FactOriginProjectLogDailyDTO get(String id) { + FactOriginProjectLogDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactOriginProjectLogDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactOriginProjectLogDailyDTO dto) { + FactOriginProjectLogDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginProjectLogDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactOriginProjectLogDailyDTO dto) { + FactOriginProjectLogDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginProjectLogDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List getAgencyTransferCount(String customerId, String monthId, String level) { + return baseDao.selectAgencyTransferCount(customerId, monthId, level); + } + + /** + * @Description 查询未被退回的项目数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 2:50 下午 + */ + @Override + public List selectNotReturnProject(String customerId, String monthId, String actionCode, String orgType) { + return baseDao.selectNotReturnProject(customerId, monthId, actionCode, orgType); + } + + @Override + public List selectNotReturn(String customerId,String monthId){ + return baseDao.selectNotReturn(customerId,monthId); + } + + /** + * @Description 查询项目评价信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 3:28 下午 + */ + @Override + public List selectProjectEvaluate(String customerId, String monthId) { + return baseDao.selectProjectEvaluate(customerId, monthId); + } + + @Override + public void deleteByDate(String customerId, String date) { + baseDao.deleteByDate(customerId, date); + } + + /** + * @Description 网格项目自治率查询 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 5:25 下午 + */ + @Override + public List selectProjectAutoNoMy(String customerId, String monthId) { + return baseDao.selectProjectAutoNoMy(customerId, monthId); + } + + @Override + public List getSatisfaction(String customerId, String monthId, String level) { + return baseDao.selectSatisfaction(customerId, monthId, level); + } + + @Override + public List getDepTransferCount(String customerId, String monthId, String level) { + return baseDao.selectDepTransferCount(customerId, monthId, level); + } + + /** + * @Description 查询各机关办结的项目数 + * @param agencies + * @return + * @author wangc + * @date 2020.09.20 23:46 + **/ + @Override + public Map getProjectHandledAgency(List agencies, String customerId,String dimId, String dateType) { + Map result = new HashMap<>(); + List countList = baseDao.selectAgencyHandledProjectCount(agencies,customerId,dimId); + if(!CollectionUtils.isEmpty(countList)){ + result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); + } + return result; + } + + + /** + * @Description 办结率 + * @param agencies + * @param dimId + * @param dateType - 日期维度类型 month date week quarter year + * @return + * @author wangc + * @date 2020.09.23 10:06 + **/ + @Override + public Map getHandlingRatio(List agencies, String customerId,String dimId, String dateType) { + //计算方式:“评价周期内被吹哨且办结(无论是哪一级办结)的项目数”/“评价周期内被吹哨的所有项目数” + + Map result = new HashMap<>(); + List projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies,customerId,dimId); + if(!CollectionUtils.isEmpty(projectAgencyCount)){ + Map whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); + List whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies,customerId,dimId); + Map whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); + whistledAndHandledProjectTotalMap.forEach((agencyId,count) -> { + //分母 被吹哨项目数 + Integer denominator = whistledProjectTotalMap.get(agencyId); + if(null == denominator || NumConstant.ZERO == denominator){ + result.put(agencyId,BigDecimal.ZERO); + }else{ + result.put(agencyId,new BigDecimal(count).divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + } + + return result; + } + + /** + * @Description 计算机关办结项目效率 + * @param + * @return + * @author wangc + * @date 2020.09.21 02:16 + **/ + @Override + public Map getAgencyWorkPieceRatio(String customerId,String dimId, String dateType) { + //计算方法 : 评价周期内办结项目的平均处理时长的倒数 + + + //1.评价周期内结案了的项目 + List projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId,dimId); + Map efficiencyMap = new HashMap<>(); + if(!CollectionUtils.isEmpty(projectsHandledByAgency)){ + Map> agencyProjectsMap = new HashMap<>(); + + projectsHandledByAgency.forEach(o -> { + String agencyId = o.getAgencyId(); + String projectId = o.getProjectId(); + if(CollectionUtils.isEmpty(agencyProjectsMap.get(agencyId))){ + List projectUnit = new LinkedList<>(); + projectUnit.add(projectId); + agencyProjectsMap.put(agencyId,projectUnit); + }else{ + agencyProjectsMap.get(agencyId).add(projectId); + } + }); + + List projects = new LinkedList<>(); + agencyProjectsMap.forEach((key,value) -> {projects.addAll(value);}); + //2.结案项目的总耗时 + List costTimes = baseDao.selectProjectCostTime(projects); + + Map projectCostTime = costTimes.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getProjectId,ProjectParticipatedAgencyResultDTO::getCount)); + agencyProjectsMap.forEach((k,v) -> { + //k -> agencyId v -> projects + int total = NumConstant.ZERO; + if(!CollectionUtils.isEmpty(v)){ + for(String p : v){ + Integer cost = projectCostTime.get(p); + total = total + (null == cost ? NumConstant.ZERO : cost); + } + //每个机关的项目平均耗时 + BigDecimal avgCost = new BigDecimal(total).divide(new BigDecimal(v.size()),4, BigDecimal.ROUND_HALF_UP); + + efficiencyMap.put(k,BigDecimal.ONE.divide(avgCost,4, BigDecimal.ROUND_HALF_UP)); + + }else{ + efficiencyMap.put(k,BigDecimal.ZERO); + } + }); + } + + return efficiencyMap; + } + + + @Override + public List 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); + } + + @Override + public List getGridSatisfaction(String customerId, String monthId) { + return baseDao.selectGridSatisfaction(customerId, monthId); + } + + @Override + public List getOrgSatisfaction(String customerId, String monthId, String level) { + return baseDao.selectOrgSatisfaction(customerId, monthId, level); + } + + /** + * 获取部门办结项目数 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/16 17:08 + */ + @Override + public List getDeptClosedProject(String customerId, String monthId) { + return baseDao.selectDeptClosedProject(customerId, monthId); + } + + /** + * 部门办结项目满意度 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/16 17:50 + */ + @Override + public List getDeptSatisfaction(String customerId, String monthId) { + return baseDao.selectDeptSatisfaction(customerId, monthId); + } + + /** + * 网格结案率统计 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/19 11:58 + */ + @Override + public List getGridClosed(String customerId, String monthId) { + return baseDao.selectGridClosed(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/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java new file mode 100644 index 0000000000..5ce0490463 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -0,0 +1,261 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; +import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.TransferRightRatioResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +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.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl implements FactOriginProjectMainDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactOriginProjectMainDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactOriginProjectMainDailyDTO.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 FactOriginProjectMainDailyDTO get(String id) { + FactOriginProjectMainDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactOriginProjectMainDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactOriginProjectMainDailyDTO dto) { + FactOriginProjectMainDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginProjectMainDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactOriginProjectMainDailyDTO dto) { + FactOriginProjectMainDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginProjectMainDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List getProjectByCustomer(String customerId) { + return baseDao.getProjectByCustomer(customerId); + } + + @Override + public List getPendingList(String customerId) { + return baseDao.getPendingList(customerId); + } + + @Override + public List getOverdueCount(String customerId, String monthId) { + return baseDao.selectOverdueCount(customerId, monthId); + } + + /** + * @Description 网格办结项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 2:06 下午 + */ + @Override + public List selectGridClosedProject(String customerId, String monthId, String status) { + return baseDao.selectGridClosedProject(customerId, monthId,status); + } + + @Override + public List selectTransferRightRatio(String customerId, String monthId){ + return baseDao.selectTransferRightRatio(customerId,monthId); + } + + @Override + public void deleteByDate(String customerId, String date) { + baseDao.deleteByDate(customerId, date); + } + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的议题转项目数 + * @Date 2020/9/18 14:11 + **/ + @Override + public List selectShiftProjectCount(String customerId, String monthId) { + //查询项目主表fact_origin_project_main_daily,这个月内新增的项目,按话题发布人分组 + /*含义:评价周期内,党员提出的议题转数目数。 + 数据来源:项目表。 + 计算方法:从项目表中按照用户ID和党员标识统计。 + 对评价结果的影响:正向。*/ + return baseDao.selectShiftProjectCount(customerId,monthId); + } + + /** + * @param customerId + * @param monthId + * @param topicIdList + * @return java.lang.Integer + * @author yinzuomei + * @description 9、自建群活跃度——议题转项目率 用 + * @Date 2020/9/20 22:25 + **/ + @Override + public Integer selectCountByPartyUser(String customerId, String monthId, List topicIdList) { + if(CollectionUtils.isEmpty(topicIdList)){ + return NumConstant.ZERO; + } + return baseDao.selectCountByPartyUser(customerId,monthId,topicIdList); + } + + /** + * @param customerId + * @param gridId + * @param closedStatus :resolved unresolved + * @param projectStatus :pending closed + * @return java.lang.Integer + * @author yinzuomei + * @description 具体某个网格内的项目 + * @Date 2020/9/23 18:17 + **/ + @Override + public Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId,String communityId, String closedStatus,String projectStatus) { + return baseDao.getGridOrCommunityClosedProjectTotal(customerId,gridId,communityId,closedStatus,projectStatus); + } + + /** + * @param customerId + * @param agencyPath + * @param closedStatus :resolved unresolved + * @param projectStatus :pending closed + * @return int + * @author yinzuomei + * @description 组织下:已解决项目 or 已结案项目总数 + * @Date 2020/9/24 17:37 + **/ + @Override + public int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus,String projectStatus) { + return baseDao.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus,projectStatus); + } + + @Override + public List 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); + } + + @Override + public List getGridProjectCount(String customerId, String monthId) { + return baseDao.getGridProjectCount(customerId, monthId); + } + + @Override + public List getOrgProjectCount(String customerId, String monthId, String level) { + return baseDao.getOrgProjectCount(customerId, monthId, level); + } + + /** + * @Description 查询难点赌点基础信息 + * @param customerId + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 10:23 + */ + @Override + public List getDifficultyBaseInfo(String customerId, List list) { + return baseDao.selectDifficultyBaseInfo(customerId,list); + } + + /** + * @Description 得到评价周期内新立项的id + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.09.28 14:10 + */ + @Override + public List getNewProject(String customerId, List list) { + return baseDao.selectNewProject(customerId,list); + } +} \ 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/FactOriginProjectOrgPeriodDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectOrgPeriodDailyServiceImpl.java new file mode 100644 index 0000000000..df9d46479d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectOrgPeriodDailyServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.service.evaluationindex.extract.todata.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.extract.FactOriginProjectOrgPeriodDailyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectOrgPeriodDailyService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/21 16:48 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class FactOriginProjectOrgPeriodDailyServiceImpl extends BaseServiceImpl implements FactOriginProjectOrgPeriodDailyService { + @Override + public List getResponsiveness(String customerId, String monthId, String level, String orgType) { + return baseDao.selectResponsiveness(customerId, monthId, level, orgType); + } + + /** + * 部门处理效率统计 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/19 9:38 + */ + @Override + public List getDeptHandle(String customerId, String monthId) { + return baseDao.selectDeptHandle(customerId, monthId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java new file mode 100644 index 0000000000..70ecc1807f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.extract.FactOriginTopicLogDailyDao; +import com.epmet.dto.extract.result.PartyActiveResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicLogDailyService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 话题明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@DataSource(DataSourceConstant.STATS) +@Service +public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl implements FactOriginTopicLogDailyService { + + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询客户下,这个月内,每个党员评论话题的次数 + * @Date 2020/9/18 13:35 + **/ + @Override + public List selectJoinTopicCount(String customerId, String monthId) { + //这个月内新增的话题评论,按人分组,不限制评论时的身份,以当前用户最新身份为准 + return baseDao.selectJoinTopicCount(customerId,monthId); + } + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员自建群活跃度——话题数 + * @Date 2020/9/18 14:33 + **/ + @Override + public List selectGroupTopicCount(String customerId, String monthId) { + return baseDao.selectGroupTopicCount(customerId,monthId); + } + + /** + * @return java.lang.Integer + * @param userId + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询当前用户在本月内评论的次数 + * @Date 2020/9/20 21:45 + **/ + @Override + public Integer selectUserCommentCount(String userId,String customerId, String monthId) { + return baseDao.selectUserCommentCount(userId,customerId,monthId); + } + + /** + * @param groupIdList + * @return java.util.List + * @author yinzuomei + * @description 组内的所有话题id + * @Date 2020/9/20 22:17 + **/ + @Override + public List selectTopicIds(List groupIdList) { + if(CollectionUtils.isEmpty(groupIdList)){ + return new ArrayList<>(); + } + return baseDao.selectTopicIds(groupIdList); + } + + /** + * @Description 查询 话题评论【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + @Override + public List selectPartyActiveTopic(String customerId, String monthId, Integer isParty) { + return baseDao.selectPartyActiveTopic(customerId, monthId, 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/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java new file mode 100644 index 0000000000..7519d9496d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java @@ -0,0 +1,328 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +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.ExtractOriginFormDTO; +import com.epmet.dto.extract.result.CreateTopicCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.org.GridInfoDTO; +import com.epmet.dto.topic.TopicOriginInfoDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.org.CustomerGridService; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +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; +import java.util.stream.Collectors; + + +/** + * 话题主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@DataSource(value = DataSourceConstant.STATS) +@Slf4j +@Service +public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl implements FactOriginTopicMainDailyService { + @Autowired + private TopicService topicService; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private FactOriginTopicLogDailyDao factOriginTopicLogDailyDao; + @Autowired + private UserService userService; + + /** + * @return void + * @author yinzuomei 数据采集:话题本身 + * @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计 + * @Date 2020/9/15 13:40 + **/ + @Override + public Boolean topicCleaning(ExtractOriginFormDTO extractOriginFormDTO) { + String customerId = extractOriginFormDTO.getCustomerId(); + String dateId = extractOriginFormDTO.getDateId(); + List 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)); + return true; + } + Map gridMap = getGridInfoMap(customerId); + Map map = this.constructFactOriginData(topicOriginInfoList, gridMap); + List mainDailyEntityList = (List) map.get("main"); + List logDailyEntityList = (List) map.get("log"); + //删除之前统计的数据 + deleteFactOriginData(customerId,dateId); + //批量保存主表 + saveFactOriginTopicMainDailyEntity(mainDailyEntityList); + //批量保存明细表 + saveFactOriginTopicLogDailyEntity(logDailyEntityList); + //更新主表的状态状态、关闭状态 + updateFactOriginTopicMain(topicService.queryUpdateTopicOriginInfoList(customerId, dateId)); + return true; + } + + /** + * @return void + * @param updateTopicOriginInfoList + * @author yinzuomei + * @description 更新话题主表的TOPIC_STATUS , CLOSED_STATUS + * @Date 2020/9/23 17:47 + **/ + private void updateFactOriginTopicMain(List updateTopicOriginInfoList) { + updateTopicOriginInfoList.forEach(topicOriginInfoDTO -> { + baseDao.updateFactOriginTopicMain(topicOriginInfoDTO.getTopicId(), + topicOriginInfoDTO.getTopicStatus(), + topicOriginInfoDTO.getClosedStatus()); + }); + } + + + private Map getGridInfoMap(String customerId) { + Map map=new HashMap<>(); + List list=customerGridService.queryGridInfoList(customerId); + if(!CollectionUtils.isEmpty(list)){ + return list.stream().collect(Collectors.toMap(GridInfoDTO::getGridId, gridInfoDTO -> gridInfoDTO)); + } + return map; + } + + + /** + * @return void + * @param mainDailyEntityList + * @author yinzuomei + * @description 批量插入 fact_origin_topic_main_daily + * @Date 2020/9/16 11:21 + **/ + private void saveFactOriginTopicMainDailyEntity(List mainDailyEntityList) { + //批量插入 + List> partition = ListUtils.partition(mainDailyEntityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.insertBatchEntity(list); + }); + } + + /** + * @return void + * @param logDailyEntityList + * @author yinzuomei + * @description 批量插入fact_origin_topic_log_daily + * @Date 2020/9/16 12:53 + **/ + private void saveFactOriginTopicLogDailyEntity(List logDailyEntityList) { + //批量插入 + List> partition = ListUtils.partition(logDailyEntityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + factOriginTopicLogDailyDao.insertBatchEntity(list); + }); + } + + /** + * @return java.util.Map + * @param topicOriginInfoList + * @author yinzuomei + * @description 构造好要插入的数据 + * @Date 2020/9/16 11:21 + **/ + private Map constructFactOriginData(List topicOriginInfoList,Map gridMap) { + Map map=new HashMap<>(); + List mainDailyEntityList=new ArrayList<>(); + List logDailyEntityList=new ArrayList<>(); + + List userIds = topicOriginInfoList.stream().map(topic -> topic.getOperateUserId()).distinct().collect(Collectors.toList()); + Map userIsPartyMap = userService.selectUserIsParty(userIds); + for(TopicOriginInfoDTO topicOriginInfoDTO:topicOriginInfoList){ + GridInfoDTO gridInfoDTO=gridMap.get(topicOriginInfoDTO.getGridId()); + if(null==gridInfoDTO){ + log.error("没有找到 gridId="+topicOriginInfoDTO.getGridId()+" 的基本信息"); +// continue; + throw new RenException("xxxxxx"); + } + // 一年的第几周 + String weekId = DateUtils.format(topicOriginInfoDTO.getOriginalBusinessTime(), DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(topicOriginInfoDTO.getOriginalBusinessTime()))); + String quarterId=DateUtils.getQuarterId(topicOriginInfoDTO.getMonthId()); + if(DimObjectActionConstant.TOPIC_PUBLISH.equals(topicOriginInfoDTO.getActionCode())){ + //如果是新发布的话题需要插入主表 + FactOriginTopicMainDailyEntity mainDailyEntity=ConvertUtils.sourceToTarget(topicOriginInfoDTO, FactOriginTopicMainDailyEntity.class); + mainDailyEntity.setId(topicOriginInfoDTO.getTopicId()); + mainDailyEntity.setWeekId(weekId); + mainDailyEntity.setQuarterId(quarterId); + mainDailyEntity.setCreateTopicUserId(topicOriginInfoDTO.getOperateUserId()); + //网格所属的组织id + mainDailyEntity.setAgencyId(gridInfoDTO.getAgencyId()); + //网格的上上级组织id=街道id + mainDailyEntity.setPid(gridInfoDTO.getPid()); + mainDailyEntity.setPids(gridInfoDTO.getPids()); + //判断用户是否是党员,调用相成写的方法 + //话题发布人是否是党员:1是党员0不是。 默认0 + if (null != userIsPartyMap && null != userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId())) { + mainDailyEntity.setCreateTopicUserIsParty(userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId()) == NumConstant.ONE ? true : false); + } else { + mainDailyEntity.setCreateTopicUserIsParty(false); + } + + mainDailyEntityList.add(mainDailyEntity); + } + FactOriginTopicLogDailyEntity logDailyEntity= ConvertUtils.sourceToTarget(topicOriginInfoDTO, FactOriginTopicLogDailyEntity.class); + logDailyEntity.setCustomerId(topicOriginInfoDTO.getCustomerId()); + logDailyEntity.setGridId(topicOriginInfoDTO.getGridId()); + logDailyEntity.setWeekId(weekId); + logDailyEntity.setQuarterId(quarterId); + logDailyEntity.setAgencyId(gridInfoDTO.getAgencyId()); + logDailyEntity.setPid(gridInfoDTO.getPid()); + logDailyEntity.setPids(gridInfoDTO.getPids()); + //判断用户是否是党员,调用相成写的方法 + if (null != userIsPartyMap && null != userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId())) { + logDailyEntity.setOperateUserIsParty(userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId()) == NumConstant.ONE ? true : false); + } else { + logDailyEntity.setOperateUserIsParty(false); + } + logDailyEntityList.add(logDailyEntity); + } + map.put("main",mainDailyEntityList); + map.put("log",logDailyEntityList); + return map; + } + + /** + * @return void + * @param customerId + * @param dateId + * @author yinzuomei + * @description 删除之前统计过的数据 + * @Date 2020/9/16 11:21 + **/ + private void deleteFactOriginData(String customerId, String dateId) { + int mainDeleteNum; + do { + //一次删除50条 + mainDeleteNum = baseDao.deleteByDateIdAndCustomerId(customerId, + dateId, + IndexCalConstant.DELETE_SIZE); + } while (mainDeleteNum > NumConstant.ZERO); + int logDeleteNum; + do { + //一次删除50条 + logDeleteNum = factOriginTopicLogDailyDao.deleteByDateIdAndCustomerId(customerId, + dateId, + IndexCalConstant.DELETE_SIZE); + } while (logDeleteNum > NumConstant.ZERO); + } + + + /** + * @param customerId + * @param monthId yyyyMM + * @author yinzuomei + * @description 党员提出话题数:返回每个党员这个月内,提出的话题数 + * @Date 2020/9/18 11:03 + **/ + @Override + public List selectPartyCreateTopicCount(String customerId, String monthId) { + //这个月内新增的话题,按人分组,不限制发话题人的身份,也就是说以用户最新的身份为准 + return baseDao.selectPartyCreateTopicCount(customerId,monthId); + } + + /** + * @Description 查询网格 党员/群众 人均提出话题数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 1:58 下午 + */ + @Override + public List selectCreateTopicCount(String customerId, String monthId,Integer isParty) { + return baseDao.selectCreateTopicCount(customerId, monthId, isParty); + } + + /** + * @param customerId + * @return int + * @author yinzuomei + * @description 党员提出的话题总数 + * @Date 2020/9/23 13:36 + **/ + @Override + public int calPublishedByPartyTopicCount(String customerId,String gridId,String agencyId) { + return baseDao.selectPublishedByPartyTopicCount(customerId,gridId,agencyId); + } + + /** + * @param customerId + * @param gridId + * @return int + * @author yinzuomei + * @description 具体某个网格或者社区的话题数 + * @Date 2020/9/23 14:22 + **/ + @Override + public int calGridOrCommunityTopicTotal(String customerId, String gridId,String communityId) { + return baseDao.selectGridOrCommunityTopicTotal(customerId,gridId,communityId); + } + + /** + * @param customerId + * @param agencyPath + * @return java.lang.Integer + * @author yinzuomei + * @description 在当前组织下,话题总数(createTopicUserIsParty=1时查询党员发布的话题总数) + * @Date 2020/9/24 15:49 + **/ + @Override + public Integer getAgencyPartyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty) { + return baseDao.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty); + } + + @Override + public List getGridTopicCount(String customerId, String monthId) { + return baseDao.selectGridTopicCount(customerId, monthId); + } + + @Override + public List getOrgTopicCount(String customerId, String monthId, String level) { + return baseDao.selectOrgTopicCount(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/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java new file mode 100644 index 0000000000..6087d86e34 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -0,0 +1,168 @@ +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +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.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; +import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; +import com.epmet.dto.stats.result.GridAttributesResultDTO; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.GroupExtractService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.stats.DimGridService; +import com.epmet.service.user.UserService; +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.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @Description 业务数据抽取 - 组相关 + * @ClassName GroupExtractServiceImpl + * @Auth wangc + * @Date 2020-09-16 14:47 + */ +@Service +@Slf4j +public class GroupExtractServiceImpl implements GroupExtractService { + + @Autowired + private FactOriginGroupMainDailyDao groupMainDailyDao; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Autowired + private GroupDataService groupDataService; + @Autowired + private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao; + @Autowired + private UserService userService; + @Autowired + private DimGridService dimGridService; + + /** + * @Description 查询建群党员数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 3:49 下午 + */ + @Override + public List selectPartyCreateGroupCount(String customerId, String monthId) { + return groupMainDailyDao.selectPartyCreateGroupCount(customerId, monthId); + } + + + /** + * @param param + * @return + * @Description 业务抽取 - 小组祥光 + * @author wangc + * @date 2020.09.18 21:07 + **/ + @Override + public void extractGroupData(ExtractOriginFormDTO param) { + int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId()); + + 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)); + } + //原生数据,如果是首次,则为全部组,如果非首次,则只有新创建以及新进人的组 + //但是每个组每天都要更新一次组长的身份信息 + List originGroupData = groupDataService.extractGroupData( + count <= NumConstant.ZERO, + param.getCustomerId(), param.getDateId()); + + List memberList = new LinkedList<>(); + if (!CollectionUtils.isEmpty(originGroupData)) { + List gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList())); + + if (!CollectionUtils.isEmpty(gridList)) { + Map gridMap = + gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2)); + if (!CollectionUtils.isEmpty(originGroupData)) { + originGroupData.forEach(group -> { + GridAttributesResultDTO attr = gridMap.get(group.getGridId()); + if (null != attr) { + group.setAgencyId(attr.getAgencyId()); + group.setParentId(attr.getParentId()); + group.setPids(attr.getPids()); + if(StringUtils.isBlank(group.getPids().trim()) || NumConstant.ZERO_STR.equals(group.getPids().trim())){ + group.setPids(group.getAgencyId()); + }else{ + group.setPids(group.getPids().concat(StrConstant.COLON).concat(group.getAgencyId())); + } + } + if(null != group.getCreatedTime()){ + DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(group.getCreatedTime()); + group.setDateId(dateInfo.getDateId()); + group.setWeekId(dateInfo.getWeekId()); + group.setMonthId(dateInfo.getMonthId()); + group.setQuarterId(dateInfo.getQuarterId()); + group.setYearId(dateInfo.getYearId()); + } + + if (!CollectionUtils.isEmpty(group.getMembers())) { + group.setMemberTotal(group.getMembers().size()); + group.getMembers().forEach(member -> { + DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(member.getJoinDate()); + member.setDateId(dateInfo.getDateId()); + member.setWeekId(dateInfo.getWeekId()); + member.setMonthId(dateInfo.getMonthId()); + member.setQuarterId(dateInfo.getQuarterId()); + member.setYearId(dateInfo.getYearId()); + if(null != attr){ + member.setAgencyId(attr.getAgencyId()); + member.setParentId(attr.getParentId()); + member.setPids(attr.getPids()); + if(StringUtils.isBlank(member.getPids().trim()) || NumConstant.ZERO_STR.equals(member.getPids().trim())){ + member.setPids(member.getAgencyId()); + }else{ + member.setPids(member.getPids().concat(StrConstant.COLON).concat(member.getAgencyId())); + } + } + memberList.add(member); + }); + } + + }); + } + + factOriginGroupMainDailyService.insertExtractedData( + count <= NumConstant.ZERO ? true : false, + param.getCustomerId(), + param.getDateId(), + originGroupData, + memberList + ); + + + } + + + List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); + List heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId()); + if(!partyIds.isEmpty()) { + factOriginGroupMainDailyDao.updatePartyFlag(partyIds, param.getCustomerId()); + } + if(!heartedIds.isEmpty()) { + factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds, param.getCustomerId()); + } + } + } +} 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 new file mode 100644 index 0000000000..20169ae538 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java @@ -0,0 +1,364 @@ +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.TimeListResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +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.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; +import com.epmet.dto.extract.form.IssueLogDailyFormDTO; +import com.epmet.dto.extract.form.IssueMainDailyFormDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.service.Issue.IssueService; +import com.epmet.service.evaluationindex.extract.todata.IssueExtractService; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/14 5:08 下午 + */ +@Service +@Slf4j +public class IssueExtractServiceImpl implements IssueExtractService { + + @Autowired + private FactOriginIssueMainDailyDao issueMainDailyDao; + @Autowired + private IssueService issueService; + @Autowired + private UserService userService; + @Autowired + private TopicService topicService; + @Autowired + private DimAgencyDao dimAgencyDao; + @Autowired + private FactOriginIssueLogDailyDao issueLogDailyDao; + + /** + * @param extractOriginFormDTO + * @Description 议题抽取 + * @author zxc + * @date 2020/9/15 2:02 下午 + */ + @Override + 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)) { + log.warn("issueExtractMain selectIssueInfo return empty,customerId:{},dateId:{}", customerId, dateId); + return true; + } + listResult.forEach(issue -> { + IssueMainDailyFormDTO issueMainDailyFormDTO = ConvertUtils.sourceToTarget(issue, IssueMainDailyFormDTO.class); + issueMainDailyFormDTO.setId(issue.getIssueId()); + result.add(issueMainDailyFormDTO); + }); + + // 2. 创建议题人ID + List userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); + Map map = userService.selectUserIsParty(userIds); + if (null != map){ + result.forEach(r -> { + map.forEach((userId,isParty) -> { + if (r.getUserId().equals(userId)){ + r.setIsParty(isParty); + } + }); + }); + } + // 3. 创建话题用户身份信息查询 + List topicIds = listResult.stream().map(issue -> issue.getTopicId()).collect(Collectors.toList()); + List topicInfoList = topicService.selectTopicInfo(topicIds); + if (CollectionUtils.isEmpty(topicInfoList)){ + throw new RenException(ExtractConstant.CREATED_TOPIC_USER_IDENTITY); + } + List createTopicUserIds = topicInfoList.stream().map(topic -> topic.getUserId()).distinct().collect(Collectors.toList()); + Map topicUserIsParty = userService.selectUserIsParty(createTopicUserIds); + topicInfoList.forEach(topic -> { + topicUserIsParty.forEach((userId,isParty) -> { + if (topic.getUserId().equals(userId)){ + topic.setIsParty(isParty); + } + }); + }); + // 4. 根据dateId赋值 + TimeListResultDTO timeList = DateUtils.getTimeList(dateId); + result.forEach(r -> { + r.setDateId(dateId); + r.setWeekId(timeList.getWeekId()); + r.setMonthId(timeList.getMonthId()); + r.setQuarterId(timeList.getQuarterId()); + r.setYearId(timeList.getYearId()); + topicInfoList.forEach(topic -> { + if (r.getTopicId().equals(topic.getTopicId())){ + r.setCreateTopicUserId(topic.getUserId()); + r.setTopicUserIsParty(topic.getIsParty()); + } + }); + }); + // 5. 查询pid + List agencyIds = result.stream().map(r -> r.getAgencyId()).distinct().collect(Collectors.toList()); + List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); + if (CollectionUtils.isEmpty(agencyInfoList)){ + throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST); + } + result.forEach(r -> { + agencyInfoList.forEach(pid -> { + if (r.getAgencyId().equals(pid.getAgencyId())){ + r.setPid(pid.getPid()); + r.setPids(pid.getPids().concat(":").concat(r.getAgencyId())); + } + }); + }); + delAndInsertMain(customerId,dateId,result); + return true; + } + + /** + * @Description 议题主表删除插入 + * @param customerId + * @param dateId + * @param result + * @author zxc + * @date 2020/9/16 3:32 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertMain(String customerId,String dateId,List result){ + issueMainDailyDao.deleteOldMainRecord(customerId, dateId); + issueMainDailyDao.insertIssueMainList(result); + } + + /** + * @Description 议题抽取(log) + * @param extractOriginFormDTO + * @author zxc + * @date 2020/9/16 9:41 上午 + */ + @Override + 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)) { + Map> groupByIssue = listResult.stream().collect(Collectors.groupingBy(IssueProcessInfoResultDTO::getIssueId)); + 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()); + }); + listResult.forEach(issueProcess -> { + IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class); + issueLogDailyFormDTO.setOperationUserId(issueProcess.getUserId()); + result.add(issueLogDailyFormDTO); + }); + } + + // 2. 查询议题满意度 + List satisfactionInfoList = issueService.selectIssueSatisfactionInfo(customerId, dateId); + if (!CollectionUtils.isEmpty(satisfactionInfoList)){ + satisfactionInfoList.forEach(s -> { + IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(s, IssueLogDailyFormDTO.class); + issueLogDailyFormDTO.setOperationUserId(s.getUserId()); + result.add(issueLogDailyFormDTO); + }); + } + + // 3. 查询议题支持反对 + List voteInfoList = issueService.selectIssueVoteInfo(customerId, dateId); + if (!CollectionUtils.isEmpty(voteInfoList)){ + voteInfoList.forEach(v -> { + IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(v, IssueLogDailyFormDTO.class); + issueLogDailyFormDTO.setOperationUserId(v.getUserId()); + result.add(issueLogDailyFormDTO); + }); + } + + // 4. 动作操作人的身份标识是否是党员 + List userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); + userIds.addAll(voteInfoList.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList())); + userIds.addAll(satisfactionInfoList.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList())); + if (CollectionUtils.isEmpty(userIds)){ + return true; + } + Map map = userService.selectUserIsParty(userIds); + if (null != map){ + result.forEach(r -> { + map.forEach((userId,isParty) -> { + if (r.getOperationUserId().equals(userId)){ + r.setIsParty(isParty == null ? NumConstant.ZERO : isParty); + } + }); + }); + } + + // 5. 上级ID + List agencyIds = result.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList()); + List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); + if (CollectionUtils.isEmpty(agencyInfoList)){ + throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST); + } + TimeListResultDTO timeList = DateUtils.getTimeList(dateId); + result.forEach(r -> { + r.setDateId(dateId); + r.setWeekId(timeList.getWeekId()); + r.setMonthId(timeList.getMonthId()); + r.setQuarterId(timeList.getQuarterId()); + r.setYearId(timeList.getYearId()); + agencyInfoList.forEach(agency -> { + if (r.getAgencyId().equals(agency.getAgencyId())){ + r.setPid(agency.getPid()); + r.setPids(agency.getPids().concat(":").concat(r.getAgencyId())); + } + }); + }); + delAndInsertLog(customerId,dateId,result); + return true; + } + + /** + * @Description 查询网格议题总数,网格人均议题数目 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + @Override + public List selectIssueTotal(String customerId, String monthId) { + return issueMainDailyDao.selectIssueTotal(customerId, monthId); + } + + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + @Override + public List selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId) { + return issueMainDailyDao.selectIssueTotalTwoMonthPlus(customerId, monthId, minusMonthId); + } + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + @Override + public List selectGridProjectCount(String customerId, String monthId, String status) { + return issueMainDailyDao.selectGridProjectCount(customerId, monthId, status); + } + + /** + * @Description 议题附表删除插入 + * @param customerId + * @param dateId + * @param result + * @author zxc + * @date 2020/9/16 3:32 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertLog(String customerId,String dateId,List result){ + issueLogDailyDao.deleteOldLogRecord(customerId, dateId); + issueLogDailyDao.insertIssueLogList(result); + } + + + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的话题转议题数 + * @Date 2020/9/18 13:57 + **/ + @DataSource(DataSourceConstant.STATS) + @Override + public List selectShiftIssueCount(String customerId, String monthId) { + //查询fact_origin_issue_main_daily 表,转议题的时间在评价周期内的,按发布话题的人分组 + /*含义:评价周期内,党员提出的话题转为议题的数目。 + 数据来源:议题表。 + 计算方法:从议题表中按照用户ID和党员标识统计。 + 对评价结果的影响:正向。*/ + return issueMainDailyDao.selectShiftIssueCount(customerId,monthId); + } + + /** + * @Description 查询网格 党员/群众 人均提出的议题转项目数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 2:26 下午 + */ + @Override + public List selectShiftProjectCountPlus(String customerId, String monthId, Integer isParty) { + return issueMainDailyDao.selectShiftProjectCountPlus(customerId, monthId, isParty); + } + + /** + * @param userId 用户id + * @param customerId + * @param monthId + * @return java.lang.Integer + * @author yinzuomei + * @description 查询用户在这个月内表决的总次数 + * @Date 2020/9/20 21:50 + **/ + @Override + public Integer selectCountUserVote(String userId, String customerId, String monthId) { + return issueLogDailyDao.selectCountUserVote(userId,customerId,monthId); + } + + /** + * @param topicIdList + * @return java.lang.Integer + * @author yinzuomei + * @description 查询本周期和上周期内,自建群内话题转为议题的数量的总和 + * @Date 2020/9/20 22:48 + **/ + @Override + public Integer selectIssueTotalTwoMonth(List topicIdList) { + return issueMainDailyDao.selectIssueTotalTwoMonth(topicIdList); + } + + /** + * @Description 查询 议题表决【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + @Override + public List selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty) { + return issueLogDailyDao.selectPartyActiveIssueVote(customerId, monthId, isParty); + } +} 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 new file mode 100644 index 0000000000..66c59bf20f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -0,0 +1,497 @@ +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; +import com.epmet.dto.ProjectDTO; +import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +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; +import com.epmet.dto.project.FinishOrgDTO; +import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.result.WorkDayResultDTO; +import com.epmet.dto.topic.ResiTopicDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.entity.project.ProjectProcessEntity; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.service.Issue.IssueService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.ProjectExtractService; +import com.epmet.service.partymember.PartyMemberService; +import com.epmet.service.project.ProjectProcessService; +import com.epmet.service.project.ProjectService; +import com.epmet.service.topic.TopicService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/15 14:00 + */ +@Service +@Slf4j +public class ProjectExtractServiceImpl implements ProjectExtractService { + + @Autowired + private ProjectService projectService; + @Autowired + private IssueService issueService; + @Autowired + private TopicService topicService; + @Autowired + private PartyMemberService partyMemberService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private ProjectProcessService projectProcessService; + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; + + private final static String ONE_DAY = "<1"; + + @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 (!CollectionUtils.isEmpty(closedList)) { + List closeProjects = + pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(process.getProjectId()); + entity.setProjectStatus(ProjectConstant.CLOSED); + entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); + entity.setUpdatedTime(process.getUpdatedTime()); + entity.setIsResolved(process.getIsResolved()); + return entity; + })).collect(Collectors.toList()); + + if (!CollectionUtils.isEmpty(finishOrgList)) { + closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> { + String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); + String org = ""; + if (orgIds.length > NumConstant.ONE) { + org = orgIds[orgIds.length - 1]; + } else { + org = orgIds[0]; + } + if (StringUtils.isNotEmpty(dto.getGridId())) { + org = org + StrConstant.COLON + dto.getGridId(); + } else if (StringUtils.isNotEmpty(dto.getDepartmentId())) { + org = org + StrConstant.COLON + dto.getDepartmentId(); + } + close.setFinishOrgIds(org); + })); + } + //更新状态 + if (!closeProjects.isEmpty()) { + factOriginProjectMainDailyService.updateBatchById(closeProjects); + } + } + //获取项目信息 + List projectList = projectService.getProjectInfo(customerId, dateString); + if (!CollectionUtils.isEmpty(projectList)) { + //提取议题ID + List issueIds = projectList.stream().map(ProjectDTO::getOriginId).collect(Collectors.toList()); + //获取议题信息 + List issueList = issueService.getIssueInfoByIds(issueIds); + //提取话题ID + List topicIds = issueList.stream().map(IssueDTO::getSourceId).collect(Collectors.toList()); + //获取话题信息 + List topicList = topicService.getTopicByIds(topicIds); + //获取网格认证党员 + List partyMemberList = partyMemberService.getPartyMemberByCustomer(customerId); + //生成DTO + list = projectList.stream().map(project -> { + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(project.getCreatedTime()); + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(project.getId()); + entity.setAgencyId(project.getAgencyId()); + entity.setCustomerId(customerId); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setWeekId(dimId.getWeekId()); + entity.setDateId(dimId.getDateId()); + entity.setIssueId(project.getOriginId()); + entity.setProjectStatus(project.getStatus()); + entity.setIsResolved(project.getClosedStatus()); + entity.setCreatedTime(project.getCreatedTime()); + entity.setUpdatedTime(project.getUpdatedTime()); + entity.setPids(project.getOrgIdPath()); + String[] pIds = project.getOrgIdPath().split(StrConstant.COLON); + if (pIds.length > 1) { + entity.setPid(pIds[pIds.length - 2]); + } else if(pIds.length == 1){ + entity.setPid(pIds[0]); + } else { + entity.setPid(NumConstant.ZERO_STR); + } + entity.setIsParty(NumConstant.ZERO_STR); + entity.setIsOverdue(NumConstant.ZERO_STR); + return entity; + }).collect(Collectors.toList()); + list.forEach(entity -> issueList.stream().filter(issueDTO -> issueDTO.getId().equals(entity.getIssueId())).forEach(issue -> { + entity.setIssueCreatorId(issue.getCreatedBy()); + entity.setTopicId(issue.getSourceId()); + })); + list.forEach(entity -> topicList.stream().filter(topicDTO -> topicDTO.getId().equals(entity.getTopicId())).forEach(topic -> { + entity.setTopicCreatorId(topic.getCreatedBy()); + entity.setGridId(topic.getGridId()); + })); + list.forEach(entity -> partyMemberList.stream().filter(partyMemberDTO -> partyMemberDTO.getGridId().equals(entity.getGridId()) && partyMemberDTO.getUserId().equals(entity.getTopicCreatorId())).forEach(partyMember -> { + entity.setIsParty(NumConstant.ONE_STR); + })); + list.forEach(entity -> finishOrgList.stream().filter(finish -> entity.getId().equals(finish.getProjectId())).forEach(dto -> { + String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); + String org = ""; + if (orgIds.length > NumConstant.ONE) { + org = orgIds[orgIds.length - 1]; + } else { + org = orgIds[0]; + } + if (StringUtils.isNotEmpty(dto.getGridId())) { + org = org + StrConstant.COLON + dto.getGridId(); + } else if (StringUtils.isNotEmpty(dto.getDepartmentId())) { + org = org + StrConstant.COLON + dto.getDepartmentId(); + } + entity.setFinishOrgIds(org); + })); + //插入数据 + if (!list.isEmpty()) { + factOriginProjectMainDailyService.deleteByDate(customerId, dateString); + factOriginProjectMainDailyService.insertBatch(list); + } + } + final List mainList = list; + List logList = new ArrayList<>(); + //节点发起人 部门流转退回结案 + List processList = projectProcessService.getProcessListByCustomer(customerId, dateString); + if (!CollectionUtils.isEmpty(processList)) { + logList = processList.stream().map(process -> { + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); + FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(process.getAgencyId()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDateId(dimId.getDateId()); + entity.setProjectId(process.getProjectId()); + entity.setOperationUserId(process.getStaffId()); + entity.setActionCode(process.getOperation()); + entity.setIsActive(NumConstant.ONE); + entity.setPids(process.getPids()); + if (StringUtils.isNotBlank(process.getDepartmentId())) { + entity.setOrgType(OrgTypeConstant.DEPARTMENT); + entity.setOrgId(process.getDepartmentId()); + entity.setPid(process.getAgencyId()); + }else if (StringUtils.isNotBlank(process.getGridId())) { + entity.setOrgType(OrgTypeConstant.GRID); + entity.setOrgId(process.getGridId()); + entity.setPid(process.getAgencyId()); + }else{ + if(!process.getPids().contains(StrConstant.COLON)){ + entity.setPids(""); + entity.setPid(NumConstant.ZERO_STR); + }else{ + String[] orgArray = process.getPids().split(StrConstant.COLON); + if(orgArray.length > NumConstant.ONE){ + entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); + String path = process.getPids().replaceAll(process.getAgencyId(),""); + if(path.endsWith(StrConstant.COLON)){ + path =path.substring(NumConstant.ZERO,path.length() - NumConstant.ONE); + } + entity.setPids(path); + }else{ + log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}",process.getAgencyId(),process.getPids()); + entity.setPid(NumConstant.ZERO_STR); + entity.setPids(""); + } + } + } + + return entity; + }).collect(Collectors.toList()); + } + //节点发起人 响应 + List responseList = projectProcessService.getResponseProcessList(customerId, dateString); + if (!CollectionUtils.isEmpty(responseList)) { + logList.addAll(responseList.stream().map(process -> { + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); + FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(process.getAgencyId()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDateId(dimId.getDateId()); + entity.setProjectId(process.getProjectId()); + entity.setOperationUserId(process.getStaffId()); + entity.setActionCode(process.getOperation()); + entity.setIsActive(NumConstant.ONE); + entity.setPids(process.getPids()); + if (StringUtils.isNotBlank(process.getDepartmentId())) { + entity.setOrgType(OrgTypeConstant.DEPARTMENT); + entity.setOrgId(process.getDepartmentId()); + entity.setPid(process.getAgencyId()); + } else if (StringUtils.isNotBlank(process.getGridId())) { + entity.setOrgType(OrgTypeConstant.GRID); + entity.setOrgId(process.getGridId()); + entity.setPid(process.getAgencyId()); + } else { + if (!process.getPids().contains(StrConstant.COLON)) { + entity.setPids(""); + entity.setPid(NumConstant.ZERO_STR); + } else { + String[] orgArray = process.getPids().split(StrConstant.COLON); + if (orgArray.length > NumConstant.ONE) { + entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); + String path = process.getPids().replaceAll(process.getAgencyId(), ""); + if (path.endsWith(StrConstant.COLON)) { + path = path.substring(NumConstant.ZERO, path.length() - NumConstant.ONE); + } + entity.setPids(path); + } else { + log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}", process.getAgencyId(), process.getPids()); + entity.setPid(NumConstant.ZERO_STR); + entity.setPids(""); + } + } + } + + return entity; + }).collect(Collectors.toList())); + } + + //项目评论人 + List satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString); + + satisfactionRecordList.forEach(log -> mainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> { + //进行满意度评价的居民的所属机关的父机机关信息 + log.setPid(main.getPid()); + log.setPids(main.getPids()); + })); + logList.addAll(satisfactionRecordList.stream().map(process -> { + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); + FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(process.getAgencyId()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDateId(dimId.getDateId()); + entity.setProjectId(process.getProjectId()); + entity.setOperationUserId(process.getStaffId()); + entity.setActionCode(process.getOperation()); + entity.setIsActive(NumConstant.ONE); + entity.setOrgId(process.getGridId()); + entity.setOrgType(OrgTypeConstant.GRID); + entity.setPids(process.getPids()); + entity.setPid(process.getPid()); + return entity; + }).collect(Collectors.toList())); + + + //节点接收人 + List processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString); + logList.addAll(processStaffList.stream().map(process -> { + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); + FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(process.getAgencyId()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDateId(dimId.getDateId()); + entity.setProjectId(process.getProjectId()); + entity.setOperationUserId(process.getStaffId()); + entity.setActionCode(process.getOperation()); + entity.setIsActive(NumConstant.ZERO); + entity.setPids(process.getPids()); + if (StringUtils.isNotBlank(process.getDepartmentId())) { + entity.setOrgType(OrgTypeConstant.DEPARTMENT); + entity.setOrgId(process.getDepartmentId()); + entity.setPid(process.getAgencyId()); + }else if (StringUtils.isNotBlank(process.getGridId())) { + entity.setOrgType(OrgTypeConstant.GRID); + entity.setOrgId(process.getGridId()); + entity.setPid(process.getAgencyId()); + }else{ + if(!process.getPids().contains(StrConstant.COLON)){ + entity.setPids(""); + entity.setPid(NumConstant.ZERO_STR); + }else{ + String[] orgArray = process.getPids().split(StrConstant.COLON); + if(orgArray.length > NumConstant.ONE){ + entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); + String path = process.getPids().replaceAll(process.getAgencyId(),""); + if(path.endsWith(StrConstant.COLON)){ + path =path.substring(NumConstant.ZERO,path.length() - NumConstant.ONE); + } + entity.setPids(path); + }else{ + log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}",process.getAgencyId(),process.getPids()); + entity.setPid(NumConstant.ZERO_STR); + entity.setPids(""); + } + } + } + return entity; + }).collect(Collectors.toList())); + + if (!logList.isEmpty()) { + factOriginProjectLogDailyService.deleteByDate(customerId, dateString); + factOriginProjectLogDailyService.insertBatch(logList); + } + + } + + /** + * @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; + if (StringUtils.isBlank(param.getDateId())) { + param.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + List extractData = + projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId()); + List formattingData = new LinkedList<>(); + extractData.forEach(original -> { + FactOriginProjectOrgPeriodDailyEntity dest + = ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class); + if(StringUtils.isNotBlank(original.getDepartmentId())){ + dest.setOrgType("dept"); + dest.setPid(original.getOrgId()); + dest.setPids(original.getOrgIdPath()); + }else if(StringUtils.isNotBlank(original.getGridId())) { + dest.setOrgType(OrgTypeConstant.GRID); + dest.setPid(original.getOrgId()); + dest.setPids(original.getOrgIdPath()); + }else { + dest.setOrgType(OrgTypeConstant.AGENCY); + dest.setPids(""); + String[] array = original.getOrgIdPath().split(StrConstant.COLON); + if (array.length <= NumConstant.ZERO) { + dest.setPid(NumConstant.ZERO_STR); + } + if (array[NumConstant.ZERO].equals(original.getOrgId()) && array.length == NumConstant.ONE) { + dest.setPid(NumConstant.ZERO_STR); + } + if (array.length > NumConstant.ONE && original.getOrgId().equals(array[array.length - NumConstant.ONE])) { + dest.setPid(array[array.length - NumConstant.TWO]); + dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),"")); + } + if(StringUtils.isNotBlank(dest.getPids())){ + while(dest.getPids().endsWith(StrConstant.COLON)){ + dest.setPids(dest.getPids().substring(NumConstant.ZERO,dest.getPids().length() - NumConstant.ONE)); + } + while(dest.getPids().startsWith(StrConstant.COLON)){ + dest.setPids(dest.getPids().replaceFirst(StrConstant.COLON,"")); + } + } + dest.setPids(dest.getPids().replaceAll(" ","")); + } + + formattingData.add(dest); + }); + if(!CollectionUtils.isEmpty(formattingData)) { + List projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(projectIds)) { + factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(projectIds); + factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData); + } + } + } + + + /** + * 工作日计算 + * @author zhaoqifeng + * @date 2020/9/17 17:02 + * @param id + * @param startDate + * @param endDate + * @return java.lang.Integer + */ + private Integer getDetentionDays(String id, Date startDate, Date endDate) { + int result; + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + + List list = new ArrayList<>(); + WorkDayFormDTO workDayFormDTO = new WorkDayFormDTO(); + workDayFormDTO.setId(id); + workDayFormDTO.setStartDate(format.format(startDate)); + workDayFormDTO.setEndDate(format.format(endDate)); + list.add(workDayFormDTO); + Result> detentionDays = epmetCommonServiceOpenFeignClient.detentionDays(list); + String days = detentionDays.getData().get(NumConstant.ZERO).getDetentionDays(); + if (ONE_DAY.equals(days)) { + result = NumConstant.ONE; + } else { + result = Integer.parseInt(days); + } + return result; + } + + /** + * 客户配置的可滞留时间,没有的话默认5天 + * @author zhaoqifeng + * @date 2020/9/28 10:27 + * @param customerId + * @return java.lang.Integer + */ + private Integer getDays(String customerId) { + String value = projectService.getParameterValueByKey(customerId); + Integer days = NumConstant.FIVE; + if (StringUtils.isNotBlank(value)) { + days = Integer.valueOf(value); + } + return days; + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java new file mode 100644 index 0000000000..ef55ca765a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java @@ -0,0 +1,52 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:28 + */ +public interface GovernRankDataExtractService { + /** + * 网格治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + void extractGridData(String customerId, String monthId); + + /** + * 社区治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractCommunityData(String customerId, String monthId); + + /** + * 街道治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractStreetData(String customerId, String monthId); + + /** + * 全区治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractDistrictData(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java new file mode 100644 index 0000000000..9a2e1dd7e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java @@ -0,0 +1,52 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/27 9:37 + */ +public interface OrgRankExtractService { + /** + * 网格先进排行 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + void extractGridData(String customerId, String monthId); + + /** + * 社区先进排行 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractCommunityData(String customerId, String monthId); + + /** + * 街道先进排行 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractStreetData(String customerId, String monthId); + + /** + * 全区先进排行 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractDistrictData(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyBaseInfoService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyBaseInfoService.java new file mode 100644 index 0000000000..91656440bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyBaseInfoService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @Desciption 党员基本情况 + * @Author zxc + * @DateTime 2020/9/22 11:14 上午 + */ +public interface PartyBaseInfoService { + + /** + * @Description 统计基层党建-党员基本情况 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/22 1:22 下午 + */ + Boolean statsPartyMemberBaseInfoToScreen(String customerId,String dateId); + +} 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 new file mode 100644 index 0000000000..2d8ac15142 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.extract.form.ExtractScreenFormDTO; + +/** + * @Author zxc + * @DateTime 2020/9/24 5:05 下午 + */ +public interface PartyGuideService { + + /** + * @Description 党建引领抽取 + * @param formDTO + * @author zxc + * @date 2020/9/24 5:10 下午 + */ + Boolean partyGuideExtract(ExtractScreenFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java new file mode 100644 index 0000000000..0b8384a024 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java @@ -0,0 +1,30 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * 先进模范数据抽取到大屏表 screen_pioneer_data + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/22 11:25 + */ +public interface PioneerDataExtractService { +// 机关级别(社区级:community, +// 乡(镇、街道)级:street, +// 区县级: district, +// 市级: city +// 省级:province) + + /** + * @param customerId + * @param dateId + * @return void + * @author yinzuomei + * @description 网格级别的 党建引领-先锋模范数据 + * @Date 2020/9/22 13:46 + **/ + void extractGridPioneerData(String customerId, String dateId); + + // 社区、街道、区县、市级别、省级 + void extractCommunityPioneerData(String customerId, String dateId); + + void extractExceptCommunityPioneerData(String customerId, String dateId); +} 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/PublicPartiTotalDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartiTotalDataExtractService.java new file mode 100644 index 0000000000..f1c5978c36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartiTotalDataExtractService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * screen_public_parti_total_data + * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 按天统计 + * @author yinzuomei@elink-cn.com + * @date 2020/9/27 11:09 + */ +public interface PublicPartiTotalDataExtractService { + + /** + * 按天统计 + * + * @param customerId 客户id + * @param dateId yyyyMMdd 这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd + * @return + */ + void extractPublicPartiTotalData(String customerId,String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java new file mode 100644 index 0000000000..7c11d3acb3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; + +/** + * 大屏中央区数据写入 + * */ + +public interface ScreenCentralZoneDataAbsorptionService { + + /** + * @Description 中央区数据写入 + * @param param + * @return + * @author wangc + * @date 2020.09.24 10:41 + **/ + void centralZoneDataHub(ScreenCentralZoneDataFormDTO param); +} 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 new file mode 100644 index 0000000000..eefe383408 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java @@ -0,0 +1,28 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:57 上午 + */ +public interface ScreenExtractService { + + /** + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO); + + /** + * @param formDTO + * @Description 抽取数据到大屏【月】 + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + void extractMonthlyAll(ExtractScreenFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java new file mode 100644 index 0000000000..56c73b2de5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java @@ -0,0 +1,29 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; + +/** + * 基层治理 + * 热心市民积分 党员能力值 + * 难点赌点 + * */ +public interface ScreenGrassrootsGovernDataAbsorptionService { + + /** + * @Description 用户积分、党员分值数据中转站 + * @param param + * @return + * @author wangc + * @date 2020.09.25 09:53 + **/ + void userScoreDataHub(ScreenCentralZoneDataFormDTO param); + + /** + * @Description 难点赌点数据中转站 + * @param param + * @return + * @author wangc + * @date 2020.09.25 10:00 + **/ + void difficultyDataHub(ScreenCentralZoneDataFormDTO param); +} 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 new file mode 100644 index 0000000000..14198e915b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -0,0 +1,286 @@ +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.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +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.apache.commons.collections4.CollectionUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:31 + */ +@Service +public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService { + @Autowired + private ScreenGovernRankDataService screenGovernRankDataService; + @Autowired + 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; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getGridSatisfaction(customerId, monthId); + if (!CollectionUtils.isEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自治率 + List gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); + if (CollectionUtils.isNotEmpty(gridList)) { + list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> { + BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); + BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); + if (grid.getResolveProjectCount() != NumConstant.ZERO) { + entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getGridResponse(customerId, monthId); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getGridResolveProject(customerId, monthId); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).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; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).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; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId, + OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); + } + + @Override + public void extractDistrictData(String customerId, String monthId) { + List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).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/OrgRankExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java new file mode 100644 index 0000000000..4e7ecc27aa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java @@ -0,0 +1,342 @@ +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.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; +import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity; +import com.epmet.service.evaluationindex.extract.todata.*; +import com.epmet.service.evaluationindex.extract.toscreen.OrgRankExtractService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService; +import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService; +import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.apache.commons.collections4.CollectionUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/27 9:37 + */ +@Service +@Slf4j +public class OrgRankExtractServiceImpl implements OrgRankExtractService { + @Autowired + private ScreenOrgRankDataService screenOrgRankDataService; + @Autowired + private FactRegUserGridMonthlyService factRegUserGridMonthlyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactRegUserAgencyMonthlyService factRegUserAgencyMonthlyService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + + @Override + public void extractGridData(String customerId, String monthId) { + List list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.GRID, null); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //党员数 + List partyMemberList = factRegUserGridMonthlyService.getGridUserCountByCustomer(customerId, monthId); + if (!CollectionUtils.isEmpty(partyMemberList)) { + list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> + entity.setPartyTotal(dto.getPartymemberTotal()) + )); + } + //小组数 + List groupList = factOriginGroupMainDailyService.getGridGroupCount(customerId, monthId); + if (CollectionUtils.isNotEmpty(groupList)) { + list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setGroupTotal(dto.getCount()) + )); + } + //话题数 + List topicList = factOriginTopicMainDailyService.getGridTopicCount(customerId, monthId); + if (CollectionUtils.isNotEmpty(topicList)) { + list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setTopicTotal(dto.getCount()) + )); + } + //议题数 + List issueList = factOriginIssueMainDailyService.getGridIssueCount(customerId, monthId); + if (CollectionUtils.isNotEmpty(issueList)) { + list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setIssueTotal(dto.getCount()) + )); + } + //项目数 + List projectList = factOriginProjectMainDailyService.getGridProjectCount(customerId, monthId); + if (CollectionUtils.isNotEmpty(projectList)) { + list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setProjectTotal(dto.getCount()) + )); + } + //结案率 结案数/项目数 +// List abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); +// if (CollectionUtils.isNotEmpty(abilityList)) { +// list.forEach(entity -> abilityList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> { +// if (dto.getProjectTotal() != NumConstant.ZERO) { +// BigDecimal total = new BigDecimal(dto.getProjectTotal()); +// BigDecimal closed = new BigDecimal(dto.getResolveProjectCount()); +// entity.setCloseProjectRatio(closed.multiply(hundred).divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); +// } +// +// })); +// } + List closed = factOriginProjectLogDailyService.getGridClosed(customerId, monthId); + if (CollectionUtils.isNotEmpty(closed)) { + list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getGridSatisfaction(customerId, monthId); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenOrgRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, monthId, IndexCalConstant.DELETE_SIZE, list); + } + + @Override + public void extractCommunityData(String customerId, String monthId) { + List list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //党员数 + List partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(partyMemberList)) { + list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setPartyTotal(dto.getPartymemberTotal()) + )); + } + //小组数 + List groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(groupList)) { + list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setGroupTotal(dto.getCount()) + )); + } + //话题数 + List topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(topicList)) { + list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setTopicTotal(dto.getCount()) + )); + } + //议题数 + List issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(issueList)) { + list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setIssueTotal(dto.getCount()) + )); + } + //项目数 + List projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(projectList)) { + list.forEach(entity -> projectList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setProjectTotal(dto.getCount()) + )); + } + //结案率 结案数/项目数 + List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(abilityList)) { + list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setCloseProjectRatio(dto.getClosedProjectRatio()) + )); + } + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenOrgRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); + } + + @Override + public void extractStreetData(String customerId, String monthId) { + List list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.STREET); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //党员数 + List partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(partyMemberList)) { + list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setPartyTotal(dto.getPartymemberTotal()) + )); + } + //小组数 + List groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(groupList)) { + list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setGroupTotal(dto.getCount()) + )); + } + //话题数 + List topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(topicList)) { + list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setTopicTotal(dto.getCount()) + )); + } + //议题数 + List issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(issueList)) { + list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setIssueTotal(dto.getCount()) + )); + } + //项目数 + List projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(projectList)) { + list.forEach(entity -> projectList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setProjectTotal(dto.getCount()) + )); + } + //结案率 结案数/项目数 + List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(abilityList)) { + list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setCloseProjectRatio(dto.getClosedProjectRatio()) + )); + } + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenOrgRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); + } + + @Override + public void extractDistrictData(String customerId, String monthId) { + List list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //党员数 + List partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(partyMemberList)) { + list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setPartyTotal(dto.getPartymemberTotal()) + )); + } + //小组数 + List groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(groupList)) { + list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setGroupTotal(dto.getCount()) + )); + } + //话题数 + List topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(topicList)) { + list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setTopicTotal(dto.getCount()) + )); + } + //议题数 + List issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(issueList)) { + list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setIssueTotal(dto.getCount()) + )); + } + //项目数 + List projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(projectList)) { + list.forEach(entity -> projectList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setProjectTotal(dto.getCount()) + )); + } + //结案率 结案数/项目数 + List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(abilityList)) { + list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setCloseProjectRatio(dto.getClosedProjectRatio()) + )); + } + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenOrgRankDataService.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 new file mode 100644 index 0000000000..90ccb5a0ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java @@ -0,0 +1,382 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; +import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.stats.DimCustomerPartymemberService; +import com.epmet.service.stats.user.FactParticipationUserGridDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import com.epmet.constant.ScreenConstant; + +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Desciption 党员基本情况 + * @Author zxc + * @DateTime 2020/9/22 11:15 上午 + */ +@Service +@Slf4j +public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { + + @Autowired + private ScreenCustomerAgencyService agencyService; + @Autowired + private ScreenCustomerGridService gridService; + @Autowired + private DimCustomerPartymemberService partyMemberService; + @Autowired + private FactParticipationUserGridDailyService userGridDailyService; + @Autowired + private ScreenCpcBaseDataService cpcBaseDataService; + + /** + * @Description 统计基层党建-党员基本情况 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/22 1:22 下午 + */ + @Override + public Boolean statsPartyMemberBaseInfoToScreen(String customerId, String dateId) { + 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); + disPose(customerGridInfoList,true,customerId,dateId); + } + if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); + disPose(customerGridInfoList,false,customerId,dateId); + } + if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); + disPose(customerGridInfoList,false,customerId,dateId); + } + if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); + disPose(customerGridInfoList,false,customerId,dateId); + } + if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); + disPose(customerGridInfoList,false,customerId,dateId); + } + } + return true; + } + + /** + * @Description + * @param isGrid true:level = community + * @author zxc + * @date 2020/9/22 4:48 下午 + */ + public void disPose(List agencyIdList, Boolean isGrid, String customerId, String dateId){ + if (!CollectionUtils.isEmpty(agencyIdList)){ + // 网格ID或机关Id + List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + List result = new ArrayList<>(); + if (isGrid == true){ + // 是 community 级别,子级为gridId + agencyIdList.forEach(agency -> { + GridPartyDTO gridPartyDTO = gridParty(customerId, dateId, agency); + result.addAll(gridPartyDTO.getResult()); + orgIds.addAll(gridPartyDTO.getOrgIds()); + }); + // 2. 处理社区级别的党员信息(因为网格级别的已算出,社区级别直接累加) + Map> groupByAgency = result.stream().collect(Collectors.groupingBy(PartyBaseInfoFormDTO::getParentId)); + List orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList())); + groupByAgency.forEach((commAgencyId,party) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (commAgencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } + form.setOrgId(commAgencyId); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setOrgType(ScreenConstant.AGENCY); + form.setAgeLevel1(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel1))); + form.setAgeLevel2(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel2))); + form.setAgeLevel3(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel3))); + form.setAgeLevel4(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel4))); + form.setAgeLevel5(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel5))); + form.setAgeLevel6(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel6))); + form.setPartyMemberCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getPartyMemberCount))); + form.setResiTotal(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getResiTotal))); + form.setRegisterUserCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getRegisterUserCount))); + result.add(form); + }); + delAndInsert(result,customerId,dateId,orgIds); + }else { + // 级别为 street,district,city,province + List directGridIds = gridService.selectDirectGrid(orgIds); + List userCountList = userGridDailyService.selectUserCount(customerId,dateId); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + List dGridId = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + dGridId.add(grid.getGridId()); + } + }); + // 不为空 存在直属网格 + if (!CollectionUtils.isEmpty(dGridId)){ + List disGrid = new ArrayList<>(); + List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, dGridId); + List orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 为每个人赋值年龄 + partyMemberInfoList.forEach(party -> { + party.setAge(getAge(party.getBirthday())); + orgNameList.forEach(orgName -> { + if (party.getGridId().equals(orgName.getGridId())){ + party.setGridName(orgName.getGridName()); + party.setAgencyName(orgName.getAgencyName()); + } + }); + }); + Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); + groupByGridId.forEach((gridId,partyInfos) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgType(ScreenConstant.GRID); + form.setOrgId(gridId); + form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); + form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); + form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); + form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); + form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); + form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); + if (!CollectionUtils.isEmpty(userCountList)){ + userCountList.forEach(user -> { + if (gridId.equals(user.getOrgId())){ + form.setResiTotal(user.getResiTotal()); + form.setRegisterUserCount(user.getRegisterUserCount()); + form.setPartyMemberCount(user.getPartyMemberCount()); + } + }); + } + disGrid.add(form); + }); + } + delAndInsert(disGrid,customerId,dateId,dGridId); + } + // 查询下级机关的党员信息,直接累加 【包括直属网格】 + List directGridList = cpcBaseDataService.selectDirectGridPartyInfo(dGridId, customerId, dateId); + List partyInfoList = cpcBaseDataService.selectPartyInfo(customerId, dateId, agencyId); + partyInfoList.addAll(directGridList); + if (!CollectionUtils.isEmpty(partyInfoList)){ + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgName(partyInfoList.get(NumConstant.ZERO).getOrgName()); + form.setOrgId(agencyId); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setOrgType(ScreenConstant.AGENCY); + form.setParentId(partyInfoList.get(NumConstant.ZERO).getParentId()); + form.setAgeLevel1(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel1))); + form.setAgeLevel2(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel2))); + form.setAgeLevel3(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel3))); + form.setAgeLevel4(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel4))); + form.setAgeLevel5(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel5))); + form.setAgeLevel6(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel6))); + form.setPartyMemberCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getPartyMemberCount))); + form.setResiTotal(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getResiTotal))); + form.setRegisterUserCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getRegisterUserCount))); + result.add(form); + } + }); + delAndInsert(result,customerId,dateId,orgIds); + } + } + } + + /** + * @Description 根据生日计算年龄 + * @param birthday + * @author zxc + * @date 2020/9/22 5:34 下午 + */ + public Integer getAge(Date birthday){ + LocalDate now = LocalDate.now(); + int nowYear = now.getYear(); + int nowMonth = now.getMonthValue(); + int nowDayOfMonth = now.getDayOfMonth(); + LocalDate birth = birthday.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + int birthDayYear = birth.getYear(); + int birthDayMonth = birth.getMonthValue(); + int birthDayOfMonth = birth.getDayOfMonth(); + int age = nowYear - birthDayYear; + // 当前月小于出生年的月份 或者 当前月等于出生年的月 并且 当前日小于出生年的日,就是不满一岁 + if (nowMonth < birthDayMonth || (nowMonth == birthDayMonth && nowDayOfMonth < birthDayOfMonth)) { + age--; + } + return age; + } + + /** + * @Description 处理年龄段之间的人数 + * @param partyMemberInfoList + * @param startAge + * @param endAge + * @author zxc + * @date 2020/9/22 5:45 下午 + */ + public Integer disposeAgeArea(List partyMemberInfoList, Integer startAge,Integer endAge ){ + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 计算大于多少岁并小于多少岁的人 + List collect = partyMemberInfoList.stream().filter(p -> p.getAge() >= startAge).filter(p -> p.getAge() <= endAge).collect(Collectors.toList()); + return collect.size(); + } + return NumConstant.ZERO; + } + + /** + * @Description 计算 大于/小于 年龄的人数 + * @param partyMemberInfoList + * @param age + * @param isGreater 是否是 大于 + * @author zxc + * @date 2020/9/22 5:49 下午 + */ + public Integer disposeAge(List partyMemberInfoList, Integer age , Boolean isGreater){ + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + List collect = new ArrayList<>(); + if (isGreater == true){ + // 大于 + collect = partyMemberInfoList.stream().filter(p -> p.getAge() > age).collect(Collectors.toList()); + }else { + // 小于 + collect = partyMemberInfoList.stream().filter(p -> p.getAge() < age).collect(Collectors.toList()); + } + return collect.size(); + } + return NumConstant.ZERO; + } + + /** + * @Description + * @param result + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/23 10:13 上午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsert(List result, String customerId, String dateId, List orgIds){ + // 查询客户下所有的agency + List partyBaseInfoList = agencyService.selectAllAgencyIdToParty(customerId,dateId); + // 查询客户下所有的grid + List resultList = gridService.selectAllGridIdToParty(customerId, dateId); + resultList.addAll(partyBaseInfoList); + 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 = cpcBaseDataService.deleteOldPartyBaseInfo(customerId, dateId, orgIds); + }while (delNum > NumConstant.ZERO); + List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + cpcBaseDataService.insertPartyBaseInfo(p); + }); + } + + public GridPartyDTO gridParty(String customerId,String dateId,CustomerAgencyInfoResultDTO agency){ + List result = new ArrayList<>(); + List orgIds = new ArrayList<>(); + List userCountList = userGridDailyService.selectUserCount(customerId,dateId); + // 1. 处理社区下的所有网格中的党员信息 + String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + orgIds.addAll(gridIds); + List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 为每个人赋值年龄 + partyMemberInfoList.forEach(party -> { + party.setAge(getAge(party.getBirthday())); + orgNameList.forEach(orgName -> { + if (party.getGridId().equals(orgName.getGridId())){ + party.setGridName(orgName.getGridName()); + party.setAgencyName(orgName.getAgencyName()); + } + }); + }); + Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); + groupByGridId.forEach((gridId,partyInfos) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgType(ScreenConstant.GRID); + form.setOrgId(gridId); + form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); + form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); + form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); + form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); + form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); + form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); + if (!CollectionUtils.isEmpty(userCountList)){ + userCountList.forEach(user -> { + if (gridId.equals(user.getOrgId())){ + form.setResiTotal(user.getResiTotal()); + form.setRegisterUserCount(user.getRegisterUserCount()); + form.setPartyMemberCount(user.getPartyMemberCount()); + } + }); + } + result.add(form); + }); + } + return new GridPartyDTO(orgIds, result); + } +} 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 new file mode 100644 index 0000000000..74f7b84d27 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -0,0 +1,534 @@ +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.utils.ConvertUtils; +import com.epmet.constant.ScreenConstant; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +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 + * @DateTime 2020/9/24 5:06 下午 + */ +@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 screenExtractFormDTO + * @author zxc + * @date 2020/9/24 5:10 下午 + */ + @Override + public Boolean partyGuideExtract(ExtractScreenFormDTO 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().minusMonths(NumConstant.ONE).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<>(); + // 判断当前级别agency是否为空 + if (!CollectionUtils.isEmpty(agencyIdList)){ + // 获取agencyIds + 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()); + }); + // 根据agencyId分组,计算各个社区的 + 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); + } + // 查询直属网格的信息 + 下级机关的信息 = agency的机关信息 + 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 处理【参与人数,组织次数】 + * eg:假设 组织A:A1 组织的直属网格:A1-G1 + * 统计 A1的参与人数、组织次数应为 + * + * 组织次数:以A1的名义组织活动次数 + 以A1-G1的名义组织活动次数 = A1组织活动总次数 + * 参与人数:以A1的名义组织活动参与人数和 + 以A1-G1的名义组织活动参与人数和 = A1组织活动参与人数总数 + * + * @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)){ + // 包括 gridId 和 agencyId + List orgIds = new ArrayList<>(); + // orgIdsAgency 客户下某个级别的所有agencyId + List orgIdsAgency = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + orgIds.addAll(orgIdsAgency); + orgIdsAgency.forEach(orgId -> { + Map agencyMap = agencyService.selectAllSubAgencyId(orgId, customerId); + List gridIds = (List) agencyMap.get(orgId); + orgIds.addAll(gridIds); + }); + List directGridIds = gridService.selectDirectGrid(orgIdsAgency); + if (isGrid == false){ + orgIds.addAll(directGridIds.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + } + // 查询客户下所有机关,网格下的参与人数 + List joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, null); + // 查询机关界别的组织次数 + List screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId); + // 查询客户下所有网格和所有机关 + List screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId); + List screenPartyBranchDataListAgencyAll = gridService.selectAllGridIdToOrganize(customerId, monthId); + screenPartyBranchDataListAgencyAll.addAll(screenPartyBranchData); + List finalResult = new ArrayList<>(); + screenPartyBranchDataListAgencyAll.forEach(rl -> { + orgIds.forEach(orgId -> { + if (rl.getOrgId().equals(orgId)){ + finalResult.add(rl); + } + }); + }); + // 查询所有机关、网格组织次数 + if (isGrid == true){ + agencyIdList.forEach(agency -> { + finalResult.forEach(fl -> { + screenPartyBranchDataByAgencyList.forEach(sp -> { + if (fl.getOrgId().equals(sp.getOrgId())){ + fl.setOrganizeCount(sp.getOrganizeCount()); + } + }); + joinUserCountList.forEach(join -> { + if (fl.getOrgId().equals(join.getOrgId())){ + fl.setJoinUserCount(join.getJoinUserCount()); + } + }); + fl.setAverageJoinUserCount(fl.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : fl.getJoinUserCount() / fl.getOrganizeCount()); + }); + }); + // 社区级别的 + Map> groupByType = finalResult.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getOrgType)); + groupByType.forEach((orgType,list) -> { + if (orgType.equals(ScreenConstant.GRID)){ + Map> groupByAgency = finalResult.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getParentId)); + groupByAgency.forEach((agencyId,actList) -> { + finalResult.forEach(fl -> { + if (fl.getOrgId().equals(agencyId)){ + fl.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); + fl.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); + // 如果存在本级名义的, 下级机关 + 本级 + screenPartyBranchDataByAgencyList.forEach(organize -> { + if (organize.getOrgId().equals(agencyId)){ + fl.setOrganizeCount(calAdd(organize.getOrganizeCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); + } + }); + joinUserCountList.forEach(join -> { + if (join.getOrgId().equals(agencyId)){ + fl.setJoinUserCount(calAdd(join.getJoinUserCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)))); + } + }); + fl.setAverageJoinUserCount(fl.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (fl.getJoinUserCount() / fl.getOrganizeCount())); + } + }); + }); + } + }); + delOrganize(customerId,monthId,orgIds); + insertOrganize(finalResult); + }else { + 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)){ + orgIds.addAll(disGridIds); + finalResult.forEach(r -> { + screenPartyBranchDataByAgencyList.forEach(party ->{ + if (r.getOrgId().equals(party.getOrgId())){ + r.setOrganizeCount(party.getOrganizeCount()); + } + }); + joinUserCountList.forEach(join -> { + if (r.getOrgId().equals(join.getOrgId())){ + r.setJoinUserCount(join.getJoinUserCount()); + } + }); + r.setAverageJoinUserCount(r.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : r.getJoinUserCount() / r.getOrganizeCount()); + }); + } + delOrganize(customerId,monthId,orgIds); + List disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds); + List screenPartyBranchDataByParentList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); + screenPartyBranchDataByParentList.addAll(disPartyBranchDataList); + if (!CollectionUtils.isEmpty(screenPartyBranchDataByParentList)){ + finalResult.forEach(form -> { + if (form.getOrgId().equals(agencyId)) { + form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); + form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); + // 如果存在本级名义的, 下级机关 + 本级 + screenPartyBranchDataByAgencyList.forEach(organize -> { + if (organize.getOrgId().equals(agencyId)) { + form.setOrganizeCount(calAdd(organize.getOrganizeCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); + } + }); + joinUserCountList.forEach(join -> { + if (join.getOrgId().equals(agencyId)) { + form.setJoinUserCount(calAdd(join.getJoinUserCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)))); + } + }); + form.setAverageJoinUserCount(form.getOrganizeCount() == NumConstant.ZERO ? NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount())); + } + }); + } + }); + insertOrganize(finalResult); + } + } + } + + /** + * @Description 加法运算 + * @Param a + * @Param b + * @author zxc + * @date 2020/9/28 3:17 下午 + */ + public Integer calAdd(Integer a, Integer b){ + if (null != a && null != b){ + return a + b; + } + return NumConstant.ZERO; + } + + /** + * @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 insertOrganize(List result){ + List> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + partyBranchDataService.insertScreenPartyBranchData(p); + }); + } + + /** + * @Description 【组织次数,参与人数】旧纪录删除 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/28 3:18 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delOrganize(String customerId, String monthId, List orgIds){ + Integer delNum; + do { + delNum = partyBranchDataService.deleteOldScreenPartyBranchData(customerId, monthId, orgIds); + }while (delNum > NumConstant.ZERO); + } + +} 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 new file mode 100644 index 0000000000..f41366eb13 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java @@ -0,0 +1,398 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.constant.DimObjectStatusConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; +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; +import org.springframework.util.StringUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +/** + * 先进模范数据抽取到大屏表screen_pioneer_data + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/22 11:25 + */ +@Slf4j +@Service +public class PioneerDataExtractServiceImpl implements PioneerDataExtractService { + + @Autowired + private ScreenPioneerDataService screenPioneerDataService; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactOriginIssueLogDailyService factOriginIssueLogDailyService; + + + /** + * @param customerId + * @param dateId + * @return void + * @author yinzuomei + * @description 网格级别的 党建引领-先锋模范数据 + * @Date 2020/9/22 13:46 + **/ + @Override + public void extractGridPioneerData(String customerId, String dateId) { + //查询客户下所有的网格,初始数据值为0 + List gridList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.GRID); + if (CollectionUtils.isEmpty(gridList)) { + return; + } + gridList.forEach(entity -> { + entity.setDataEndTime(dateId); + String gridId = entity.getOrgId(); + //何为参与: 议题的表决行为次数总计 + //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); + BigDecimal issueRatio=new BigDecimal(entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setIssueRatio(issueRatio.setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + } + + //3、党员发布话题: + entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); + //4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 + if (entity.getTopicTotal() == NumConstant.ZERO) { + entity.setTopicRatio(BigDecimal.ZERO); + } else { + //当前网格内所有话题总数 + int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); + if(gridTopicTotal == NumConstant.ZERO){ + entity.setTopicRatio(BigDecimal.ZERO); + }else{ + BigDecimal topicRatio=new BigDecimal(entity.getTopicTotal() / gridTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setTopicRatio(topicRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + } + + //当前网格内所有议题总数 + int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null); + if (gridIssueTotal != NumConstant.ZERO) { + //5、党员发布议题 + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null)); + //6、党员发布议题占比 : 占网格内所有议题的比率 + if (entity.getPublishIssueTotal() == NumConstant.ZERO) { + entity.setPublishIssueRatio(BigDecimal.ZERO); + }else{ + BigDecimal publishIssueRatio=new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setPublishIssueRatio(publishIssueRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //7、议题转项目数 + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); + //8、议题转项目占比 : 占网格内议题总数的比率 + if(entity.getShiftProjectTotal() == NumConstant.ZERO){ + entity.setShiftProjectRatio(BigDecimal.ZERO); + }else{ + BigDecimal shiftProjectRatio=new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setShiftProjectRatio(shiftProjectRatio.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); + } + + + // 9、已解决项目 + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED)); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { + entity.setResolvedProjectRatio(BigDecimal.ZERO); + } else { + // 10、占总结项目 + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null); + if(closedProjectTotal == NumConstant.ZERO){ + entity.setResolvedProjectRatio(BigDecimal.ZERO); + }else { + BigDecimal resolvedProjectRatio=new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setResolvedProjectRatio(resolvedProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + } + }); + screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.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 + List communityList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isEmpty(communityList)) { + return; + } + communityList.forEach(entity -> { + entity.setDataEndTime(dateId); + String communityId = entity.getOrgId(); + //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)); + //4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率 + if (entity.getTopicTotal() == NumConstant.ZERO) { + entity.setTopicRatio(BigDecimal.ZERO); + } else { + //当前社区内所有话题总数 + int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId); + entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //当前社区内所有议题总数 + int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId); + if (communityIssueTotal != NumConstant.ZERO) { + //5、党员发布议题 + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId)); + //6、党员发布议题占比 : 占社区内所有议题的比率 + if (entity.getPublishIssueTotal() == NumConstant.ZERO) { + entity.setPublishIssueRatio(BigDecimal.ZERO); + } + entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + + //7、议题转项目数 + 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); + } + + + // 9、已解决项目 + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED)); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { + entity.setResolvedProjectRatio(BigDecimal.ZERO); + } else { + // 10、占总结项目 + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, communityList); + } + + + @Override + public void extractExceptCommunityPioneerData(String customerId, String dateId) { + //查询客户下所有的组织(社区除外),初始数据值为0 + List agencyList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.AGENCY); + if (CollectionUtils.isEmpty(agencyList)) { + return; + } + agencyList.forEach(entity -> { + entity.setDataEndTime(dateId); + 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)); + //4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率 + if (entity.getTopicTotal() == NumConstant.ZERO) { + entity.setTopicRatio(BigDecimal.ZERO); + } else { + //当前组织内所有话题总数 + int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null); + entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //当前组织内所有议题总数 + int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath()); + if (agencyIssueTotal != NumConstant.ZERO) { + //5、党员发布议题 + entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath())); + //6、党员发布议题占比 : 占社区内所有议题的比率 + if (entity.getPublishIssueTotal() == NumConstant.ZERO) { + entity.setPublishIssueRatio(BigDecimal.ZERO); + } + entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + + //7、议题转项目数 + 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); + } + + + // 9、已解决项目 + entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED)); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { + entity.setResolvedProjectRatio(BigDecimal.ZERO); + } else { + // 10、占总结项目 + int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, agencyList); + + } + + //组织下:已解决项目 or 已结案项目总数 + private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) { + return factOriginProjectMainDailyService.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus, ProjectConstant.CLOSED); + } + + //组织下:议题转项目数 + private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { + return factOriginIssueMainDailyService.getAgencyShiftProjectTotal(customerId,agencyPath); + } + + //组织内: 党员发布议题 + private Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath) { + return factOriginIssueMainDailyService.getAgencyParyPublishIssueTotal(customerId,agencyPath); + } + + //组织内:所有议题总数 + private int getAgencyIssueTotal(String customerId, String agencyPath) { + return factOriginIssueMainDailyService.getAgencyIssueTotal(customerId,agencyPath); + } + + + //在当前组织下,话题总数(createTopicUserIsParty=1时查询党员发布的话题总数) + private Integer getAgencyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty) { + return factOriginTopicMainDailyService.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty); + } + + + /** + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @param closedStatus 结案状态:已解决 resolved,未解决 unresolved + * @description 网格或者社区下: 已解决项目 + **/ + private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) { + return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus,ProjectConstant.CLOSED); + } + + /** + * @return int + * @param customerId 客户id + * @param gridId 网格id + * @param agencyId 社区的agencyId + * @description 网格或者社区下: 党员发布的话题总数 + **/ + private int getTopicTotal(String customerId, String gridId, String agencyId) { + return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, gridId, agencyId); + } + + /** + * @return int + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下 :话题总数 + **/ + private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) { + return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId); + } + + /** + * @return int + * @param customerId 客户id + * @param gridId 网格id + * @param agencyId 社区的agencyId + * @description 网格或者社区下: 党员发布的议题总数 + **/ + private int getParyPublishIssueTotal(String customerId, String gridId, String agencyId) { + return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, gridId, agencyId); + } + + /** + * @return int + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下 :议题总数 + **/ + private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) { + return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId); + } + + /** + * @return java.lang.Integer + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下: 议题转项目数 + **/ + private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { + return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); + } + +} 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..bdbb60d9d7 --- /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,287 @@ +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.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; +import com.epmet.dto.extract.result.GridUserCountResultDTO; +import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; +import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService; +import com.epmet.service.evaluationindex.screen.ScreenUserJoinService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.DimGridService; +import com.epmet.service.stats.FactIssueAgencyMonthlyService; +import com.epmet.service.stats.FactIssueGridMonthlyService; +import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService; +import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +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.*; +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; + @Autowired + private FactIssueAgencyMonthlyService factIssueAgencyMonthlyService; + @Autowired + private FactRegUserAgencyMonthlyService factRegUserAgencyMonthlyService; + @Autowired + private FactOriginIssueLogDailyService factOriginIssueLogDailyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Autowired + private ScreenUserJoinService screenUserJoinService; + + + /** + * desc: 【月】抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * 总参与:统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数 + * 百人人均议题:统计周期内总的议题数/(注册用户数/100) + * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与人数/应参与人数)的和)/被表决的议题数 来源 获取issue_vote_statistical_daily中 monthId的数据 + *

+ * 不考虑市北:人均议题:统计周期内议题总数/发过议题的人数 参与度:各个行为(表决)的总数/发生行为的人数 + * + * @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("抽取【公众参与-人均议题】,获取组织数据失败"); + return; + } + //构建组织数据 + Map insertMap = new HashMap<>(); + orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap)); + //获取议题月份增量 + List issueTotal = factIssueGridMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(issueTotal)) { + log.error("抽取【公众参与-人均议题】,获取议题增量为空"); + return; + } + List userCountList = factRegUserGridMonthlyService.selectGridUserCount(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(userCountList)) { + log.error("抽取【公众参与-人均议题】,获取注册用户数为空"); + return; + } + Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o)); + issueTotal.forEach(issue -> { + String gridId = issue.getGridId(); + ScreenUserJoinEntity entity = insertMap.get(gridId); + entity.setJoinTotal(issue.getIssueIncr()); + GridUserCountResultDTO user = userCountMap.get(gridId); + //百人人均议题:统计周期内总的议题数/(注册用户数/100) + log.debug("issue:{}", JSON.toJSONString(issue)); + log.debug("user:{}", JSON.toJSONString(user)); + if (!user.getRegTotal().equals(0)) { + BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal()) + .divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP); + entity.setAvgIssue(avgIssueCount); + } + }); + + + //获取该月 表决的人数 + List voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.GRID_ID); + Map gridMemberCount = new HashMap<>(); + if (!CollectionUtils.isEmpty(issueTotal)) { + //获取每个网格的应表决人数 + List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID); + if (CollectionUtils.isEmpty(memberCountList)) { + log.warn("抽取【公众参与-人均议题】,获取应表决人数为空"); + return; + } + gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); + } + + //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + + //遍历实际参与人数 + Map> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId)); + log.debug("平均参与度:实际参与人数:{}", JSON.toJSONString(voteMap)); + for (Map.Entry> entry : voteMap.entrySet()) { + String gridId = entry.getKey(); + ScreenUserJoinEntity entity = insertMap.get(gridId); + List issueList = entry.getValue(); + BigDecimal bigDecimal = new BigDecimal(0); + BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount()); + for (IssueVoteUserCountResultDTO vote : issueList) { + Integer memberCount = gridMemberCount.get(gridId); + log.debug("平均参与度:网格Id:{},实际投票人数:{},参与投票人数:{}", gridId, vote.getVoteCount(), memberCount); + if (memberCount == null) { + memberCount = 0; + } + if (memberCount != 0) { + bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0))); + } + } + if (votedByIssueCount.intValue() != 0) { + entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); + } + } + screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values())); + } + + private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) { + List orgList = dimAgencyService.getAgencyListByCustomerId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(orgList)) { + log.warn("抽取【公众参与-人均议题】,获取组织数据失败"); + return; + } + //构建组织数据 + Map insertMap = new HashMap<>(); + orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap)); + List issueTotal = factIssueAgencyMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); + + List userCountList = factRegUserAgencyMonthlyService.selectAgencyUserCount(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(issueTotal)) { + log.error("抽取【公众参与-人均议题】,获取注册用户数为空"); + return; + } + Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o)); + Set agencyIdSet = new HashSet<>(); + issueTotal.forEach(issue -> { + String agencyId = issue.getAgencyId(); + agencyIdSet.add(agencyId); + ScreenUserJoinEntity entity = insertMap.get(agencyId); + entity.setJoinTotal(issue.getIssueIncr()); + GridUserCountResultDTO user = userCountMap.get(agencyId); + //百人人均议题:统计周期内总的议题数/(注册用户数/100) + if (!user.getRegTotal().equals(0)) { + BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal()) + .divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP); + entity.setAvgIssue(avgIssueCount); + } + }); + + List> partition = ListUtils.partition(new ArrayList<>(agencyIdSet), NumConstant.THIRTY); + partition.forEach(list -> { + //获取该月 表决的人数 + List voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.AGENCY_ID); + Map orgMemberCount = new HashMap<>(); + if (!CollectionUtils.isEmpty(issueTotal)) { + //获取每个网格的应表决人数 + List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID); + if (CollectionUtils.isEmpty(memberCountList)) { + log.warn("抽取【公众参与-人均议题】,获取应表决人数为空"); + return; + } + orgMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); + } + + //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + + //遍历实际参与人数 + Map> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId)); + for (Map.Entry> entry : voteMap.entrySet()) { + String orgId = entry.getKey(); + ScreenUserJoinEntity entity = insertMap.get(orgId); + List issueList = entry.getValue(); + BigDecimal bigDecimal = new BigDecimal(0); + BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount()); + for (IssueVoteUserCountResultDTO vote : issueList) { + Integer memberCount = orgMemberCount.get(orgId); + if (memberCount == null) { + memberCount = 0; + } + bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0))); + } + if (votedByIssueCount.intValue() != 0) { + entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); + } + } + }); + screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values())); + } + + private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map result) { + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM)); + 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/PublicPartiTotalDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java new file mode 100644 index 0000000000..23d433b8b5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java @@ -0,0 +1,61 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.PublicPartiTotalDataExtractService; +import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService; +import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * screen_public_parti_total_data + * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 按天统计 + * @author yinzuomei@elink-cn.com + * @date 2020/9/27 11:09 + */ +@Slf4j +@Service +public class PublicPartiTotalDataExtractServiceImpl implements PublicPartiTotalDataExtractService { + @Autowired + private ScreenUserTotalDataService screenUserTotalDataService; + @Autowired + private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService; + @Autowired + private FactOriginIssueLogDailyService factOriginIssueLogDailyService; + + /** + * 按天统计 + * + * @param customerId 客户id + * @param dateId yyyyMMdd 这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd + * @return + */ + @Override + public void extractPublicPartiTotalData(String customerId, String dateId) { + List userTotalDataEntityList = screenUserTotalDataService.selectList(customerId); + if (CollectionUtils.isEmpty(userTotalDataEntityList)) { + log.warn("screen_user_total_data dosen't have any record customerId="+customerId); + return; + } + List list = new ArrayList<>(); + for (ScreenUserTotalDataEntity totalData : userTotalDataEntityList) { + ScreenPublicPartiTotalDataEntity entity = ConvertUtils.sourceToTarget(totalData,ScreenPublicPartiTotalDataEntity.class); + entity.setDataEndTime(dateId); + entity.setRegUserTotal(totalData.getUserTotal()); + //参与人数参与人数: 议题的表决行为的用户数去重的累计值 + int joinUserTotal=factOriginIssueLogDailyService.queryJoinUserTotal(customerId,totalData.getOrgType(),totalData.getOrgId()); + entity.setJoinUserTotal(joinUserTotal); + list.add(entity); + } + //先删除,后插入 + screenPublicPartiTotalDataService.delAndInsertBatch(customerId, list); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java new file mode 100644 index 0000000000..40d47d4f91 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java @@ -0,0 +1,50 @@ +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.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; +import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; +import com.epmet.service.stats.ScreenCentralZoneDataExtractService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @Description + * @ClassName ScreenCentralZoneDataAbsorptionServiceImpl + * @Auth wangc + * @Date 2020-09-24 10:42 + */ +@Service +@Slf4j +public class ScreenCentralZoneDataAbsorptionServiceImpl implements ScreenCentralZoneDataAbsorptionService { + + @Autowired + private ScreenCentralZoneDataExtractService screenCentralZoneDataExtractService; + @Autowired + private ScreenUserTotalDataService screenUserTotalDataService; + + /** + * @Description 中央区数据写入 + * @param param + * @return + * @author wangc + * @date 2020.09.24 10:41 + **/ + @Override + public void centralZoneDataHub(ScreenCentralZoneDataFormDTO param) { + if(StringUtils.isBlank(param.getDateId())){ + //默认前一天 + param.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + List dataList = screenCentralZoneDataExtractService.extractCentralZoneData(param.getCustomerId(),param.getDateId()); + + screenUserTotalDataService.dataClean(dataList,param.getCustomerId()); + } +} 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 new file mode 100644 index 0000000000..1ad6a429fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -0,0 +1,264 @@ +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.enums.EnvEnum; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.service.evaluationindex.extract.toscreen.*; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; +import com.epmet.service.stats.DimCustomerService; +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.time.LocalDate; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:57 上午 + */ +@Service +@Slf4j +public class ScreenExtractServiceImpl implements ScreenExtractService { + + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private PartyBaseInfoService partyBaseInfoService; + @Autowired + private PartyGuideService partyGuideService; + @Autowired + private PioneerDataExtractService pioneerDataExtractService; + @Autowired + private PublicPartExtractService publicPartExtractService; + @Autowired + private OrgRankExtractService orgRankExtractService; + @Autowired + private GovernRankDataExtractService governRankDataExtractService; + @Autowired + private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; + @Autowired + private IndexCalculateService indexCalculateService; + + @Autowired + private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; + @Autowired + private ScreenGrassrootsGovernDataAbsorptionService screenGrassrootsGovernDataAbsorptionService; + /** + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @Override + public void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) { + List customerIds = new ArrayList<>(); + 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)) { + customerIds.forEach(customerId -> { + if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) { + List daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate()); + daysBetween.forEach(dateId -> { + extractDaily(customerId, dateId); + }); + } else if (StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) { + extractDaily(customerId, extractOriginFormDTO.getDateId()); + } else { + String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); + extractDaily(customerId, dateId); + } + }); + } + + } + + @Override + public void extractMonthlyAll(ExtractScreenFormDTO formDTO) { + + List customerIds = new ArrayList<>(); + if (StringUtils.isNotBlank(formDTO.getCustomerId())) { + customerIds.add(formDTO.getCustomerId()); + } else { + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + } + if (!CollectionUtils.isEmpty(customerIds)) { + customerIds.forEach(customerId -> { + if (StringUtils.isNotBlank(formDTO.getStartMonth()) && StringUtils.isNotBlank(formDTO.getEndMonth())) { + List daysBetween = DateUtils.getMonthBetween(formDTO.getStartDate(), formDTO.getEndDate()); + daysBetween.forEach(monthId -> { + extractMonthly(customerId, monthId); + }); + } else if (StringUtils.isNotBlank(formDTO.getMonthId())) { + extractMonthly(customerId, formDTO.getMonthId()); + } else { + String monthId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-", "").substring(NumConstant.ZERO,NumConstant.SIX); + extractMonthly(customerId, monthId); + } + }); + } + + } + + /** + * @param customerId + * @param dateId + * @Description 按天计算 + * @author zxc + * @date 2020/9/24 10:16 上午 + */ + public void extractDaily(String customerId, String dateId) { + //党员基本情况screen_cpc_base_data + try { + partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId); + }catch (Exception e){ + log.error("党员基本情况抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + //先锋模范screen_pioneer_data + try { + pioneerDataExtractService.extractGridPioneerData(customerId, dateId); + }catch (Exception e){ + log.error("先锋模范【网格】抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + try { + pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); + }catch (Exception e){ + log.error("先锋模范【社区】抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + try { + pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); + }catch (Exception e){ + log.error("先锋模范【extractExceptCommunityPioneerData】抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + //公众参与排行(注册人数、参与人数、话题数、议题数、项目数)screen_public_party_total_data + try { + publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId,dateId); + }catch (Exception e){ + log.error("公众参与排行抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + + ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); + param.setCustomerId(customerId);param.setDateId(dateId); + //中央区 screen_user_total_data + try { + screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); + }catch (Exception e){ + log.error("中央区抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + //基层治理- 难点赌点 screen_difficulty_data | screen_difficulty_img_data + try { + screenGrassrootsGovernDataAbsorptionService.difficultyDataHub(param); + }catch (Exception e){ + log.error("基层治理-难点赌点抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + log.info("===== extractDaily method end ======"); + } + + /** + * @Description 按月计算 + * @author zxc + * @date 2020/9/24 10:16 上午 + */ + public void extractMonthly(String customerId, String monthId) { + ExtractScreenFormDTO formDTO = new ExtractScreenFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setMonthId(monthId); + + //基层治理-公众参与screen_user_join + try { + publicPartExtractService.extractTotalDataMonthly(formDTO); + }catch (Exception e){ + log.error("基层治理-公众参与抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + //治理能力排行screen_govern_rank_data + try { + governRankDataExtractService.extractGridData(customerId, monthId); + }catch (Exception e){ + log.error("治理能力排行【网格】抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + try { + governRankDataExtractService.extractCommunityData(customerId, monthId); + }catch (Exception e){ + log.error("治理能力排行【社区】抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + try { + governRankDataExtractService.extractStreetData(customerId, monthId); + }catch (Exception e){ + log.error("治理能力排行【街道】抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + try { + governRankDataExtractService.extractDistrictData(customerId, monthId); + }catch (Exception e){ + log.error("治理能力排行【全区】抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + //先进排行 screen_org_rank_data + try { + orgRankExtractService.extractGridData(customerId, monthId); + }catch (Exception e){ + log.error("先进排行【网格】抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + try { + orgRankExtractService.extractCommunityData(customerId, monthId); + }catch (Exception e){ + log.error("先进排行【社区】抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + try { + orgRankExtractService.extractStreetData(customerId, monthId); + }catch (Exception e){ + log.error("先进排行【街道】抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + try { + orgRankExtractService.extractDistrictData(customerId, monthId); + }catch (Exception e){ + log.error("先进排行【全区】抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + // 党建引领 screen_party_branch_data,screen_party_link_masses_data + try { + partyGuideService.partyGuideExtract(formDTO); + }catch (Exception e){ + log.error("党建引领抽取到大屏失败,参数为:"+ JSON.toJSONString(formDTO), e); + } + try { + //基层治理 - 热心市民 screen_party_user_rank_data + ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); + param.setCustomerId(customerId); + param.setDateId(monthId); + screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param); + }catch(Exception e){ + log.error("大屏热心市民/党员得分数据写入失败,参数为:{}",JSON.toJSONString(formDTO)); + } + //此方法保持在最后即可 计算指标分数 todo 优化 手动创建线程池 控制任务数量 + ExecutorService pool = Executors.newSingleThreadExecutor(); + pool.submit(() -> { + long start = System.currentTimeMillis(); + CalculateCommonFormDTO formDTO1 = new CalculateCommonFormDTO(); + try { + formDTO1.setMonthId(monthId); + formDTO1.setCustomerId(customerId); + Boolean aBoolean = indexCalculateService.indexCalculate(formDTO1); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); + } catch (Exception e) { + log.error("extractMonthly 计算分数异常,参数:{}", JSON.toJSONString(formDTO1)); + } + }); + log.info("===== extractMonthly method end ======"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java new file mode 100644 index 0000000000..013838a959 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -0,0 +1,173 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.org.GridInfoDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService; +import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; +import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService; +import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; +import com.epmet.service.org.CustomerGridService; +import com.epmet.service.point.UserPointService; +import com.epmet.service.project.ProjectProcessService; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + + +/** + * @Description 基层治理数据 + * @ClassName ScreenGrassrootsGovernDataAbsorptionServiceImpl + * @Auth wangc + * @Date 2020-09-25 09:48 + */ + +@Service +@Slf4j +public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGrassrootsGovernDataAbsorptionService { + + @Autowired + private UserService userService; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private UserPointService userPointService; + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; + @Autowired + private ScreenPartyUserRankDataService screenPartyUserRankDataService; + @Autowired + private ScreenDifficultyDataService screenDifficultyDataService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private ProjectProcessService projectProcessService; + @Autowired + private TopicService topicService; + /** + * @Description 用户积分、党员分值数据中转站 + * @param param + * @return + * @author wangc + * @date 2020.09.25 09:53 + **/ + @Override + public void userScoreDataHub(ScreenCentralZoneDataFormDTO param) { + //1.查询出客户下的网格注册用户 + List registeredUsers = userService.getRegisteredUserList(param.getCustomerId()); + + //2.查询出客户下网格的相关信息 + List gridList = customerGridService.queryGridInfoList(param.getCustomerId()); + Map gridMap = new HashMap<>(); + gridList.forEach(grid -> {gridMap.put(grid.getGridId(),grid);}); + + //3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分) + Map pointMap = userPointService.getUserPointMap(param.getCustomerId()); + //4.查询出客户下党员的分值 + String dateId = param.getDateId(); + if(StringUtils.isEmpty(dateId)){ + //如果没有传月份,则使用当前时间的上一个月 + dateId = DateUtils.getBeforeNMonth(NumConstant.ONE); + }else{ + String dateType = DateUtils.identifyTimeDimension(dateId); + if(StringUtils.isEmpty(dateType) || !org.apache.commons.lang3.StringUtils.equalsAny(dateType,"date","month")){ + dateId = DateUtils.getBeforeNMonth(NumConstant.ONE); + }else if(org.apache.commons.lang3.StringUtils.equals(dateType,"date")){ + dateId = dateId.substring(NumConstant.ZERO,dateId.length() - NumConstant.TWO); + } + } + final String finalDateId = dateId; + + Map scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId); + + //5.整合数据 + if(!CollectionUtils.isEmpty(registeredUsers)){ + registeredUsers.forEach(user -> { + GridInfoDTO gridInfo = gridMap.get(user.getGridId()); + if(null != gridInfo){ + user.setGridName(gridInfo.getGridName()); + user.setOrgId(gridInfo.getAgencyId()); + user.setOrgName(gridInfo.getOrgName()); + //原始数据Pid使用英文:隔开,大屏数据要求按照英文,隔开 + user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON,StrConstant.COMMA)); + } + Integer point = pointMap.get(user.getUserId()); + BigDecimal score = scoreMap.get(user.getUserId()); + + user.setPointTotal(null == point ? NumConstant.ZERO : point); + user.setIndexScore(null == score ? new BigDecimal(NumConstant.ZERO) : score); + + user.setDataEndTime(finalDateId); + }); + + } + + //6.存入数据库 + //不按照时间删除,每次插入之前将该客户下的所有历史数据清空 + screenPartyUserRankDataService.dataClean(registeredUsers,param.getCustomerId()); + } + + /** + * @Description 难点赌点数据中转站 + * @param param + * @return + * @author wangc + * @date 2020.09.25 10:00 + **/ + @Override + public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { + //验证是否存在 + DifficultyIfExistedResultDTO existedMap = screenDifficultyDataService.selectExistedInfo(param.getCustomerId()); + //查询数据 + List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),existedMap.getClosedIds()); + if(CollectionUtils.isEmpty(difficulties)) return; + List projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); + //最近一次操作 + Map latestOperationMap = projectProcessService.selectLatestOperation(projectIds,param.getCustomerId()); + boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false; + //图片 + List projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); + + Map> imgMap = + topicService.getTopicImgs(projectSourceMap); + boolean isImgNull = CollectionUtils.isEmpty(imgMap) ? true : false; + Map contentMap = topicService.getTopicContent(projectSourceMap); + boolean isContentNull = CollectionUtils.isEmpty(contentMap) ? true : false; + difficulties.forEach( diff -> { + if(!isImgNull) { + List figureList = imgMap.get(diff.getEventId()); + diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl()); + } + if(!isContentNull) { + diff.setEventContent(contentMap.get(diff.getEventId())); + } + if(!isOperationNull){ + diff.setLatestOperateDesc(latestOperationMap.get(diff.getEventId())); + } + diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE)); + }); + List imgList = new LinkedList<>(); + imgMap.values().forEach(list -> {imgList.addAll(list);}); + + screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java index 3cd66eccf5..29acca93a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java @@ -2,6 +2,9 @@ package com.epmet.service.evaluationindex.indexcal; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import java.math.BigDecimal; +import java.util.Map; + /** * 党员指标计算service * @@ -15,4 +18,14 @@ public interface CpcIndexCalculateService { * @return */ Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO); + + /** + * @Description 获取党员指标得分 + * @param customerId + * @param monthId + * @return + * @author wangc + * @date 2020.09.25 16:48 + **/ + Map getCpcScore(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 71359d8b32..b2e0158aa4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; import com.epmet.dao.evaluationindex.indexcal.CpcSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CpcScoreResultDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; @@ -66,6 +67,24 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { return true; } + /** + * @Description 获取党员指标得分 + * @param customerId + * @param monthId + * @return + * @author wangc + * @date 2020.09.25 16:48 + **/ + @Override + public Map getCpcScore(String customerId, String monthId) { + List scores = cpcScoreDao.selectCpcScore(customerId,monthId); + Map map = new HashMap<>(); + if(!CollectionUtils.isEmpty(scores)){ + scores.forEach(score -> {map.put(score.getUserId(),score.getScore());}); + } + return map; + } + /** * desc: 计算总分 * @@ -184,13 +203,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { //计算最大最小值 Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { - log.error("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); - throw new RenException("指标原始数据记录不存在"); + log.warn("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); + return; } //指标集合 Map> groupIndexDetailsMap = getIndexDetailMap(formDTO); if (groupIndexDetailsMap == null) { - log.error("calculatePartScore"); + log.error("calculatePartScore groupIndexDetailsMap is empty"); return; } @@ -314,6 +333,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { child.setAllParentIndexCode(o.getAllParentIndexCode()); child.setScore(o.getScore()); child.setWeight(o.getWeight()); + child.setOriginValue(o.getOriginValue()); subList.add(child); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 6266d20651..00ebad6b5d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -26,14 +26,18 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcal.DeptSelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.DeotScore; import com.epmet.dto.indexcal.DeptScoreDetailDTO; import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; @@ -59,10 +63,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -91,6 +92,10 @@ public class DeptScoreServiceImpl extends BaseServiceImpl indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + indexList.forEach(index -> { + String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); + //获取出指标之间的关系 + List selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(selfSubIndexList)) { + log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId()); + return; + } + //获取该能力下的分数 + List subScore = deptSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + if (CollectionUtils.isEmpty(subScore)) { + log.warn("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); + return; + } + Map> selfSubParentMap = new HashMap<>(); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); + Map weightMap = new HashMap<>(); + selfSubIndexList.forEach(o -> { + //找出自身 和下级的指标 + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); + weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); + } else { + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); + weightMap.put(ProjectConstant.ZI_SHEN, weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0)).add(o.getWeight())); + } + }); + Map insertMap = new HashMap<>(); + subScore.forEach(score -> { + String key = score.getAgencyId().concat(index.getIndexCode()); + DeptSelfSubScoreEntity scoreEntity = insertMap.get(key); + if (scoreEntity == null) { + scoreEntity = ConvertUtils.sourceToTarget(score, DeptSelfSubScoreEntity.class); + insertMap.put(key, scoreEntity); + scoreEntity.setSelfScore(new BigDecimal(0)); + scoreEntity.setSubScore(new BigDecimal(0)); + scoreEntity.setParentIndexCode(index.getIndexCode()); + scoreEntity.setSelfWeight(weightMap.getOrDefault(score.getIndexCode(), new BigDecimal(0))); + scoreEntity.setSubWeight(weightMap.getOrDefault(score.getIndexCode(), new BigDecimal(0))); + } + BigDecimal partScore = score.getScore().multiply(score.getWeight()); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { + scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); + scoreEntity.setSelfWeight(weightMap.get(ProjectConstant.XIA_JI)); + } else { + scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); + scoreEntity.setSelfWeight(weightMap.get(ProjectConstant.ZI_SHEN)); + } + log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore); + }); + deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap); + }); + } + + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { + int effectRow = 0; + do { + deptSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + } while (effectRow > 0); + + deptSelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); + } + /** - * @return void * @param formDTO + * @return void * @author yinzuomei * @description 区直部门-党建能力分值计算 - * @Date 2020/9/10 17:21 + * @Date 2020/9/10 17:21 **/ private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) { //获取区直部门的治理能力下,五级指标权重 @@ -322,6 +402,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + indexList.forEach(index -> { + String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); + //获取出指标之间的关系 + List selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(selfSubIndexList)) { + log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId()); + return; + } + //获取该能力下的分数 + List subScore = gridSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + if (CollectionUtils.isEmpty(subScore)) { + log.warn("calculateSelfSubScore gridSubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); + return; + } + Map> selfSubParentMap = new HashMap<>(); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); + Map weightMap = new HashMap<>(); + selfSubIndexList.forEach(o -> { + //找出自身 和下级的指标 + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); + weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); + } else { + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); + weightMap.put(ProjectConstant.ZI_SHEN, weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0)).add(o.getWeight())); + } + }); + Map insertMap = new HashMap<>(); + subScore.forEach(score -> { + + String key = score.getGridId().concat(index.getIndexCode()); + GridSelfSubScoreEntity scoreEntity = insertMap.get(key); + if (scoreEntity == null) { + scoreEntity = ConvertUtils.sourceToTarget(score, GridSelfSubScoreEntity.class); + insertMap.put(key, scoreEntity); + scoreEntity.setSelfScore(new BigDecimal(0)); + scoreEntity.setSubScore(new BigDecimal(0)); + scoreEntity.setParentIndexCode(index.getIndexCode()); + scoreEntity.setSubWeight(weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0))); + scoreEntity.setSelfWeight(weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0))); + } + BigDecimal partScore = score.getScore().multiply(score.getWeight()); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { + scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); + } else { + scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); + } + log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getGridId(), score.getScore(), score.getWeight(), partScore); + }); + deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap); + }); + } + + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { + int effectRow = 0; + do { + effectRow = gridSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + } while (effectRow > 0); + + gridSelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); + } + /** * @param formDTO * @return void @@ -376,6 +459,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { gridSubScoreEntity.setAllParentIndexCode(detail.getAllParentIndexCode()); gridSubScoreEntity.setScore(detail.getScore()); gridSubScoreEntity.setWeight(detail.getWeight()); + gridSubScoreEntity.setOriginValue(detail.getOriginValue()); gridSubScoreList.add(gridSubScoreEntity); } }); @@ -417,7 +501,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { log.info("计算的结果(List)"+JSON.toJSONString(listTemp));*/ HashMap resultMap = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); - log.info("计算的结果{}", resultMap); + log.info("计算的结果{}", JSON.toJSONString(resultMap)); return resultMap; } @@ -458,7 +542,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { minValue = contactMassesAblityMap.get(StrConstant.MIN); maxValue = contactMassesAblityMap.get(StrConstant.MAX); } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())) { -// log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); +// log.info("组织内党员的参与议事能力考评分平均值) 单独处理"); Map joinIssueAblityMap = this.getJoinIssueAblityMap(formDTO); minValue = joinIssueAblityMap.get(StrConstant.MIN); maxValue = joinIssueAblityMap.get(StrConstant.MAX); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index d7777dd540..fa0fc396b3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -6,19 +6,26 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; 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.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; +import com.epmet.dao.evaluationindex.indexcal.CommunitySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySubScoreDao; import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CommunityCalResultDTO; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.dto.screen.result.SubGridAvgResultDTO; +import com.epmet.entity.evaluationindex.indexcal.CommunitySelfSubScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; @@ -68,6 +75,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni private GridScoreDao factIndexGridScoreDao; @Autowired private CommunitySubScoreDao communitySubScoreDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + @Autowired + private CommunitySelfSubScoreDao communitySelfSubScoreDao; /** * @param customerId @@ -76,6 +87,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/1 4:12 下午 */ + @Override public Boolean calCommunityAll(String customerId, String monthId) { Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 if (!aBoolean.equals(true)) { @@ -93,9 +105,86 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (!dBoolean.equals(true)) { throw new RenException("calculate community-all insert failure ......"); } + //计算自身和下级 + CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); + formDTO.setMonthId(monthId); + formDTO.setCustomerId(customerId); + calculateSelfSubScore(formDTO); return true; } + private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) { + //todo 指标添加缓存 + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + indexList.forEach(index -> { + String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); + //获取出指标之间的关系 + List selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(selfSubIndexList)) { + log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId()); + return; + } + //获取该能力下的分数 + List subScore = communitySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + if (CollectionUtils.isEmpty(subScore)) { + log.warn("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); + return; + } + Map> selfSubParentMap = new HashMap<>(); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); + Map weightMap = new HashMap<>(); + selfSubIndexList.forEach(o -> { + //找出自身 和下级的指标 + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); + weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); + } else { + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); + weightMap.put(ProjectConstant.ZI_SHEN, weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0)).add(o.getWeight())); + } + }); + Map insertMap = new HashMap<>(); + subScore.forEach(score -> { + String key = score.getAgencyId().concat(index.getIndexCode()); + CommunitySelfSubScoreEntity scoreEntity = insertMap.get(key); + if (scoreEntity == null) { + scoreEntity = ConvertUtils.sourceToTarget(score, CommunitySelfSubScoreEntity.class); + insertMap.put(key, scoreEntity); + scoreEntity.setSelfScore(new BigDecimal(0)); + scoreEntity.setSubScore(new BigDecimal(0)); + scoreEntity.setParentIndexCode(index.getIndexCode()); + scoreEntity.setSubWeight(weightMap.get(ProjectConstant.XIA_JI)); + scoreEntity.setSelfWeight(weightMap.get(ProjectConstant.ZI_SHEN)); + } + BigDecimal partScore = score.getScore().multiply(score.getWeight()); + + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { + scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); + } else { + scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); + } + log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore); + }); + deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap); + }); + } + + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { + int effectRow = 0; + do { + effectRow = communitySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + } while (effectRow > 0); + + communitySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); + } + /** * @param customerId * @Description 社区名义发文数量计算【党建能力】 @@ -108,7 +197,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -117,7 +206,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { - log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); + log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL); } else { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); @@ -137,27 +226,28 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni // 社区名义发文数量 List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(publishArticleCountList)) { - log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); - } - String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); - if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); - return; + log.warn(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); } else { - List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); - publishArticleList.forEach(publish -> { - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); - SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); - index1SampleValues.add(s); + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); - indexInputVOS.add(index1VO); - }); + } } } }); @@ -182,7 +272,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -190,7 +280,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridGovernAvg)){ - log.error("社区下级治理能力平均分集合为空"); + log.warn("社区下级治理能力平均分集合为空"); }else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); @@ -210,7 +300,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni // 治理能力的六个五级指标 List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(communityGovernAbility)){ - log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); + log.warn(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -254,7 +344,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -263,7 +353,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridServiceAvg)) { - log.error("查询社区下级所有网格服务能力得分平均值集合为空"); + log.warn("查询社区下级所有网格服务能力得分平均值集合为空"); } else { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); @@ -282,7 +372,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } else { List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { - log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); + log.warn(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -364,11 +454,13 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @date 2020/8/27 1:30 下午 */ public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { - BigDecimal max = Collections.max(list); - BigDecimal min = Collections.min(list); MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); - result.setMax(max); - result.setMin(min); + if(!CollectionUtils.isEmpty(list)) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + result.setMax(max); + result.setMin(min); + } return result; } @@ -458,6 +550,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni s.setScore(fiveDetail.getScore()); s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode()); s.setWeight(fiveDetail.getWeight()); + s.setOriginValue(fiveDetail.getOriginValue()); pid.forEach((agency, parentAgency) -> { if (k.equals(agency)) { s.setParentAgencyId(parentAgency); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 0309f40eda..5b18396a66 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -6,18 +6,26 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; 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.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyCalResultDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.IndexCalculateDistrictService; @@ -65,11 +73,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private ScreenCustomerAgencyDao customerAgencyDao; @Autowired private AgencySubScoreDao agencySubScoreDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + @Autowired + private AgencySelfSubScoreDao agencySelfSubScoreDao; /** - * @Description 计算全区相关总分 * @param customerId * @param monthId + * @Description 计算全区相关总分 * @author zxc * @date 2020/9/2 3:12 下午 */ @@ -91,9 +103,85 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (!dBoolean.equals(true)) { throw new RenException("calculate district-all insert failure ......"); } + //计算自身和下级 + CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); + formDTO.setMonthId(monthId); + formDTO.setCustomerId(customerId); + calculateSelfSubScore(formDTO); return true; } + private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) { + //todo 指标添加缓存 + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + indexList.forEach(index -> { + String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); + //获取出指标之间的关系 + List selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(selfSubIndexList)) { + log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId()); + return; + } + //获取该能力下的分数 + List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DISTRICT, levelIndexPath); + if (CollectionUtils.isEmpty(subScore)) { + log.warn("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); + return; + } + Map> selfSubParentMap = new HashMap<>(); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); + Map weightMap = new HashMap<>(); + selfSubIndexList.forEach(o -> { + //找出自身 和下级的指标 + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); + weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); + } else { + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); + weightMap.put(ProjectConstant.ZI_SHEN, weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0)).add(o.getWeight())); + } + }); + Map insertMap = new HashMap<>(); + subScore.forEach(score -> { + String key = score.getAgencyId().concat(index.getIndexCode()); + AgencySelfSubScoreEntity scoreEntity = insertMap.get(key); + if (scoreEntity == null) { + scoreEntity = ConvertUtils.sourceToTarget(score, AgencySelfSubScoreEntity.class); + insertMap.put(key, scoreEntity); + scoreEntity.setSelfScore(new BigDecimal(0)); + scoreEntity.setSubScore(new BigDecimal(0)); + scoreEntity.setParentIndexCode(index.getIndexCode()); + scoreEntity.setSubWeight(weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0))); + scoreEntity.setSelfWeight(weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0))); + } + BigDecimal partScore = score.getScore().multiply(score.getWeight()); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { + scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); + } else { + scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); + } + log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore); + }); + deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap); + }); + } + + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { + int effectRow = 0; + do { + effectRow = agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DISTRICT, indexCode); + } while (effectRow > 0); + + agencySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); + } + /** * @param customerId * @Description 全区名义发文数量计算【党建能力】 @@ -106,7 +194,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(indexDetailList)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -115,16 +203,18 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { - log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); + log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); - SampleValue s = new SampleValue(c.getParentId(), c.getScore()); - index1SampleValues.add(s); + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); + } }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); @@ -135,27 +225,28 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict // 区名义发文数量 List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); if (CollectionUtils.isEmpty(publishArticleCountList)) { - log.error(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); - } - String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); - if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); - return; - } else{ - List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); - publishArticleList.forEach(publish -> { - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); - SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); - index1SampleValues.add(s); + log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); - indexInputVOS.add(index1VO); - }); + } } } }); @@ -180,24 +271,31 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + for (int i = 0; i < districtGovernAvgList.size(); i++) { + if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + districtGovernAvgList.remove(districtGovernAvgList.get(i)); + } + } if (CollectionUtils.isEmpty(districtGovernAvgList)) { - log.error("查询所有街道治理能力平均值集合为空"); + log.warn("查询所有街道治理能力平均值集合为空"); } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); - SampleValue s = new SampleValue(c.getParentId(), c.getScore()); - index1SampleValues.add(s); + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); + } }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); @@ -206,8 +304,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + for (int i = 0; i < deptScoreAvgList.size(); i++) { + if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + deptScoreAvgList.remove(deptScoreAvgList.get(i)); + } + } if (CollectionUtils.isEmpty(deptScoreAvgList)) { - log.error("查询所有直属部门治理能力平均值集合为空"); + log.warn("查询所有直属部门治理能力平均值集合为空"); } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); @@ -247,7 +350,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -255,8 +358,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + for (int i = 0; i < subStreetAvgList.size(); i++) { + if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + subStreetAvgList.remove(subStreetAvgList.get(i)); + } + } if (CollectionUtils.isEmpty(subStreetAvgList)) { - log.error("查询区下属街道服务能力汇总平均值集合为空"); + log.warn("查询区下属街道服务能力汇总平均值集合为空"); } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); @@ -264,9 +372,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); - SampleValue s = new SampleValue(c.getParentId(), c.getScore()); - index1SampleValues.add(s); + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); + } }); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); @@ -435,6 +545,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); s.setDataType(IndexCalConstant.DISTRICT_LEVEL); s.setWeight(streetScore.getWeight()); + s.setOriginValue(streetScore.getOriginValue()); pid.forEach((agency, parentAgency) -> { //todo 确认 if (k != null && k.equals(agency)) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index a2703968ec..753dc70726 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -91,9 +91,10 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private Boolean calulateCustomerIndexScore(CalculateCommonFormDTO formDTO) { try { String customerId = formDTO.getCustomerId(); - Boolean flag; + Boolean insertFlag = true; long start = System.currentTimeMillis(); try { + Boolean flag = false; //校验是否含有组织数据 int agencyCount = screenCustomerAgencyDao.selectCountByCustomerId(formDTO.getCustomerId()); if (agencyCount < 1) { @@ -107,7 +108,6 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { log.info("客户Id:{}【党员相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate cpcIndexCalculate exception", e); - throw new RenException("indexCalculate cpcIndexCalculate exception", e); } //测试用 @@ -118,7 +118,6 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calculateGridCorreLation exception", e); - throw new RenException("indexCalculate calculateGridCorreLation exception", e); } //计算社区 start = System.currentTimeMillis(); @@ -127,7 +126,6 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calCommunityAll exception", e); - throw new RenException("indexCalculate calAll exception", e); } //计算街道 @@ -137,7 +135,6 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { log.info("客户Id:{}【街道相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calStreetAll exception", e); - throw new RenException("indexCalculate calStreetAll exception", e); } //计算区直属 @@ -147,34 +144,33 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { log.info("客户Id:{}【区直部门】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calculateDeptCorreLation exception", e); - throw new RenException("indexCalculate calculateDeptCorreLation exception", e); } //计算全区 start = System.currentTimeMillis(); try { - indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); + flag = indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); log.info("客户Id:{}【全区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calDistrictAll exception", e); - throw new RenException("indexCalculate calDistrictAll exception", e); } } catch (RenException e) { - flag = false; + insertFlag = false; } - //计算完毕后 将结果插入大屏相关数据表 - if (flag) { + //计算完毕后 将结果插入大屏相关数据表 计算当月的数据时 及时有错也插入 + String currentMonthId = DimIdGenerator.getMonthDimId(new Date()); + if (insertFlag || currentMonthId.equals(formDTO.getMonthId())) { start = System.currentTimeMillis(); try { factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId()); log.info("客户Id:{}分数插入到大屏显示库完毕,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000); } catch (Exception e) { log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e); - flag = false; + insertFlag = false; } } - return flag; + return insertFlag; } catch (Exception e) { log.error("calulateCustomerIndexScore exception", e); } finally { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 5a4b2a8dcd..4669ae0cda 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -6,19 +6,27 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; 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.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dto.indexcal.AgencyCalResultDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.IndexCalculateStreetService; @@ -68,11 +76,15 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ private AgencyScoreDao agencyScoreDao; @Autowired private AgencySubScoreDao agencySubScoreDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + @Autowired + private AgencySelfSubScoreDao agencySelfSubScoreDao; /** - * @Description 计算街道相关总分 * @param customerId * @param monthId + * @Description 计算街道相关总分 * @author zxc * @date 2020/9/2 3:12 下午 */ @@ -94,9 +106,86 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (!dBoolean.equals(true)) { throw new RenException("calculate street-all insert failure ......"); } + //计算自身和下级 + CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); + formDTO.setMonthId(monthId); + formDTO.setCustomerId(customerId); + calculateSelfSubScore(formDTO); return true; } + private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) { + //todo 指标添加缓存 + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + indexList.forEach(index -> { + String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); + //获取出指标之间的关系 + List selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(selfSubIndexList)) { + log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId()); + return; + } + //获取该能力下的分数 + List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.STREET, levelIndexPath); + if (CollectionUtils.isEmpty(subScore)) { + log.warn("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); + return; + } + Map> selfSubParentMap = new HashMap<>(); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); + Map weightMap = new HashMap<>(); + selfSubIndexList.forEach(o -> { + //找出自身 和下级的指标 + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); + weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); + } else { + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); + weightMap.put(ProjectConstant.ZI_SHEN, weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0)).add(o.getWeight())); + } + + }); + Map insertMap = new HashMap<>(); + subScore.forEach(score -> { + String key = score.getAgencyId().concat(index.getIndexCode()); + AgencySelfSubScoreEntity scoreEntity = insertMap.get(key); + if (scoreEntity == null) { + scoreEntity = ConvertUtils.sourceToTarget(score, AgencySelfSubScoreEntity.class); + insertMap.put(key, scoreEntity); + scoreEntity.setSelfScore(new BigDecimal(0)); + scoreEntity.setSubScore(new BigDecimal(0)); + scoreEntity.setParentIndexCode(index.getIndexCode()); + scoreEntity.setSubWeight(weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0))); + scoreEntity.setSelfWeight(weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0))); + } + BigDecimal partScore = score.getScore().multiply(score.getWeight()); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { + scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); + } else { + scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); + } + log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore); + }); + deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap); + }); + } + + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { + int effectRow = 0; + do { + effectRow = agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.STREET, indexCode); + } while (effectRow > 0); + + agencySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); + } + /** * @param customerId * @Description 社区名义发文数量计算【党建能力】 @@ -109,7 +198,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -118,7 +207,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { - log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); + log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; @@ -139,26 +228,27 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ // 街道名义发文数量 List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(mapList)) { - log.error(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); - } - String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); - if (StringUtils.isEmpty(fieldName)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); - return; - }else{ - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); - List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); - publishArticleList.forEach(publish -> { - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); - SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); - index1SampleValues.add(s); + log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldName)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); + List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); - indexInputVOS.add(index1VO); - }); + } } } }); @@ -183,7 +273,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -191,7 +281,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridGovernAvg)){ - log.error("查询街道下属所有社区治理能力汇总为空"); + log.warn("查询街道下属所有社区治理能力汇总为空"); }else if (subGridGovernAvg.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); @@ -211,7 +301,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ // 治理能力的六个五级指标 List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(communityGovernAbility)){ - log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); + log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -255,7 +345,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -264,7 +354,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subCommServiceAvg)) { - log.error("查询街道下属社区服务能力得分平均值为空"); + log.warn("查询街道下属社区服务能力得分平均值为空"); } else if (subCommServiceAvg.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE); @@ -283,7 +373,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } else { List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { - log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); + log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -463,6 +553,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ s.setDataType(IndexCalConstant.STREET_LEVEL); s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); s.setWeight(streetScore.getWeight()); + s.setOriginValue(streetScore.getOriginValue()); pid.forEach((agency, parentAgency) -> { if (k.equals(agency)) { s.setParentAgencyId(parentAgency); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyService.java new file mode 100644 index 0000000000..d2d25c7a6f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyService.java @@ -0,0 +1,32 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/21 15:24 + */ +public interface FactIndexGovrnAblityDeptMonthlyService extends BaseService { + /** + * 根据客户清空数据 + * @author zhaoqifeng + * @date 2020/9/20 20:33 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomer(String customerId, String monthId); + + /** + * 批量插入 + * @author zhaoqifeng + * @date 2020/9/21 17:08 + * @param list + * @return void + */ + void saveList(List list); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java new file mode 100644 index 0000000000..8010a566d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java @@ -0,0 +1,24 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:34 + */ +public interface FactIndexGovrnAblityGridMonthlyService extends BaseService { + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + List getGridByCustomer(String customerId, String monthId); +} 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 new file mode 100644 index 0000000000..4c38049785 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java @@ -0,0 +1,63 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 20:29 + */ +public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService { + /** + * 根据客户清空数据 + * @author zhaoqifeng + * @date 2020/9/20 20:33 + * @param customerId + * @param monthId + * @param type + * @return void + */ + void deleteByCustomer(String customerId, String monthId, String type); + + /** + * @Description 批量插入治理能力 + * @param lists + * @author zxc + * @date 2020/9/19 4:28 下午 + */ + void insertGovernAbilityRecord(@Param("lists") List lists); + + /** + * @Description 删除治理能力旧纪录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:31 下午 + */ + Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId); + + /** + * 批量插入 + * @author zhaoqifeng + * @date 2020/9/21 17:08 + * @param list + * @return void + */ + void saveList(List 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/FactIndexPartyAblityCpcMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java new file mode 100644 index 0000000000..5614ff29a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; + +import java.util.List; + + +/** + * 党建能力-党员相关的事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +public interface FactIndexPartyAblityCpcMonthlyService extends BaseService { + /** + * @return void + * @param customerId + * @param monthId + * @param indexPartyAblityCpcList + * @author yinzuomei + * @description 先删后增 + * @Date 2020/9/22 16:30 + **/ + void delAndSavePartyAblityCpcMonthly(String customerId, String monthId, List indexPartyAblityCpcList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java new file mode 100644 index 0000000000..9abeed8617 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java @@ -0,0 +1,51 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 23:00 + */ +public interface FactIndexPartyAblityOrgMonthlyService extends BaseService { + /** + * 根据客户清空数据 + * @author zhaoqifeng + * @date 2020/9/20 20:33 + * @param customerId + * @param monthId + * @param type + * @return void + */ + void deleteByCustomer(String customerId, String monthId, String type); + + /** + * @Description 网格党建能力插入 + * @param lists + * @author zxc + * @date 2020/9/19 10:32 上午 + */ + void insertPartyAbility(List lists); + + /** + * @Description 删除旧的党建能力记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 10:45 上午 + */ + Integer deleteOldPartyAbility(String customerId,String monthId); + + /** + * 批量插入 + * @author zhaoqifeng + * @date 2020/9/21 17:08 + * @param list + * @return void + */ + void saveList(List list); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java new file mode 100644 index 0000000000..3249c1a7eb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.indexcoll; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; + +import java.util.List; + + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +public interface FactIndexServiceAblityGridMonthlyService extends BaseService { + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询出所有的网格,初始化好 服务能力-网格相关事实表 各个指标值赋值为0 + * @Date 2020/9/21 9:38 + **/ + List initAllGridList(String customerId); + + /** + * @return void + * @param customerId + * @param monthId + * @param entityList + * @author yinzuomei + * @description 先删后增 + * @Date 2020/9/22 16:45 + **/ + void delAndSaveServiceAbilityGridMonthly(String customerId, String monthId, 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/indexcoll/FactIndexServiceAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyService.java new file mode 100644 index 0000000000..77c375fd83 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyService.java @@ -0,0 +1,33 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/30 16:39 + */ +public interface FactIndexServiceAblityOrgMonthlyService extends BaseService { + /** + * 根据客户清空数据 + * @author zhaoqifeng + * @date 2020/9/20 20:33 + * @param customerId + * @param monthId + * @param type + * @return void + */ + void deleteByCustomer(String customerId, String monthId, String type); + + /** + * 批量插入 + * @author zhaoqifeng + * @date 2020/9/21 17:08 + * @param list + * @return void + */ + void saveList(List list); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index ade95f1c5d..83ad985174 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -2,6 +2,8 @@ package com.epmet.service.evaluationindex.indexcoll.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; @@ -23,16 +25,23 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; 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.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -43,6 +52,7 @@ import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexCollectServiceImpl implements FactIndexCollectService { + Cache allParentIds = CacheBuilder.newBuilder().expireAfterWrite(2, TimeUnit.HOURS).build(); @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @@ -78,6 +88,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { private ScreenCustomerDeptDao screenCustomerDeptDao; @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private RedissonClient redissonClient; @Override @Transactional(rollbackFor = Exception.class) @@ -192,33 +204,60 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } + /** + * @Description 目前只支持到区县级别,区县级以上的未实现 + * @Param monthId + * @Param customerId + * @author zxc + * @date 2020/10/20 2:59 下午 + */ @Override - @Transactional(rollbackFor = Exception.class) public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { - if (NumConstant.SIX != monthId.length()){ + if (NumConstant.SIX != monthId.length()) { throw new RuntimeException("入参monthId格式不正确:monthId =" + monthId); } - // 根据网格类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.GRID); - // 开始处理 网格相关分值表 - this.startHandleIndexGridScore(monthId, customerId); - - // 根据组织类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.AGENCY); - // 开始处理 社区相关分值表 - this.startHandleIndexCommunityScore(monthId, customerId); - - // 根据部门类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.DEPARTMENT); - // 开始处理 区直部门分值表 - this.startHandleIndexDeptScore(monthId, customerId); - - // 同样是 组织类型,所以不再重复删除了 - // 开始处理 区/街道相关分数表 - this.startHandleIndexAgencyScore(monthId, customerId); - - // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly - this.insertIndexDataYear(monthId, customerId); + RLock lock = redissonClient.getLock(RedisKeys.getScreenIndexDataLockKey()); + try { + AtomicInteger tryTimes = new AtomicInteger(0); + boolean lockFlag = false; + do { + lockFlag = lock.tryLock(1, 10, TimeUnit.MINUTES); + } while (!lockFlag && tryTimes.addAndGet(1) < 3); + if (!lockFlag) { + log.error("插入大屏指数方法获取锁失败"); + return; + } + allParentIds.cleanUp(); + // 根据网格类型,删除 指数-指数数据(每月数值)表中 匹配的数据 + this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.GRID); + // 开始处理 网格相关分值表 + this.startHandleIndexGridScore(monthId, customerId); + + // 根据组织类型,删除 指数-指数数据(每月数值)表中 匹配的数据 + this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.AGENCY); + // 开始处理 社区相关分值表 + this.startHandleIndexCommunityScore(monthId, customerId); + + // 根据部门类型,删除 指数-指数数据(每月数值)表中 匹配的数据 + this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.DEPARTMENT); + // 开始处理 区直部门分值表 + this.startHandleIndexDeptScore(monthId, customerId); + + // 同样是 组织类型,所以不再重复删除了 + // 开始处理 区/街道相关分数表 + this.startHandleIndexAgencyScore(monthId, customerId); + + // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly + this.insertIndexDataYear(monthId, customerId); + allParentIds.invalidateAll(); + } catch (InterruptedException inter) { + log.error("插入计算指标数据异常", inter); + } finally { + //判断是否是当前线程 持有锁 + if (lock.isHeldByCurrentThread()) { + lock.unlock(); + } + } } /** @@ -283,6 +322,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScoreDTOS.get(i).getGridId(), gridScoreDTOS.get(i).getParentAgencyId(), gridScoreDTOS.get(i).getGridName(), monthlyDTO); + monthlyDTO.setAllParentIds(gridScoreDTOS.get(i).getAllParentIds()); monthlyFormDTOList.add(monthlyDTO); } screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); @@ -298,21 +338,26 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS){ + private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS) { List monthlyFormDTOList = new ArrayList<>(); // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); // 查询网格的 上级组织id 和 组织名称 List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); - for(Map.Entry> gridScore : collect.entrySet()){ + if (!CollectionUtils.isEmpty(parentGridList)) { + parentGridList.forEach(o -> { + allParentIds.put(o.getGridId(), o.getAllParentIds()); + }); + } + for (Map.Entry> gridScore : collect.entrySet()) { IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); - for ( int i = 0; i < gridScore.getValue().size(); i++){ - if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())){ + for (int i = 0; i < gridScore.getValue().size(); i++) { + if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())) { // 是总分 - if (IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode().equals(gridScore.getValue().get(i).getIndexCode())){ + if (IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode().equals(gridScore.getValue().get(i).getIndexCode())) { // 总指数 = 网格相关 monthlyFormDTO.setIndexTotal(gridScore.getValue().get(i).getScore()); } @@ -334,11 +379,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } if ("".equals(parentAgencyId)){ - throw new RuntimeException("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey()); + log.error("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey()); + continue; } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScore.getKey(), parentAgencyId, gridName, monthlyFormDTO); + monthlyFormDTO.setAllParentIds(allParentIds.getIfPresent(monthlyFormDTO.getOrgId())); monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ @@ -409,6 +456,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScoreDTOS.get(i).getAgencyId(), communityScoreDTOS.get(i).getPid(), communityScoreDTOS.get(i).getAgencyName(), monthlyDTO); + monthlyDTO.setAllParentIds(communityScoreDTOS.get(i).getPids()); monthlyFormDTOList.add(monthlyDTO); } screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); @@ -424,20 +472,25 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS){ + private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS) { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); // 根据客户id,查询区/街道 组织名称、id List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); - for(Map.Entry> communityScore : collect.entrySet()){ + if (!CollectionUtils.isEmpty(parentAgencyList)) { + parentAgencyList.forEach(o -> { + allParentIds.put(o.getAgencyId(), o.getPids()); + }); + } + for (Map.Entry> communityScore : collect.entrySet()) { IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); - for ( int i = 0; i < communityScore.getValue().size(); i++){ - if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())){ + for (int i = 0; i < communityScore.getValue().size(); i++) { + if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())) { // 是总分 - if (IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode().equals(communityScore.getValue().get(i).getIndexCode())){ + if (IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode().equals(communityScore.getValue().get(i).getIndexCode())) { // 总指数 = 社区相关 monthlyFormDTO.setIndexTotal(communityScore.getValue().get(i).getScore()); } @@ -459,12 +512,14 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { agencyName = agencyScoreDTO.getAgencyName(); } } - if ("".equals(agencyName)){ - throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); + if ("".equals(agencyName)) { + log.error("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); + continue; } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScore.getKey(), parentAgencyId, agencyName, monthlyFormDTO); + monthlyFormDTO.setAllParentIds(allParentIds.getIfPresent(monthlyFormDTO.getOrgId())); // 补充表中其他字段 monthlyFormDTOList.add(monthlyFormDTO); } @@ -497,7 +552,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); } - if (!CollectionUtils.isEmpty(mismatchDeptList)){ + if (!CollectionUtils.isEmpty(mismatchDeptList)) { + mismatchDeptList.forEach(o -> { + String pids = allParentIds.getIfPresent(o.getParentAgencyId()); + if (!StringUtils.isEmpty(pids)) { + allParentIds.put(o.getDeptId(), pids.concat(StrConstant.COLON).concat(o.getParentAgencyId())); + } + }); // 如果进行不匹配查询,查到了其他部门信息,一律赋默认值 this.insertIndexMonthlyByDeptDefaultScore(monthId, customerId, mismatchDeptList); } @@ -534,6 +595,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScoreDTOS.get(i).getDeptId(), deptScoreDTOS.get(i).getParentAgencyId(), deptScoreDTOS.get(i).getDeptName(), monthlyDTO); + monthlyDTO.setAllParentIds(allParentIds.getIfPresent(monthlyDTO.getOrgId())); monthlyFormDTOList.add(monthlyDTO); } screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); @@ -579,12 +641,18 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deptName = deptEntity.getDeptName(); } } - if ("".equals(parentAgencyId)){ - throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); + if ("".equals(parentAgencyId)) { + log.error("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); + continue; } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScore.getKey(), parentAgencyId, deptName, monthlyFormDTO); + //部门表没有 allParentIds 所以直接获取 然后拼接 + String ppIds = allParentIds.getIfPresent(monthlyFormDTO.getParentId()); + if (!StringUtils.isEmpty(ppIds)) { + monthlyFormDTO.setAllParentIds(ppIds.concat(StrConstant.COLON).concat(monthlyFormDTO.getParentId())); + } monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ @@ -634,18 +702,27 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS){ + private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS) { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); int j = 0; - for(Map.Entry> agencyScore : collect.entrySet()){ + if (!CollectionUtils.isEmpty(parentAgencyList)) { + parentAgencyList.forEach(o -> { + allParentIds.put(o.getAgencyId(), o.getPids()); + }); + } + for (Map.Entry> agencyScore : collect.entrySet()) { + if (NumConstant.ZERO_STR.equals(agencyScore.getKey())) { + log.warn("insertIndexDataMonthlyByAgencyScore agencyyId is 0"); + continue; + } IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); - for ( int i = 0; i < agencyScore.getValue().size(); i++){ - if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())){ + for (int i = 0; i < agencyScore.getValue().size(); i++) { + if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())) { // 是总分 总指数 = IS_TOTAL = 1 monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore()); } else { @@ -665,12 +742,17 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { agencyName = agencyScoreDTO.getAgencyName(); } } - if ("".equals(agencyName)){ - throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); + if ("".equals(agencyName)) { + log.error("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); + continue; } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, agencyScore.getKey(), parentAgencyId, agencyName, monthlyFormDTO); + if ("S2-C1".equals(monthlyFormDTO.getOrgId())) { + System.out.println("======" + allParentIds.getIfPresent(monthlyFormDTO.getOrgId())); + } + monthlyFormDTO.setAllParentIds(allParentIds.getIfPresent(monthlyFormDTO.getOrgId())); monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityDeptMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityDeptMonthlyServiceImpl.java new file mode 100644 index 0000000000..896ca7c334 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityDeptMonthlyServiceImpl.java @@ -0,0 +1,39 @@ +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.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/21 15:25 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexGovrnAblityDeptMonthlyServiceImpl extends BaseServiceImpl implements FactIndexGovrnAblityDeptMonthlyService { + + @Override + public void deleteByCustomer(String customerId, String monthId) { + baseDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, monthId); + } + + /** + * 批量插入 + * + * @param list + * @return void + * @author zhaoqifeng + * @date 2020/9/21 17:08 + */ + @Override + public void saveList(List list) { + insertBatch(list); + } +} 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 new file mode 100644 index 0000000000..3f9c73afb3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java @@ -0,0 +1,25 @@ +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; + +/** + * @author zhaoqifeng + * @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) { + return baseDao.selectGridByCustomer(customerId, 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 new file mode 100644 index 0000000000..a19669e39d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java @@ -0,0 +1,54 @@ +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.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 20:29 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl implements FactIndexGovrnAblityOrgMonthlyService { + + @Autowired + private FactIndexGovrnAblityGridMonthlyDao governAbilityDao; + + @Override + public void deleteByCustomer(String customerId, String monthId, String type) { + baseDao.deleteByCustomer(customerId, monthId, type); + } + + @Override + public void insertGovernAbilityRecord(List lists) { + governAbilityDao.insertGovernAbilityRecord(lists); + } + + @Override + public Integer deleteOldGovernAbilityRecord(String customerId, String monthId) { + return governAbilityDao.deleteOldGovernAbilityRecord(customerId, monthId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveList(List 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/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java new file mode 100644 index 0000000000..33316c2eba --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import org.apache.commons.collections4.ListUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + + +/** + * 党建能力-党员相关的事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Service +public class FactIndexPartyAblityCpcMonthlyServiceImpl extends BaseServiceImpl implements FactIndexPartyAblityCpcMonthlyService { + + /** + * @param customerId + * @param monthId + * @param indexPartyAblityCpcList + * @return void + * @author yinzuomei + * @description 先删后增 + * @Date 2020/9/22 16:30 + **/ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + @Override + public void delAndSavePartyAblityCpcMonthly(String customerId, String monthId, List indexPartyAblityCpcList) { + int deleteNum; + do { + deleteNum = baseDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); + } while (deleteNum > NumConstant.ZERO); + List> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.insertBatchEntity(list); + }); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..f49196555d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java @@ -0,0 +1,48 @@ +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.FactIndexPartyAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 23:01 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexPartyAblityOrgMonthlyServiceImpl extends BaseServiceImpl implements FactIndexPartyAblityOrgMonthlyService { + + @Autowired + private FactIndexPartyAblityGridMonthlyDao partyAbilityGridDao; + + @Override + public void deleteByCustomer(String customerId, String monthId, String type) { + baseDao.deleteByCustomer(customerId, monthId, type); + } + + @Override + public void insertPartyAbility(List lists) { + partyAbilityGridDao.insertPartyAbility(lists); + } + + @Override + public Integer deleteOldPartyAbility(String customerId, String monthId) { + return partyAbilityGridDao.deleteOldPartyAbility(customerId, monthId); + } + + @Override + public void saveList(List list) { + insertBatch(list); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..3d575b8958 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityGridMonthlyServiceImpl.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; +import org.apache.commons.collections4.ListUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Service +public class FactIndexServiceAblityGridMonthlyServiceImpl extends BaseServiceImpl implements FactIndexServiceAblityGridMonthlyService { + + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 查询出所有的网格,初始化好 服务能力-网格相关事实表 各个指标值赋值为0 + * @Date 2020/9/21 9:38 + **/ + @Override + @DataSource(DataSourceConstant.EVALUATION_INDEX) + public List initAllGridList(String customerId) { + return baseDao.initAllGridList(customerId); + } + + @Transactional(rollbackFor = Exception.class) + @Override + @DataSource(DataSourceConstant.EVALUATION_INDEX) + public void delAndSaveServiceAbilityGridMonthly(String customerId, String monthId, List entityList) { + int deleteNum; + do { + deleteNum = baseDao.deleteFactIndexServiceAblityGridMonthly(customerId, monthId); + } while (deleteNum > NumConstant.ZERO); + + List> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.insertBatchEntity(list); + }); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..ec11ae6d2e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityOrgMonthlyServiceImpl.java @@ -0,0 +1,30 @@ +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.FactIndexServiceAblityOrgMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/30 16:39 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexServiceAblityOrgMonthlyServiceImpl extends BaseServiceImpl implements FactIndexServiceAblityOrgMonthlyService { + @Override + public void deleteByCustomer(String customerId, String monthId, String type) { + baseDao.deleteByCustomer(customerId, monthId, type); + } + + @Override + public void saveList(List list) { + insertBatch(list); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java new file mode 100644 index 0000000000..15a9d72a35 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java @@ -0,0 +1,59 @@ +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.dto.screencoll.form.*; + +/** + * 大屏数据采集api - 安宁 + */ +public interface AnScreenCollService { + + /** + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 16:41 + */ + void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId); + + /** + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:19 + */ + void pmRank(ScreenCollFormDTO formDTO,String customerId); + + /** + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:20 + */ + void pmTotal(ScreenCollFormDTO formDTO,String customerId); + + /** + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:22 + */ + void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId); + + /** + * @Description 安宁大屏数据采集 - 基层治理-各类数 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:23 + */ + void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java index eb77f2cf63..9e903481f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java @@ -19,8 +19,10 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import java.math.BigDecimal; +import java.util.Collection; import java.util.List; /** @@ -46,4 +48,14 @@ public interface IndexGroupDetailService extends BaseService values, String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java new file mode 100644 index 0000000000..314bd3181a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.PartyInfoResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity; + +import java.util.List; + +/** + * 基层党建-党员基本情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenCpcBaseDataService extends BaseService { + + /** + * @Description 插入党员基本信息 + * @param baseInfoFormDTOS + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + void insertPartyBaseInfo(List baseInfoFormDTOS); + + /** + * @Description 删除旧的党员基本信息 + * @param customerId + * @param dateId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyBaseInfo(String customerId, String dateId, List orgIds); + + /** + * @Description 查询党员信息【根据agencyId来查】 + * @param customerId + * @param dateId + * @param agencyId + * @author zxc + * @date 2020/9/23 2:01 下午 + */ + List selectPartyInfo(String customerId, String dateId,String agencyId); + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + List selectDirectGridPartyInfo(List gridIds,String customerId,String dateId); + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..5ff8fdf050 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +import com.epmet.dto.extract.result.OrgNameResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; +import com.epmet.entity.org.CustomerAgencyEntity; + +import java.util.Map; + +/** + * 组织机构信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenCustomerAgencyService{ + + /** + * @Description 根据agencyId,查询所有子级agencyId,【当机关的级别为 community时,所有子级为gridId】 + * @param agencyId + * @param customerId + * map.put('机关的级别(level)','community/street/district/city/province') + * map.put('agencyId','List 所有子级agencyId') + * @author zxc + * @date 2020/9/22 1:39 下午 + */ + Map selectAllSubAgencyId(String agencyId, String customerId); + + /** + * @Description 查询客户下所有机关ID + * @param customerId + * @author zxc + * @date 2020/9/22 4:06 下午 + */ + List selectAllAgencyId(String customerId); + + ScreenCustomerAgencyEntity getLastAddedAgency(); + + ScreenCustomerAgencyEntity getLastUpdatedAgency(); + + void initAgencies(List agencies2Add, List agencies2Update); + + /** + * @Description 查询下一级机关的ID【即以agencyId为pid的agency】 + * @param agencyId + * @param customerId + * @author zxc + * @date 2020/9/23 11:11 上午 + */ + List selectSubAgencyId(String agencyId, String customerId); + + /** + * @Description 查询客户下所有机关ID + * @param customerId + * @author zxc + * @date 2020/9/23 3:10 下午 + */ + 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 + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameGrid(List gridIds); + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameAgency(List agencyIds); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerDeptService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerDeptService.java new file mode 100644 index 0000000000..88405c7f49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerDeptService.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; +import com.epmet.entity.org.CustomerDepartmentEntity; + +import java.util.List; + +/** + * 部门信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenCustomerDeptService extends BaseService { + + /** + * 最后一次添加的部门 + * @return + */ + ScreenCustomerDeptEntity getLastAddDept(); + + ScreenCustomerDeptEntity getLastUpdateDept(); + + void addAndUpdateDepartments(List depts2Add, List depts2Update); + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..3d2fc7a15a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.*; +import com.epmet.dto.extract.result.GridInfoResultDTO; +import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; +import com.epmet.entity.org.CustomerGridEntity; + +import java.util.List; + +/** + * 网格(党支部)信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenCustomerGridService extends BaseService { + + ScreenCustomerGridEntity getLastAddGrid(); + ScreenCustomerGridEntity getLastUpdateGrid(); + + void addAndUpdateGrids(List grids2Add, List grids2Update); + + /** + * @Description 查询客户下所有网格ID + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/23 3:10 下午 + */ + List 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 + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + List selectDirectGrid(List agencyIds); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + List selectAllGridInfoToParty(String customerId); + + /** + * @param customerId + * @Description 查询全部网格信息 + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + List selectAllGridInfo(String customerId); + + /** + * desc: 初始化客户的业务组织关系 + * + * @param formDTO + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/10/21 2:33 下午 + */ + Boolean initBizOrg(CustomerBizOrgFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java new file mode 100644 index 0000000000..8f9d136d88 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; + +import java.util.List; + +/** + * 基层治理-难点堵点(耗时最长|设计部门最多|处理次数) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenDifficultyDataService extends BaseService { + + /** + * @Description 查询数据库中是否有该客户下的难点赌点信息 + * @param customerId + * @return com.epmet.dto.screen.result.DifficultyIfExistedResultDTO + * @author wangc + * @date 2020.09.28 10:53 + */ + DifficultyIfExistedResultDTO selectExistedInfo(String customerId); + + + /** + * @Description 数据清洗 + * @param customerId + * @param difficulties + * @return void + * @author wangc + * @date 2020.09.28 11:04 + */ + void dataClean(String customerId,List difficulties, List imgs); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenEventDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenEventDataService.java new file mode 100644 index 0000000000..7585eeb028 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenEventDataService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenEventDataEntity; + +/** + * 中央区-事件数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenEventDataService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenEventImgDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenEventImgDataService.java new file mode 100644 index 0000000000..e6dc620f13 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenEventImgDataService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; + +/** + * 中央区-事件数据图片数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenEventImgDataService extends BaseService { + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..0f9b23b166 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; + +import java.util.List; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenGovernRankDataService extends BaseService { + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * + * @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/ScreenOrgRankDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenOrgRankDataService.java new file mode 100644 index 0000000000..a6b4ab661c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenOrgRankDataService.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity; + +import java.util.List; + +/** + * 党建引领-组织先进排行榜 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenOrgRankDataService extends BaseService { + + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * + * @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 new file mode 100644 index 0000000000..1fc80f30ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +/** + * 基层党建-建设情况数据(支部,联建,志愿服务)按月 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +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 new file mode 100644 index 0000000000..77b8cdb3eb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +/** + * 党建引领-党员联系群众数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +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/ScreenPartyUserRankDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java new file mode 100644 index 0000000000..99ce30dc0c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; + +import java.util.List; + +/** + * 党建引领|基层治理-市民(党员)积分排行榜 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenPartyUserRankDataService extends BaseService { + + + /** + * @Description 用户参与排行数据清洗 + * @param dataList + * @param customerId + * @return + * @author wangc + * @date 2020.09.27 09:44 + **/ + void dataClean(List dataList,String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java new file mode 100644 index 0000000000..99196d9950 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; + +import java.util.List; + +/** + * 党建引领-先锋模范数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenPioneerDataService extends BaseService { + + /** + * @return java.util.List + * @param customerId + * @param orgType :grid,agency + * @author yinzuomei + * @description 构造screen_pioneer_data 初始数据,先赋值为0 + * @Date 2020/9/22 14:41 + **/ + List initPioneerDataList(String customerId, String orgType); + + /** + * @return void + * @param customerId + * @param orgType grid, agency + * @param deleteSize + * @param entityList 待插入的数据 + * @author yinzuomei + * @description 保存抽取结果 + * @Date 2020/9/22 15:54 + **/ + void delAndSavePioneerData(String customerId, String orgType, 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/ScreenPublicPartiTotalDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java new file mode 100644 index 0000000000..0e03f4d555 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; + +import java.util.List; + +/** + * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenPublicPartiTotalDataService extends BaseService { + /** + * @return void + * @param customerId + * @param list screen_public_parti_total_data 记录 + * @author yinzuomei + * @description 先删除,后插入 + * @Date 2020/9/27 13:51 + **/ + void delAndInsertBatch(String customerId, List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java new file mode 100644 index 0000000000..0a42c758a4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; + +import java.util.List; + +/** + * 基层治理-公众参与 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenUserJoinService extends BaseService { + /** + * desc: 删除并插入某月的数据 + * + * @param formDTO + * @param list + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/27 4:40 下午 + */ + Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java new file mode 100644 index 0000000000..313de8c061 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; + +import java.util.List; + +/** + * 中央区-各类(用户|党员|党群|话题|议题|项目)总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +public interface ScreenUserTotalDataService extends BaseService { + + + /** + * @Description 大屏中央区数据清洗 + * @param list + * @return + * @author wangc + * @date 2020.09.24 17:59 + **/ + void dataClean(List list,String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 根据条件查询screen_user_total_data表 + * @Date 2020/9/27 11:18 + **/ + List selectList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java index 12d46a16f9..41f2256c50 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java @@ -1,8 +1,7 @@ package com.epmet.service.evaluationindex.screen; +import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; import com.epmet.dto.screencoll.form.*; - -import java.util.List; /** * 大屏数据采集api * @@ -231,4 +230,14 @@ public interface ShiBeiScreenCollService { * @Date 09:44 2020-08-25 **/ void insertPublicPartiTotalData(PublicPartiTotalDataListFormDTO formDTO, String customerId); + + /** + * desc: 初始化客户业务组织关系表 + * + * @param formDTO + * @return java.lang.Integer + * @author LiuJanJun + * @date 2020/10/21 2:38 下午 + */ + Integer initBizOrg(CustomerBizOrgFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java new file mode 100644 index 0000000000..41eac708e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java @@ -0,0 +1,191 @@ +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; +import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; +import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.dto.screencoll.form.*; +import com.epmet.service.evaluationindex.screen.AnScreenCollService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + + +import java.util.List; + + +/** + * @Description 安宁数据采集 + * @ClassName AnScreenCollServiceImpl + * @Auth wangc + * @Date 2020-10-09 13:32 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Slf4j +public class AnScreenCollServiceImpl implements AnScreenCollService { + + @Autowired + private ScreenAnCommunityProjectProfileDao communityProjectProfileDao; + @Autowired + private ScreenAnGrassRootsGovernMonthlyDao governMonthlyDao; + @Autowired + private ScreenAnGrassRootsOrgMonthlyDao orgMonthlyDao; + @Autowired + private ScreenAnGrassRootsPmRankDao pmRankDao; + @Autowired + private ScreenAnGrassRootsPmTotalMonthlyDao pmTotalMonthlyDao; + + + /** + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 16:41 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + if(formDTO.getIsFirst()){ + int affectRows = communityProjectProfileDao.deleteBatch(customerId); + while(affectRows >= NumConstant.ONE){ + affectRows = communityProjectProfileDao.deleteBatch(customerId); + } + } + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + communityProjectProfileDao.insertBatch(list,customerId); + }); + + } + + /** + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:19 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void pmRank(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + if(formDTO.getIsFirst()){ + int affectRows = pmRankDao.deleteBatch(customerId); + while(affectRows >= NumConstant.ONE){ + affectRows = pmRankDao.deleteBatch(customerId); + } + } + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + pmRankDao.insertBatch(list,customerId); + }); + } + + /** + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:20 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void pmTotal(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + + if(formDTO.getIsFirst()){ + int affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + while(affectRows >= NumConstant.ONE){ + affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + } + } + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + pmTotalMonthlyDao.insertBatch(list, + customerId, + formDTO.getMonthId(), + quarterId, + yearId); + }); + + } + + /** + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:22 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + + if(formDTO.getIsFirst()){ + int affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + while(affectRows >= NumConstant.ONE){ + affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + } + } + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + orgMonthlyDao.insertBatch(list, + customerId, + formDTO.getMonthId(), + quarterId, + yearId); + }); + + } + + /** + * @Description 安宁大屏数据采集 - 基层治理-各类数 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:23 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + + if(formDTO.getIsFirst()){ + int affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + while(affectRows >= NumConstant.ONE){ + affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + } + } + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + governMonthlyDao.insertBatch(list, + customerId, + formDTO.getMonthId(), + quarterId, + yearId); + }); + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java index 26fb5b8cc2..c607004310 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import com.epmet.redis.IndexCalRedis; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; import lombok.extern.slf4j.Slf4j; @@ -33,6 +34,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.util.Collection; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -79,4 +81,21 @@ public class IndexGroupDetailServiceImpl extends BaseServiceImpl values, String customerId) { + int updatedNum=0; + for(IndexGroupDetailTemplateEntity entity:values){ + updatedNum+=baseDao.updateWeight(entity.getIndexCode(),customerId,entity.getWeight(),entity.getAllParentIndexCode()); + } + log.info("修改客户权重信息,影响行数="+updatedNum); + } + } \ 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/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java index e455120eef..50092d64db 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java @@ -68,28 +68,22 @@ private IndexGroupTemplateDao indexGroupTemplateDao; public Boolean initCustomerIndexGroup(String customerId) { List groupTempList = indexGroupTemplateDao.selectAll(); List groupDetailTempList = indexGroupDetailTemplateDao.selectAll(); - if (CollectionUtils.isEmpty(groupTempList) || CollectionUtils.isEmpty(groupDetailTempList)){ + if (CollectionUtils.isEmpty(groupTempList) || CollectionUtils.isEmpty(groupDetailTempList)) { throw new RenException("没有需要初始化的数据"); } Map groupMap = groupTempList.stream().collect(Collectors.toMap(IndexGroupTemplateEntity::getId, o -> o)); - Map groupEntityMap = new HashMap<>(); - Map groupNewIdMap = new HashMap<>(); + Map groupNewIdMap = new HashMap<>(); + + indexGroupDetailDao.deleteByCustomerId(customerId); + baseDao.deleteByCustomerId(customerId); List insertGroupList = new ArrayList<>(); - groupMap.forEach((oldGroupTempId,o)->{ + groupMap.forEach((oldGroupTempId, o) -> { IndexGroupEntity newGroupEntity = ConvertUtils.sourceToTarget(o, IndexGroupEntity.class); String newGroupId = UniqueIdGenerator.generate(); newGroupEntity.setId(newGroupId); newGroupEntity.setCustomerId(customerId); - String oldPid = newGroupEntity.getParentIndexGroupId(); - String newPid = groupNewIdMap.get(oldPid); - /*if (StringUtils.isBlank(newPid)){ - newPid = UniqueIdGenerator.generate(); - groupNewIdMap.put(oldPid,newPid); - }*/ - //newGroupEntity.setParentIndexGroupId(newPid); - groupNewIdMap.put(oldGroupTempId,newGroupId); - //groupEntityMap.put(newGroupId,newGroupEntity); + groupNewIdMap.put(oldGroupTempId, newGroupId); insertGroupList.add(newGroupEntity); }); insertGroupList.forEach(o-> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java new file mode 100644 index 0000000000..7505476087 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenCpcBaseDataDao; +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.PartyInfoResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 基层党建-党员基本情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenCpcBaseDataServiceImpl extends BaseServiceImpl implements ScreenCpcBaseDataService { + + + @Override + public void insertPartyBaseInfo(List baseInfoFormDTOS) { + baseDao.insertPartyBaseInfo(baseInfoFormDTOS); + } + + /** + * @Description 删除旧的党员基本信息 + * @param customerId + * @param dateId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + @Override + public Integer deleteOldPartyBaseInfo(String customerId, String dateId, List orgIds) { + return baseDao.deleteOldPartyBaseInfo(customerId, dateId,orgIds); + } + + /** + * @Description 查询党员信息【根据agencyId来查】 + * @param customerId + * @param dateId + * @param agencyId + * @author zxc + * @date 2020/9/23 2:01 下午 + */ + @Override + public List selectPartyInfo(String customerId, String dateId, String agencyId) { + return baseDao.selectPartyInfo(customerId, dateId, agencyId); + } + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + @Override + public List selectDirectGridPartyInfo(List gridIds,String customerId,String dateId) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectDirectGridPartyInfo(gridIds, customerId, dateId); + } + 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/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java new file mode 100644 index 0000000000..2cc97d3256 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -0,0 +1,258 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +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.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import lombok.extern.slf4j.Slf4j; +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.util.*; +import java.util.stream.Collectors; + +/** + * 组织机构信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyService { + + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + + /** + * @Description 根据agencyId,查询所有子级agencyId,【当机关的级别为 community时,所有子级为gridId】 + * @param agencyId + * @param customerId + * map.put('机关的级别(level)','community/street/district/city/province') + * map.put('agencyId','List 所有子级agencyId') + * @author zxc + * @date 2020/9/22 1:39 下午 + */ + @Override + public Map selectAllSubAgencyId(String agencyId, String customerId) { + Map resultMap = new HashMap<>(16); + TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId,agencyId); + if (null == rootAgency){ + return new HashMap<>(16); + } + if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)){ + List gridIdList = screenCustomerGridDao.selectGridIdByAgencyId(agencyId); + resultMap.put(ScreenConstant.LEVEL,ScreenConstant.COMMUNITY); + resultMap.put(agencyId,gridIdList); + }else { + resultMap.put(ScreenConstant.LEVEL,rootAgency.getLevel()); + resultMap.put(agencyId,getSubList((ScreenConstant.STR_NULL.equals(rootAgency.getPids())||rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getAgencyId() : rootAgency.getPids().concat(ScreenConstant.ENGLISH_COMMA).concat(rootAgency.getAgencyId()))); + } + return resultMap; + } + + private List getSubList(String subAgencyPids) { + List result = new ArrayList<>(); + List subAgencyList = screenCustomerAgencyDao.selectSubAgencyList(subAgencyPids); + if (!CollectionUtils.isEmpty(subAgencyList)) { + result.addAll(subAgencyList.stream().map(sub -> sub.getAgencyId()).collect(Collectors.toList())); + subAgencyList.forEach(sub -> { + List subAgency = getSubList(sub.getPids() + "," + sub.getAgencyId()); + result.addAll(subAgency); + }); + } + return result; + } + + @Override + public ScreenCustomerAgencyEntity getLastAddedAgency() { + return screenCustomerAgencyDao.getLastAddedAgency(); + } + + @Override + public ScreenCustomerAgencyEntity getLastUpdatedAgency() { + return screenCustomerAgencyDao.getLastUpdatedAgency(); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initAgencies(List agencies2Add, List agencies2Update) { + String dateEndTime = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + if (!CollectionUtils.isEmpty(agencies2Add)) { + // 添加 + for (CustomerAgencyEntity e : agencies2Add) { + addAgency(e, dateEndTime); + } + } + + if (!CollectionUtils.isEmpty(agencies2Update)) { + // 更新 + for (CustomerAgencyEntity e : agencies2Update) { + ScreenCustomerAgencyEntity exists = screenCustomerAgencyDao.selectByAgencyId(e.getId()); + if (exists != null) { + exists.setAgencyName(e.getOrganizationName()); + exists.setPids(e.getPids()); + exists.setPid(e.getPid()); + exists.setLevel(e.getLevel()); + exists.setDataEndTime(dateEndTime); + exists.setAreaCode(e.getAreaCode()); + //如果没有区划 则默认暂时不显示 + if (StringUtils.isEmpty(e.getAreaCode())) { + exists.setIsDisplay(NumConstant.ZERO_STR); + } else { + exists.setIsDisplay(NumConstant.ONE_STR); + } + exists.setAllParentNames(e.getAllParentName()); + updateAgency(exists); + } + } + } + } + + /** + * @Description 查询下一级机关的ID【即以agencyId为pid的agency】 + * @param agencyId + * @param customerId + * @author zxc + * @date 2020/9/23 11:11 上午 + */ + @Override + public List selectSubAgencyId(String agencyId, String customerId) { + return screenCustomerAgencyDao.selectSubAgencyId(agencyId, customerId); + } + + /** + * @Description 查询客户下所有机关ID + * @param customerId + * @author zxc + * @date 2020/9/23 3:10 下午 + */ + @Override + public List selectAllAgencyIdToParty(String customerId,String dateId) { + 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 + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + @Override + public List selectOrgNameGrid(List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return screenCustomerGridDao.selectOrgName(gridIds); + } + return new ArrayList<>(); + } + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + @Override + public List selectOrgNameAgency(List agencyIds) { + if (!CollectionUtils.isEmpty(agencyIds)){ + return screenCustomerAgencyDao.selectOrgNameAgency(agencyIds); + } + return new ArrayList<>(); + } + + private void updateAgency(ScreenCustomerAgencyEntity exists) { + screenCustomerAgencyDao.updateById(exists); + } + + /** + * 添加agency + * @param e + */ + private void addAgency(CustomerAgencyEntity e, String dateEndTime) { + ScreenCustomerAgencyEntity cae = new ScreenCustomerAgencyEntity(); + cae.setAgencyId(e.getId()); + cae.setAgencyName(e.getOrganizationName()); + cae.setAllParentNames(e.getAllParentName()); + cae.setAreaCode(e.getAreaCode()); + //cae.setAreaMarks(e); + //如果没有区划 则默认暂时不显示 + if (StringUtils.isEmpty(e.getAreaCode())) { + cae.setIsDisplay(NumConstant.ZERO_STR); + } else { + cae.setIsDisplay(NumConstant.ONE_STR); + } + cae.setCustomerId(e.getCustomerId()); + cae.setDataEndTime(dateEndTime); + cae.setLevel(e.getLevel()); + cae.setPid(e.getPid()); + cae.setPids(e.getPids()); + cae.setSourceType(OrgSourceTypeConstant.INTERNAL); + screenCustomerAgencyDao.insert(cae); + } + + /** + * @Description 查询客户下所有机关ID + * @param customerId + * @author zxc + * @date 2020/9/22 4:06 下午 + */ + @Override + public List selectAllAgencyId(String customerId) { + return screenCustomerAgencyDao.selectAllAgencyId(customerId); + } + + +} \ 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/ScreenCustomerDeptServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java new file mode 100644 index 0000000000..95e7f066c0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgSourceTypeConstant; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; +import com.epmet.entity.org.CustomerDepartmentEntity; +import com.epmet.service.evaluationindex.screen.ScreenCustomerDeptService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 部门信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) +public class ScreenCustomerDeptServiceImpl extends BaseServiceImpl implements ScreenCustomerDeptService { + + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + + @Override + public ScreenCustomerDeptEntity getLastAddDept() { + return screenCustomerDeptDao.getLastAddDept(); + } + + @Override + public ScreenCustomerDeptEntity getLastUpdateDept() { + return screenCustomerDeptDao.getLastUpdateDept(); + } + + /** + * 添加/更新部门列表 + * @param depts2Add + * @param depts2Update + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void addAndUpdateDepartments(List depts2Add, List depts2Update) { + String dateStr = DateUtils.format(new Date(), "YYYYmmdd"); + for (CustomerDepartmentEntity dept : depts2Add) { + ScreenCustomerDeptEntity e = screenCustomerDeptDao.selectByDeptId(dept.getId()); + if (e == null) { + e = new ScreenCustomerDeptEntity(); + e.setCustomerId(dept.getCustomerId()); + e.setDataEndTime(dateStr); + e.setDeptId(dept.getId()); + e.setDeptName(dept.getDepartmentName()); + e.setParentAgencyId(dept.getAgencyId()); + e.setSourceType(OrgSourceTypeConstant.INTERNAL); + screenCustomerDeptDao.insert(e); + } + } + + for (CustomerDepartmentEntity dept : depts2Update) { + ScreenCustomerDeptEntity e = screenCustomerDeptDao.selectByDeptId(dept.getId()); + if (e != null) { + // 不是新增的 + e.setParentAgencyId(dept.getAgencyId()); + e.setDeptName(dept.getDepartmentName()); + e.setDataEndTime(dateStr); + e.setCustomerId(dept.getCustomerId()); + screenCustomerDeptDao.updateById(e); + } + } + } + +} \ 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/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java new file mode 100644 index 0000000000..e20a0a6709 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -0,0 +1,167 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.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.*; +import com.epmet.dto.extract.result.GridInfoResultDTO; +import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; +import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 网格(党支部)信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenCustomerGridServiceImpl extends BaseServiceImpl implements ScreenCustomerGridService { + + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + + @Override + public ScreenCustomerGridEntity getLastAddGrid() { + return screenCustomerGridDao.getLastAddGrid(); + } + + @Override + public ScreenCustomerGridEntity getLastUpdateGrid() { + return screenCustomerGridDao.getLastUpdateGrid(); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void addAndUpdateGrids(List grids2Add, List grids2Update) { + String dateStr = DateUtils.format(new Date(), "YYYYmmdd"); + for (CustomerGridEntity grid : grids2Add) { + ScreenCustomerGridEntity screenGrid = screenCustomerGridDao.getByGridId(grid.getId()); + if (screenGrid == null) { + ScreenCustomerGridEntity insertOne = new ScreenCustomerGridEntity(); + insertOne.setAllParentIds(grid.getPids()); + insertOne.setCustomerId(grid.getCustomerId()); + insertOne.setDataEndTime(dateStr); + insertOne.setGridId(grid.getId()); + insertOne.setGridName(grid.getGridName()); + insertOne.setParentAgencyId(grid.getPid()); + insertOne.setSourceType(OrgSourceTypeConstant.INTERNAL); + screenCustomerGridDao.insert(insertOne); + } + } + + for (CustomerGridEntity grid : grids2Update) { + ScreenCustomerGridEntity screenGrid = screenCustomerGridDao.getByGridId(grid.getId()); + if (screenGrid != null) { + //说明之前已经插入了该数据 + screenGrid.setParentAgencyId(grid.getPid()); + screenGrid.setAllParentIds(grid.getPids()); + screenGrid.setCustomerId(grid.getCustomerId()); + screenGrid.setDataEndTime(dateStr); + screenGrid.setGridName(grid.getGridName()); + screenCustomerGridDao.updateById(screenGrid); + } + } + } + + /** + * @Description 查询客户下所有网格ID + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/23 3:10 下午 + */ + @Override + public List selectAllGridIdToParty(String customerId, String dateId) { + return screenCustomerGridDao.selectAllGridIdToParty(customerId, dateId); + } + + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + @Override + public List 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 + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + @Override + public List selectDirectGrid(List agencyIds) { + if (!CollectionUtils.isEmpty(agencyIds)){ + return screenCustomerGridDao.selectDirectGrid(agencyIds); + } + return new ArrayList<>(); + } + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + @Override + public List selectAllGridInfoToParty(String customerId) { + return screenCustomerGridDao.selectAllGridInfoToParty(customerId); + } + + /** + * @param customerId + * @Description 查询全部网格信息 + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + @Override + public List selectAllGridInfo(String customerId) { + return screenCustomerGridDao.selectAllGridInfo(customerId); + } + + @Override + public Boolean initBizOrg(CustomerBizOrgFormDTO formDTO) { + return null; + } +} \ 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/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java new file mode 100644 index 0000000000..bc772ba821 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao; +import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 基层治理-难点堵点(耗时最长|设计部门最多|处理次数) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl implements ScreenDifficultyDataService { + + + @Override + public DifficultyIfExistedResultDTO selectExistedInfo(String customerId) { + int count = baseDao.selectCountByCustomerId(customerId); + DifficultyIfExistedResultDTO existedMap = new DifficultyIfExistedResultDTO(); + if (count <= NumConstant.ZERO) { + existedMap.setIfExisted(true); + } else { + existedMap.setClosedIds(baseDao.selectClosedProjectId(customerId)); + } + + return existedMap; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void dataClean(String customerId, List difficulties, List imgs) { + if (!CollectionUtils.isEmpty(difficulties)) { + baseDao.deleteBatchDifficulty(customerId, difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList())); + baseDao.insertBatch(difficulties); + } + if (!CollectionUtils.isEmpty(imgs)) { + baseDao.deleteBatchDifficultyImg(imgs.stream().map(ScreenDifficultyImgDataEntity::getEventId).distinct().collect(Collectors.toList())); + baseDao.insertBatchImg(imgs); + } + + baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE)); + } +} \ 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/ScreenEventDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenEventDataServiceImpl.java new file mode 100644 index 0000000000..b7301b01f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenEventDataServiceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.entity.evaluationindex.screen.ScreenEventDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenEventDataService; +import org.springframework.stereotype.Service; + +/** + * 中央区-事件数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +public class ScreenEventDataServiceImpl extends BaseServiceImpl implements ScreenEventDataService { + + +} \ 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/ScreenEventImgDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenEventImgDataServiceImpl.java new file mode 100644 index 0000000000..32fd61d2c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenEventImgDataServiceImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.screen.ScreenEventImgDataDao; +import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenEventImgDataService; +import org.springframework.stereotype.Service; + +/** + * 中央区-事件数据图片数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +public class ScreenEventImgDataServiceImpl extends BaseServiceImpl implements ScreenEventImgDataService { + +} \ 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/ScreenGovernRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java new file mode 100644 index 0000000000..4679187995 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl implements ScreenGovernRankDataService { + + + @Override + public List initList(String customerId, String orgType, String agencyLevel) { + List list = new ArrayList<>(); + switch (orgType) { + case OrgTypeConstant.AGENCY: + log.info("组织级别统计"); + list = baseDao.initAgencyDataList(customerId, agencyLevel); + break; + case OrgTypeConstant.GRID: + log.info("网格级别统计"); + list = baseDao.initGridDataList(customerId); + break; + default: + log.info("部门级别统计"); + break; + } + return list; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, + List 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/ScreenOrgRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenOrgRankDataServiceImpl.java new file mode 100644 index 0000000000..ce164aa136 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenOrgRankDataServiceImpl.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.ScreenOrgRankDataDao; +import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 党建引领-组织先进排行榜 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +@Slf4j +public class ScreenOrgRankDataServiceImpl extends BaseServiceImpl implements ScreenOrgRankDataService { + + + @Override + @DataSource(DataSourceConstant.STATS) + public List initList(String customerId, String orgType, String agencyLevel) { + List list = new ArrayList<>(); + switch (orgType) { + case OrgTypeConstant.AGENCY: + log.info("组织级别统计"); + list = baseDao.initAgencyDataList(customerId, agencyLevel); + break; + case OrgTypeConstant.GRID: + log.info("网格级别统计"); + list = baseDao.initGridDataList(customerId); + break; + default: + log.info("部门级别统计"); + break; + } + return list; + } + + @Override + @DataSource(DataSourceConstant.EVALUATION_INDEX) + public void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List entityList) { + if (CollectionUtils.isEmpty(entityList)) { + return; + } + List orgIds = new ArrayList<>(); + for (ScreenOrgRankDataEntity 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 new file mode 100644 index 0000000000..afd2e8aee3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +/** + * 基层党建-建设情况数据(支部,联建,志愿服务)按月 + * + * @author generator generator@elink-cn.com + * @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 new file mode 100644 index 0000000000..2915297086 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +/** + * 党建引领-党员联系群众数据 + * + * @author generator generator@elink-cn.com + * @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/ScreenPartyUserRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java new file mode 100644 index 0000000000..8e11fe379b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java @@ -0,0 +1,67 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.ScreenPartyUserRankDataDao; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 党建引领|基层治理-市民(党员)积分排行榜 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenPartyUserRankDataServiceImpl extends BaseServiceImpl implements ScreenPartyUserRankDataService { + + @Autowired + ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + + /** + * @Description 用户参与排行数据清洗 + * @param dataList + * @param customerId + * @return + * @author wangc + * @date 2020.09.27 09:44 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void dataClean(List dataList, String customerId) { + if(!CollectionUtils.isEmpty(dataList)) { + int affectedRows; + do { + affectedRows = baseDao.deleteBatchByCustomerIdAndDateId(customerId); + } while (affectedRows > NumConstant.ZERO); + baseDao.insertBatch(dataList); + } + } +} \ 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/ScreenPioneerDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java new file mode 100644 index 0000000000..ff49082598 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao; +import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + * 党建引领-先锋模范数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Slf4j +@Service +public class ScreenPioneerDataServiceImpl extends BaseServiceImpl implements ScreenPioneerDataService { + + + /** + * @param customerId + * @param orgType :grid,agency 机关级别(社区级:community, 乡(镇、街道)级:street,区县级: district,市级: city 省级:province) + * @return java.util.List + * @author yinzuomei + * @description 构造screen_pioneer_data 初始数据,先赋值为0 + * @Date 2020/9/22 14:41 + **/ + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @Override + public List initPioneerDataList(String customerId, String orgType) { + List list = new ArrayList<>(); + if (OrgTypeConstant.GRID.equals(orgType)) { + //按网格构造 + list = baseDao.initGridPioneerDataList(customerId); + } else if (OrgTypeConstant.COMMUNITY.equals(orgType)) { + //按社构造 + list = baseDao.initCommunityPioneerDataList(customerId); + }else if(OrgTypeConstant.AGENCY.equals(orgType)){ + list = baseDao.initExceptCommunityPioneerDataList(customerId); + } + return list; + } + + + /** + * @param customerId + * @param orgType grid, agency + * @param deleteSize + * @param entityList 待插入的数据 + * @return void + * @author yinzuomei + * @description 保存抽取结果 + * @Date 2020/9/22 15:54 + **/ + @Transactional(rollbackFor = Exception.class) + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @Override + public void delAndSavePioneerData(String customerId, String orgType, Integer deleteSize, List entityList) { + if(CollectionUtils.isEmpty(entityList)){ + return; + } + List orgIds=new ArrayList<>(); + for(ScreenPioneerDataEntity entity:entityList){ + orgIds.add(entity.getOrgId()); + } + int deleteNum; + do { + deleteNum = baseDao.deletePioneerData(customerId, orgType, deleteSize,orgIds); + } while (deleteNum != NumConstant.ZERO); + + List> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.insertBatchEntity(list); + }); + } + +} \ 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/ScreenPublicPartiTotalDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java new file mode 100644 index 0000000000..859941d9ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.IndexCalConstant; +import com.epmet.dao.evaluationindex.screen.ScreenPublicPartiTotalDataDao; +import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +public class ScreenPublicPartiTotalDataServiceImpl extends BaseServiceImpl implements ScreenPublicPartiTotalDataService { + + + /** + * @param customerId + * @param entityList screen_public_parti_total_data 记录 + * @return void + * @author yinzuomei + * @description 先删除,后插入 + * @Date 2020/9/27 13:51 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + @Transactional(rollbackFor = Exception.class) + @Override + public void delAndInsertBatch(String customerId, List entityList) { + if(CollectionUtils.isEmpty(entityList)){ + return; + } + int deleteNum=0; + do{ + //沿用原来项目采集的删除方法,一次删除1000 + deleteNum=baseDao.deletePublicPartiTotalData(customerId); + }while (deleteNum!= NumConstant.ZERO); + List> partionList= ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); + partionList.forEach(list->{ + baseDao.insertBatchEntity(list); + }); + } +} \ 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/ScreenUserJoinServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java new file mode 100644 index 0000000000..c6ca536993 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java @@ -0,0 +1,194 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.CompareConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenUserJoinDao; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; +import com.epmet.service.evaluationindex.screen.ScreenUserJoinService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * 基层治理-公众参与 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Slf4j +@Service +public class ScreenUserJoinServiceImpl extends BaseServiceImpl implements ScreenUserJoinService { + + + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List list) { + if (formDTO == null || StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getMonthId()) || CollectionUtils.isEmpty(list)) { + log.error("deleteAndInsertBatch param is error"); + return false; + } + int deleteNum; + do { + deleteNum = baseDao.deleteUserJoin(formDTO.getCustomerId(), formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + + + String[] orgIds = new String[list.size()]; + for (int i = NumConstant.ZERO; i < list.size(); i++) { + orgIds[i] = list.get(i).getOrgId(); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.addDateMonths(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM), -1)); + // 获取上个月的基本数据 + List lastMonthJoinList = baseDao.selectLastMonthScreenUserJoinList(formDTO.getCustomerId(), + dimIdBean.getYearId(), + dimIdBean.getMonthId(), + orgIds); + + // 定义本月待添加数据的集合 + List curMonthJoinEntityList = new ArrayList<>(); + // 增加率计算 + if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) { + // 存在上个月的数据 (本月-上月)/上月 *100 + for (int i = NumConstant.ZERO; i < list.size(); i++) { + for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) { + if (list.get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())) { + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(list.get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), list.get(j).getJoinTotal())); + entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), list.get(j).getJoinTotal())); + entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), list.get(j).getAvgIssue())); + entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), list.get(j).getAvgIssue())); + entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), list.get(j).getAvgJoin())); + entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), list.get(j).getAvgJoin())); + curMonthJoinEntityList.add(entity); + } + } + } + } else { + // 计算增长率后的 待新增数据 + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + // 不存在上个月的数据 + for (int i = NumConstant.ZERO; i < list.size(); i++) { + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(list.get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(zero); + entity.setJoinTotalUpFlag(""); + entity.setAvgIssueUpRate(zero); + entity.setAvgIssueUpFlag(""); + entity.setAgvgJoinUpRate(zero); + entity.setAgvgJoinUpFlag(""); + curMonthJoinEntityList.add(entity); + } + } + + this.insertBatch(list, NumConstant.ONE_HUNDRED); + return true; + } + + + /** + * 计算 本月数值 相较于 上月数值,的增长率 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.math.BigDecimal + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + 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); + 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; + } + + + /** + * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.util.String + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + 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.compareTo(now) == -1) { + return CompareConstant.INCR_STR; + } else { + return CompareConstant.EQ_STR; + } + } +} \ 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/ScreenUserTotalDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java new file mode 100644 index 0000000000..ff856eefe2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.ScreenUserTotalDataDao; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 中央区-各类(用户|党员|党群|话题|议题|项目)总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-22 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl implements ScreenUserTotalDataService { + + /** + * @Description 大屏中央区数据清洗 + * @param list + * @return + * @author wangc + * @date 2020.09.24 17:59 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void dataClean(List list,String customerId) { + if(!CollectionUtils.isEmpty(list)){ + int deleteNum; + do { + deleteNum = baseDao.deleteUserTotalData(customerId); + } while (deleteNum > NumConstant.ZERO); + baseDao.insertBatch(list); + } + } + + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 根据条件查询screen_user_total_data表 + * @Date 2020/9/27 11:18 + **/ + @Override + public List selectList(String customerId) { + return baseDao.selectList(customerId); + } +} \ 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 bbb0585d44..cd26e20bd2 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 @@ -17,16 +17,24 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.alibaba.fastjson.JSONObject; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.CompareConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; import com.epmet.dto.screencoll.form.*; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerBizOrgEntity; import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; +import org.apache.commons.collections4.ListUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -36,6 +44,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Calendar; import java.util.List; +import java.util.stream.Collectors; /** * 大屏数据采集 @@ -47,9 +56,9 @@ import java.util.List; @DataSource(DataSourceConstant.EVALUATION_INDEX) public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { - @Autowired - private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; - @Autowired + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; @Autowired private ScreenPartyBranchDataDao screenPartyBranchDataDao; @@ -74,6 +83,8 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; @Autowired + private ScreenCustomerBizOrgDao screenCustomerBizOrgDao; + @Autowired private ScreenUserTotalDataDao screenUserTotalDataDao; @Autowired private ScreenUserJoinDao screenUserJoinDao; @@ -87,7 +98,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPartyUserRankData(PartyUserRankDataListFormDTO formDTO,String customerId) { + public void insertPartyUserRankData(PartyUserRankDataListFormDTO formDTO, String customerId) { if (formDTO.getIsFirst()) { int deleteNum; do { @@ -180,7 +191,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) { // 根据原始事件ID,物理删除 - 事件数据图片数据 events[i] = formDTO.getDataList().get(i).getEventId(); - for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){ + for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++) { // 新增 中央区-事件数据图片数据 表 ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); @@ -191,7 +202,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } } } - if (isImgUrl){ + if (isImgUrl) { screenEventImgDataDao.delEventImgDataByEvent(events); screenEventImgDataDao.batchInsertEventImgData(eventImgDataList); } @@ -203,11 +214,11 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Override @Transactional(rollbackFor = Exception.class) public void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId) { - if(formDTO.getIsFirst()){ + if (formDTO.getIsFirst()) { //直接删除当前客户下所有的数据 screenDifficultyDataDao.deleteDifficultyData(customerId); } - if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDataList())){ + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDataList())) { screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDataList(), customerId); } } @@ -223,7 +234,10 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO.getDataList(), customerId); + List> pageByOneHundred = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + pageByOneHundred.forEach(one -> { + screenCpcBaseDataDao.batchInsertCpcBaseData(one, customerId); + }); } } @@ -298,6 +312,11 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + List pidIsZeroList = formDTO.getDataList().stream().filter(d -> d.getPid().equals(NumConstant.ZERO_STR) || "".equals(d.getPid())).collect(Collectors.toList()); + if (pidIsZeroList.size() > NumConstant.ONE) { + Object o = JSONObject.toJSON(pidIsZeroList); + throw new RenException("多个pid为【0】的数据:" + o.toString()); + } screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO.getDataList(), customerId); } } @@ -328,9 +347,9 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - if (formDTO.getDataList().size() > NumConstant.ZERO){ + if (formDTO.getDataList().size() > NumConstant.ZERO) { String[] orgIds = new String[formDTO.getDataList().size()]; - for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { orgIds[i] = formDTO.getDataList().get(i).getOrgId(); } @@ -345,11 +364,11 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { // 定义本月待添加数据的集合 List curMonthJoinEntityList = new ArrayList<>(); // 增加率计算 - if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO){ + if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) { // 存在上个月的数据 (本月-上月)/上月 *100 - for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ - for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++){ - if (formDTO.getDataList().get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())){ + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { + for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) { + if (formDTO.getDataList().get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())) { ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.getDataList().get(i), ScreenUserJoinEntity.class); entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), formDTO.getDataList().get(j).getJoinTotal())); entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), formDTO.getDataList().get(j).getJoinTotal())); @@ -365,8 +384,8 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { // 计算增长率后的 待新增数据 BigDecimal zero = new BigDecimal(NumConstant.ZERO); // 不存在上个月的数据 - for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ - ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.getDataList().get(i), ScreenUserJoinEntity.class); + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.getDataList().get(i), ScreenUserJoinEntity.class); entity.setJoinTotalUpRate(zero); entity.setJoinTotalUpFlag(""); entity.setAvgIssueUpRate(zero); @@ -381,14 +400,37 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } } + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public Integer initBizOrg(CustomerBizOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId()); + List list = new ArrayList<>(); + if (CollectionUtils.isEmpty(entityList)) { + return 0; + } + entityList.forEach(o -> { + ScreenCustomerBizOrgEntity entity = new ScreenCustomerBizOrgEntity(); + entity.setCustomerId(o.getCustomerId()); + entity.setOrgId(o.getAgencyId()); + entity.setBizType(formDTO.getBizType()); + list.add(entity); + }); + + screenCustomerBizOrgDao.deleteByBizType(formDTO); + return screenCustomerBizOrgDao.batchInsert(list); + } + /** * 获取当前日期的前一个月的日期 + * * @param * @return java.lang.String[] * @Author zhangyong * @Date 15:33 2020-08-21 **/ - private String[] lastMonthDate(){ + private String[] lastMonthDate() { String[] date = new String[NumConstant.TWO]; //Java获取当前日期的前一个月的日期 Calendar calendar = Calendar.getInstance(); @@ -396,8 +438,9 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH) + NumConstant.ONE; date[NumConstant.ZERO] = String.valueOf(year); - date[NumConstant.ONE] = String.valueOf(month);; - if (NumConstant.TEN >= month){ + date[NumConstant.ONE] = String.valueOf(month); + ; + if (NumConstant.TEN >= month) { date[NumConstant.ONE] = NumConstant.ZERO_STR + month; } return date; @@ -406,34 +449,73 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { /** * 计算 本月数值 相较于 上月数值,的增长率 * - * @param old 上月数值 - * @param now 本月数值 + * @param old 上月数值 + * @param now 本月数值 * @return java.math.BigDecimal * @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; } + + /** + * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.util.String + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + 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 本月数值 + * @param old 上月数值 + * @param now 本月数值 * @return java.util.String * @Author zhangyong * @Date 15:38 2020-08-21 **/ - private String calculateGrowthRateFlag(Integer old, Integer now){ - if (old > now){ + 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; @@ -447,7 +529,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenPioneerDataDao.deletePioneerData(customerId); + 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/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index 82588801a7..38e291d420 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -1,5 +1,6 @@ package com.epmet.service.group; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -55,4 +56,14 @@ public interface GroupDataService { */ List getAgencyGrid(@Param("gridIds") List gridIds); + /** + * @Description 业务抽取 - 小组数据 + * @param isFirst + * @param customerId + * @return + * @author wangc + * @date 2020.09.18 22:52 + **/ + List extractGroupData(Boolean isFirst,String customerId,String dateId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 2b37f81ed6..b7875982d5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -4,6 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.group.GroupDataDao; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; @@ -12,9 +13,12 @@ import com.epmet.dto.group.result.*; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.StringUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -193,4 +197,18 @@ public class GroupDataServiceImpl implements GroupDataService { } + /** + * @Description 业务抽取 - 小组数据 + * * @param isFirst + * @param customerId + * @return + * @author wangc + * @date 2020.09.18 22:52 + **/ + @Override + public List extractGroupData(Boolean isFirst ,String customerId,String dateId) { + return groupDataDao.groupExtracting(customerId,isFirst?null:dateId); + } + + } 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 new file mode 100644 index 0000000000..769372ad25 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java @@ -0,0 +1,54 @@ +package com.epmet.service.heart; + +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; + +import java.util.List; +import java.util.Map; + +/** + * 活动信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/21 16:39 + */ +public interface ActInfoService { + /** + * @return java.util.List + * @param regUserIds + * @author yinzuomei + * @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 + * @Date 2020/9/21 16:41 + **/ + List getGridRegUserVolunteer(List regUserIds); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 网格活动组织次数 爱心活动 值得是: 活动状态已结束并且实际结束时间在评价周期内的 + * @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); + + /** + * 获取机关活动次数 + * @author zhaoqifeng + * @date 2020/9/30 17:02 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getAgencyActCount(String customerId, String monthId); +} 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..c7cb47c47a --- /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, String orgType); + +} 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 new file mode 100644 index 0000000000..b0fffe3f6d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java @@ -0,0 +1,80 @@ +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.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.service.heart.ActInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 活动信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/21 16:40 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EPMET_HEART) +public class ActInfoServiceImpl implements ActInfoService { + @Autowired + private ActInfoDao baseDao; + + /** + * @return java.util.List + * @param regUserIds + * @author yinzuomei + * @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 + * @Date 2020/9/21 13:50 + **/ + @Override + @DataSource(DataSourceConstant.EPMET_HEART) + public List getGridRegUserVolunteer(List regUserIds) { + return baseDao.selectGridRegUserVolunteer(regUserIds); + } + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 网格活动组织次数 爱心活动 值得是: 活动状态已结束并且实际结束时间在评价周期内的 + * @Date 2020/9/21 10:23 + **/ + @Override + @DataSource(DataSourceConstant.EPMET_HEART) + public Map calActivityCountMap(String customerId, String monthId) { + List list = baseDao.selectActGroupByGridId(customerId, monthId); + Map resultMap = new HashMap<>(); + for (GridIndexCommonDTO gridIndexCommonDTO : list) { + resultMap.put(gridIndexCommonDTO.getGridId(), gridIndexCommonDTO.getIndexValue()); + } + 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) { + return baseDao.selectActInfo(customerId, monthId); + } + + @Override + public List getAgencyActCount(String customerId, String monthId) { + return baseDao.selectAgencyActCount(customerId, monthId); + } +} 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..b9b5165260 --- /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, String orgType) { + return actUserRelationDao.selectJoinUserCount(customerId, monthId, orgType); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java new file mode 100644 index 0000000000..d35aa6bec6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java @@ -0,0 +1,155 @@ +package com.epmet.service.impl; + +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.entity.org.CustomerDepartmentEntity; +import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.service.EIDimService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerDeptService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerDepartmentService; +import com.epmet.service.org.CustomerGridService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class EIDimServiceImpl implements EIDimService { + + @Autowired + private ScreenCustomerAgencyService screenCustomerAgencyService; + + @Autowired + private ScreenCustomerDeptService screenCustomerDeptService; + + @Autowired + private ScreenCustomerGridService screenCustomerGridService; + + @Autowired + private CustomerAgencyService originCustomerAgencyService; + + @Autowired + private CustomerDepartmentService originCustomerDepartmentService; + + @Autowired + private CustomerGridService customerGridService; + + @Override + public void initAgencies() { + List agencies2Add = listAgencies2Add(); + List agencies2Update = listAgencies2Update(); + + screenCustomerAgencyService.initAgencies(agencies2Add, agencies2Update); + } + + /** + * 查询可更新的单位 + * @return + */ + private List listAgencies2Update() { + ScreenCustomerAgencyEntity e = screenCustomerAgencyService.getLastUpdatedAgency(); + + if (e != null) { + // 说明不是第一次初始化 + Date startTime = e.getUpdatedTime(); + Date endTime = new Date(); + return originCustomerAgencyService.listAgenciesByUpdatedTime(startTime, endTime); + } + + return new ArrayList<>(); + } + + /** + * 查询可增加的单位 + * @return + */ + private List listAgencies2Add() { + ScreenCustomerAgencyEntity e = screenCustomerAgencyService.getLastAddedAgency(); + + Date endTime = new Date(); + Date startTime = null; + if (e != null) { + startTime = e.getCreatedTime(); + } + + return originCustomerAgencyService.listAgenciesByCreateTime(startTime, endTime); + } + + @Override + public void initDepartments() { + List depts2Add = listDepts2Add(); + List depts2Update = listDepts2Update(); + screenCustomerDeptService.addAndUpdateDepartments(depts2Add, depts2Update); + } + + /** + * 查询需要更新的部门列表 + * @return + */ + private List listDepts2Update() { + ScreenCustomerDeptEntity lastUpdateDept = screenCustomerDeptService.getLastUpdateDept(); + + if (lastUpdateDept != null) { + // 不是第一次初始化 + Date endTime = new Date(); + Date startTime = lastUpdateDept.getUpdatedTime(); + return originCustomerDepartmentService.listDepartmentsByUpdatedTime(startTime, endTime); + } + + return new ArrayList<>(); + } + + /** + * 查询需要新增的部门列表 + * @return + */ + private List listDepts2Add() { + ScreenCustomerDeptEntity lastAddDept = screenCustomerDeptService.getLastAddDept(); + + Date startTime = null; + Date endTime = new Date(); + if (lastAddDept != null) { + startTime = lastAddDept.getCreatedTime(); + } + + return originCustomerDepartmentService.listDepartmentsByCreatedTime(startTime, endTime); + } + + @Override + public void initGrids() { + List grids2Add = listGrids2Add(); + List grids2Update =listGrids2Update(); + screenCustomerGridService.addAndUpdateGrids(grids2Add, grids2Update); + } + + private List listGrids2Update() { + ScreenCustomerGridEntity lastUpdateGrid = screenCustomerGridService.getLastUpdateGrid(); + if (lastUpdateGrid != null) { + Date endTime = new Date(); + Date startTime = lastUpdateGrid.getUpdatedTime(); + return customerGridService.listUpdatedGridsByUpdateTime(startTime, endTime); + } + + return new ArrayList(); + } + + private List listGrids2Add() { + ScreenCustomerGridEntity lastAddGrid = screenCustomerGridService.getLastAddGrid(); + + Date endTime = new Date(); + Date startTime = null; + if (lastAddGrid != null) { + startTime = lastAddGrid.getCreatedTime(); + } + + return customerGridService.listGridsByCreateTime(startTime, endTime); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java index 15178715ed..f7d5900682 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java @@ -9,5 +9,5 @@ public interface CustomerDepartmentService { List listDepartmentsByCreatedTime(Date createdTimeFrom, Date createdTimeTo); - List listDepartmentsByUpdatedTime(Date createdTime, Date initTime); + List listDepartmentsByUpdatedTime(Date startTime, Date endTime); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index b2b7a5b129..2cdee8ccad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -3,6 +3,7 @@ package com.epmet.service.org; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import java.util.Date; @@ -40,4 +41,13 @@ public interface CustomerGridService { * @return */ List listUpdatedGridsByUpdateTime(Date lastInitTime, Date now); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询客户下的网格的agencyId, 还有pid + * @Date 2020/9/16 14:02 + **/ + List queryGridInfoList(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index 5bab5596a7..fa8018e1e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.dao.org.CustomerGridDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.org.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -51,4 +52,16 @@ public class CustomerGridServiceImpl implements CustomerGridService { public List listUpdatedGridsByUpdateTime(Date lastInitTime, Date now) { return customerGridDao.listUpdatedGridsByUpdateTime(lastInitTime, now); } + + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 查询客户下的网格的agencyId, 还有pid + * @Date 2020/9/16 14:02 + **/ + @Override + public List queryGridInfoList(String customerId) { + return customerGridDao.selectListGridInfo(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java new file mode 100644 index 0000000000..df2dd2741e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java @@ -0,0 +1,40 @@ +package com.epmet.service.partymember; + +import com.epmet.dto.party.PartyMemberDTO; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/17 1:52 下午 + */ +public interface PartyMemberService { + + /** + * @Description 查询党员信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 1:58 下午 + */ + List selectPartyMemberInfo(String customerId, String dateId); + + /** + * 获取客户网格下注册党员 + * @author zhaoqifeng + * @date 2020/9/16 10:51 + * @param customerId + * @return java.util.List + */ + List getPartyMemberByCustomer(String customerId); + + /** + * @return java.util.List + * @param volunteerUserIds + * @author yinzuomei + * @description 志愿者中,同时是党员的人数 + * @Date 2020/9/21 16:46 + **/ + List getVolunteerPartyUserIds(List volunteerUserIds); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java new file mode 100644 index 0000000000..88fd54bcc4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java @@ -0,0 +1,56 @@ +package com.epmet.service.partymember.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.partymember.PartyMemberDao; +import com.epmet.dto.party.PartyMemberDTO; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.service.partymember.PartyMemberService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/17 1:53 下午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.PARTY_MEMBER) +public class PartyMemberServiceImpl implements PartyMemberService { + + @Autowired + private PartyMemberDao partyMemberDao; + + /** + * @Description 查询党员信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 1:58 下午 + */ + @Override + public List selectPartyMemberInfo(String customerId, String dateId){ + return partyMemberDao.selectPartyMemberInfo(customerId, dateId); + } + + @Override + public List getPartyMemberByCustomer(String customerId) { + return partyMemberDao.selectPartyMemberByCustomer(customerId); + } + + /** + * @return java.util.List + * @param volunteerUserIds + * @author yinzuomei + * @description 志愿者中,同时是党员的人数 + * @Date 2020/9/21 14:10 + **/ + @Override + @DataSource(DataSourceConstant.PARTY_MEMBER) + public List getVolunteerPartyUserIds(List volunteerUserIds) { + return partyMemberDao.selectVolunteerPartyUserIds(volunteerUserIds); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/UserPointService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/UserPointService.java new file mode 100644 index 0000000000..ce185cad6a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/UserPointService.java @@ -0,0 +1,18 @@ +package com.epmet.service.point; + +import java.util.Map; + +/** + * 用户积分库 + * */ +public interface UserPointService { + + /** + * @Description 根据客户Id查询用户积分Map + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 16:00 + **/ + Map getUserPointMap(String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/impl/UserPointServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/impl/UserPointServiceImpl.java new file mode 100644 index 0000000000..0402afe418 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/impl/UserPointServiceImpl.java @@ -0,0 +1,46 @@ +package com.epmet.service.point.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.point.PointDao; +import com.epmet.dto.point.UserPointDTO; +import com.epmet.service.point.UserPointService; +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.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description + * @ClassName UserPointServiceImpl + * @Auth wangc + * @Date 2020-09-25 15:54 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EPMET_POINT) +public class UserPointServiceImpl implements UserPointService { + + @Autowired + private PointDao pointDao; + /** + * @Description 根据客户Id查询用户积分Map + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 16:00 + **/ + @Override + public Map getUserPointMap(String customerId) { + List points = pointDao.selectUserPointByCustomerId(customerId); + Map map = new HashMap<>(); + if(!CollectionUtils.isEmpty(points)){ + points.forEach(point -> {map.put(point.getUserId(),point.getPointTotal());}); + } + return map; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java index 729e724267..66dc3dfe10 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -18,10 +18,15 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.project.FinishOrgDTO; +import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import java.util.List; +import java.util.Map; /** * 项目处理进展表 @@ -37,4 +42,86 @@ public interface ProjectProcessService extends BaseService * @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) **/ List getProcessList(ProjectEntity projectEntity); + + /** + * 根据客户查询项目处理进展 + * @author zhaoqifeng + * @date 2020/9/16 15:42 + * @param customerId + * @param date + * @return java.util.List + */ + List getProcessListByCustomer(String customerId, String date); + + /** + * 根据客户查询响应节点 + * @author zhaoqifeng + * @date 2020/9/30 16:27 + * @param customerId + * @param date + * @return java.util.List + */ + List getResponseProcessList(String customerId, String date); + + /** + * 查询各个节点的受理人 + * @author zhaoqifeng + * @date 2020/9/17 10:53 + * @param customerId + * @param date + * @return java.util.List + */ + List getProcessStaffByCustomer(String customerId, String date); + + /** + * 获取满意度评价记录 + * @author zhaoqifeng + * @date 2020/9/17 13:59 + * @param customerId + * @param date + * @return java.util.List + */ + List getSatisfactionRecord(String customerId, String date); + + /** + * 获取已结案的项目列表 + * @author zhaoqifeng + * @date 2020/9/17 14:43 + * @param customerId + * @param date + * @return java.util.List + */ + List getClosedProjectList(String customerId, String date); + + /** + * @Description 查询各机关项目节点历时 + * @param isFirst 是否首次 + * @param customerId + * @param date + * @return + * @author wangc + * @date 2020.09.18 13:38 + **/ + List getProjectPeriod(Boolean isFirst,String customerId,String date); + + /** + * 获取办结组织 + * @author zhaoqifeng + * @date 2020/9/20 21:11 + * @param customerId + * @param date + * @return java.util.List + */ + List getFinishOrg(String customerId, String date); + + /** + * @Description 获得项目最新操作 + * @param list + * @param customerId + * @return java.util.Map + * @author wangc + * @date 2020.09.28 14:44 + */ + Map selectLatestOperation(List list, String customerId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 45929aebb7..0b0692ba21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -18,8 +18,10 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectInfoDTO; import com.epmet.entity.project.ProjectEntity; import java.util.List; @@ -78,4 +80,23 @@ public interface ProjectService extends BaseService { * @return java.util.List */ List getGridClosedProjectInc(String customerId, String date); + + /** + * 获取项目信息 + * @author zhaoqifeng + * @date 2020/9/15 16:09 + * @param customerId + * @param date + * @return java.util.List + */ + List getProjectInfo(String customerId, String date); + + /** + * 获取用户可滞留天数 + * @author zhaoqifeng + * @date 2020/9/28 10:15 + * @param customerId + * @return java.lang.String + */ + String getParameterValueByKey(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index de1a52e1c2..074bff1979 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -19,14 +19,26 @@ package com.epmet.service.project.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.project.ProjectProcessDao; +import com.epmet.dto.form.CommonStaffIdFormDTO; +import com.epmet.dto.project.FinishOrgDTO; +import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.service.project.ProjectProcessService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; -import java.util.List; +import java.util.*; +import java.util.stream.Collector; +import java.util.stream.Collectors; /** * 项目处理进展表 @@ -34,6 +46,7 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2020-05-11 */ +@Slf4j @Service @DataSource(DataSourceConstant.GOV_PROJECT) public class ProjectProcessServiceImpl extends BaseServiceImpl implements ProjectProcessService { @@ -47,4 +60,153 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl getProcessList(ProjectEntity projectEntity) { return baseDao.selectProcessList(projectEntity); } + + @Override + public List getProcessListByCustomer(String customerId, String date) { + return baseDao.selectProcessListByCustomer(customerId, date); + } + + @Override + public List getResponseProcessList(String customerId, String date) { + return baseDao.selectResponseProcessList(customerId, date); + } + + @Override + public List getProcessStaffByCustomer(String customerId, String date) { + return baseDao.selectProcessStaffByCustomer(customerId, date); + } + + @Override + public List getSatisfactionRecord(String customerId, String date) { + return baseDao.selectSatisfactionRecordByCustomer(customerId, date); + } + + @Override + public List getClosedProjectList(String customerId, String date) { + return baseDao.selectClosedProjectList(customerId, date); + } + + /** + * @Description 查询各机关项目节点历时 + * @param isFirst 是否首次 + * @param customerId + * @param date + * @return + * @author wangc + * @date 2020.09.18 13:38 + **/ + @Override + public List getProjectPeriod(Boolean isFirst,String customerId, String date) { + List projectNodePeriodPerOrgList; + if(isFirst){ + projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,null); + }else{ + projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,date); + } + + if(!CollectionUtils.isEmpty(projectNodePeriodPerOrgList)){ + + Map> processMap + = projectNodePeriodPerOrgList.stream().collect(Collectors.groupingBy(ProjectOrgPeriodResultDTO :: getProcessId)); + + List projects = + projectNodePeriodPerOrgList.stream().map(ProjectOrgPeriodResultDTO::getProjectId).distinct().collect(Collectors.toList()); + if(!projects.isEmpty()){ + List responseList = baseDao.selectResponseTrace(projects); + Map> sorted = + responseList.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getProjectId)); + skipLevelGrouping(processMap,sorted); + List result = new LinkedList<>(); + processMap.values().forEach(list -> {list.forEach(obj -> {result.add(obj);});}); + return result; + } + } + + return new ArrayList<>(); + } + + @Override + public List getFinishOrg(String customerId, String date) { + return baseDao.selectFinishOrg(customerId, date); + } + + /** + * @Description 获得项目最新操作 + * @param list + * @param customerId + * @return java.util.Map + * @author wangc + * @date 2020.09.28 14:44 + */ + @Override + public Map selectLatestOperation(List list, String customerId) { + List operations = baseDao.selectLatestOperation(list); + if(CollectionUtils.isEmpty(operations)){ + return Collections.EMPTY_MAP; + }else{ + return operations.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,ProjectLatestOperationResultDTO :: getOperationName)); + } + + } + + /** + * @Description 跨级分组 eg -> transfer ; response response transfer ; return ; response close. + * @param dest - Map> 需要填充的数据 + * @param fillFactor - Map> 填充因子 + * @return + * @author wangc + * @date 2020.09.18 15:27 + **/ + private void skipLevelGrouping(Map> dest,Map> fillFactor){ + for(String projectId : fillFactor.keySet()){ + List projectTraceUnit = fillFactor.get(projectId); + if(!projectTraceUnit.isEmpty()){ + Map> staffResponseTrace = + projectTraceUnit.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getStaffId)); + if(!CollectionUtils.isEmpty(staffResponseTrace)){ + staffResponseTrace.keySet().forEach( staffId -> { + + if(!CollectionUtils.isEmpty(staffResponseTrace.get(staffId))){ + List staffResponseTraceUnit + = staffResponseTrace.get(staffId); + int lastEndCount = NumConstant.ONE_NEG; + for(int index = NumConstant.ZERO; index < staffResponseTraceUnit.size(); index ++){ + + if(StringUtils.equalsAny(staffResponseTraceUnit.get(index).getOperation(), + "transfer","return","close")){ + + replaceFirstResponseDate(dest,index,staffResponseTraceUnit,true); + + lastEndCount = index; + }else{ + if(lastEndCount == NumConstant.ONE_NEG) continue; + + if(index - NumConstant.ONE == lastEndCount){ + replaceFirstResponseDate(dest,index,staffResponseTraceUnit,false); + }else{continue;} + } + } + } + }); + } + + } + } + } + + private void replaceFirstResponseDate(Map> dest, int index, List staffResponseTraceUnit, boolean ifResponsed){ + List processSingleList = + dest.get(staffResponseTraceUnit.get(index).getProcessId()); + if(!CollectionUtils.isEmpty(processSingleList)){ + //ProjectOrgPeriodResultDTO element = processSingleList.get(NumConstant.ZERO); + ProjectOrgPeriodResultDTO element = processSingleList.stream().filter(node -> + StringUtils.equals(node.getStaffId(),staffResponseTraceUnit.get(index).getStaffId())).findFirst().get(); + if(!ifResponsed && null == element.getHandledDate()){ + log.warn("com.epmet.service.project.impl.ProjectProcessServiceImpl.skipLevelGrouping::已流出节点没有办结日期,节点ID{}",element.getProcessId() ); + } + element.setPeriodTillReplyFirstly(ifResponsed ? staffResponseTraceUnit.get(index).getCreatedTime() :element.getHandledDate()); + } + } + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 0a5bac27b6..fa22e2090e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -21,8 +21,10 @@ 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.project.ProjectDao; +import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectInfoDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.springframework.beans.factory.annotation.Autowired; @@ -70,4 +72,14 @@ public class ProjectServiceImpl extends BaseServiceImpl getProjectInfo(String customerId, String date) { + return baseDao.selectProjectInfo(customerId, date); + } + + @Override + public String getParameterValueByKey(String customerId) { + return baseDao.selectParameterValueByKey(customerId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index aad2cae314..e22b42c609 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -25,6 +25,7 @@ import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity; +import javax.xml.soap.SAAJResult; import java.util.Date; import java.util.List; import java.util.Map; @@ -176,4 +177,14 @@ public interface DimAgencyService extends BaseService { DimAgencyEntity getLatestCreatedAgencyDimEntity(); DimAgencyEntity getLatestUpdatedAgencyDimEntity(); + + /** + * 根据级别获取组织信息 + * @author zhaoqifeng + * @date 2020/9/20 17:29 + * @param customerId + * @param level + * @return java.util.List + */ + List getAgencyByLevel(String customerId, String level); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java new file mode 100644 index 0000000000..d231065d66 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -0,0 +1,134 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.result.PartyMemberInfoResultDTO; +import com.epmet.dto.stats.DimCustomerPartymemberDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.entity.stats.DimCustomerPartymemberEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +public interface DimCustomerPartymemberService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimCustomerPartymemberDTO + * @author generator + * @date 2020-09-17 + */ + DimCustomerPartymemberDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-17 + */ + void save(DimCustomerPartymemberDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-17 + */ + void update(DimCustomerPartymemberDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-17 + */ + void delete(String[] ids); + + /** + * @Description 统计党员 + * @param customerIdAndDateIdFormDTO + * @author zxc + * @date 2020/9/17 11:05 上午 + */ + Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO); + + /** + * @return java.util.List + * @param customerId 客户id + * @author yinzuomei + * @description 查询客户下所有的党员, 构造好党员相关-党建能力初始值 + * @Date 2020/9/18 9:03 + **/ + List selectPartyMemberList(String customerId); + + /** + * @Description 查询党员信息 + * @param customerId + * @param gridIds + * @author zxc + * @date 2020/9/22 5:26 下午 + */ + List selectPartyMemberInfo(String customerId,List gridIds); + /** + * @return java.util.List + * @param customerId + * @param orgId: 网格id 或者社区id + * @type grid,community + * @author yinzuomei 暂时这个方法没用 + * @description 查询在本网格或者社区注册 或者 组织下 的党员id + * @Date 2020/9/23 14:18 + **/ + List getPartyMemberUserIds(String customerId, String type,String orgId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java index 9d53593957..5a02299b44 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java @@ -116,4 +116,11 @@ public interface DimCustomerService extends BaseService { DimCustomerEntity getLatestCreatedDimEntity(); DimCustomerEntity getLatestUpdatedDimEntity(); + + /** + * @Description 查询所有客户ID + * @author zxc + * @date 2020/9/17 3:30 下午 + */ + List getAllCustomerId(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java index 767d5b8ffe..c1d5478153 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java @@ -110,4 +110,14 @@ public interface DimDepartmentService extends BaseService { DimDepartmentEntity getLatestCreatedDimEntity(); DimDepartmentEntity getLatestUpdatedDimEntity(); + + /** + * 获取区直部门列表 + * @author zhaoqifeng + * @date 2020/9/21 14:50 + * @param customerId + * @return java.util.List + */ + List getDistrictDepByCustomer(String customerId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java index b937efdf9e..f98f0dd75a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java @@ -23,6 +23,8 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.dto.stats.result.GridAttributesResultDTO; +import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.LastExecRecordEntity; @@ -129,4 +131,21 @@ public interface DimGridService extends BaseService { List selectSubAgencyId(List formDTO); DimGridEntity getLastUpdatedGridDim(); + + /** + * @Description 查询网格属于哪个机关 + * @param gridIds + * @author zxc + * @date 2020/9/17 2:34 下午 + */ + List selectGridBelongAgencyInfo(List gridIds); + + /** + * @Description 查询网格的所有所属上级属性 + * @param gridIds + * @return + * @author wangc + * @date 2020.09.20 13:01 + **/ + List getGridAttributes(String customerId,List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java index dc9d7e3d63..5838685418 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java @@ -18,9 +18,11 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import java.util.Collection; +import java.util.List; /** * 文章发布数量【机关】日统计表 @@ -42,4 +44,15 @@ public interface FactArticlePublishedAgencyDailyService extends BaseService values); + /** + * 获取组织文章数量 + * @author zhaoqifeng + * @date 2020/9/20 22:49 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getArticleCount(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/stats/FactArticlePublishedDepartmentDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java index 40ae1d8002..28baf7be81 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java @@ -18,9 +18,11 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.FactArticlePublishedDepartmentDailyDTO; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import java.util.Collection; +import java.util.List; /** * 文章发布数量【部门】日统计表 @@ -41,4 +43,14 @@ public interface FactArticlePublishedDepartmentDailyService extends BaseService< */ boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + /** + * 获取区直部门文章数量 + * @author zhaoqifeng + * @date 2020/9/20 22:49 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getDeptCount(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/FactArticlePublishedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java index d19038fa4e..f0b212f125 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java @@ -18,6 +18,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.result.PublishCountResultDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; @@ -55,5 +56,12 @@ public interface FactArticlePublishedGridDailyService extends BaseService values); - + /** + * @Description 查询网格下的文章发文数量 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 2:44 下午 + */ + List selectArticlePublishCount(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/FactIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java index b388e8ee58..944f38884b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java @@ -115,10 +115,22 @@ public interface FactIssueAgencyMonthlyService extends BaseService list); + + /** + * desc: 获取某月议题总数 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 3:30 下午 + */ + List getIssueIncCountAndTotalByMonthId(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/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java index a40b8c7236..494823db73 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 getIssueIncCountAndTotalByMonthId(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/ScreenCentralZoneDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java new file mode 100644 index 0000000000..0406c9f42a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java @@ -0,0 +1,22 @@ +package com.epmet.service.stats; + +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; + +import java.util.List; + +/** + * 大屏中央区数据抽取(form : date-statistical) + * */ +public interface ScreenCentralZoneDataExtractService { + + /** + * @Description 抽取中央区数据 + * @param customerId + * @param dimId + * @return + * @author wangc + * @date 2020.09.24 11:13 + **/ + List extractCentralZoneData(String customerId,String dimId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index ee4c56db29..f0f530fa4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -276,4 +276,9 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAgencyByLevel(String customerId, String level) { + return baseDao.selectDimAgencyByLevel(customerId, level); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java new file mode 100644 index 0000000000..5aa8fb1d26 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -0,0 +1,249 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.dto.form.TimeListResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.StatsConstant; +import com.epmet.dao.stats.DimCustomerPartymemberDao; +import com.epmet.dto.extract.result.PartyMemberInfoResultDTO; +import com.epmet.dto.stats.DimCustomerPartymemberDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.entity.stats.DimCustomerPartymemberEntity; +import com.epmet.service.partymember.PartyMemberService; +import com.epmet.service.stats.DimCustomerPartymemberService; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.service.stats.DimGridService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +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 java.util.*; +import java.util.stream.Collectors; + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +@Service +@Slf4j +public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl implements DimCustomerPartymemberService { + + @Autowired + private DimCustomerPartymemberDao partyMemberDao; + @Autowired + private PartyMemberService partyMemberService; + @Autowired + private DimGridService dimGridService; + @Autowired + private DimCustomerService dimCustomerService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimCustomerPartymemberDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimCustomerPartymemberDTO.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 DimCustomerPartymemberDTO get(String id) { + DimCustomerPartymemberEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimCustomerPartymemberDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimCustomerPartymemberDTO dto) { + DimCustomerPartymemberEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerPartymemberEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimCustomerPartymemberDTO dto) { + DimCustomerPartymemberEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerPartymemberEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 统计党员 + * @param customerIdAndDateIdFormDTO + * @author zxc + * @date 2020/9/17 11:05 上午 + */ + @Override + public Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { + String customerIdOne = customerIdAndDateIdFormDTO.getCustomerId(); + List customerIds = new ArrayList<>(); + List dateIds = new ArrayList<>(); + if (StringUtils.isNotBlank(customerIdOne)){ + customerIds.add(customerIdOne); + }else { + customerIds = dimCustomerService.getAllCustomerId(); + } + if (CollectionUtils.isEmpty(customerIds)){ + throw new RenException(StatsConstant.CUSTOMER_INFO_NULL); + } + if ((StringUtils.isBlank(customerIdAndDateIdFormDTO.getStartDate()) && StringUtils.isBlank(customerIdAndDateIdFormDTO.getEndDate()))){ + if (StringUtils.isNotBlank(customerIdAndDateIdFormDTO.getDateId())){ + dateIds.add(customerIdAndDateIdFormDTO.getDateId()); + }else { + dateIds.add(DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1))); + } + }else { + dateIds = DateUtils.getDaysBetween(customerIdAndDateIdFormDTO.getStartDate(), customerIdAndDateIdFormDTO.getEndDate()); + } + List finalDateIds = dateIds; + customerIds.forEach(customerId -> { + finalDateIds.forEach(dateId -> { + List partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId); + if (CollectionUtils.isEmpty(partyMemberList)){ + log.warn(String.format(StatsConstant.PARTY_INFO_LIST,customerId)); + return; + } + List gridIds = partyMemberList.stream().map(party -> party.getGridId()).distinct().collect(Collectors.toList()); + List agencyInfos = dimGridService.selectGridBelongAgencyInfo(gridIds); + TimeListResultDTO timeList = DateUtils.getTimeList(dateId); + partyMemberList.forEach(party -> { + BeanUtils.copyProperties(timeList,party); + agencyInfos.forEach(agency -> { + if (party.getGridId().equals(agency.getGridId())){ + party.setAgencyId(agency.getAgencyId()); + party.setParentId(agency.getParentId()); + party.setPids(agency.getPids()); + } + }); + }); + delAndInsertParty(partyMemberList,customerId,dateId); + }); + }); + return true; + } + + /** + * @param customerId 客户id + * @return java.util.List + * @author yinzuomei + * @description 查询客户下所有的党员, 构造好党员相关-党建能力初始值 + * @Date 2020/9/18 9:03 + **/ + @DataSource(value = DataSourceConstant.STATS) + @Override + public List selectPartyMemberList(String customerId) { + return baseDao.selectPartyMemberList(customerId); + } + + /** + * @Description 查询党员信息 + * @param customerId + * @param gridIds + * @author zxc + * @date 2020/9/22 5:26 下午 + */ + @Override + public List selectPartyMemberInfo(String customerId, List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectPartyMemberInfo(customerId, gridIds); + } + return new ArrayList<>(); + } + + /** + * @Description 删除旧纪录,插入新纪录 + * @param partyMemberList + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 2:46 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertParty(List partyMemberList,String customerId,String dateId){ + if (!CollectionUtils.isEmpty(partyMemberList)){ + partyMemberDao.deleteOldPartyRecord(customerId, dateId); + partyMemberDao.insertPartyMemberInfo(partyMemberList); + } + } + + + /** + * @param customerId + * @param orgId : 可能是gridId, 也可能是communityId, 也有可能是 pids + * @param type : grid,community + * @return java.util.List + * @author yinzuomei + * @description 查询在本网格注册的党员id,或者社区下的党员, 或者组织下的 + * @Date 2020/9/23 14:18 + **/ + @DataSource(value = DataSourceConstant.STATS) + @Override + public List getPartyMemberUserIds(String customerId, String type, String orgId) { + List partyMemberUserIds = new ArrayList<>(); + if ("grid".equals(type)) { + partyMemberUserIds = baseDao.selectGridPartyMemberUserIds(customerId, orgId); + } else if ("community".equals(type)) { + partyMemberUserIds = baseDao.selectCommunityPartyMemberUserIds(customerId, orgId); + } else if("agency".equals(type)){ + partyMemberUserIds = baseDao.selectPartyMemberUserIdsByPids(customerId, orgId); + } + return partyMemberUserIds; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java index cd5a1bad1d..367b06629b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java @@ -159,4 +159,14 @@ public class DimCustomerServiceImpl extends BaseServiceImpl getAllCustomerId() { + return baseDao.getAllCustomerId(); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java index bbc261910c..5b05345a16 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java @@ -158,4 +158,9 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl getDistrictDepByCustomer(String customerId) { + return baseDao.getDistrictDepByCustomer(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java index aa4091f60b..5062b8e94f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java @@ -34,17 +34,17 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.dto.stats.result.GridAttributesResultDTO; +import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.stats.DimGridService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 客户网格维度 @@ -165,4 +165,28 @@ public class DimGridServiceImpl extends BaseServiceImpl selectGridBelongAgencyInfo(List gridIds) { + return baseDao.selectGridBelongAgencyInfo(gridIds); + } + + /** + * @Description 查询网格的所有所属上级属性 + * @param gridIds + * @return + * @author wangc + * @date 2020.09.20 13:01 + **/ + @Override + public List getGridAttributes(String customerId,List gridIds) { + if(CollectionUtils.isEmpty(gridIds)) return Collections.EMPTY_LIST; + return baseDao.selectGridAttributes(customerId,gridIds); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java index c12d4b176f..a411475a62 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -22,6 +22,7 @@ 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.stats.FactArticlePublishedAgencyDailyDao; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; import lombok.extern.slf4j.Slf4j; @@ -30,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.Collection; +import java.util.List; /** * 文章发布数量【机关】日统计表 @@ -55,4 +57,11 @@ public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl< this.insertBatch(values, 100); return true; } + + @Override + public List getArticleCount(String customerId, String monthId, String level) { + return baseDao.selectArticleCount(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/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java index b21b0bb942..0630970f56 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java @@ -21,6 +21,7 @@ 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.stats.FactArticlePublishedDepartmentDailyDao; +import com.epmet.dto.stats.FactArticlePublishedDepartmentDailyDTO; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; import lombok.extern.slf4j.Slf4j; @@ -28,6 +29,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.Collection; +import java.util.List; /** * 文章发布数量【部门】日统计表 @@ -51,4 +53,9 @@ public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceI this.insertBatch(values, 100); return true; } + + @Override + public List getDeptCount(String customerId, String monthId) { + return baseDao.selectDeptCount(customerId, 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/FactArticlePublishedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java index 9ad55d632f..2b2b77edce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactArticlePublishedGridDailyDao; +import com.epmet.dto.extract.result.PublishCountResultDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; import com.epmet.service.stats.FactArticlePublishedGridDailyService; @@ -67,4 +68,16 @@ public class FactArticlePublishedGridDailyServiceImpl extends BaseServiceImpl selectArticlePublishCount(String customerId, String monthId) { + return baseDao.selectArticlePublishCount(customerId, 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/FactIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java index 2c3b7d46af..915bee4837 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java @@ -117,4 +117,9 @@ public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl getIssueIncCountAndTotalByMonthId(String customerId, String monthId) { + return baseDao.getIssueIncCountAndTotalByMonthId(customerId, 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..23ade86942 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 getIssueIncCountAndTotalByMonthId(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/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java new file mode 100644 index 0000000000..24811db736 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -0,0 +1,172 @@ +package com.epmet.service.stats.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.*; +import com.epmet.dao.stats.topic.FactTopicTotalGridDailyDao; + + + +import com.epmet.dao.stats.user.FactRegUserGridDailyDao; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.stats.ScreenCentralZoneDataExtractService; +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.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Description 大屏中央区数据抽取(form : date-statistical) + * @ClassName ScreenCentralZoneDataExtractServiceImpl + * @Auth wangc + * @Date 2020-09-24 11:15 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.STATS) +public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZoneDataExtractService { + + @Autowired + private FactRegUserGridDailyDao factRegUserGridDailyDao; + @Autowired + private FactGroupGridDailyDao factGroupGridDailyDao; + @Autowired + private FactTopicTotalGridDailyDao factTopicTotalGridDailyDao; + @Autowired + private FactIssueGridDailyDao factIssueGridDailyDao; + @Autowired + private FactAgencyProjectDailyDao factAgencyProjectDailyDao; + + + private final String ORG_LEVEL_AGENCY = "agency"; + private final String ORG_LEVEL_GRID = "grid"; + + + /** + * @Description 抽取中央区数据 + * @param customerId + * @param dimId + * @return + * @author wangc + * @date 2020.09.24 11:13 + **/ + @Override + public List extractCentralZoneData(String customerId, String dimId) { + + //1.查询用户与党员数据,判断dimId是否为昨天,如果根据这个dimId没有查询出结果,则取前天的数据 + //如果还是查不出数据,继续向下执行,这部分数据设置默认值 + + //注册用户数 + List result = + factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(result)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + result = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + if(null == result) result = new LinkedList<>(); + } + List gridUserResult = + factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + + if(CollectionUtils.isEmpty(gridUserResult)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridUserResult = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + if(!CollectionUtils.isEmpty(gridUserResult)){ + result.addAll(gridUserResult); + } + + //2.组 + List agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyGroup)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridGroup)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map groupMap = agencyGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal)); + groupMap.putAll(gridGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal))); + + + //3.话题 + List agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyTopic)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridTopic)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map topicMap = agencyTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal)); + topicMap.putAll(gridTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal))); + + //4.议题 + List agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyIssue)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridIssue)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map issueMap = agencyIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)); + issueMap.putAll(gridIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal))); + + //5.项目 + List agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyProject)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridProject)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map projectMap = agencyProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal)); + projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal))); + + result.forEach(o -> { + String orgId = o.getOrgId(); + Integer count = groupMap.get(orgId); + o.setGroupTotal(null == count ? NumConstant.ZERO : count); + + count = topicMap.get(orgId); + o.setTopicTotal(null == count ? NumConstant.ZERO : count); + + count = issueMap.get(orgId); + o.setIssueTotal(null == count ? NumConstant.ZERO : count); + + count = projectMap.get(orgId); + o.setProjectTotal(null == count ? NumConstant.ZERO : count); + o.setDataEndTime(dimId); + }); + + + + return result; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java index f489c17788..22923f3b3a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java @@ -19,6 +19,7 @@ package com.epmet.service.stats.user; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.result.UserCountResultDTO; import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; @@ -93,4 +94,13 @@ public interface FactParticipationUserAgencyDailyService extends BaseService selectUserCount(String customerId, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java index 5b4ef692c7..0f3ab1e3af 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java @@ -19,6 +19,7 @@ package com.epmet.service.stats.user; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.result.UserCountResultDTO; import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; @@ -93,4 +94,12 @@ public interface FactParticipationUserGridDailyService extends BaseService selectUserCount(String customerId,String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java index 6f5f7c4963..7875beea3f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java @@ -19,10 +19,10 @@ package com.epmet.service.stats.user; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; - import java.util.List; import java.util.Map; @@ -93,4 +93,27 @@ public interface FactRegUserAgencyMonthlyService extends BaseService + * @author LiuJanJun + * @date 2020/9/27 3:45 下午 + */ + List selectAgencyUserCount(String customerId, String monthId); + + /** + * 查询机关下各用户数量 + * + * @author zhaoqifeng + * @date 2020/9/27 14:02 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgUserCountByCustomer(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/stats/user/FactRegUserGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java index 11c7dd2e12..7917a3c001 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java @@ -19,6 +19,7 @@ package com.epmet.service.stats.user; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; @@ -93,4 +94,24 @@ public interface FactRegUserGridMonthlyService extends BaseService selectGridUserCount(String customerId,String monthId); + + /** + * 查询网格下各用户数量 + * + * @author zhaoqifeng + * @date 2020/9/27 14:02 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridUserCountByCustomer(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/user/impl/FactParticipationUserAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java index f606044f1f..6ad42a15fc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.user.FactParticipationUserAgencyDailyDao; +import com.epmet.dto.extract.result.UserCountResultDTO; import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; import com.epmet.service.stats.user.FactParticipationUserAgencyDailyService; @@ -98,4 +99,16 @@ public class FactParticipationUserAgencyDailyServiceImpl extends BaseServiceImpl baseDao.deleteBatchIds(Arrays.asList(ids)); } + /** + * @Description 查询机关下用户信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/23 9:57 上午 + */ + @Override + public List selectUserCount(String customerId, String dateId) { + return baseDao.selectUserCount(customerId, dateId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java index 8d6915f6fa..30516acafa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.user.FactParticipationUserGridDailyDao; +import com.epmet.dto.extract.result.UserCountResultDTO; import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; import com.epmet.service.stats.user.FactParticipationUserGridDailyService; @@ -99,4 +100,15 @@ public class FactParticipationUserGridDailyServiceImpl extends BaseServiceImpl selectUserCount(String customerId,String dateId) { + return baseDao.selectUserCount(customerId,dateId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java index 55925a2b81..b1bc32ea7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java @@ -20,15 +20,15 @@ package com.epmet.service.stats.user.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; 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.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.user.FactRegUserAgencyMonthlyDao; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -99,4 +99,14 @@ public class FactRegUserAgencyMonthlyServiceImpl extends BaseServiceImpl selectAgencyUserCount(String customerId, String monthId) { + return baseDao.selectAgencyUserCount(customerId, monthId); + } + + @Override + public List getOrgUserCountByCustomer(String customerId, String monthId, String level) { + return baseDao.selectOrgUserCountByCustomer(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/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java index 2054ea5909..b859133325 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.user.FactRegUserGridMonthlyDao; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; @@ -99,4 +100,21 @@ public class FactRegUserGridMonthlyServiceImpl extends BaseServiceImpl selectGridUserCount(String customerId, String monthId) { + return baseDao.selectGridUserCount(customerId, monthId); + } + + @Override + public List getGridUserCountByCustomer(String customerId, String monthId) { + return baseDao.selectGridUserCountByCustomer(customerId, monthId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index a83bc3a5c0..8acaa3c3ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -1,12 +1,18 @@ package com.epmet.service.topic; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.dto.topic.ResiTopicDTO; +import com.epmet.dto.topic.TopicOriginInfoDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.util.DimIdGenerator; import java.util.Date; import java.util.List; +import java.util.Map; /** * @Author wangc @@ -25,4 +31,56 @@ public interface TopicService { **/ TopicStatisticalData compute(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List statusDimension); + /** + * 根据ids获取话题信息 + * @author zhaoqifeng + * @date 2020/9/15 17:52 + * @param ids + * @return java.util.List + */ + List getTopicByIds(List ids); + /** + * @return java.util.List + * @param customerId + * @param dateId yyyyMMdd + * @author yinzuomei + * @description 根据日期查询resi_topic_operation,返回所有对话体的操作记录 + * @Date 2020/9/15 18:12 + **/ + List queryTopicOriginInfoList(String customerId, String dateId); + /** + * @Description 查询话题创建者信息 + * @param topicIds + * @author zxc + * @date 2020/9/15 4:55 下午 + */ + List selectTopicInfo(List topicIds); + + /** + * @return java.util.List + * @param customerId + * @param updateDateId + * @author yinzuomei + * @description 查询在这一天发生变化的话题记录 + * @Date 2020/9/23 17:51 + **/ + List queryUpdateTopicOriginInfoList(String customerId, String updateDateId); + + /** + * @Description 查询话题(项目)的图片 + * @param list + * @return java.util.Map> + * @author wangc + * @date 2020.09.28 15:57 + */ + Map> getTopicImgs(List list); + + /** + * @Description 得到话题(项目)内容 + * @param list + * @return java.util.Map + * @author wangc + * @date 2020.09.28 16:28 + */ + Map getTopicContent(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 0bc3aacd65..61c926507d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -5,14 +5,19 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.*; -import com.epmet.dto.stats.topic.result.GridTopicData; import com.epmet.dto.stats.topic.result.GroupTopicData; import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.dto.topic.ResiTopicDTO; +import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; import com.epmet.dto.topic.result.ResiTopicResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.service.topic.TopicService; import com.epmet.service.user.impl.UserServiceImpl; import com.epmet.util.DimIdGenerator; @@ -22,10 +27,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; import java.util.*; +import java.util.stream.Collector; import java.util.stream.Collectors; /** @@ -94,6 +101,88 @@ public class TopicServiceImpl implements TopicService { } + @Override + public List getTopicByIds(List ids) { + return topicDao.selectTopicByIds(ids); + } + + + /** + * @Description 查询话题创建者信息 + * @param topicIds + * @author zxc + * @date 2020/9/15 4:55 下午 + */ + @Override + public List selectTopicInfo(List topicIds) { + return topicDao.selectTopicInfo(topicIds); + } + + /** + * @param customerId + * @param dateId + * @return java.util.List + * @author yinzuomei + * @description 查询在这一天发生变化的话题记录 + * @Date 2020/9/23 17:51 + **/ + @Override + public List queryUpdateTopicOriginInfoList(String customerId, String updateDateId) { + return topicDao.queryUpdateTopicOriginInfoList(customerId,updateDateId); + } + + /** + * @Description 查询话题的图片 + * @param list + * @return java.util.Map> + * @author wangc + * @date 2020.09.28 15:57 + */ + @Override + public Map> getTopicImgs(List list) { + if(CollectionUtils.isEmpty(list)) return Collections.EMPTY_MAP; + List imgs = topicDao.selectTopicImgs(list); + if(CollectionUtils.isEmpty(imgs)) return Collections.EMPTY_MAP; + //key -> topicId | value -> projectId + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + //key -> topicId + Map> result + = imgs.stream().collect(Collectors.groupingBy(ScreenDifficultyImgDataEntity :: getEventId)); + Map> projectResult = new HashMap<>(); + result.forEach((topic,imgList) -> { + if(!CollectionUtils.isEmpty(imgList)){ + imgList.forEach(img -> { + img.setEventId(projectTopicMap.get(topic)); + }); + } + projectResult.put(projectTopicMap.get(topic),imgList); + }); + + return projectResult; + } + + /** + * @Description 得到话题(项目)内容 + * @param list + * @return java.util.Map + * @author wangc + * @date 2020.09.28 16:28 + */ + @Override + public Map getTopicContent(List list) { + if(CollectionUtils.isEmpty(list)) return Collections.EMPTY_MAP; + List contents = topicDao.selectTopicContent(list); + if(CollectionUtils.isEmpty(contents)) return Collections.EMPTY_MAP; + Map topicContentMap = contents.stream().collect(Collectors.toMap(TopicContentResultDTO :: getTopicId,TopicContentResultDTO::getContent)); + //key -> topicId | value -> projectId + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + Map result = new HashMap<>(); + projectTopicMap.forEach((topic,project) -> { + result.put(project,topicContentMap.get(topic)); + }); + return result; + } + /** * @Description 初始化机关-所有下级网格Map * @param pid - 固定一个机关Id @@ -219,8 +308,9 @@ public class TopicServiceImpl implements TopicService { List groupList = new LinkedList<>(); for(Map.Entry> entry : gridGroupMap.entrySet()){ - if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO) + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ groupList.addAll(entry.getValue()); + } } //key -> groupId @@ -353,8 +443,9 @@ public class TopicServiceImpl implements TopicService { List groupListBetweenTimeRange = new LinkedList<>(); for(Map.Entry> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){ - if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO) + if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO){ groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue()); + } } List operationsBetweenTimeRange = topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDateCheck); @@ -447,9 +538,9 @@ public class TopicServiceImpl implements TopicService { * @date 2020.06.22 16:03 **/ Map traverseGroupTopic(List groups, Map> topicOperationMap){ - if(null == groups || groups.size() < NumConstant.ONE) + if(null == groups || groups.size() < NumConstant.ONE){ return null; - + } Map groupTopicStatistical = new HashMap<>(); groups.forEach(group -> { @@ -477,7 +568,9 @@ public class TopicServiceImpl implements TopicService { //}else{ for (ResiTopicResultDTO topic : group.getTopics()) { - if(StringUtils.isBlank(topic.getTopicId())) continue; + if(StringUtils.isBlank(topic.getTopicId())){ + continue; + } if (StringUtils.equals(NumConstant.ONE_STR, topic.getIncrFlag())) { groupTopicData.setTopicIncr(groupTopicData.getTopicIncr() + NumConstant.ONE); } @@ -966,8 +1059,9 @@ public class TopicServiceImpl implements TopicService { List groupList = new LinkedList<>(); for(Map.Entry> entry : gridGroupMap.entrySet()){ - if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO) + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ groupList.addAll(entry.getValue()); + } } //key -> groupId @@ -1134,8 +1228,9 @@ public class TopicServiceImpl implements TopicService { List groupListBetweenTimeRange = new LinkedList<>(); for(Map.Entry> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){ - if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO) + if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO){ groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue()); + } } List operationsBetweenTimeRange = topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDate); @@ -1251,5 +1346,17 @@ public class TopicServiceImpl implements TopicService { } - + /** + * @param customerId + * @param dateId + * @return java.util.List + * @author yinzuomei + * @description 根据日期查询resi_topic_operation,返回所有对话题操作记录 + * @Date 2020/9/15 18:13 + **/ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List queryTopicOriginInfoList(String customerId, String dateId) { + return topicDao.selectListTopicOriginInfo(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index cd4c70287b..767af842b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -1,8 +1,11 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.util.DimIdGenerator; +import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @@ -27,4 +30,49 @@ public interface UserService { * @date 2020.06.18 10:03 **/ UserStatisticalData traverseGridUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension); + + /** + * @Description 查询用户是不是党员 + * @param userIds + * @author zxc + * @date 2020/9/15 4:23 下午 + */ + Map selectUserIsParty(List userIds); + + /** + * @Description 查询客户下的党员userId + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 15:01 + **/ + List getPartymembersByCustomerId(String customerId); + + /** + * @Description 查询客户下的热心居民Id以及所在网格Id + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 15:01 + **/ + List getWarmHeartedByCustomerId(String customerId); + + /** + * @return java.util.List + * @param customerId + * @param gridId + * @author yinzuomei + * @description 查询当前网格下,首次注册的用户ids + * @Date 2020/9/21 16:44 + **/ + List getGridRegUserIds(String customerId, String gridId); + + /** + * @Description 获取客户下的网格注册居民 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 13:54 + **/ + List getRegisteredUserList(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 3882b0d524..faf43458cd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -3,11 +3,15 @@ package com.epmet.service.user.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.ExtractConstant; import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.service.user.UserService; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; @@ -16,11 +20,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; -import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** @@ -118,6 +123,60 @@ public class UserServiceImpl implements UserService { return dataPacket; } + /** + * @Description 查询用户是不是党员 + * @param userIds + * @author zxc + * @date 2020/9/15 4:23 下午 + */ + @Override + public Map selectUserIsParty(List userIds) { + List userPartyResultDTOS = userDao.selectUserIsParty(userIds); + Map result = new HashMap<>(); + if (!CollectionUtils.isEmpty(userPartyResultDTOS)){ + Map> collect = userPartyResultDTOS.stream().collect(Collectors.groupingBy(UserPartyResultDTO::getUserId)); + collect.forEach((userId,c) -> { + AtomicReference isParty = new AtomicReference<>(false); + c.forEach(user -> { + if (user.getRoleName().equals(ExtractConstant.PARTY)){ + isParty.set(true); + } + }); + result.put(userId,isParty.get() == true ? NumConstant.ONE : NumConstant.ZERO); + }); + } + for (String userId : userIds) { + if (!result.containsKey(userId)){ + result.put(userId,NumConstant.ZERO); + } + } + return result; + } + + /** + * @Description 查询客户下的党员userId + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 15:01 + **/ + @Override + public List getPartymembersByCustomerId(String customerId) { + return userDao.selectPartymembersByCustomerId(customerId); + } + + /** + * @Description 查询客户下的热心居民Id以及所在网格Id + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 15:01 + **/ + @Override + public List getWarmHeartedByCustomerId(String customerId) { + return userDao.selectWarmHeartedByCustomerId(customerId); + } + /** * @Description 初始化机关-所有下级网格Map @@ -298,10 +357,6 @@ public class UserServiceImpl implements UserService { dataPacket.setPartiAgencyDailyList(list); } - - - - FactRegUserAgencyMonthlyDTO regAgencyM = new FactRegUserAgencyMonthlyDTO(); regAgencyM.setCustomerId(customerId); regAgencyM.setAgencyId(agencyId); @@ -636,28 +691,42 @@ public class UserServiceImpl implements UserService { } - } - public static void main(String[] args) { - - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); - //calendar.set(Calendar.DAY_OF_MONTH, 1); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - System.out.println(format.format(calendar.getTime())); - - + /** + * @return java.util.List + * @param customerId + * @param gridId + * @author yinzuomei + * @description 查询当前网格下,首次注册的用户ids + * @Date 2020/9/21 13:44 + **/ + @Override + @DataSource(DataSourceConstant.EPMET_USER) + public List getGridRegUserIds(String customerId, String gridId) { + return userDao.selectGridRegUserIds(customerId,gridId); + } - calendar.setTime(calendar.getTime()); - calendar.add(Calendar.DATE, -1); - System.out.println(calendar.getTime()); - System.out.println(format.format(calendar.getTime())); - System.out.println(format2.format(calendar.getTime())); + /** + * @Description 获取客户下的网格注册居民 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 13:54 + **/ + @Override + public List getRegisteredUserList(String customerId) { + List userList = userDao.selectRegisteredUserByCustomerId(customerId); + List partyList = userDao.selectPartymembersByCustomerId(customerId); + if(!CollectionUtils.isEmpty(userList)){ + userList.forEach(user -> { + if(partyList.contains(user.getUserId())){ + user.setPartyFlag(NumConstant.ONE); + } + }); + } + return userList; } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java index 1eecc8cf36..599e566540 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java @@ -3,11 +3,11 @@ package com.epmet.support.normalizing; import java.math.BigDecimal; /** - * 分值常量 + * 分值常量 归一区间 */ public class ScoreConstants { - public static final BigDecimal MIN_SCORE = new BigDecimal(0); + public static final BigDecimal MIN_SCORE = new BigDecimal(60); public static final BigDecimal MAX_SCORE = new BigDecimal(100); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java index 786ec50233..47be178b7a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -1,6 +1,11 @@ package com.epmet.support.normalizing.batch; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; import java.math.BigDecimal; import java.math.RoundingMode; @@ -58,15 +63,30 @@ public class BatchScoreCalculator { String sampleId = vo.getSampleId(); //归一后的值 BigDecimal normalizeValue;// = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); - //如果不需要归一 则 直接value*权重 + + BigDecimal minScoreValue = idx.getScoreCalculator().getMinScore(); + BigDecimal maxScoreValue = idx.getScoreCalculator().getMaxScore(); + + //1.如果是分数值(平均值)不需要归一 则 直接value*权重 + //2.否则 先判断 样本值是否相等 是:反正切函数 否:归一算法 if (idx.isScore()) { + vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString())); normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold); } else { - normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); - } - //反正切函数 [-pi/2,pi/2] - if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) { - normalizeValue = new BigDecimal(Math.atan(new Double(vo.getSampleValue().toString())) / Math.PI * 100).setScale(6, RoundingMode.HALF_UP); + if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) { + //*((max-min)/ (Math.PI/2))+min + //Math.atan(new Double(vo.getSampleValue().toString()))* + normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) + .multiply( + (maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) + .add(minScoreValue).setScale(6, RoundingMode.HALF_UP); + // + if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) { + normalizeValue = maxScoreValue.subtract(normalizeValue); + } + } else { + normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); + } } BigDecimal score = normalizeValue.multiply(weight).setScale(6, RoundingMode.HALF_UP); CalculateResult result = scoreCountOfSamples.get(sampleId); @@ -79,9 +99,9 @@ public class BatchScoreCalculator { result.setDetails(new ArrayList<>()); scoreCountOfSamples.put(sampleId, result); } - IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), normalizeValue, idx.getWeight()); + IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), String.valueOf(vo.getSampleValue()), normalizeValue, idx.getWeight()); result.getDetails().add(sampleScore); - result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); + result.setTotalScore(result.getTotalScore().add(score)); } } @@ -105,4 +125,16 @@ public class BatchScoreCalculator { ? bdRealValue : threshold; } + + public static void main(String[] args) { + List indexInputVOS = new ArrayList<>(); + String jsonStr = "{\"allParentIndexCode\":\"quanquxiangguan:zhilinengli\",\"indexId\":\"suoyoujiedaozlnlpjz\",\"indexValueVOs\":[{\"sampleId\":\"7b6f9a9f9f38d5f9fa7ce94a93d6eb28\",\"sampleValue\":69.830369}],\"score\":true,\"scoreCalculator\":{\"coefficient\":0,\"correlation\":\"POSITIVE\",\"maxScore\":100,\"maxValue\":69.830369,\"minScore\":60,\"minValue\":69.830369},\"threshold\":-1.0000,\"weight\":0.8000}"; + IndexInputVO vo = JSON.parseObject(jsonStr, IndexInputVO.class); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(new BigDecimal("69.830369"), new BigDecimal("69.830369"), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(Correlation.POSITIVE.getCode())); + vo.setScoreCalculator(sc); + indexInputVOS.add(vo); + BatchScoreCalculator sc2 = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = sc2.getScoreTotalOfSampleId(indexInputVOS); + System.out.println(JSON.toJSONString(scoreTotalOfSampleId)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java index dd971eadc3..ab5a14088e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -22,6 +22,10 @@ public class IndexScoreVo implements Serializable { * 所有指标code拼接的字符串 冒号隔开 */ private String allParentIndexCode; + /** + * 参与计算的原始值 + */ + private String originValue; /** * 分值 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index c2b2f726f4..8f22922df8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -170,6 +170,21 @@ dynamic: url: @datasource.druid.evaluationIndex.url@ username: @datasource.druid.evaluationIndex.username@ password: @datasource.druid.evaluationIndex.password@ + partyMember: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.partyMember.url@ + username: @datasource.druid.partyMember.username@ + password: @datasource.druid.partyMember.password@ + epmetHeart: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.epmetHeart.url@ + username: @datasource.druid.epmetHeart.username@ + password: @datasource.druid.epmetHeart.password@ + epmetPoint: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.epmetPoint.url@ + username: @datasource.druid.epmetPoint.username@ + password: @datasource.druid.epmetPoint.password@ thread: # 线程池配置 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.4__screen_org_add_source_col.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.4__screen_org_add_source_col.sql new file mode 100644 index 0000000000..fe2f474600 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.4__screen_org_add_source_col.sql @@ -0,0 +1,5 @@ +# alter table screen_customer_agency add column SOURCE_TYPE varchar(20) default 'external' after AREA_CODE; +# alter table screen_customer_dept add column SOURCE_TYPE varchar(20) default 'external' after DEPT_MARK; +# alter table screen_customer_grid add column SOURCE_TYPE varchar(20) default 'external' after PARTY_MARK; + +select 1; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index 99ae63af58..f099678400 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -149,6 +149,16 @@ + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml new file mode 100644 index 0000000000..1190fcb7d4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml new file mode 100644 index 0000000000..e29c6c19f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ 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 new file mode 100644 index 0000000000..4710c224fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + DELETE FROM + fact_origin_group_main_daily + WHERE + CUSTOMER_ID = #{customerId} + + + + + + DELETE FROM + fact_origin_group_member_daily + WHERE + CUSTOMER_ID = #{customerId} + + + + AND MONTH_ID = #{dimId} + + + AND DATE_ID = #{dimId} + + + + + + + DELETE FROM + fact_origin_group_main_daily + + CUSTOMER_ID = #{customerId} + + ID = #{groupId} + + + + + + UPDATE fact_origin_group_main_daily + SET IS_OWNER_PARTY = 1 + + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + + GROUP_OWNER_ID = #{ownerId} + + + + + + UPDATE fact_origin_group_main_daily + SET IS_OWNER_HEARTED = 1 + + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + + (GROUP_OWNER_ID = #{item.userId} AND GRID_ID = #{item.gridId}) + + + + + + INSERT INTO fact_origin_group_main_daily + ( + + id, + customer_id, + group_state, + grid_id, + agency_id, + parent_id, + pids, + date_id, + week_id, + month_id, + quarter_id, + year_id, + resi_member_count, + member_total, + group_owner_id, + is_owner_hearted, + is_owner_party, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + )VALUES + + ( + #{item.id}, + #{item.customerId}, + #{item.groupState}, + #{item.gridId}, + #{item.agencyId}, + #{item.parentId}, + #{item.pids}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + 0, + #{item.memberTotal}, + #{item.groupOwnerId}, + + + 0, + + + #{item.isOwnerHearted}, + + + + + + 0, + + + #{item.isOwnerParty}, + + + + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + + ) + + + + + + INSERT INTO fact_origin_group_member_daily + ( + id, + group_id, + grid_id, + agency_id, + parent_id, + pids, + member_id, + customer_id, + leader_flag, + date_id, + week_id, + month_id, + quarter_id, + year_id, + action_code, + revision, + del_flag, + created_by, + created_time, + updated_by, + updated_time + )VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.groupId}, + #{item.gridId}, + #{item.agencyId}, + #{item.parentId}, + #{item.pids}, + #{item.memberId}, + #{item.customerId}, + #{item.leaderFlag}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.actionCode}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..d54794d323 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -0,0 +1,156 @@ + + + + + + + + INSERT INTO fact_origin_issue_log_daily ( + ID, + CUSTOMER_ID, + GRID_ID, + PID, + PIDS, + AGENCY_ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_ID, + OPERATION_USER_ID, + ACTION_CODE, + IS_PARTY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.gridId}, + #{item.pid}, + #{item.pids}, + #{item.agencyId}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.issueId}, + #{item.operationUserId}, + #{item.actionCode}, + #{item.isParty}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_origin_issue_log_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml new file mode 100644 index 0000000000..42949df17b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -0,0 +1,294 @@ + + + + + + + + INSERT INTO fact_origin_issue_main_daily( + ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + CUSTOMER_ID, + IS_PARTY, + USER_ID, + CREATE_TOPIC_USER_ID, + TOPIC_ID, + GRID_ID, + PID, + PIDS, + AGENCY_ID, + ISSUE_STATUS, + RESOLVE_TYPE, + TOPIC_USER_IS_PARTY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) + VALUES + + ( + #{item.id}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.customerId}, + #{item.isParty}, + #{item.userId}, + #{item.createTopicUserId}, + #{item.topicId}, + #{item.gridId}, + #{item.pid}, + #{item.pids}, + #{item.agencyId}, + #{item.issueStatus}, + #{item.resolveType}, + #{item.topicUserIsParty}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + update fact_origin_issue_main_daily + set ISSUE_STATUS = #{status} + where id = #{issueId} + + + + + DELETE + FROM + fact_origin_issue_main_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..2db8a97d58 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -0,0 +1,528 @@ + + + + + + DELETE FROM + fact_origin_project_log_daily + WHERE + CUSTOMER_ID = #{customerId} + + AND DATE_ID = #{date} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..ec08e185d4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -0,0 +1,441 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM + fact_origin_project_main_daily + WHERE + CUSTOMER_ID = #{customerId} + + AND DATE_ID = #{date} + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..d0b868f62f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM + fact_origin_project_org_period_daily + WHERE + DEL_FLAG = '0' + + PROJECT_ID = #{item} + + + + + + + + insert into fact_origin_project_org_period_daily + ( + id, + customer_id, + project_id, + org_id, + org_type, + pid, + pids, + informed_date, + handled_date, + total_period, + period_till_reply_firstly, + is_resolved, + operation, + del_flag, + revision, + created_time, + created_by, + updated_time, + updated_by + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.projectId}, + #{item.orgId}, + #{item.orgType}, + + 0, + #{item.pid}, + + #{item.pids}, + #{item.informedDate}, + #{item.handledDate}, + #{item.totalPeriod}, + #{item.periodTillReplyFirstly}, + #{item.isResolved}, + #{item.operation}, + '0', + 0, + now(), + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT' + ) + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml new file mode 100644 index 0000000000..1d7bc88cab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml @@ -0,0 +1,146 @@ + + + + + + DELETE + FROM + fact_origin_topic_log_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + LIMIT #{deleteSize} + + + + insert into fact_origin_topic_log_daily + ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + PID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TOPIC_ID, + GROUP_ID, + ACTION_CODE, + OPERATE_USER_ID, + OPERATE_USER_IS_PARTY, + ORIGINAL_BUSINESS_TIME, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + PIDS + ) values + + ( + #{item.id}, + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.pid}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.topicId}, + #{item.groupId}, + #{item.actionCode}, + #{item.operateUserId}, + #{item.operateUserIsParty}, + #{item.originalBusinessTime}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.pids} + ) + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..a4f2d9bbaa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml @@ -0,0 +1,180 @@ + + + + + + + DELETE + FROM + fact_origin_topic_main_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + LIMIT #{deleteSize} + + + + insert into fact_origin_topic_main_daily + ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + PID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + GROUP_ID, + TOPIC_STATUS, + CREATE_TOPIC_USER_ID, + CREATE_TOPIC_USER_IS_PARTY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + PIDS, + CLOSED_STATUS + ) values + + ( + #{item.id}, + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.pid}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.groupId}, + #{item.topicStatus}, + #{item.createTopicUserId}, + #{item.createTopicUserIsParty}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.pids}, + #{item.closedStatus} + ) + + + + + + + + + + + + + + + + update fact_origin_topic_main_daily + set TOPIC_STATUS=#{topicStatus}, + CLOSED_STATUS=#{closedStatus}, + UPDATED_TIME=NOW() + where id = #{topicId} + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 65922677e5..9de83a3a9a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -101,13 +101,15 @@ PARENT_AGENCY_ID AS parentId FROM fact_index_agency_score fics + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID WHERE fics.del_flag = '0' - AND fics.customer_id = #{customerId} - AND fics.month_id = #{monthId} - AND fics.index_code = #{indexCode} + AND sca.level = 'district' + AND fics.customer_id = #{customerId} + AND fics.month_id = #{monthId} + AND fics.index_code = #{indexCode} AND fics.DATA_TYPE = #{dataType} - GROUP BY fics.parent_agency_id + GROUP BY fics.parent_agency_id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml new file mode 100644 index 0000000000..4504a7fe6c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml @@ -0,0 +1,46 @@ + + + + + + + delete from fact_index_agency_self_sub_score + where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and DATA_TYPE = #{dataType,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + and PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR} + limit 1000 + + + + INSERT INTO fact_index_agency_self_sub_score + (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, + DATA_TYPE, SELF_SCORE, SUB_SCORE, PARENT_INDEX_CODE,ALL_PARENT_INDEX_CODE, + SELF_WEIGHT,SUB_WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.dataType}, + #{item.selfScore}, + #{item.subScore}, + #{item.parentIndexCode}, + #{item.allParentIndexCode}, + #{item.selfWeight}, + #{item.subWeight}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml index 37b2450690..64cca5242c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml @@ -5,7 +5,7 @@ - INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, + INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES @@ -18,6 +18,7 @@ #{item.quarterId}, #{item.monthId}, #{item.dataType}, + #{item.originValue}, #{item.score}, #{item.indexCode}, #{item.allParentIndexCode}, @@ -45,4 +46,17 @@ LIMIT #{delNum} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index aca5ce3669..8be2f83314 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -83,6 +83,7 @@ WHERE fics.del_flag = '0' AND sca.DEL_FLAG = 0 + AND sca.level = 'street' AND fics.customer_id = #{customerId} AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml new file mode 100644 index 0000000000..f9fa8c6d9b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml @@ -0,0 +1,61 @@ + + + + + + + delete from fact_index_community_self_sub_score + where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + AND PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR} + limit 1000 + + + + INSERT INTO `fact_index_community_self_sub_score` ( + `ID`, + `CUSTOMER_ID`, + `AGENCY_ID`, + `PARENT_AGENCY_ID`, + `QUARTER_ID`, + `YEAR_ID`, + `MONTH_ID`, + `SELF_SCORE`, + `SUB_SCORE`, + `PARENT_INDEX_CODE`, + `ALL_PARENT_INDEX_CODE`, + `SELF_WEIGHT`, + `SUB_WEIGHT`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.selfScore}, + #{item.subScore}, + #{item.parentIndexCode}, + #{item.allParentIndexCode}, + #{item.selfWeight}, + #{item.subWeight}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml index bdf1146ae7..f4dfd8fbd9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml @@ -5,7 +5,7 @@ - INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, + INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES @@ -17,6 +17,7 @@ #{item.yearId}, #{item.quarterId}, #{item.monthId}, + #{item.originValue}, #{item.score}, #{item.indexCode}, #{item.allParentIndexCode}, @@ -43,4 +44,17 @@ LIMIT #{delNum} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml index 8fbb50a81d..bf0cfd3d51 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -148,4 +148,18 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml index 848323447a..ac0154854f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml @@ -14,24 +14,9 @@ - - - - - - - - - - - - - - - + SELECT + ID, + CUSTOMER_ID, + DEPT_ID, + AGENCY_ID, + QUARTER_ID, + YEAR_ID, + MONTH_ID, + ORIGIN_VALUE, + SCORE, + INDEX_CODE, + ALL_PARENT_INDEX_CODE, + WEIGHT + FROM + fact_index_dept_sub_score + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + AND ALL_PARENT_INDEX_CODE = #{allIndexCodePath,jdbcType=VARCHAR} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml new file mode 100644 index 0000000000..0fd2472f7e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index 499f3349f4..7f3912fa6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -110,8 +110,8 @@ m.YEAR_ID, m.MONTH_ID, m.IS_TOTAL, - M.SCORE, - M.INDEX_CODE + m.SCORE, + m.INDEX_CODE FROM fact_index_grid_score m WHERE @@ -135,10 +135,11 @@ sca.pid AS parentId FROM fact_index_grid_score figc - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID WHERE figc.del_flag = '0' AND sca.DEL_FLAG = 0 + AND sca.level = 'community' AND figc.customer_id = #{customerId} AND figc.month_id = #{monthId} AND figc.index_code = #{indexCode} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSelfSubScoreDao.xml new file mode 100644 index 0000000000..cb7a33fc47 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSelfSubScoreDao.xml @@ -0,0 +1,58 @@ + + + + + + delete from fact_index_grid_self_sub_score where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} AND PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR} limit 1000 + + + + INSERT INTO `fact_index_grid_self_sub_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `ALL_PARENT_IDS`, + `QUARTER_ID`, + `YEAR_ID`, + `MONTH_ID`, + `SELF_SCORE`, + `SUB_SCORE`, + `PARENT_INDEX_CODE`, + `ALL_PARENT_INDEX_CODE`, + `SELF_WEIGHT`, + `SUB_WEIGHT`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.selfScore}, + #{item.subScore}, + #{item.parentIndexCode}, + #{item.allParentIndexCode}, + #{item.selfWeight}, + #{item.subWeight}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml index 536f834564..056f92afb2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml @@ -14,6 +14,7 @@ `QUARTER_ID`, `YEAR_ID`, `MONTH_ID`, + `ORIGIN_VALUE`, `SCORE`, `INDEX_CODE`, ALL_PARENT_INDEX_CODE, @@ -36,6 +37,7 @@ #{item.quarterId}, #{item.yearId}, #{item.monthId}, + #{item.originValue}, #{item.score}, #{item.indexCode}, #{item.allParentIndexCode}, @@ -63,4 +65,28 @@ limit #{deleteSize} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index a84dff6a5c..e30d52c675 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -161,4 +161,106 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + + + + + + + + + INSERT INTO fact_index_govrn_ablity_grid_monthly ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_TOTAL, + AVG_ISSUE_COUNT, + ISSUE_TO_PROJECT_RATIO, + PROJECT_TOTAL, + SELF_SOLVE_PROJECT_COUNT, + RESOLVE_PROJECT_COUNT, + TRANSFER_RIGHT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.issueTotal}, + #{item.avgIssueCount}, + #{item.issueToProjectRatio}, + #{item.projectTotal}, + #{item.selfSolveProjectCount}, + #{item.resolveProjectCount}, + #{item.transferRightRatio}, + #{item.satisfactionRatio}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE FROM fact_index_govrn_ablity_grid_monthly + WHERE CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + LIMIT 1000 + 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 eb9a582759..3a4250d1ad 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 @@ -33,6 +33,12 @@ AND MONTH_ID = #{monthId} limit 1000; + + delete from fact_index_govrn_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND DATA_TYPE = #{type} + insert into fact_index_govrn_ablity_org_monthly @@ -109,4 +115,18 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 443d22edfa..788af38336 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -125,5 +125,63 @@ LIMIT #{offset},#{pageSize} - + + + insert into fact_index_party_ablity_cpc_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + CREATE_TOPIC_COUNT, + JOIN_TOPIC_COUNT, + SHIFT_ISSUE_COUNT, + SHIFT_PROJECT_COUNT, + JOIN_THREE_MEETS_COUNT, + GROUP_USER_COUNT, + GROUP_TOPIC_COUNT, + TOPIC_TO_ISSUE_RATIO, + GROUP_ACTIVE_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + USER_ID + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.createTopicCount}, + #{item.joinTopicCount}, + #{item.shiftIssueCount}, + #{item.shiftProjectCount}, + #{item.joinThreeMeetsCount}, + #{item.groupUserCount}, + #{item.groupTopicCount}, + #{item.topicToIssueRatio}, + #{item.groupActiveUserCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.userId} + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index 5f94b54fba..9208f9a533 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -193,4 +193,78 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + + INSERT INTO fact_index_party_ablity_grid_monthly ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + USER_COUNT, + PARTY_COUNT, + ACTIVE_USER_COUNT, + ACTIVE_PARTY_COUNT, + PARTY_AVG_TOPIC_COUNT, + USER_AVG_TOPIC_COUNT, + PARTY_AVG_SHIFT_PROJECT_COUNT, + USER_AVG_SHIFT_PROJECT_COUNT, + CREATE_GROUP_PARTY_COUNT, + PUBLISH_ARTICLE_COUNT, + ISSUE_TO_PROJECT_RATIO, + CREATE_THREE_MEETS_COUNT, + JOIN_THREE_MEETS_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.userCount}, + #{item.partyCount}, + #{item.activeUserCount}, + #{item.activePartyCount}, + #{item.partyAvgTopicCount}, + #{item.userAvgTopicCount}, + #{item.partyAvgShiftProjectCount}, + #{item.userAvgShiftProjectCount}, + #{item.createGroupPartyCount}, + #{item.publishArticleCount}, + #{item.issueToProjectRatio}, + #{item.createThreeMeetsCount}, + #{item.joinThreeMeetsCount}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_party_ablity_grid_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + LIMIT 1000 + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index 4aacf64da8..cf9146cc1f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -27,6 +27,12 @@ AND MONTH_ID = #{monthId} limit 1000; + + delete from fact_index_party_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND DATA_TYPE = #{type} + insert into fact_index_party_ablity_org_monthly diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index f3ec6462f2..2a4d8a7039 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -132,4 +132,66 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + + + + + insert into fact_index_service_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ACTIVITY_COUNT, + VOLUNTEER_RATIO, + PARTY_VOLUNTEER_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.activityCount}, + #{item.volunteerRatio}, + #{item.partyVolunteerRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index e87e17874f..a72642ef9a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -27,6 +27,12 @@ AND MONTH_ID = #{monthId} limit 1000; + + delete from fact_index_service_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND DATA_TYPE = #{type} + insert into fact_index_service_ablity_org_monthly diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml index 668ba89e2d..4f0c4d0c75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml @@ -6,4 +6,8 @@ + + + delete from index_group where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml index 76bec7b257..0fa884b2c7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml @@ -6,7 +6,7 @@ + + + delete from index_group_detail where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + + + + + + UPDATE index_group_detail + SET WEIGHT =#{weight},UPDATED_TIME=NOW() + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND INDEX_CODE = #{indexCode} + and ALL_PARENT_INDEX_CODE=#{allParentIndexCode} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml index a8e5f55a2e..5769bd5818 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml @@ -7,7 +7,7 @@ delete from index_group_detail_template diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupTemplateDao.xml index 92067e3247..e1fd380618 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupTemplateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupTemplateDao.xml @@ -7,7 +7,7 @@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.xml new file mode 100644 index 0000000000..757f39f347 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.xml @@ -0,0 +1,46 @@ + + + + + + + DELETE + FROM + screen_an_community_project_profile + WHERE + CUSTOMER_ID = #{customerId} + LIMIT 1000 + + + + INSERT INTO screen_an_community_project_profile + ( id, + customer_id, + data_end_time, + org_id, + project_total, + level, + created_by, + created_time, + updated_by, + updated_time + ) + values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.dataEndTime}, + #{item.orgId}, + #{item.projectTotal}, + #{item.level}, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.xml new file mode 100644 index 0000000000..5c6ce14824 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.xml @@ -0,0 +1,63 @@ + + + + + + + DELETE + FROM + screen_an_grass_roots_govern_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND + MONTH_ID = #{monthId} + LIMIT 1000 + + + + INSERT INTO screen_an_grass_roots_govern_monthly + ( + id, + customer_id, + month_id, + quarter_id, + year_id, + org_id, + org_name, + org_type, + pid, + parti_project_total, + closed_project_total, + project_response_ratio, + project_satis_ratio, + closed_project_ratio, + created_by, + created_time, + updated_by, + updated_time + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{quarterId}, + #{yearId}, + #{item.orgId}, + #{item.orgName}, + #{item.orgType}, + #{item.pid}, + #{item.partiProjectTotal}, + #{item.closedProjectTotal}, + #{item.projectResponseRatio}, + #{item.projectSatisRatio}, + #{item.closedProjectRatio}, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.xml new file mode 100644 index 0000000000..f72fa27b99 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.xml @@ -0,0 +1,60 @@ + + + + + + + DELETE + FROM + screen_an_grass_roots_org_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND + MONTH_ID = #{monthId} + LIMIT 1000 + + + + + INSERT INTO screen_an_grass_roots_org_monthly + ( + id, + customer_id, + month_id, + quarter_id, + year_id, + org_id, + org_name, + org_type, + pid, + group_total, + issue_total, + project_total, + created_by, + created_time, + updated_by, + updated_time + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{quarterId}, + #{yearId}, + #{item.orgId}, + #{item.orgName}, + #{item.orgType}, + #{item.pid}, + #{item.groupTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.xml new file mode 100644 index 0000000000..c76f1db82f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.xml @@ -0,0 +1,59 @@ + + + + + + + DELETE + FROM + screen_an_grass_roots_pm_rank + WHERE + CUSTOMER_ID = #{customerId} + LIMIT 1000 + + + + INSERT INTO screen_an_grass_roots_pm_rank + ( + id, + customer_id, + user_id, + user_name, + branch_id, + branch_name, + community_id, + community_name, + group_member_total, + topic_total, + parti_user_total, + issue_total, + all_parent_ids, + created_by, + created_time, + updated_by, + updated_time + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.userId}, + #{item.userName}, + #{item.branchId}, + #{item.branchName}, + #{item.communityId}, + #{item.communityName}, + #{item.groupMemberTotal}, + #{item.topicTotal}, + #{item.partiUserTotal}, + #{item.issueTotal}, + #{item.allParentIds}, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.xml new file mode 100644 index 0000000000..6f4b7b7e67 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.xml @@ -0,0 +1,61 @@ + + + + + + + DELETE + FROM + screen_an_grass_roots_pm_total_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND + MONTH_ID = #{monthId} + LIMIT 1000 + + + + INSERT INTO screen_an_grass_roots_pm_total_monthly + ( + id, + customer_id, + month_id, + quarter_id, + year_id, + org_id, + org_name, + org_type, + pid, + group_member_total, + topic_total, + topic_parti_user_total, + issue_total, + created_by, + created_time, + updated_by, + updated_time + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{quarterId}, + #{yearId}, + #{item.orgId}, + #{item.orgName}, + #{item.orgType}, + #{item.pid}, + #{item.groupMemberTotal}, + #{item.topicTotal}, + #{item.topicPartiUserTotal}, + #{item.issueTotal}, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + \ No newline at end of file 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 03270712ee..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 @@ -9,6 +9,69 @@ limit 1000; + + + + + + insert into screen_cpc_base_data ( @@ -64,5 +127,74 @@ + + + insert into screen_cpc_base_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + REGISTER_USER_COUNT, + RESI_TOTAL, + PARTY_MEMBER_COUNT, + AGE_LEVEL_1, + AGE_LEVEL_2, + AGE_LEVEL_3, + AGE_LEVEL_4, + AGE_LEVEL_5, + AGE_LEVEL_6, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + REPLACE(UUID(), '-', ''), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.registerUserCount}, + #{item.resiTotal}, + #{item.partyMemberCount}, + #{item.ageLevel1}, + #{item.ageLevel2}, + #{item.ageLevel3}, + #{item.ageLevel4}, + #{item.ageLevel5}, + #{item.ageLevel6}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + now(), + #{item.updatedBy}, + now() + ) + + + + + + + delete from screen_cpc_base_data + where CUSTOMER_ID = #{customerId} + and DATA_END_TIME = #{dateId} + and + ( + + 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 49ce41b17c..97eea5c398 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 @@ -24,6 +24,7 @@ PARTY_MARK, `LEVEL`, AREA_CODE, + IS_DISPLAY, DEL_FLAG, REVISION, CREATED_BY, @@ -46,6 +47,7 @@ #{item.partyMark}, #{item.level}, #{item.areaCode}, + ifnull(#{item.isDisplay},'1'), 0, 0, 'APP_USER', @@ -80,8 +82,10 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerBizOrgDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerBizOrgDao.xml new file mode 100644 index 0000000000..4287eea798 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerBizOrgDao.xml @@ -0,0 +1,39 @@ + + + + + + delete from screen_customer_biz_org + where CUSTOMER_ID = #{customerId} + and BIZ_TYPE = #{bizType,jdbcType=VARCHAR} + + + insert into screen_customer_biz_org + ( + ID, + CUSTOMER_ID, + ORG_ID, + BIZ_TYPE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgId}, + #{item.bizType}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 1533203d14..26c34d328b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -91,4 +91,76 @@ DEL_FLAG = '0' AND CUSTOMER_ID =#{customerId} + + + + + + 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 92486a3f10..9df4f5941f 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 @@ -126,11 +126,206 @@ SELECT GRID_ID gridId, GRID_NAME gridName, - PARENT_AGENCY_ID parentAgencyId + PARENT_AGENCY_ID parentAgencyId, + ALL_PARENT_IDS allParentIds FROM screen_customer_grid WHERE DEL_FLAG = '0' AND CUSTOMER_ID =#{customerId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml index 051f14cbcf..36536a08b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -18,6 +18,7 @@ PARENT_ID, ORG_NAME, EVENT_ID, + EVENT_TITLE, EVENT_IMG_URL, EVENT_SOURCE, EVENT_CONTENT, @@ -47,6 +48,7 @@ #{item.parentId}, #{item.orgName}, #{item.eventId}, + #{item.eventTitle}, #{item.eventImgUrl}, #{item.eventSource}, #{item.eventContent}, @@ -70,4 +72,149 @@ + + + + + + + + UPDATE + screen_difficulty_data + SET + DATA_END_TIME = #{dateId} + WHERE + DEL_FLAG = '0' + AND + CUSTOMER_ID = #{customerId} + + + + + DELETE + FROM screen_difficulty_data + WHERE + CUSTOMER_ID = #{customerId} + + + EVENT_ID = #{projectId} + + + + + + DELETE + FROM screen_difficulty_img_data + + + EVENT_ID = #{projectId} + + + + + + insert into screen_difficulty_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + EVENT_ID, + EVENT_IMG_URL, + EVENT_SOURCE, + EVENT_CONTENT, + EVENT_COST_TIME, + EVENT_RE_ORG, + EVENT_HANDLED_COUNT, + EVENT_CATEGORY_CODE, + EVENT_CATEGORY_NAME, + EVENT_STATUS_CODE, + EVENT_STATUS_DESC, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + LATEST_OPERATE_DESC, + DATA_END_TIME, + ALL_PARENT_IDS + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.eventId}, + #{item.eventImgUrl}, + #{item.eventSource}, + #{item.eventContent}, + #{item.eventCostTime}, + #{item.eventReOrg}, + #{item.eventHandledCount}, + #{item.eventCategoryCode}, + #{item.eventCategoryName}, + #{item.eventStatusCode}, + #{item.eventStatusDesc}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now(), + #{item.latestOperateDesc}, + #{item.dataEndTime}, + #{item.allParentIds} + ) + + + + + + insert into screen_difficulty_img_data + ( + ID, + EVENT_ID, + EVENT_IMG_URL, + SORT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.eventId}, + #{item.eventImgUrl}, + #{item.sort}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + 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 f569cb89a9..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,56 @@ 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} + + + insert into screen_govern_rank_data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml index f192c1373c..91ecd0a870 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml @@ -19,6 +19,7 @@ ORG_TYPE, ORG_ID, PARENT_ID, + ALL_PARENT_IDS, ORG_NAME, INDEX_TOTAL, PARTY_DEV_ABLITY, @@ -43,6 +44,7 @@ #{item.orgType}, #{item.orgId}, #{item.parentId}, + #{item.allParentIds}, #{item.orgName}, #{item.indexTotal}, @@ -99,4 +101,10 @@ where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} AND ORG_TYPE = #{orgType} limit 1000; + + + update screen_index_data_monthly m3 + SET m3.ALL_PARENT_IDS =#{allParentIds} + where m3.id=#{id} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml index 2cf5f7dc33..8da6637ec1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml @@ -8,6 +8,66 @@ where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} limit 1000; + + delete from screen_org_rank_data + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + + and ORG_TYPE=#{orgType} + + + and + ( + + ORG_ID = #{orgId} + + ) + + limit #{deleteSize} + + + insert into screen_org_rank_data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml index a7058e4a08..c8b84d14b4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml @@ -58,4 +58,113 @@ ) + + + + INSERT INTO screen_party_branch_data ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + TYPE, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + MEET_CATEGORY_ID, + MEET_CATEGORY_NAME, + ORGANIZE_COUNT, + JOIN_USER_COUNT, + AVERAGE_JOIN_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.type}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.meetCategoryId}, + #{item.meetCategoryName}, + #{item.organizeCount}, + #{item.joinUserCount}, + #{item.averageJoinUserCount}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + delete from screen_party_branch_data + where CUSTOMER_ID = #{customerId} + and MONTH_ID = #{monthId} + and + ( + + org_id = #{orgId} + + ) + LIMIT 1000 + + + + + + + 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/evaluationindex/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml index d4089fcc30..2d59208760 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml @@ -9,6 +9,12 @@ limit 1000; + + delete from screen_party_user_rank_data + where CUSTOMER_ID = #{customerId} + limit 1000; + + insert into screen_party_user_rank_data ( @@ -24,6 +30,7 @@ `NAME`, USER_NAME, POINT_TOTAL, + INDEX_SCORE, DEL_FLAG, REVISION, CREATED_BY, @@ -47,6 +54,7 @@ #{item.name}, #{item.userName}, #{item.pointTotal}, + IFNULL(#{item.indexScore},0), 0, 0, 'APP_USER', @@ -59,4 +67,56 @@ + + insert into screen_party_user_rank_data + ( + ID, + CUSTOMER_ID, + GRID_ID, + GRID_NAME, + ORG_ID, + ORG_NAME, + PARTY_FLAG, + USER_ID, + SURNAME, + `NAME`, + USER_NAME, + POINT_TOTAL, + INDEX_SCORE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME, + ALL_PARENT_IDS + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.gridId}, + #{item.gridName}, + #{item.orgId}, + #{item.orgName}, + #{item.partyFlag}, + #{item.userId}, + #{item.surname}, + #{item.name}, + #{item.userName}, + #{item.pointTotal}, + #{item.indexScore}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now(), + #{item.dataEndTime}, + #{item.allParentIds} + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index 91d8537c19..c2ad6b5722 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -3,10 +3,27 @@ - + delete from screen_pioneer_data where CUSTOMER_ID = #{customerId} - limit 1000; + limit #{deleteSize} + + + + delete from screen_pioneer_data + where CUSTOMER_ID = #{customerId} + + and ORG_TYPE=#{orgType} + + + and + ( + + ORG_ID = #{orgId} + + ) + + limit #{deleteSize} @@ -66,4 +83,139 @@ + + + + + + + + + + + + insert into screen_pioneer_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + PUBLISH_ISSUE_TOTAL, + ISSUE_TOTAL, + TOPIC_TOTAL, + SHIFT_PROJECT_TOTAL, + RESOLVED_PROJECT_TOTAL, + PUBLISH_ISSUE_RATIO, + ISSUE_RATIO, + TOPIC_RATIO, + SHIFT_PROJECT_RATIO, + RESOLVED_PROJECT_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.publishIssueTotal}, + #{item.issueTotal}, + #{item.topicTotal}, + #{item.shiftProjectTotal}, + #{item.resolvedProjectTotal}, + #{item.publishIssueRatio}, + #{item.issueRatio}, + #{item.topicRatio}, + #{item.shiftProjectRatio}, + #{item.resolvedProjectRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml index 0c2bfa9c51..1b33f8b0ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml @@ -77,5 +77,50 @@ - + + + insert into screen_public_parti_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + REG_USER_TOTAL, + JOIN_USER_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + #{item.regUserTotal}, + #{item.joinUserTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index ecf0039810..c3b3ef7de7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -57,4 +57,60 @@ + + insert into screen_user_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + USER_TOTAL, + PARTY_TOTAL, + GROUP_TOTAL, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.userTotal}, + #{item.partyTotal}, + #{item.groupTotal}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 0ed8f428fe..f47b266eba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -155,5 +155,75 @@ rgm.resi_group_id + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..d29bbb6cce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + 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..4d49a71968 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 2b6c50fb7f..945fd7b0e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -181,5 +181,111 @@ AND i.customer_id = #{customerId} + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 48c5176a78..ea0d0fc48b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -68,4 +68,21 @@ WHERE UPDATED_TIME >= #{startTime} AND UPDATED_TIME #{endTime} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml new file mode 100644 index 0000000000..1a6a74ddd4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/point/UserPointDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/point/UserPointDao.xml new file mode 100644 index 0000000000..9c082f3ea2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/point/UserPointDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index ed572b8f52..08c8d78d5b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -76,5 +76,34 @@ AND CUSTOMER_ID = #{customerId} AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') = #{date} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index 5f6816ff3b..a1a4a7f483 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -19,5 +19,224 @@ ORDER BY pro.project_id,pro.CREATED_TIME ASC + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml index 3b7fb8b8ba..f0df043bf5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml @@ -299,4 +299,37 @@ limit 1 + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml index 13bc6a3e01..54914e24d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml @@ -40,4 +40,9 @@ order by UPDATED_TIME desc limit 1; + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml new file mode 100644 index 0000000000..2d92d5d61b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -0,0 +1,143 @@ + + + + + + + + INSERT INTO dim_customer_partymember ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + PARENT_ID, + PIDS, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + USER_ID, + ID_CARD, + BIRTHDAY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.parentId}, + #{item.pids}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.userId}, + #{item.idCard}, + #{item.birthday}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE FROM dim_customer_partymember + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml index 4f0a68ed28..7b20671a99 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml @@ -52,4 +52,15 @@ order by UPDATED_TIME desc limit 1 + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml index eef43456f7..b83e517441 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml @@ -15,7 +15,8 @@ SELECT ID, CUSTOMER_ID, - AGENCY_ID + AGENCY_ID, + GRID_NAME FROM dim_grid WHERE @@ -69,4 +70,45 @@ limit 1; + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml index 34327672d6..b2333a5451 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml @@ -25,4 +25,24 @@ AND date_id = #{dateId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml index ea4debe1dc..aeef594371 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml @@ -25,6 +25,19 @@ DELETE FROM fact_article_published_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml index abe5fafc0a..421a90c31b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml @@ -25,6 +25,19 @@ DELETE FROM fact_article_published_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml index b265d0b0c9..01af6f789d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml @@ -41,5 +41,17 @@ DELETE FROM fact_article_published_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index 8c8ab22e50..7b4c669324 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -76,4 +76,24 @@ AND customer_id = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml index 45f53d10cc..2aab89ada4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -71,4 +71,13 @@ da.ID + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml index 998f24e343..de8596943f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml @@ -50,4 +50,24 @@ + + + + \ No newline at end of file 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/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml index 537a46cebb..097fb515a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml @@ -90,4 +90,22 @@ + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml index b41b6f89dd..f23abdcbf1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml @@ -102,5 +102,19 @@ + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml index 575cea1844..30c5f5c39c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -107,5 +107,19 @@ + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml index aa8548ff1c..7d01629a99 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml @@ -101,5 +101,31 @@ AND CUSTOMER_ID = #{customerId} - + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml index f8d85b7ab9..855007785a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml @@ -106,4 +106,47 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml index f5f66265fe..209d13e228 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -106,5 +106,31 @@ + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index c567d0c842..700c7fde61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -128,5 +128,117 @@ order by TOPIC_ID + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 6b796d944e..90c573cb4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -408,4 +408,92 @@ AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) AND erole.ROLE_NAME = '热心居民' + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/RedissonTest.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/RedissonTest.java new file mode 100644 index 0000000000..6f01774eab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/RedissonTest.java @@ -0,0 +1,61 @@ +package com.epmet.stats.test; + +import com.epmet.DataStatsApplication; +import lombok.extern.slf4j.Slf4j; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.concurrent.TimeUnit; + +/** + * desc:redisson测试类 + */ +@Slf4j +@RunWith(value = SpringRunner.class) +@SpringBootTest(classes = {DataStatsApplication.class}) +public class RedissonTest { + + @Autowired + private RedissonClient redissonClient; + + @Test + public void lockTest() { + //获取一个名为 lockName 的锁实例 + RLock lock = redissonClient.getLock("lockName"); + try { + // 尝试加锁(推荐使用) + // 参数1 等待时长 waitTime:5 等待时长是5秒 如果5秒内还获取不到锁 则返回false, + // 参数2 持有时长 leaseTime:5 持有锁时长超过5秒 就释放锁 此时如果继续lock.unlock()会抛出异常 + // 参数3 时间单位 + boolean bs = lock.tryLock(5, 6, TimeUnit.SECONDS); + + //如果获取不到锁 会一直阻塞到着 直至获取到锁 不推荐使用 + //lock.lock(); + + //异步方式 + /* RFuture future = lock.lockAsync(); + if (future.isSuccess()){ + //todo something + }*/ + if (bs) { + // 业务代码 + System.out.println("进入业务代码: " + 123); + } else { + Thread.sleep(300); + } + } catch (Exception e) { + log.error("lockTest exception", e); + } finally { + //判断是否是当前线程 持有锁 + if (lock.isHeldByCurrentThread()) { + lock.unlock(); + } + } + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java index bed5fc95b7..408f837691 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java @@ -1,17 +1,30 @@ package com.epmet.stats.test.normalizing; +import java.math.BigDecimal; +import java.math.RoundingMode; + public class MathUtilTest { public static void main(String[] args) { + //值 域:(-π/2,π/2) ->(60,100) double tan = Math.atan(4); double tan2 = Math.atan(1); double tan3 = Math.atan(8); - double tan4 = Math.atan(3); + double tan4 = Math.atan(1000); + double min = 60; + double max = 100; + System.out.println(tan * ((max - min) / (Math.PI / 2)) + min); + System.out.println(tan2 * ((max - min) / (Math.PI / 2)) + min); + System.out.println(tan3 * ((max - min) / (Math.PI / 2)) + min); + System.out.println(tan4 * ((max - min) / (Math.PI / 2)) + min); - System.out.println((tan / Math.PI)); - System.out.println((tan2 / Math.PI)); - System.out.println((tan3 / Math.PI)); - System.out.println((tan4 / Math.PI * 200)); + BigDecimal maxValue = new BigDecimal(100); + BigDecimal minValue = new BigDecimal(60); + BigDecimal normalizeValue = new BigDecimal(Math.atan(new Double("0"))) + .multiply( + (maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))).add(minValue).setScale(6, RoundingMode.HALF_UP); + System.out.println(normalizeValue); + //new BigDecimal(Math.atan(new Double(vo.getSampleValue().toString())) / Math.PI * 100).setScale(6, RoundingMode.HALF_UP); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt new file mode 100644 index 0000000000..cb778584e1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt @@ -0,0 +1,7 @@ +1. 当数据偏小时,可能社区下没有网格,例如 网格发文数量得分就为0; +2. screen_index_data_monthly中的 数据条数 与客户下(组织数 + 直属部门数 + 网格数)的和不统一, + 原因:数据插入的时候,只算到了区县级,区县级以上的没有计算,少了 市级和省级agency + +文档地址: + 1. 大屏指标项文档说明:https://www.kdocs.cn/view/l/svtSfaUyzNYZ?f=130 + 2. 大屏或手机端:https://www.kdocs.cn/view/l/suilmk0Ziss1?f=130 \ 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..9c90c24c9e 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/dto/form/GetJwtAccessTokenFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/GetJwtAccessTokenFormDTO.java new file mode 100644 index 0000000000..47577b2787 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/GetJwtAccessTokenFormDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class GetJwtAccessTokenFormDTO { + + @NotBlank(message = "AppId不能为空") + private String appId; + +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AppIdInfoResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AppIdInfoResultDTO.java new file mode 100644 index 0000000000..b4dc217e2d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AppIdInfoResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/21 5:30 下午 + */ +@Data +public class AppIdInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 4556971930323763712L; + + /** + * 应用ID + */ + private String appId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 密钥 + */ + private String secret; + + private String accessToken; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java new file mode 100644 index 0000000000..58cf9ecc6f --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class GetJwtAccessTokenResultDTO { + + private String customerId; + private String token; + private Long ts; + +} 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..c2471c0255 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 @@ -3,7 +3,9 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.ExternalAppAuthFormDTO; +import com.epmet.dto.form.GetJwtAccessTokenFormDTO; import com.epmet.dto.form.WorkDayFormDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.WorkDayResultDTO; import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallback; @@ -20,7 +22,7 @@ import java.util.List; * @date 2020/6/4 10:28 */ @FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) -//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103") +//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "localhost:8103") public interface EpmetCommonServiceOpenFeignClient { /** * @param formDTO @@ -46,4 +48,23 @@ public interface EpmetCommonServiceOpenFeignClient { */ @PostMapping("/commonservice/externalapp/getcustomerids") Result> getExternalCustomerIds(); + + /** + * 查询秘钥(仅限内部使用) + * @return + */ + @PostMapping("/commonservice/externalapp/get-secret") + Result getSecret(@RequestBody String appId); + + /** + * @Description 获取AccessToken + * @return Result + * @author wxz + * @date 2020.10.22 10:19 + */ + @PostMapping("/commonservice/externalapp/get-jwt-accesstoken") + Result getAccessToken(@RequestBody GetJwtAccessTokenFormDTO form); + + @PostMapping("/commonservice/externalapp/appidinfo") + Result appIdInfo(@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..198bd13203 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 @@ -4,7 +4,9 @@ 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.form.ExternalAppAuthFormDTO; +import com.epmet.dto.form.GetJwtAccessTokenFormDTO; import com.epmet.dto.form.WorkDayFormDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.WorkDayResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -34,4 +36,19 @@ 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); + } + + @Override + public Result appIdInfo(String appId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "appIdInfo", appId); + } + + @Override + public Result getAccessToken(GetJwtAccessTokenFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getAccessToken", form); + } } diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml index acc32b8306..ce46139cfe 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.17 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.24 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index b22388767b..c5f2f8bdab 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.17 + 0.3.24 com.epmet epmet-common-service 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..baee81af67 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,23 +2,25 @@ 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; import com.epmet.dto.form.ExternalAppAuthFormDTO; import com.epmet.dto.form.ExternalAppFormDTO; +import com.epmet.dto.form.GetJwtAccessTokenFormDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; +import com.epmet.dto.result.GetJwtAccessTokenResultDTO; 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; import org.slf4j.LoggerFactory; 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; @@ -34,6 +36,9 @@ public class ExternalAppController { @Autowired private ExternalAppService externalAppService; + @Autowired + private ExternalAppSecretService externalAppSecretService; + /** * 外部请求认证 * @param formDTO @@ -128,4 +133,36 @@ 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); + } + + /** + * @Description 获取AccessToken + * @return Result + * @author wxz + * @date 2020.10.22 10:19 + */ + @PostMapping("get-jwt-accesstoken") + public Result getAccessToken(@RequestBody GetJwtAccessTokenFormDTO form) { + ValidatorUtils.validateEntity(form); + String appId = form.getAppId(); + GetJwtAccessTokenResultDTO jwtAccessToken = externalAppService.getJwtAccessToken(appId); + return new Result().ok(jwtAccessToken); + } + + @PostMapping("appidinfo") + public Result appIdInfo(@RequestBody String appId){ + return new Result().ok(externalAppService.appIdInfo(appId)); + } + } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java index 45dda5390a..b2f89b9b90 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; import com.epmet.entity.ExternalAppEntity; import org.apache.ibatis.annotations.Mapper; @@ -41,4 +42,12 @@ public interface ExternalAppDao extends BaseDao { List list(@Param("customerId") String customerId); List getCustomerIds(); + + /** + * @Description 根据appId查询客户ID和密钥 + * @Param appId + * @author zxc + * @date 2020/10/21 5:50 下午 + */ + AppIdInfoResultDTO appIdInfo(@Param("appId")String appId); } \ No newline at end of file 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/ExternalAppService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java index 4d5d847e68..77e4c32f48 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java @@ -18,7 +18,9 @@ package com.epmet.service; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; +import com.epmet.dto.result.GetJwtAccessTokenResultDTO; import java.util.List; @@ -38,4 +40,8 @@ public interface ExternalAppService { List getCustomerIds(); String resetSecret(String appId); + + GetJwtAccessTokenResultDTO getJwtAccessToken(String appId); + + AppIdInfoResultDTO appIdInfo(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/service/impl/ExternalAppServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java index db3267c600..7b4229b3a1 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java @@ -27,12 +27,15 @@ import com.epmet.dao.ExternalAppDao; import com.epmet.dao.ExternalAppSecretDao; import com.epmet.dao.ExternalCustomerDao; import com.epmet.dto.CustomerDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; +import com.epmet.dto.result.GetJwtAccessTokenResultDTO; import com.epmet.entity.ExternalAppEntity; import com.epmet.entity.ExternalAppSecretEntity; import com.epmet.enu.CustomerTypeEnum; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.ExternalAppService; +import com.epmet.utils.externalapp.ExtAppJwtTokenUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.slf4j.Logger; @@ -41,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.HashMap; import java.util.List; import java.util.UUID; @@ -70,6 +74,9 @@ public class ExternalAppServiceImpl implements ExternalAppService { @Autowired private RedisUtils redisUtils; + @Autowired + private ExtAppJwtTokenUtils tokenUtils; + @Transactional @Override public ExternalAppResultDTO add(String appName, String customerId, String customerType) { @@ -197,4 +204,25 @@ public class ExternalAppServiceImpl implements ExternalAppService { return null; } + @Override + public GetJwtAccessTokenResultDTO getJwtAccessToken(String appId) { + ExternalAppEntity externalAppEntity = externalAppDao.selectById(appId); + String customerId = externalAppEntity.getCustomerId(); + String secret = externalAppSecretDao.getSecretByAppId(appId); + long ts = System.currentTimeMillis(); + + String token = tokenUtils.genToken(secret, appId, customerId, ts); + return new GetJwtAccessTokenResultDTO(customerId, token, ts); + } + @Override + public AppIdInfoResultDTO appIdInfo(String appId) { + AppIdInfoResultDTO appIdInfoResultDTO = externalAppDao.appIdInfo(appId); + if (null == appIdInfoResultDTO){ + throw new RenException("没查到对应appId【"+appId+"】的信息"); + } + String accessToken = tokenUtils.genToken(appIdInfoResultDTO.getSecret(), appId, appIdInfoResultDTO.getCustomerId(), System.currentTimeMillis()); + appIdInfoResultDTO.setAccessToken(accessToken); + return appIdInfoResultDTO; + } + } \ 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 de4de9ed21..1714ed728a 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 @@ -49,7 +49,7 @@ public class ExtAppJwtTokenUtils { } } - public String createToken(Map map, String secret) { + private String createToken(Map map, String secret) { return Jwts.builder() .setHeaderParam("typ", "JWT") .setClaims(map) @@ -59,37 +59,39 @@ public class ExtAppJwtTokenUtils { .compact(); } -// /** -// * token是否过期 -// * -// * @return true:过期 -// */ -// public boolean isTokenExpired(Date expiration) { -// return expiration.before(new Date()); -// } + public static void genTestToken() { + HashMap claim = new HashMap<>(); + //市北 + //String secret = "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970"; + //String appId = "acc4ad66c82a7b46e741364b4c62dce2"; + // String customrId = "b09527201c4409e19d1dbc5e3c3429a1"; + //孔村 +// String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8"; +// String appId = "f358d63a89f3670c197c62ca4c3a0366"; +// String customrId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - public static void main(String[] args) { - genToken(); -// getClaim(); + //测试-模拟客户 + String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8"; + String appId = "f358d63a89f3670c197c62ca4c3a0366"; + String customrId = "45687aa479955f9d06204d415238f7cc"; + + long ts = System.currentTimeMillis() + 1000 * 60 * 1; + System.out.println("时间戳:" + ts); + String token = new ExtAppJwtTokenUtils().genToken(secret, appId, customrId, ts); + System.out.println(token); } - public static void genToken() { + public String genToken(String secret, String appId, String customrId, Long ts) { HashMap claim = new HashMap<>(); - claim.put("appId", "acc4ad66c82a7b46e741364b4c62dce2"); - claim.put("customerId", "b09527201c4409e19d1dbc5e3c3429a1"); - long ts = System.currentTimeMillis() - 1000 * 60 * 4; - System.out.println("时间戳:" + ts); + claim.put("customerId", customrId); + claim.put("appId", appId); claim.put("ts", ts); - String abc = new ExtAppJwtTokenUtils().createToken(claim, "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970"); - System.out.println(abc); + return createToken(claim, secret); } - public static void getClaim() { - String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHBJZCI6IjEiLCJjdXN0b21lcklkIjoiYzEiLCJpYXQiOjE1OTc3NDI2NTB9.09Vop0Nobg3LENAJoAZaCUKtgAjADAK48BS11ky3YdAp6h-cXYtGeqUxbgvE_4F6239rc7UE2fjxtEvMuWEJuA"; - - Claims claimByToken = new ExtAppJwtTokenUtils().getClaimByToken(token, "4a762660254c57996343f8ee42fbc0a6"); - System.out.println(claimByToken); + public static void main(String[] args) { + genTestToken(); } } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppMD5AuthProcessor.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppMD5AuthProcessor.java index b19e963f53..0ec71dc38f 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppMD5AuthProcessor.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppMD5AuthProcessor.java @@ -15,6 +15,7 @@ public class ExtAppMD5AuthProcessor extends ExtAppAuthProcessor { private static Logger logger = LoggerFactory.getLogger(ExtAppMD5AuthProcessor.class); + @Override public ExternalAppAuthResultDTO auth(String appId, String token, Long ts) { if (ts == null) { return fillAuthResult(false, "需要传入时间戳参数", null); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml index 8ce99b1a67..55889d71b1 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml @@ -66,5 +66,19 @@ SELECT CUSTOMER_ID FROM external_app WHERE DEL_FLAG = 0 + + + \ No newline at end of file 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-ext/epmet-ext-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml index bf71f1b198..a5ec527cf3 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-ext-server: container_name: epmet-ext-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.7 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.8 ports: - "8113:8113" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 1c3afc05d1..6f2c432d23 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.7 + 0.0.8 com.epmet @@ -26,11 +26,11 @@ epmet-ext-client 2.0.0 - + com.epmet epmet-commons-tools diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 147308f38e..81ccddbdff 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -1,7 +1,6 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -38,7 +37,7 @@ public class OpenUpController { * @author zxc * @date 2020/8/13 9:42 上午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("staffsingrid") public Result> staffSinGrid(@RequestBody StaffSinGridFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, StaffSinGridFormDTO.StaffSinGrid.class); @@ -51,7 +50,7 @@ public class OpenUpController { * @author zxc * @date 2020/8/13 9:51 上午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("staffsindept") public Result> staffSinDept(@RequestBody StaffSinDeptFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, StaffSinDeptFormDTO.StaffSinDept.class); @@ -64,7 +63,7 @@ public class OpenUpController { * @author zxc * @date 2020/8/17 9:59 上午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("staffsinagency") public Result> staffSinAgency(@RequestBody StaffSinAgencyFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, StaffSinAgencyFormDTO.StaffSinAgency.class); @@ -78,7 +77,7 @@ public class OpenUpController { * @author wangc * @date 2020.08.17 10:30 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("staffinfo") public Result staffInfo(@LoginUser TokenDto token){ CommonStaffIdFormDTO commonStaffIdFormDTO = new CommonStaffIdFormDTO(); @@ -94,7 +93,7 @@ public class OpenUpController { * @author wangc * @date 2020.08.17 17:30 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("permission") Result staffPermissionExt(@RequestBody CommonStaffIdFormDTO commonStaffIdFormDTO){ ValidatorUtils.validateEntity(commonStaffIdFormDTO, CommonStaffIdFormDTO.StaffIdGroup.class); diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpUserController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpUserController.java index 341715b6ae..41124d3b5d 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpUserController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpUserController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -33,7 +32,7 @@ public class OpenUpUserController { * @author wangc * @date 2020.08.17 10:30 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("userinfo") Result userInfo(@LoginUser TokenDto token){ CommonUserIdFormDTO userParam = new CommonUserIdFormDTO(); diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java index 0f5033e02a..4ee734f45e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java @@ -139,13 +139,17 @@ public class ResiActDetailResultDTO implements Serializable { private Boolean isSignUp; /** - * 用户报名活动后,当前状态 - * --(已报名/待审核auditing, - * -- 审核通过passed, - * -- 未报名(审核不通过 或 取消报名)canceled, - * -- ) + * 按钮控制字段(兼容旧版) - true已报名;false未报名 */ - private String isRegistration; + private Boolean isRegistration; + + /** + * 按钮控制字段(新版) - + * 已报名/待审核auditing, + * 审核通过passed, + * 未报名(审核不通过 或 取消报名)canceled + */ + private String userAuditStatus; /** * 打卡开始时间(yyyy-MM-dd HH:mm) diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml index df1de492cb..15d0c6a0b6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-heart-server: container_name: epmet-heart-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.53 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.54 ports: - "8111:8111" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 202bc6a9d7..298e8b79f3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.53 + 0.0.54 com.epmet epmet-heart diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 4f539675fb..eb2cd42af7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -221,15 +221,24 @@ public class ActInfoServiceImpl extends BaseServiceImpl 4.0.0 - 0.3.25 + 0.3.27 com.epmet epmet-job diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java new file mode 100644 index 0000000000..d33490b2eb --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java @@ -0,0 +1,13 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Author zxc + * @DateTime 2020/9/17 3:05 下午 + */ +public interface DimPartyMemberService { + + Result getPartyInfo(String date); + +} 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 new file mode 100644 index 0000000000..b41295af10 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java @@ -0,0 +1,23 @@ +package com.epmet.service; + + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; + +/** + * desc: 业务数据抽取到统计库服务类 + * + * @return: + * @date: 2020/6/22 10:24 + * @author: jianjun liu + */ +public interface FactOriginExtractTaskService { + + /** + * desc: 【日】抽取 小组 话题 议题 项目数据到统计库 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result factOriginExtractJob(ExtractOriginFormDTO formDTO); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/IndexOriginExtractTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/IndexOriginExtractTaskService.java new file mode 100644 index 0000000000..5416375c13 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/IndexOriginExtractTaskService.java @@ -0,0 +1,24 @@ +package com.epmet.service; + + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; + +/** + * desc: 统计库数据抽取到指标库服务类 + * + * @return: + * @date: 2020/6/22 10:24 + * @author: jianjun liu + */ +public interface IndexOriginExtractTaskService { + + /** + * desc: 【月】抽取 数据到指标库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result indexOriginExtractJob(ExtractIndexFormDTO formDTO); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java new file mode 100644 index 0000000000..25a4244301 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java @@ -0,0 +1,22 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:21 上午 + */ +public interface ScreenExtractTaskService { + + + Result screenExtractDaily(String params); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param params + * @author yinzuomei + * @description 大屏数据抽取-按月统计 + * @Date 2020/9/28 10:49 + **/ + Result screenExtractMonthly(String params); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java new file mode 100644 index 0000000000..ca4d773f2a --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java @@ -0,0 +1,29 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.DimPartyMemberService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; + +/** + * @Author zxc + * @DateTime 2020/9/17 3:06 下午 + */ +@Service +public class DimPartyMemberServiceImpl implements DimPartyMemberService { + + @Autowired + private DataStatisticalOpenFeignClient statsFeignClient; + + + @Override + public Result getPartyInfo(String form) { + CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO = JSON.parseObject(form, CustomerIdAndDateIdFormDTO.class); + return statsFeignClient.getPartyInfo(customerIdAndDateIdFormDTO); + } +} 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 new file mode 100644 index 0000000000..41244194c0 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java @@ -0,0 +1,30 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.FactOriginExtractTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * desc:数据统计 任务服务类 + */ +@Service +public class FactOriginExtractTaskServiceImpl implements FactOriginExtractTaskService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + /** + * desc: 【日】抽取 小组 话题 议题 项目数据到统计库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + 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/IndexOriginExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/IndexOriginExtractTaskServiceImpl.java new file mode 100644 index 0000000000..e734004bd7 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/IndexOriginExtractTaskServiceImpl.java @@ -0,0 +1,30 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.IndexOriginExtractTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * desc:指标原始数据统计 任务服务类 + */ +@Service +public class IndexOriginExtractTaskServiceImpl implements IndexOriginExtractTaskService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + /** + * desc: 【月】抽取 统计库对象数据到统计库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result indexOriginExtractJob(ExtractIndexFormDTO formDTO) { + return dataStatisticalOpenFeignClient.indexOriginExtractAll(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 new file mode 100644 index 0000000000..698a3ec7b3 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java @@ -0,0 +1,50 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.ScreenExtractTaskService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:22 上午 + */ +@Service +@Slf4j +public class ScreenExtractTaskServiceImpl implements ScreenExtractTaskService { + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + @Override + public Result screenExtractDaily(String params) { + ExtractOriginFormDTO extractOriginFormDTO = new ExtractOriginFormDTO(); + if (StringUtils.isNotBlank(params)) { + extractOriginFormDTO = JSON.parseObject(params, ExtractOriginFormDTO.class); + } + return dataStatisticalOpenFeignClient.extractDailyAll(extractOriginFormDTO); + } + + /** + * @param params + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 大屏数据抽取-按月统计 + * @Date 2020/9/28 10:49 + **/ + @Override + public Result screenExtractMonthly(String params) { + ExtractScreenFormDTO extractScreenFormDTO=new ExtractScreenFormDTO(); + if(StringUtils.isNotBlank(params)){ + extractScreenFormDTO=JSON.parseObject(params,ExtractScreenFormDTO.class); + } + return dataStatisticalOpenFeignClient.extractMonthlyAll(extractScreenFormDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java new file mode 100644 index 0000000000..1998cbe6fa --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java @@ -0,0 +1,30 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.DimPartyMemberService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2020/9/17 3:04 下午 + */ +@Slf4j +@Component("dimPartyMemberTask") +public class DimPartyMemberTask implements ITask{ + + @Autowired + private DimPartyMemberService dimPartyMemberService; + + @Override + public void run(String params) { + log.info("dimPartyMemberTask定时任务正在执行,参数为:{}", params); + Result result = dimPartyMemberService.getPartyInfo(params); + if (result.success()){ + log.info("dimPartyMemberTask定时任务执行成功"); + }else { + log.error("dimPartyMemberTask定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EvaIndexScreenDimInitTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EvaIndexScreenDimInitTask.java new file mode 100644 index 0000000000..c89e4f4271 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EvaIndexScreenDimInitTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Slf4j +@Component("evaIndexScreenDimInitTask") +public class EvaIndexScreenDimInitTask implements ITask { + + @Autowired + private DataStatisticalOpenFeignClient feignClient; + + @Override + public void run(String params) { + log.debug("EvaIndexScreenDimInitTask定时任务正在执行,参数为:{}", params); + Result result = null; + try { + result = feignClient.initAllEIDims(); + } catch (Exception e) { + log.error("EvaIndexScreenDimInitTask定时任务正在执行定时任务执行失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + if (result.success()){ + log.debug("EvaIndexScreenDimInitTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("EvaIndexScreenDimInitTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} 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 new file mode 100644 index 0000000000..92f58cf22b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java @@ -0,0 +1,48 @@ +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.ExtractOriginFormDTO; +import com.epmet.service.FactOriginExtractTaskService; +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; + +/** + * desc:数据抽取定时任务 定时任务 + */ +@Component("factOriginExtractTask") +public class FactOriginExtractTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private FactOriginExtractTaskService factOriginExtractTaskService; + + + @Override + public void run(String params) { + 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(); + String params = "{'date':'\"2020-06-20','customerId':'123'}"; + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, StatsFormDTO.class); + } + System.out.println(JSON.toJSONString(formDTO)); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IndexOriginExtractTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IndexOriginExtractTask.java new file mode 100644 index 0000000000..4567910487 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IndexOriginExtractTask.java @@ -0,0 +1,38 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.service.IndexOriginExtractTaskService; +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; + +/** + * desc:数据抽取定时任务 定时任务 + */ +@Component("indexOriginExtractTask") +public class IndexOriginExtractTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private IndexOriginExtractTaskService indexOriginExtractTaskService; + + + @Override + public void run(String params) { + logger.info("indexOriginExtractTask定时任务正在执行,参数为:{}", params); + ExtractIndexFormDTO formDTO = new ExtractIndexFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, ExtractIndexFormDTO.class); + } + Result result = indexOriginExtractTaskService.indexOriginExtractJob(formDTO); + if (result.success()) { + logger.info("indexOriginExtractTask定时任务执行成功"); + } else { + logger.error("indexOriginExtractTask定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java new file mode 100644 index 0000000000..3e5c130e1a --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java @@ -0,0 +1,33 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.ScreenExtractTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:26 上午 + */ +@Component("screenExtractDailyTask") +public class ScreenExtractDailyTask implements ITask{ + + @Autowired + private ScreenExtractTaskService screenExtractTaskService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + + @Override + public void run(String params) { + logger.info("ScreenExtractDailyTask定时任务正在执行,参数为:{}", params); + Result result = screenExtractTaskService.screenExtractDaily(params); + if (result.success()){ + logger.info("ScreenExtractDailyTask定时任务执行成功"); + }else { + logger.error("ScreenExtractDailyTask定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractMonthlyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractMonthlyTask.java new file mode 100644 index 0000000000..9e4cc24222 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractMonthlyTask.java @@ -0,0 +1,34 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.ScreenExtractTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 大屏数据抽取-按月统计 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/28 10:39 + */ +@Component("screenExtractMonthlyTask") +public class ScreenExtractMonthlyTask implements ITask{ + @Autowired + private ScreenExtractTaskService screenExtractTaskService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + + @Override + public void run(String params) { + logger.info("ScreenExtractMonthlyTask定时任务正在执行,参数为:{}", params); + Result result = screenExtractTaskService.screenExtractMonthly(params); + if (result.success()){ + logger.info("ScreenExtractMonthlyTask定时任务执行成功"); + }else { + logger.error("ScreenExtractMonthlyTask定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpMsgSendRecordDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpMsgSendRecordDTO.java new file mode 100644 index 0000000000..99149fde28 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpMsgSendRecordDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 消息发送记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpMsgSendRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 所属端类型 居民端:resi 工作端:work + */ + private String clientType; + + /** + * 消息模板Id 消息模板Id + */ + private String templateId; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * openId openId + */ + private String wxOpenId; + + /** + * 行为类型(存title字段的中间值) 入组申请、党员认证等 + */ + private String behaviorType; + + /** + * 消息标题 消息标题 + */ + private String title; + + /** + * 消息内容 消息内容 + */ + private String messageContent; + + /** + * 消息时间 消息时间 + */ + private Date messageTime; + + /** + * 发送结果(成功:success 失败:error) + */ + private String result; + + /** + * 发送失败的原因,成功可以不记录 + */ + private String reason; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpResiUserSubscribeDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpResiUserSubscribeDTO.java new file mode 100644 index 0000000000..e8b2f2a1fb --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpResiUserSubscribeDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民端用户订阅模板消息次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpResiUserSubscribeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 消息模板Id 消息模板Id + */ + private String templateId; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * openId openId + */ + private String wxOpenId; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; + + /** + * 可用推送次数 可用推送次数 + */ + private Integer count; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpTemplateMsgSubscribeStatusDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpTemplateMsgSubscribeStatusDTO.java new file mode 100644 index 0000000000..00dc07a199 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpTemplateMsgSubscribeStatusDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户模板消息订阅授权状态表(记录我们自己和微信的授权页用户勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpTemplateMsgSubscribeStatusDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 所属端类型 居民端:resi 工作端:work + */ + private String clientType; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * 是否总是访问 是:yes 否:no + */ + private String alwaysVisit; + + /** + * 订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String subscribeStatus; + + /** + * wx是否总是访问 是:yes 否:no + */ + private String wxAlwaysVisit; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUserSubscribeRecordDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUserSubscribeRecordDTO.java new file mode 100644 index 0000000000..901023e9ea --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUserSubscribeRecordDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户触发订阅的行为记录表(同时记录微信授权页每次勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpUserSubscribeRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 消息模板Id 消息模板Id + */ + private String templateId; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * openId openId + */ + private String wxOpenId; + + /** + * 行为类型(存title字段的中间值) 入组申请、党员认证等 + */ + private String behaviorType; + + /** + * wx是否总是访问 是:yes 否:no + */ + private String wxAlwaysVisit; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpWorkUserSubscribeDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpWorkUserSubscribeDTO.java new file mode 100644 index 0000000000..632c9ecf84 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpWorkUserSubscribeDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作端用户订阅模板消息有效次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpWorkUserSubscribeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 消息模板Id 消息模板Id + */ + private String templateId; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * openId openId + */ + private String wxOpenId; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; + + /** + * 可用推送次数 可用推送次数 + */ + private Integer count; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/TemplateListFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/TemplateListFormDTO.java new file mode 100644 index 0000000000..87b3ff0cad --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/TemplateListFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 获取客户小程序模板列表-接口入参 + * @Author sun + */ +@Data +public class TemplateListFormDTO implements Serializable { + + /** + * 客户Id + */ + @NotBlank(message="客户Id不能为空", groups = {TemplateListFormDTO.AddUserInternalGroup.class}) + private String customerId; + /** + * 小程序Id + */ + @NotBlank(message="小程序appId不能为空", groups = {TemplateListFormDTO.AddUserInternalGroup.class}) + private String appId; + /** + * 模板类型(站内信提醒) + */ + private String templateType; + public interface AddUserInternalGroup {} +} + diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxMsgAuthInfoFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxMsgAuthInfoFormDTO.java new file mode 100644 index 0000000000..11d70e506d --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxMsgAuthInfoFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class WxMsgAuthInfoFormDTO { + + public interface SaveSysAuthInfoGroup {} + + @NotBlank(message = "客户id不能为空", groups = { SaveSysAuthInfoGroup.class }) + private String customerId; + + @NotBlank(message = "客户端类型不能为空", groups = { SaveSysAuthInfoGroup.class }) + private String clientType; + + @NotBlank(message = "是否总是字段不能为空", groups = { SaveSysAuthInfoGroup.class }) + private String alwaysVisit; + + @NotBlank(message = "是否去订阅字段不能为空", groups = { SaveSysAuthInfoGroup.class }) + private String subscribeStatus; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java new file mode 100644 index 0000000000..1dc30e2f8c --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.form; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + * @description: 微信订阅消息FormDTO + * @author: liushaowen + * @date: 2020/10/21 14:29 + */ +@Data +public class WxSubscribeMessageFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + /** + * 客户端类型 居民端:resi 工作端:work + */ + @NotBlank(message = "客户端类型不能为空") + private String clientType; + + /** + * 接收者(用户)的 userId + */ + @NotBlank(message = "接收用户id不能为空") + private String userId; + + /** + * 行为类型(存title字段的中间值) 入组申请、党员认证等 + */ + @NotBlank(message = "行为类型不能为空") + private String behaviorType; + + /** + * 消息内容 + */ + @NotBlank(message = "消息内容不能为空") + private String messageContent; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/WxMsgAuthInfoResultDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/WxMsgAuthInfoResultDTO.java new file mode 100644 index 0000000000..13988b5411 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/WxMsgAuthInfoResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class WxMsgAuthInfoResultDTO { + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 所属端类型 居民端:resi 工作端:work + */ + private String clientType; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * 是否总是访问 是:yes 否:no + */ + private String alwaysVisit; + + /** + * 订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String subscribeStatus; + + /** + * wx是否总是访问 是:yes 否:no + */ + private String wxAlwaysVisit; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index b8f1def9d3..1035ab1552 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.form.WxSubscribeMessageFormDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -67,4 +68,13 @@ public interface EpmetMessageOpenFeignClient { **/ @PostMapping(value = "message/usermessage/saveusermessagelist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result saveUserMessageList(List msgList); + + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Description 发送微信订阅消息 + **/ + @PostMapping(value = "message/wxmpmessage/sendwxsubscribemessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result sendWxSubscribeMessage(List msgList); } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java index 3cc5a5c5eb..889569147f 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.form.WxSubscribeMessageFormDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import org.springframework.stereotype.Component; @@ -45,4 +46,9 @@ public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeig public Result saveUserMessageList(List msgList) { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessageList", msgList); } + + @Override + public Result sendWxSubscribeMessage(List msgList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendWxSubscribeMessage", msgList); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 1322ad2243..28f44f4962 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -96,6 +96,17 @@ flyway-core + + com.epmet + epmet-user-client + 2.0.0 + + + com.epmet + epmet-third-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/WxmpMessageConstant.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/WxmpMessageConstant.java new file mode 100644 index 0000000000..667a8b3bfc --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/WxmpMessageConstant.java @@ -0,0 +1,61 @@ +package com.epmet.constant; + +import java.util.HashMap; +import java.util.Map; + +/** + * @description: 微信订阅消息常量 + * @author: liushaowen + * @date: 2020/10/21 17:45 + */ + +public interface WxmpMessageConstant { + String SEND_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="; + + String ERR_CODE = "errcode"; + + String ERR_MSG = "errmsg"; + + int USER_REFUSED = 43101; + + String AUTHORIZER_ACCESS_TOKEN = "authorizerAccessToken"; + + String RESI = "resi"; + + String WORK = "work"; + + String ACCESS_TOKEN = "access_token"; + + String TOUSER = "touser"; + + String TEMPLATE_ID = "template_id"; + + String PAGE = "page"; + + String TITLE = "title"; + + int TITLE_LIMIT = 20; + + String MESSAGE_CONTENT = "message_content"; + + int MESSAGE_CONTENT_LIMIT = 20; + + String MESSAGE_TIME = "message_time"; + + String DATA = "data"; + + String MINIPROGRAM_STATE = "miniprogram_state"; + + String SUCCESS = "success"; + + String ERROR = "error"; + + String PAGE_RESI = ""; + + String PAGE_WORK = ""; + + String STATE_DEV = "developer"; + + String STATE_TEST = "trial"; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java index 82cc047ea8..a176b3f2ca 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java @@ -162,4 +162,4 @@ public class UserMessageController { List list = userMessageService.queryStaffMessage(formDTO); return new Result>().ok(list); } -} \ No newline at end of file +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java new file mode 100644 index 0000000000..7e06c80b0a --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.GetTemplateListFormDTO; +import com.epmet.dto.form.WxMsgAuthInfoFormDTO; +import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.result.GetTemplateListResultDTO; +import com.epmet.service.WxmpMessageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 微信消息订阅controller + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@RestController +@RequestMapping("wxmpmessage") +public class WxmpMessageController { + + @Autowired + private WxmpMessageService wxmpMessageService; + + @Autowired + private LoginUserUtil loginUserUtil; + + /** + * @Description 保存系统自身的弹框授权信息 + * @return com.epmet.commons.tools.utils.Result + * @author wxz + * @date 2020.10.21 17:32 + */ + @PostMapping("save-sys-authorizeinfo") + public Result saveSysAuthorizationInfo(@RequestBody WxMsgAuthInfoFormDTO form) { + ValidatorUtils.validateEntity(form, WxMsgAuthInfoFormDTO.SaveSysAuthInfoGroup.class); + + String alwaysVisit = form.getAlwaysVisit(); + String clientType = form.getClientType(); + String customerId = form.getCustomerId(); + String subscribeStatus = form.getSubscribeStatus(); + + wxmpMessageService.saveSysAuthorizeInfo(customerId, clientType, alwaysVisit, subscribeStatus, loginUserUtil.getLoginUserId()); + + return new Result(); + } + @PostMapping("sendwxsubscribemessage") + public Result sendWxSubscribeMessage(@RequestBody List msgList){ + for (WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO : msgList) { + ValidatorUtils.validateEntity(wxSubscribeMessageFormDTO); + } + wxmpMessageService.sendWxSubscribeMessage(msgList); + return new Result(); + } + + /** + * @return + * @Description 居民端、工作端-获取客户小程序模板列表 + * @author sun + */ + @PostMapping("templatelist") + public Result> templateList(@RequestBody GetTemplateListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GetTemplateListFormDTO.AddUserInternalGroup.class); + return new Result>().ok(wxmpMessageService.templateList(formDTO)); + } + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMsgSendRecordController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMsgSendRecordController.java new file mode 100644 index 0000000000..ad71a5db81 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMsgSendRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.WxmpMsgSendRecordDTO; +import com.epmet.excel.WxmpMsgSendRecordExcel; +import com.epmet.service.WxmpMsgSendRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 消息发送记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@RestController +@RequestMapping("wxmpmsgsendrecord") +public class WxmpMsgSendRecordController { + + @Autowired + private WxmpMsgSendRecordService wxmpMsgSendRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = wxmpMsgSendRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + WxmpMsgSendRecordDTO data = wxmpMsgSendRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody WxmpMsgSendRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + wxmpMsgSendRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody WxmpMsgSendRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + wxmpMsgSendRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + wxmpMsgSendRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = wxmpMsgSendRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WxmpMsgSendRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpResiUserSubscribeController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpResiUserSubscribeController.java new file mode 100644 index 0000000000..e4c38f9478 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpResiUserSubscribeController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.WxmpResiUserSubscribeDTO; +import com.epmet.excel.WxmpResiUserSubscribeExcel; +import com.epmet.service.WxmpResiUserSubscribeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 居民端用户订阅模板消息次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@RestController +@RequestMapping("wxmpresiusersubscribe") +public class WxmpResiUserSubscribeController { + + @Autowired + private WxmpResiUserSubscribeService wxmpResiUserSubscribeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = wxmpResiUserSubscribeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + WxmpResiUserSubscribeDTO data = wxmpResiUserSubscribeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody WxmpResiUserSubscribeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + wxmpResiUserSubscribeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody WxmpResiUserSubscribeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + wxmpResiUserSubscribeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + wxmpResiUserSubscribeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = wxmpResiUserSubscribeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WxmpResiUserSubscribeExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpTemplateMsgSubscribeStatusController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpTemplateMsgSubscribeStatusController.java new file mode 100644 index 0000000000..a80fd35b58 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpTemplateMsgSubscribeStatusController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.WxmpTemplateMsgSubscribeStatusDTO; +import com.epmet.excel.WxmpTemplateMsgSubscribeStatusExcel; +import com.epmet.service.WxmpTemplateMsgSubscribeStatusService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 用户模板消息订阅授权状态表(记录我们自己和微信的授权页用户勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@RestController +@RequestMapping("wxmptemplatemsgsubscribestatus") +public class WxmpTemplateMsgSubscribeStatusController { + + @Autowired + private WxmpTemplateMsgSubscribeStatusService wxmpTemplateMsgSubscribeStatusService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = wxmpTemplateMsgSubscribeStatusService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + WxmpTemplateMsgSubscribeStatusDTO data = wxmpTemplateMsgSubscribeStatusService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody WxmpTemplateMsgSubscribeStatusDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + wxmpTemplateMsgSubscribeStatusService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody WxmpTemplateMsgSubscribeStatusDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + wxmpTemplateMsgSubscribeStatusService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + wxmpTemplateMsgSubscribeStatusService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = wxmpTemplateMsgSubscribeStatusService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WxmpTemplateMsgSubscribeStatusExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUserSubscribeRecordController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUserSubscribeRecordController.java new file mode 100644 index 0000000000..e30eace2f5 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUserSubscribeRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.WxmpUserSubscribeRecordDTO; +import com.epmet.excel.WxmpUserSubscribeRecordExcel; +import com.epmet.service.WxmpUserSubscribeRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 用户触发订阅的行为记录表(同时记录微信授权页每次勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@RestController +@RequestMapping("wxmpusersubscriberecord") +public class WxmpUserSubscribeRecordController { + + @Autowired + private WxmpUserSubscribeRecordService wxmpUserSubscribeRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = wxmpUserSubscribeRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + WxmpUserSubscribeRecordDTO data = wxmpUserSubscribeRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody WxmpUserSubscribeRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + wxmpUserSubscribeRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody WxmpUserSubscribeRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + wxmpUserSubscribeRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + wxmpUserSubscribeRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = wxmpUserSubscribeRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WxmpUserSubscribeRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpWorkUserSubscribeController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpWorkUserSubscribeController.java new file mode 100644 index 0000000000..be838ea49d --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpWorkUserSubscribeController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.WxmpWorkUserSubscribeDTO; +import com.epmet.excel.WxmpWorkUserSubscribeExcel; +import com.epmet.service.WxmpWorkUserSubscribeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 工作端用户订阅模板消息有效次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@RestController +@RequestMapping("wxmpworkusersubscribe") +public class WxmpWorkUserSubscribeController { + + @Autowired + private WxmpWorkUserSubscribeService wxmpWorkUserSubscribeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = wxmpWorkUserSubscribeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + WxmpWorkUserSubscribeDTO data = wxmpWorkUserSubscribeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody WxmpWorkUserSubscribeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + wxmpWorkUserSubscribeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody WxmpWorkUserSubscribeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + wxmpWorkUserSubscribeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + wxmpWorkUserSubscribeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = wxmpWorkUserSubscribeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WxmpWorkUserSubscribeExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpMsgSendRecordDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpMsgSendRecordDao.java new file mode 100644 index 0000000000..17aacf2a79 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpMsgSendRecordDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.WxmpMsgSendRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 消息发送记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Mapper +public interface WxmpMsgSendRecordDao extends BaseDao { + + int saveRecord(WxmpMsgSendRecordEntity entity); +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpResiUserSubscribeDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpResiUserSubscribeDao.java new file mode 100644 index 0000000000..c1a6e83d2f --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpResiUserSubscribeDao.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.WxmpResiUserSubscribeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 居民端用户订阅模板消息次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Mapper +public interface WxmpResiUserSubscribeDao extends BaseDao { + + /** + * @Description 根据openId获取剩余订阅条数 + * @param openId + * @param templateId + * @param customerId + * @return java.lang.Integer + * @Author liushaowen + * @Date 2020/10/22 9:30 + */ + Integer getResiSubscribeInfo(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId); + + /** + * @Description 减少订阅条数 + * @param openId + * @param customerId + * @param templateId + * @param i 减少的数量 + * @return int + * @Author liushaowen + * @Date 2020/10/22 9:38 + */ + int decreaseResiSubscribeCount(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId,@Param("num") int i); + + /** + * @Description 清空订阅条数,修改订阅状态 + * @param openId + * @param customerId + * @param templateId + * @return int + * @Author liushaowen + * @Date 2020/10/22 13:23 + */ + int clearResiSubscribeCount(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId); + /** + * @Description 获取模板id + * @param openId + * @param templateId + * @param customerId + * @return java.lang.Integer + * @Author liushaowen + * @Date 2020/10/23 10:53 + */ + String getResiSubscribeTemplateId(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId); +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpTemplateMsgSubscribeStatusDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpTemplateMsgSubscribeStatusDao.java new file mode 100644 index 0000000000..df2764868c --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpTemplateMsgSubscribeStatusDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.WxMsgAuthInfoResultDTO; +import com.epmet.entity.WxmpTemplateMsgSubscribeStatusEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 用户模板消息订阅授权状态表(记录我们自己和微信的授权页用户勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Mapper +public interface WxmpTemplateMsgSubscribeStatusDao extends BaseDao { + + WxMsgAuthInfoResultDTO getUserSubscribeStatusDTO(@Param("userId") String userId, + @Param("customerId") String customerId, + @Param("clientType") String clientType); + + WxmpTemplateMsgSubscribeStatusEntity getUserSubscribeStatusEntity(@Param("userId") String userId, + @Param("customerId") String customerId, + @Param("clientType") String clientType); +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUserSubscribeRecordDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUserSubscribeRecordDao.java new file mode 100644 index 0000000000..75a67bf727 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUserSubscribeRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.WxmpUserSubscribeRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户触发订阅的行为记录表(同时记录微信授权页每次勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Mapper +public interface WxmpUserSubscribeRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpWorkUserSubscribeDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpWorkUserSubscribeDao.java new file mode 100644 index 0000000000..0638e2bfc4 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpWorkUserSubscribeDao.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.WxmpWorkUserSubscribeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 工作端用户订阅模板消息有效次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Mapper +public interface WxmpWorkUserSubscribeDao extends BaseDao { + + /** + * @Description 根据openId获取剩余订阅条数 + * @param openId + * @param templateId + * @param customerId + * @return java.lang.Integer + * @Author liushaowen + * @Date 2020/10/22 9:31 + */ + Integer getWorkSubscribeInfo(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId); + + /** + * @Description 减少订阅条数 + * @param openId + * @param templateId + * @param customerId + * @param i 减少的数量 + * @return int + * @Author liushaowen + * @Date 2020/10/22 9:38 + */ + int decreaseWorkSubscribeCount(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId, @Param("num") int i); + + /** + * @Description 清空订阅数,修改订阅状态 + * @param openId + * @param customerId + * @param templateId + * @return int + * @Author liushaowen + * @Date 2020/10/22 13:22 + */ + int clearWorkSubscribeCount(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId); + + /** + * @Description 获取模板id + * @param openId + * @param templateId + * @param customerId + * @return java.lang.String + * @Author liushaowen + * @Date 2020/10/23 10:54 + */ + String getWorkSubscribeTemplateId(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId); +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpMsgSendRecordEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpMsgSendRecordEntity.java new file mode 100644 index 0000000000..89e1837475 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpMsgSendRecordEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 消息发送记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wxmp_msg_send_record") +public class WxmpMsgSendRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 所属端类型 居民端:resi 工作端:work + */ + private String clientType; + + /** + * 消息模板Id 消息模板Id + */ + private String templateId; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * openId openId + */ + private String wxOpenId; + + /** + * 行为类型(存title字段的中间值) 入组申请、党员认证等 + */ + private String behaviorType; + + /** + * 消息标题 消息标题 + */ + private String title; + + /** + * 消息内容 消息内容 + */ + private String messageContent; + + /** + * 消息时间 消息时间 + */ + private Date messageTime; + + /** + * 发送结果(成功:success 失败:error) + */ + private String result; + + /** + * 发送失败的原因,成功可以不记录 + */ + private String reason; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpResiUserSubscribeEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpResiUserSubscribeEntity.java new file mode 100644 index 0000000000..cff96c779d --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpResiUserSubscribeEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民端用户订阅模板消息次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wxmp_resi_user_subscribe") +public class WxmpResiUserSubscribeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 消息模板Id 消息模板Id + */ + private String templateId; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * openId openId + */ + private String wxOpenId; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; + + /** + * 可用推送次数 可用推送次数 + */ + private Integer count; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpTemplateMsgSubscribeStatusEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpTemplateMsgSubscribeStatusEntity.java new file mode 100644 index 0000000000..991ed157f1 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpTemplateMsgSubscribeStatusEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户模板消息订阅授权状态表(记录我们自己和微信的授权页用户勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wxmp_template_msg_subscribe_status") +public class WxmpTemplateMsgSubscribeStatusEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 所属端类型 居民端:resi 工作端:work + */ + private String clientType; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * 是否总是访问 是:yes 否:no + */ + private String alwaysVisit; + + /** + * 订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String subscribeStatus; + + /** + * wx是否总是访问 是:yes 否:no + */ + private String wxAlwaysVisit; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUserSubscribeRecordEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUserSubscribeRecordEntity.java new file mode 100644 index 0000000000..8d40463334 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUserSubscribeRecordEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户触发订阅的行为记录表(同时记录微信授权页每次勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wxmp_user_subscribe_record") +public class WxmpUserSubscribeRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 消息模板Id 消息模板Id + */ + private String templateId; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * openId openId + */ + private String wxOpenId; + + /** + * 行为类型(存title字段的中间值) 入组申请、党员认证等 + */ + private String behaviorType; + + /** + * wx是否总是访问 是:yes 否:no + */ + private String wxAlwaysVisit; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpWorkUserSubscribeEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpWorkUserSubscribeEntity.java new file mode 100644 index 0000000000..124a450386 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpWorkUserSubscribeEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作端用户订阅模板消息有效次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wxmp_work_user_subscribe") +public class WxmpWorkUserSubscribeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 客户Id + */ + private String customerId; + + /** + * 消息模板Id 消息模板Id + */ + private String templateId; + + /** + * 用户Id 用户Id + */ + private String userId; + + /** + * openId openId + */ + private String wxOpenId; + + /** + * wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe) + */ + private String wxSubscribeStatus; + + /** + * 可用推送次数 可用推送次数 + */ + private Integer count; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpMsgSendRecordExcel.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpMsgSendRecordExcel.java new file mode 100644 index 0000000000..a0d474ba82 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpMsgSendRecordExcel.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 消息发送记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpMsgSendRecordExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id 客户Id") + private String customerId; + + @Excel(name = "所属端类型 居民端:resi 工作端:work") + private String clientType; + + @Excel(name = "消息模板Id 消息模板Id") + private String templateId; + + @Excel(name = "用户Id 用户Id") + private String userId; + + @Excel(name = "openId openId") + private String wxOpenId; + + @Excel(name = "行为类型(存title字段的中间值) 入组申请、党员认证等") + private String behaviorType; + + @Excel(name = "消息标题 消息标题") + private String title; + + @Excel(name = "消息内容 消息内容") + private String messageContent; + + @Excel(name = "消息时间 消息时间") + private Date messageTime; + + @Excel(name = "发送结果") + private String result; + + @Excel(name = "发送失败的原因") + private String reason; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpResiUserSubscribeExcel.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpResiUserSubscribeExcel.java new file mode 100644 index 0000000000..b72c75dd7f --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpResiUserSubscribeExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 居民端用户订阅模板消息次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpResiUserSubscribeExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id 客户Id") + private String customerId; + + @Excel(name = "消息模板Id 消息模板Id") + private String templateId; + + @Excel(name = "用户Id 用户Id") + private String userId; + + @Excel(name = "openId openId") + private String wxOpenId; + + @Excel(name = "wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe)") + private String wxSubscribeStatus; + + @Excel(name = "可用推送次数 可用推送次数") + private Integer count; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpTemplateMsgSubscribeStatusExcel.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpTemplateMsgSubscribeStatusExcel.java new file mode 100644 index 0000000000..7c39312da3 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpTemplateMsgSubscribeStatusExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户模板消息订阅授权状态表(记录我们自己和微信的授权页用户勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpTemplateMsgSubscribeStatusExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id 客户Id") + private String customerId; + + @Excel(name = "所属端类型 居民端:resi 工作端:work") + private String clientType; + + @Excel(name = "用户Id 用户Id") + private String userId; + + @Excel(name = "是否总是访问 是:yes 否:no") + private String alwaysVisit; + + @Excel(name = "订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe)") + private String subscribeStatus; + + @Excel(name = "wx是否总是访问 是:yes 否:no") + private String wxAlwaysVisit; + + @Excel(name = "wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe)") + private String wxSubscribeStatus; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUserSubscribeRecordExcel.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUserSubscribeRecordExcel.java new file mode 100644 index 0000000000..b52a82b5cf --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUserSubscribeRecordExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户触发订阅的行为记录表(同时记录微信授权页每次勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpUserSubscribeRecordExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id 客户Id") + private String customerId; + + @Excel(name = "消息模板Id 消息模板Id") + private String templateId; + + @Excel(name = "用户Id 用户Id") + private String userId; + + @Excel(name = "openId openId") + private String wxOpenId; + + @Excel(name = "行为类型(存title字段的中间值) 入组申请、党员认证等") + private String behaviorType; + + @Excel(name = "wx是否总是访问 是:yes 否:no") + private String wxAlwaysVisit; + + @Excel(name = "wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe)") + private String wxSubscribeStatus; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpWorkUserSubscribeExcel.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpWorkUserSubscribeExcel.java new file mode 100644 index 0000000000..7397f5dfa3 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpWorkUserSubscribeExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 工作端用户订阅模板消息有效次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Data +public class WxmpWorkUserSubscribeExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id 客户Id") + private String customerId; + + @Excel(name = "消息模板Id 消息模板Id") + private String templateId; + + @Excel(name = "用户Id 用户Id") + private String userId; + + @Excel(name = "openId openId") + private String wxOpenId; + + @Excel(name = "wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe)") + private String wxSubscribeStatus; + + @Excel(name = "可用推送次数 可用推送次数") + private Integer count; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/exception/WxSubscribeException.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/exception/WxSubscribeException.java new file mode 100644 index 0000000000..e6fdee6127 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/exception/WxSubscribeException.java @@ -0,0 +1,43 @@ +package com.epmet.exception; + +/** + * @description: + * @author: liushaowen + * @date: 2020/10/22 11:07 + */ + +public class WxSubscribeException extends Exception { + private String openId; + private String templateId; + + /** + * Constructs a new exception with the specified detail message. The + * cause is not initialized, and may subsequently be initialized by + * a call to {@link #initCause}. + * + * @param message the detail message. The detail message is saved for + * later retrieval by the {@link #getMessage()} method. + */ + public WxSubscribeException(String message, String templateId, String openId) { + super(message); + this.openId = openId; + this.templateId = templateId; + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpMessageRedis.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpMessageRedis.java new file mode 100644 index 0000000000..a0672e7d58 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpMessageRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @description: 微信订阅Redis + * @author: liushaowen + * @date: 2020/10/21 15:28 + */ +@Slf4j +@Component +public class WxmpMessageRedis { + @Autowired + private RedisUtils redisUtils; + + /** + * @Description 获取刷新 + * @param key = epmet:wechartthird:authorizerrefreshtoken:customerId:clientType 前缀+客户ID+客户端类型 + * @author zxc + */ + public Map getAuthorizerRefreshToken(String key){ + Map result = redisUtils.hGetAll("epmet:wechartthird:authorizerrefreshtoken:" + key); + return result; + } +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpMsgSendRecordRedis.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpMsgSendRecordRedis.java new file mode 100644 index 0000000000..68ba610368 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpMsgSendRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 消息发送记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Component +public class WxmpMsgSendRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpResiUserSubscribeRedis.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpResiUserSubscribeRedis.java new file mode 100644 index 0000000000..ee0081e5db --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpResiUserSubscribeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 居民端用户订阅模板消息次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Component +public class WxmpResiUserSubscribeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpTemplateMsgSubscribeStatusRedis.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpTemplateMsgSubscribeStatusRedis.java new file mode 100644 index 0000000000..67de7a368b --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpTemplateMsgSubscribeStatusRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户模板消息订阅授权状态表(记录我们自己和微信的授权页用户勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Component +public class WxmpTemplateMsgSubscribeStatusRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUserSubscribeRecordRedis.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUserSubscribeRecordRedis.java new file mode 100644 index 0000000000..6cf0c8eb72 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUserSubscribeRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户触发订阅的行为记录表(同时记录微信授权页每次勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Component +public class WxmpUserSubscribeRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpWorkUserSubscribeRedis.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpWorkUserSubscribeRedis.java new file mode 100644 index 0000000000..f6cfcea0c2 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpWorkUserSubscribeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 工作端用户订阅模板消息有效次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Component +public class WxmpWorkUserSubscribeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java new file mode 100644 index 0000000000..fdde63f2a5 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.dto.form.GetTemplateListFormDTO; +import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.result.GetTemplateListResultDTO; + +import java.util.List; + +/** + * 微信消息订阅Service + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +public interface WxmpMessageService { + + void saveSysAuthorizeInfo(String customerId, String clientType, String alwaysVisit, String subscribeStatus, String userId); + + /** + * @Description 发送订阅消息 + * @param msgList + * @return void + * @Author liushaowen + * @Date 2020/10/21 15:34 + */ + void sendWxSubscribeMessage(List msgList); + + /** + * @return + * @Description 居民端、工作端-获取客户小程序模板列表 + * @author sun + */ + List templateList(GetTemplateListFormDTO formDTO); +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMsgSendRecordService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMsgSendRecordService.java new file mode 100644 index 0000000000..882848002b --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMsgSendRecordService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.WxmpMsgSendRecordDTO; +import com.epmet.entity.WxmpMsgSendRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 消息发送记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +public interface WxmpMsgSendRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-10-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-10-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WxmpMsgSendRecordDTO + * @author generator + * @date 2020-10-21 + */ + WxmpMsgSendRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void save(WxmpMsgSendRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void update(WxmpMsgSendRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-10-21 + */ + void delete(String[] ids); + + /** + * 保存 + * + * @param entity + * @return int + * @author liushaowen + * @date 2020-10-22 + */ + int saveRecord(WxmpMsgSendRecordEntity entity); +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpResiUserSubscribeService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpResiUserSubscribeService.java new file mode 100644 index 0000000000..eeee48bc3a --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpResiUserSubscribeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.WxmpResiUserSubscribeDTO; +import com.epmet.entity.WxmpResiUserSubscribeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民端用户订阅模板消息次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +public interface WxmpResiUserSubscribeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-10-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-10-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WxmpResiUserSubscribeDTO + * @author generator + * @date 2020-10-21 + */ + WxmpResiUserSubscribeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void save(WxmpResiUserSubscribeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void update(WxmpResiUserSubscribeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-10-21 + */ + void delete(String[] ids); +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpTemplateMsgSubscribeStatusService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpTemplateMsgSubscribeStatusService.java new file mode 100644 index 0000000000..c719aa0c9b --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpTemplateMsgSubscribeStatusService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.WxmpTemplateMsgSubscribeStatusDTO; +import com.epmet.entity.WxmpTemplateMsgSubscribeStatusEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户模板消息订阅授权状态表(记录我们自己和微信的授权页用户勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +public interface WxmpTemplateMsgSubscribeStatusService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-10-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-10-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WxmpTemplateMsgSubscribeStatusDTO + * @author generator + * @date 2020-10-21 + */ + WxmpTemplateMsgSubscribeStatusDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void save(WxmpTemplateMsgSubscribeStatusDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void update(WxmpTemplateMsgSubscribeStatusDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-10-21 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUserSubscribeRecordService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUserSubscribeRecordService.java new file mode 100644 index 0000000000..eda8ee4a3f --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUserSubscribeRecordService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.WxmpUserSubscribeRecordDTO; +import com.epmet.entity.WxmpUserSubscribeRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户触发订阅的行为记录表(同时记录微信授权页每次勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +public interface WxmpUserSubscribeRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-10-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-10-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WxmpUserSubscribeRecordDTO + * @author generator + * @date 2020-10-21 + */ + WxmpUserSubscribeRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void save(WxmpUserSubscribeRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void update(WxmpUserSubscribeRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-10-21 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpWorkUserSubscribeService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpWorkUserSubscribeService.java new file mode 100644 index 0000000000..60c482cd2e --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpWorkUserSubscribeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.WxmpWorkUserSubscribeDTO; +import com.epmet.entity.WxmpWorkUserSubscribeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作端用户订阅模板消息有效次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +public interface WxmpWorkUserSubscribeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-10-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-10-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WxmpWorkUserSubscribeDTO + * @author generator + * @date 2020-10-21 + */ + WxmpWorkUserSubscribeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void save(WxmpWorkUserSubscribeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-21 + */ + void update(WxmpWorkUserSubscribeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-10-21 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java new file mode 100644 index 0000000000..bf9d8ed39c --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java @@ -0,0 +1,322 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.WxmpMessageConstant; +import com.epmet.dao.WxmpResiUserSubscribeDao; +import com.epmet.dao.WxmpTemplateMsgSubscribeStatusDao; +import com.epmet.dao.WxmpWorkUserSubscribeDao; +import com.epmet.dto.form.GetTemplateListFormDTO; +import com.epmet.dto.form.StaffBasicInfoFormDTO; +import com.epmet.dto.form.UserBasicInfoFormDTO; +import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.result.GetTemplateListResultDTO; +import com.epmet.entity.WxmpMsgSendRecordEntity; +import com.epmet.entity.WxmpTemplateMsgSubscribeStatusEntity; +import com.epmet.exception.WxSubscribeException; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.redis.WxmpMessageRedis; +import com.epmet.service.WxmpMessageService; +import com.epmet.service.WxmpMsgSendRecordService; +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.Service; + +import javax.annotation.Resource; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 微信消息订阅Service + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Service +public class WxmpMessageServiceImpl implements WxmpMessageService { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private WxmpTemplateMsgSubscribeStatusDao msgSubscribeStatusDao; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private WxmpMessageRedis wxmpMessageRedis; + + @Resource + private WxmpResiUserSubscribeDao wxmpResiUserSubscribeDao; + + @Resource + private WxmpWorkUserSubscribeDao wxmpWorkUserSubscribeDao; + + @Autowired + private WxmpMsgSendRecordService wxmpMsgSendRecordService; + + /** + * @return void + * @Description 保存系统授权信息 + * @author wxz + * @date 2020.10.21 17:29 + */ + @Override + public void saveSysAuthorizeInfo(String customerId, String clientType, String alwaysVisit, String subscribeStatus, String userId) { + WxmpTemplateMsgSubscribeStatusEntity userSubscribeStatusEntity = msgSubscribeStatusDao.getUserSubscribeStatusEntity(userId, customerId, clientType); + if (userSubscribeStatusEntity != null) { + userSubscribeStatusEntity.setAlwaysVisit(alwaysVisit); + userSubscribeStatusEntity.setSubscribeStatus(subscribeStatus); + msgSubscribeStatusDao.updateById(userSubscribeStatusEntity); + return; + } + + userSubscribeStatusEntity = new WxmpTemplateMsgSubscribeStatusEntity(); + userSubscribeStatusEntity.setCustomerId(customerId); + userSubscribeStatusEntity.setClientType(clientType); + userSubscribeStatusEntity.setAlwaysVisit(alwaysVisit); + userSubscribeStatusEntity.setSubscribeStatus(subscribeStatus); + userSubscribeStatusEntity.setUserId(userId); + msgSubscribeStatusDao.insert(userSubscribeStatusEntity); + } + + /** + * @param msgList + * @return void + * @Description 发送订阅消息 + * @Author liushaowen + * @Date 2020/10/21 15:34 + */ + @Override + public void sendWxSubscribeMessage(List msgList) { + logger.info("待发送订阅消息数量:{}", msgList.size()); + int succecssCount = 0; + for (WxSubscribeMessageFormDTO msg : msgList) { + try { + String userId = msg.getUserId(); + String clientType = msg.getClientType(); + String customerId = msg.getCustomerId(); + String templateId = null; + String openId = null; + //通过userId获取openId + try { + if (WxmpMessageConstant.RESI.equals(clientType)) { + UserBasicInfoFormDTO userBasicInfoFormDTO = new UserBasicInfoFormDTO(); + userBasicInfoFormDTO.setUserId(userId); + openId = epmetUserOpenFeignClient.getUserBasicInfo(userBasicInfoFormDTO).getData().getOpenId(); + } else if (WxmpMessageConstant.WORK.equals(clientType)) { + StaffBasicInfoFormDTO staffBasicInfoFormDTO = new StaffBasicInfoFormDTO(); + staffBasicInfoFormDTO.setStaffId(userId); + openId = epmetUserOpenFeignClient.getStaffBasicInfo(staffBasicInfoFormDTO).getData().getOpenId(); + } else { + throw new WxSubscribeException("clientType有误", "", openId); + } + } catch (Exception e) { + throw new WxSubscribeException("连接User服务失败", "", ""); + } + + if (StringUtils.isBlank(openId)) { + throw new WxSubscribeException("openId获取失败", "", ""); + } + + //获取accessToken + StringBuilder key = new StringBuilder(msg.getCustomerId()).append(":").append(msg.getClientType()); + Map authorizerRefreshToken = new HashMap<>(); + try { + authorizerRefreshToken = wxmpMessageRedis.getAuthorizerRefreshToken(key.toString()); + } catch (Exception e) { + throw new WxSubscribeException("连接缓存服务器失败", "", openId); + } + String accessToken = (String) authorizerRefreshToken.get(WxmpMessageConstant.AUTHORIZER_ACCESS_TOKEN); + if (StringUtils.isBlank(accessToken)) { + throw new WxSubscribeException("accessToken获取失败", "", openId); + } + + //获取模板id + if (WxmpMessageConstant.RESI.equals(clientType)) { + templateId = wxmpResiUserSubscribeDao.getResiSubscribeTemplateId(openId, templateId, customerId); + } else if (WxmpMessageConstant.WORK.equals(clientType)) { + templateId = wxmpWorkUserSubscribeDao.getWorkSubscribeTemplateId(openId, templateId, customerId); + } + if (StringUtils.isBlank(templateId)) { + throw new WxSubscribeException("获取模板id失败", "", openId); + } + + //判断用户是否有次数 + Integer count = null; + if (WxmpMessageConstant.RESI.equals(clientType)) { + count = wxmpResiUserSubscribeDao.getResiSubscribeInfo(openId, templateId, customerId); + } else if (WxmpMessageConstant.WORK.equals(clientType)) { + count = wxmpWorkUserSubscribeDao.getWorkSubscribeInfo(openId, templateId, customerId); + } + if (count == null) { + //用户未订阅 + throw new WxSubscribeException("用户未订阅", templateId, openId); + } + if (count == 0) { + throw new WxSubscribeException("用户可用额度不足", templateId, openId); + } + + //发送消息 + JSONObject jsonObject = new JSONObject(); + JSONObject data = new JSONObject(); + //必填项 + jsonObject.put(WxmpMessageConstant.ACCESS_TOKEN, accessToken); + jsonObject.put(WxmpMessageConstant.TOUSER, openId); + jsonObject.put(WxmpMessageConstant.TEMPLATE_ID, templateId); + data.put(WxmpMessageConstant.TITLE, new JSONObject().put("value", ("您有一条" + msg.getBehaviorType()).substring(0, WxmpMessageConstant.TITLE_LIMIT))); + data.put(WxmpMessageConstant.MESSAGE_CONTENT, new JSONObject().put("value", msg.getMessageContent().substring(0, WxmpMessageConstant.MESSAGE_CONTENT_LIMIT))); + data.put(WxmpMessageConstant.MESSAGE_TIME, new JSONObject().put("value", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()))); + jsonObject.put(WxmpMessageConstant.DATA, data); + EnvEnum envEnum = EnvEnum.getCurrentEnv(); + //选填项 + if (WxmpMessageConstant.RESI.equals(clientType)) { + jsonObject.put(WxmpMessageConstant.PAGE, WxmpMessageConstant.PAGE_RESI); + } else if (WxmpMessageConstant.WORK.equals(clientType)) { + jsonObject.put(WxmpMessageConstant.PAGE, WxmpMessageConstant.PAGE_WORK); + } + //开发环境 + if ("dev".equals(envEnum.getCode())) { + jsonObject.put(WxmpMessageConstant.MINIPROGRAM_STATE, WxmpMessageConstant.STATE_DEV); + } + //测试环境 + if ("test".equals(envEnum.getCode())) { + jsonObject.put(WxmpMessageConstant.MINIPROGRAM_STATE, WxmpMessageConstant.STATE_TEST); + } + + String resultStr = HttpClientManager.getInstance().sendPostByJSON(WxmpMessageConstant.SEND_MESSAGE + accessToken, JSON.toJSONString(jsonObject)).getData(); + Map resultMap = JSON.parseObject(resultStr, Map.class); + Object errcode = resultMap.get(WxmpMessageConstant.ERR_CODE); + if (errcode.equals(NumConstant.ZERO)) { + //发送成功 + + //订阅条数-1 + int decrease = 0; + if (WxmpMessageConstant.RESI.equals(clientType)) { + decrease = wxmpResiUserSubscribeDao.decreaseResiSubscribeCount(openId, templateId, customerId, 1); + } else if (WxmpMessageConstant.WORK.equals(clientType)) { + decrease = wxmpWorkUserSubscribeDao.decreaseWorkSubscribeCount(openId, templateId, customerId, 1); + } + if (decrease == 0) { + logger.error("消息{}发送成功但订阅条数-1失败", JSON.toJSONString(msg)); + } + //存表 + int saveRes = wxmpMsgSendRecordService.saveRecord(initRecord(msg, templateId, openId, WxmpMessageConstant.SUCCESS)); + if (saveRes == 0) { + logger.error("消息{}发送成功但存入记录表失败", JSON.toJSONString(msg)); + } + } else { + //发送失败 + //用户拒绝,需清空订阅表条数,修改订阅状态 + if (errcode.equals(WxmpMessageConstant.USER_REFUSED)) { + int clear = 0; + if (WxmpMessageConstant.RESI.equals(clientType)) { + clear = wxmpResiUserSubscribeDao.clearResiSubscribeCount(openId, templateId, customerId); + } else if (WxmpMessageConstant.WORK.equals(clientType)) { + clear = wxmpWorkUserSubscribeDao.clearWorkSubscribeCount(openId, templateId, customerId); + } + if (clear == 0) { + logger.error("消息{}发送失败且清空订阅条数失败", JSON.toJSONString(msg)); + } + } + + //抛出错误 + throw new WxSubscribeException(String.valueOf(resultMap.get(WxmpMessageConstant.ERR_MSG)),templateId, openId); + } + + succecssCount++; + } catch (Exception e) { + String errMsg = e.getMessage(); + //ValidateException错误信息为getMsg +// if (StringUtils.isBlank(errMsg) && e instanceof ValidateException) { +// errMsg = ((ValidateException) e).getMsg(); +// } + if (e instanceof WxSubscribeException) { + //存表 + WxmpMsgSendRecordEntity wxmpMsgSendRecordEntity = initRecord(msg, ((WxSubscribeException) e).getTemplateId(), ((WxSubscribeException) e).getOpenId(), WxmpMessageConstant.ERROR); + wxmpMsgSendRecordEntity.setReason(errMsg); + int saveRes = wxmpMsgSendRecordService.saveRecord(wxmpMsgSendRecordEntity); + if (saveRes == 0) { + logger.error("消息{}发送失败且存入记录表失败", JSON.toJSONString(msg)); + } + } + + logger.error("消息:{}发送失败,原因是:{}", JSON.toJSONString(msg), errMsg); + continue; + } + } + logger.info("{}条消息中的{}条发送成功", msgList.size(), succecssCount); + } + + //初始化记录对象 + private WxmpMsgSendRecordEntity initRecord(WxSubscribeMessageFormDTO msg, String templateId, String openId, String status) { + WxmpMsgSendRecordEntity wxmpMsgSendRecordEntity = new WxmpMsgSendRecordEntity(); + wxmpMsgSendRecordEntity.setCustomerId(msg.getCustomerId()); + wxmpMsgSendRecordEntity.setClientType(msg.getClientType()); + wxmpMsgSendRecordEntity.setTemplateId(templateId); + wxmpMsgSendRecordEntity.setUserId(msg.getUserId()); + wxmpMsgSendRecordEntity.setWxOpenId(openId); + wxmpMsgSendRecordEntity.setBehaviorType(msg.getBehaviorType()); + wxmpMsgSendRecordEntity.setTitle("您有一条" + msg.getBehaviorType()); + wxmpMsgSendRecordEntity.setMessageContent(msg.getMessageContent()); + wxmpMsgSendRecordEntity.setMessageTime(new Date()); + wxmpMsgSendRecordEntity.setResult(status); + return wxmpMsgSendRecordEntity; + } + + /** + * @return + * @Description 居民端、工作端-获取客户小程序模板列表 + * @author sun + */ + @Override + public List templateList(GetTemplateListFormDTO formDTO) { + GetTemplateListFormDTO dto = ConvertUtils.sourceToTarget(formDTO, GetTemplateListFormDTO.class); + String url = "https://epmet-cloud.elinkservice.cn/api/third/personaltemplate/templatelist"; + //String url = "http://localhost:8080/api/third/personaltemplate/templatelist"; + String data = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(dto)).getData(); + logger.info("ThirdLoginServiceImpl.getUserWeChat:httpclient->url:"+url+",结果->"+data); + JSONObject toResult = JSON.parseObject(data); + Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class); + if (null != toResult.get("code")) { + mapToResult.setCode(((Integer) toResult.get("code")).intValue()); + } + if (!mapToResult.success()) { + logger.error("调用epmet_third服务获取小程序消息订阅模板数据失败"); + throw new RenException(mapToResult.getCode()); + } + List resultList = (List) mapToResult.getData(); + return resultList; + } + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMsgSendRecordServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMsgSendRecordServiceImpl.java new file mode 100644 index 0000000000..62fdc10b0d --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMsgSendRecordServiceImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.WxmpMsgSendRecordDao; +import com.epmet.dto.WxmpMsgSendRecordDTO; +import com.epmet.entity.WxmpMsgSendRecordEntity; +import com.epmet.redis.WxmpMsgSendRecordRedis; +import com.epmet.service.WxmpMsgSendRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 消息发送记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Service +public class WxmpMsgSendRecordServiceImpl extends BaseServiceImpl implements WxmpMsgSendRecordService { + + @Autowired + private WxmpMsgSendRecordRedis wxmpMsgSendRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WxmpMsgSendRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WxmpMsgSendRecordDTO.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 WxmpMsgSendRecordDTO get(String id) { + WxmpMsgSendRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WxmpMsgSendRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WxmpMsgSendRecordDTO dto) { + WxmpMsgSendRecordEntity entity = ConvertUtils.sourceToTarget(dto, WxmpMsgSendRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WxmpMsgSendRecordDTO dto) { + WxmpMsgSendRecordEntity entity = ConvertUtils.sourceToTarget(dto, WxmpMsgSendRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int saveRecord(WxmpMsgSendRecordEntity entity) { + return baseDao.saveRecord(entity); + } +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpResiUserSubscribeServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpResiUserSubscribeServiceImpl.java new file mode 100644 index 0000000000..2c317e037b --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpResiUserSubscribeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.WxmpResiUserSubscribeDao; +import com.epmet.dto.WxmpResiUserSubscribeDTO; +import com.epmet.entity.WxmpResiUserSubscribeEntity; +import com.epmet.redis.WxmpResiUserSubscribeRedis; +import com.epmet.service.WxmpResiUserSubscribeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 居民端用户订阅模板消息次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Service +public class WxmpResiUserSubscribeServiceImpl extends BaseServiceImpl implements WxmpResiUserSubscribeService { + + @Autowired + private WxmpResiUserSubscribeRedis wxmpResiUserSubscribeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WxmpResiUserSubscribeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WxmpResiUserSubscribeDTO.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 WxmpResiUserSubscribeDTO get(String id) { + WxmpResiUserSubscribeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WxmpResiUserSubscribeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WxmpResiUserSubscribeDTO dto) { + WxmpResiUserSubscribeEntity entity = ConvertUtils.sourceToTarget(dto, WxmpResiUserSubscribeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WxmpResiUserSubscribeDTO dto) { + WxmpResiUserSubscribeEntity entity = ConvertUtils.sourceToTarget(dto, WxmpResiUserSubscribeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpTemplateMsgSubscribeStatusServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpTemplateMsgSubscribeStatusServiceImpl.java new file mode 100644 index 0000000000..5ea81bdd63 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpTemplateMsgSubscribeStatusServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.WxmpTemplateMsgSubscribeStatusDao; +import com.epmet.dto.WxmpTemplateMsgSubscribeStatusDTO; +import com.epmet.entity.WxmpTemplateMsgSubscribeStatusEntity; +import com.epmet.redis.WxmpTemplateMsgSubscribeStatusRedis; +import com.epmet.service.WxmpTemplateMsgSubscribeStatusService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户模板消息订阅授权状态表(记录我们自己和微信的授权页用户勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Service +public class WxmpTemplateMsgSubscribeStatusServiceImpl extends BaseServiceImpl implements WxmpTemplateMsgSubscribeStatusService { + + @Autowired + private WxmpTemplateMsgSubscribeStatusRedis wxmpTemplateMsgSubscribeStatusRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WxmpTemplateMsgSubscribeStatusDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WxmpTemplateMsgSubscribeStatusDTO.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 WxmpTemplateMsgSubscribeStatusDTO get(String id) { + WxmpTemplateMsgSubscribeStatusEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WxmpTemplateMsgSubscribeStatusDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WxmpTemplateMsgSubscribeStatusDTO dto) { + WxmpTemplateMsgSubscribeStatusEntity entity = ConvertUtils.sourceToTarget(dto, WxmpTemplateMsgSubscribeStatusEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WxmpTemplateMsgSubscribeStatusDTO dto) { + WxmpTemplateMsgSubscribeStatusEntity entity = ConvertUtils.sourceToTarget(dto, WxmpTemplateMsgSubscribeStatusEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpUserSubscribeRecordServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpUserSubscribeRecordServiceImpl.java new file mode 100644 index 0000000000..9326681fe4 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpUserSubscribeRecordServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.WxmpUserSubscribeRecordDao; +import com.epmet.dto.WxmpUserSubscribeRecordDTO; +import com.epmet.entity.WxmpUserSubscribeRecordEntity; +import com.epmet.redis.WxmpUserSubscribeRecordRedis; +import com.epmet.service.WxmpUserSubscribeRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户触发订阅的行为记录表(同时记录微信授权页每次勾选的状态) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Service +public class WxmpUserSubscribeRecordServiceImpl extends BaseServiceImpl implements WxmpUserSubscribeRecordService { + + @Autowired + private WxmpUserSubscribeRecordRedis wxmpUserSubscribeRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WxmpUserSubscribeRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WxmpUserSubscribeRecordDTO.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 WxmpUserSubscribeRecordDTO get(String id) { + WxmpUserSubscribeRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WxmpUserSubscribeRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WxmpUserSubscribeRecordDTO dto) { + WxmpUserSubscribeRecordEntity entity = ConvertUtils.sourceToTarget(dto, WxmpUserSubscribeRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WxmpUserSubscribeRecordDTO dto) { + WxmpUserSubscribeRecordEntity entity = ConvertUtils.sourceToTarget(dto, WxmpUserSubscribeRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpWorkUserSubscribeServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpWorkUserSubscribeServiceImpl.java new file mode 100644 index 0000000000..93a3ad4147 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpWorkUserSubscribeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.WxmpWorkUserSubscribeDao; +import com.epmet.dto.WxmpWorkUserSubscribeDTO; +import com.epmet.entity.WxmpWorkUserSubscribeEntity; +import com.epmet.redis.WxmpWorkUserSubscribeRedis; +import com.epmet.service.WxmpWorkUserSubscribeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作端用户订阅模板消息有效次数记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-21 + */ +@Service +public class WxmpWorkUserSubscribeServiceImpl extends BaseServiceImpl implements WxmpWorkUserSubscribeService { + + @Autowired + private WxmpWorkUserSubscribeRedis wxmpWorkUserSubscribeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WxmpWorkUserSubscribeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WxmpWorkUserSubscribeDTO.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 WxmpWorkUserSubscribeDTO get(String id) { + WxmpWorkUserSubscribeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WxmpWorkUserSubscribeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WxmpWorkUserSubscribeDTO dto) { + WxmpWorkUserSubscribeEntity entity = ConvertUtils.sourceToTarget(dto, WxmpWorkUserSubscribeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WxmpWorkUserSubscribeDTO dto) { + WxmpWorkUserSubscribeEntity entity = ConvertUtils.sourceToTarget(dto, WxmpWorkUserSubscribeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpMsgSendRecordDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpMsgSendRecordDao.xml new file mode 100644 index 0000000000..da33d13106 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpMsgSendRecordDao.xml @@ -0,0 +1,48 @@ + + + + + + + insert into wxmp_msg_send_record + (id, + customer_id, + client_type, + template_id, + user_id, + wx_open_id, + behavior_type, + title, + message_content, + message_time, + result, + reason, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time) + values + (MD5(replace(UUID(),'-','')), + #{customerId}, + #{clientType}, + #{templateId}, + #{userId}, + #{wxOpenId}, + #{behaviorType}, + #{title}, + #{messageContent}, + #{messageTime}, + #{result}, + #{reason}, + 0, + 0, + 'sys', + now(), + 'sys', + now() + ) + + + diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpResiUserSubscribeDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpResiUserSubscribeDao.xml new file mode 100644 index 0000000000..2a1df8a057 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpResiUserSubscribeDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + update Wxmp_Resi_User_Subscribe + set count = if(count 1, 0, count - ${num} ) + where + del_flag = 0 + and customer_id = #{customerId} + and template_id = #{templateId} + and wx_open_id = #{openId} + and wx_subscribe_status = 'subscribe' + + + + update Wxmp_Resi_User_Subscribe + set count = 0, + wx_subscribe_status = 'unsubscribe' + where + del_flag = 0 + and customer_id = #{customerId} + and template_id = #{templateId} + and wx_open_id = #{openId} + + + + + diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpTemplateMsgSubscribeStatusDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpTemplateMsgSubscribeStatusDao.xml new file mode 100644 index 0000000000..d1fde2360a --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpTemplateMsgSubscribeStatusDao.xml @@ -0,0 +1,47 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUserSubscribeRecordDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUserSubscribeRecordDao.xml new file mode 100644 index 0000000000..042c8f94a0 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUserSubscribeRecordDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpWorkUserSubscribeDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpWorkUserSubscribeDao.xml new file mode 100644 index 0000000000..efa31174f9 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpWorkUserSubscribeDao.xml @@ -0,0 +1,49 @@ + + + + + + + + + update Wxmp_Work_User_Subscribe + set count = if(count < 1, 0, count - ${num} ) + where + del_flag =0 + and customer_id = #{customerId} + and template_id = #{templateId} + and wx_open_id = #{openId} + and wx_subscribe_status = 'subscribe' + + + update Wxmp_Work_User_Subscribe + set count = 0, + wx_subscribe_status = 'unsubscribe' + where + del_flag =0 + and customer_id = #{customerId} + and template_id = #{templateId} + and wx_open_id = #{openId} + + + diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java index c37afa2921..6ccb0b2a51 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java @@ -27,6 +27,6 @@ public class CommonPageUserFormDTO implements Serializable { private Integer pageSize = 10; - @NotBlank(message = "获取不到用户Id" , groups = PageUserGroup.class) + @NotBlank(message = "获取不到客户Id" , groups = PageUserGroup.class) private String customerId; } diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml index 9797b08b02..fb22688a83 100644 --- a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-point-server: container_name: epmet-point-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-point-server:0.0.40 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-point-server:0.0.42 ports: - "8112:8112" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index f0add3faf1..19dad360dd 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.40 + 0.0.42 epmet-point com.epmet diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GetTemplateListFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GetTemplateListFormDTO.java new file mode 100644 index 0000000000..09fb259376 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GetTemplateListFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 获取客户小程序模板列表-接口入参 + * @Author sun + */ +@Data +public class GetTemplateListFormDTO implements Serializable { + + /** + * 客户Id + */ + @NotBlank(message="客户Id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + /** + * 小程序Id + */ + @NotBlank(message="小程序appId不能为空", groups = {AddUserInternalGroup.class}) + private String appId; + /** + * 模板类型(站内信提醒) + */ + private String templateType; + public interface AddUserInternalGroup {} +} + diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GetTemplateListResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GetTemplateListResultDTO.java new file mode 100644 index 0000000000..d95e482c6f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GetTemplateListResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 获取客户小程序模板列表-接口返参 + * @Author sun + */ +@Data +public class GetTemplateListResultDTO implements Serializable { + private static final long serialVersionUID = 6856602932571839314L; + + /** + * 模板Id + */ + private String templateId; + + /** + * 模板类型(站内信提醒) + */ + private String templateType; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index 89160aed2c..f01831dba3 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.141 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.147 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index f85185fb9b..050301d9f6 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.141 + 0.0.147 com.epmet diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PersonalTemplateController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PersonalTemplateController.java new file mode 100644 index 0000000000..bec7a2d3a8 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PersonalTemplateController.java @@ -0,0 +1,37 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.GetTemplateListFormDTO; +import com.epmet.dto.result.GetTemplateListResultDTO; +import com.epmet.service.PersonalTemplateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@RestController +@RequestMapping("personaltemplate") +public class PersonalTemplateController { + + @Autowired + private PersonalTemplateService personalTemplateService; + + /** + * @return + * @Description 居民端、工作端-获取客户小程序模板列表 + * @author sun + */ + @PostMapping("templatelist") + public Result> templateList(@RequestBody GetTemplateListFormDTO formDTO) { + return new Result>().ok(personalTemplateService.templateList(formDTO)); + } + + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java index bd77f6ffea..a92981e0d4 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java @@ -19,7 +19,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.PersonalTemplateDTO; +import com.epmet.dto.form.GetTemplateListFormDTO; import com.epmet.dto.result.CustomerTempResultDTO; +import com.epmet.dto.result.GetTemplateListResultDTO; import com.epmet.dto.result.TemplateDTO; import com.epmet.entity.PersonalTemplateEntity; import org.apache.ibatis.annotations.Mapper; @@ -76,4 +78,11 @@ public interface PersonalTemplateDao extends BaseDao { */ List selectListByCustomerId(@Param("appId") String appId, @Param("customerId") String customerId, @Param("clientType") String clientType); + + /** + * @return + * @Description 居民端、工作端-获取客户小程序模板列表 + * @author sun + */ + List selectTemplateList(GetTemplateListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java index 447e6dd388..9f79ece63c 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java @@ -20,6 +20,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.PersonalTemplateDTO; +import com.epmet.dto.form.GetTemplateListFormDTO; +import com.epmet.dto.result.GetTemplateListResultDTO; import com.epmet.dto.result.TemplateDTO; import com.epmet.entity.PersonalTemplateEntity; @@ -123,4 +125,11 @@ public interface PersonalTemplateService extends BaseService getListByCustomer(String appId, String customerId, String clientType); + + /** + * @return + * @Description 居民端、工作端-获取客户小程序模板列表 + * @author sun + */ + List templateList(GetTemplateListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java index f7b5589f43..8a5764427a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java @@ -25,6 +25,8 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.PersonalTemplateDao; import com.epmet.dto.PersonalTemplateDTO; +import com.epmet.dto.form.GetTemplateListFormDTO; +import com.epmet.dto.result.GetTemplateListResultDTO; import com.epmet.dto.result.TemplateDTO; import com.epmet.entity.PersonalTemplateEntity; import com.epmet.service.PersonalTemplateService; @@ -116,4 +118,15 @@ public class PersonalTemplateServiceImpl extends BaseServiceImpl templateList(GetTemplateListFormDTO formDTO) { + //根据客户Id、appId、模板类型查询小程序订阅消息模板列表 + return baseDao.selectTemplateList(formDTO); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml index f3b46b3c42..0b3f7ace51 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml @@ -75,5 +75,18 @@ ON t1.PRI_TMPL_ID = t2.PID + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml index 08aec5c665..f942a8fdb1 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.88 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.91 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 94f959ad2b..041a45f6fc 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.88 + 0.3.91 com.epmet gov-org diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 826e186d7f..7595aafa33 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -237,11 +237,21 @@ public class AgencyServiceImpl implements AgencyService { @Override public Result subAgencyList(SubAgencyFormDTO formDTO) { SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO(); - //1:根据当前机关Id查询直属下一级机关列表 + //1:根据当前机关Id查询直属下一级机关列表,只返回前十条 List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId()); - subAgencyResultDTO.setAgencyList(null == agencyList ? new ArrayList() : agencyList); - //2:统计下一级机关数 - subAgencyResultDTO.setSubAgencyCount(agencyList.size()); + if (null == agencyList || agencyList.size() < NumConstant.ONE) { + subAgencyResultDTO.setAgencyList(new ArrayList()); + subAgencyResultDTO.setSubAgencyCount(NumConstant.ZERO); + } else { + subAgencyResultDTO.setSubAgencyCount(agencyList.size()); + if (agencyList.size() > NumConstant.TEN) { + List newList = agencyList.subList(NumConstant.ZERO, NumConstant.TEN); + subAgencyResultDTO.setAgencyList(newList); + } else { + subAgencyResultDTO.setAgencyList(agencyList); + } + } + return new Result().ok(subAgencyResultDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 0721780e09..4e295b44cf 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -67,7 +67,6 @@ WHERE del_flag = '0' AND pid = #{pId} ORDER BY created_time DESC - LIMIT 10 SELECT @@ -29,6 +42,7 @@ AND sr.ORG_ID = #{orgId} AND sr.DEL_FLAG = '0' AND r.DEL_FLAG = '0' + ORDER BY r.SORT asc SELECT - gsr.role_key AS roleKey, - gsr.role_name AS roleName, - sr.staff_id AS userId + gsr.role_key AS roleKey, + gsr.role_name AS roleName, + sr.staff_id AS userId FROM - gov_staff_role gsr - LEFT JOIN staff_role sr ON sr.role_id = gsr.id + gov_staff_role gsr + LEFT JOIN staff_role sr ON sr.role_id = gsr.id WHERE - gsr.del_flag = 0 - AND sr.del_flag = 0 - AND - ( - - sr.staff_id = #{userId} - - ) + gsr.del_flag = 0 + AND sr.del_flag = 0 + AND + ( + + sr.staff_id = #{userId} + + ) \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml index faaa5757e9..d287af8fcd 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml @@ -36,4 +36,26 @@ LIMIT 1 + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml index 6822515ed6..c1f8791e16 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml @@ -52,4 +52,19 @@ AND user.FROM_APP = 'resi' + +