diff --git a/epmet-admin/epmet-admin-server/Dockerfile b/epmet-admin/epmet-admin-server/Dockerfile index c0b3c72e27..63927bad16 100644 --- a/epmet-admin/epmet-admin-server/Dockerfile +++ b/epmet-admin/epmet-admin-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-admin.jar EXPOSE 8082 diff --git a/epmet-admin/epmet-admin-server/deploy/docker-compose-dev.yml b/epmet-admin/epmet-admin-server/deploy/docker-compose-dev.yml index 1b77c09bda..f86422e850 100644 --- a/epmet-admin/epmet-admin-server/deploy/docker-compose-dev.yml +++ b/epmet-admin/epmet-admin-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-admin.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml b/epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml index e5d93e9ac3..e9d8d41470 100644 --- a/epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml +++ b/epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-admin.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml b/epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml index 6ae49f3aa3..575e1267c8 100644 --- a/epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml +++ b/epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-admin.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml index 0275695054..6b4803d4d8 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml +++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-admin-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-auth/Dockerfile b/epmet-auth/Dockerfile index c106eaf299..207ac66a19 100644 --- a/epmet-auth/Dockerfile +++ b/epmet-auth/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-auth.jar EXPOSE 8081 diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index f533348156..0ee4421f6f 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-auth.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-auth/deploy/docker-compose-prod.yml b/epmet-auth/deploy/docker-compose-prod.yml index afffcf2474..b9387658c5 100644 --- a/epmet-auth/deploy/docker-compose-prod.yml +++ b/epmet-auth/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-auth.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-auth/deploy/docker-compose-test.yml b/epmet-auth/deploy/docker-compose-test.yml index bfc9acc44b..e4aab166ec 100644 --- a/epmet-auth/deploy/docker-compose-test.yml +++ b/epmet-auth/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./epmet-auth.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 12162bfbd3..9631436b98 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -66,8 +66,8 @@ public class GovWebServiceImpl implements GovWebService { boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); if (!flag) { logger.error(String.format("用户%s登录,验证码输入错误,暂时放行", formDTO.getPhone())); - //暂时关闭验证码校验 TODO - //throw new RenException(EpmetErrorCode.ERR10019.getCode()); + //开启验证码校验 + throw new RenException(EpmetErrorCode.ERR10019.getCode()); } //3.校验登陆账号是否存在 //根据客户Id和手机号查询登陆用户信息(此处不需要判断登陆人是否是有效客户以及是否是客户的根管理员,前一接口获取登陆手机号对应客户列表已经判断了) diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 8e526e2a73..49dbbb94d5 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_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?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 0a9d9adf91..62939c595f 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 @@ -24,9 +24,9 @@ public class DynamicDataSource extends AbstractRoutingDataSource { @Override protected Object determineCurrentLookupKey() { - String datasourceName = DynamicContextHolder.peek(); - logger.info("使用的数据源名称为:{}", datasourceName); - return datasourceName; + String ds = DynamicContextHolder.peek(); + logger.info("动态数据源:{}" + ds); + return ds; } } 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 c9b252c0ca..079440664b 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 @@ -4,6 +4,7 @@ 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; @@ -209,7 +210,8 @@ public class ExternalAppRequestAuthAspect { 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-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java index 8e065c792a..4500453213 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java @@ -41,7 +41,7 @@ public class CustomerApplicationRunner implements ApplicationRunner { //发送启动成功消息 EnvEnum currentEnv = EnvEnum.getCurrentEnv(); logger.info(currentEnv); - if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode())) { + if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode()) && !EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) { InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); 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 0c3f798318..ed782790e8 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,6 +11,7 @@ import org.springframework.core.env.Environment; * @date 2020-07-03 11:14 **/ public enum EnvEnum { + LOCAL("local", "本地环境"), DEV("dev", "开发环境"), TEST("test", "体验环境"), PROD("prod", "生产环境"), 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 3417d172d8..1c1e6ae20b 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 @@ -95,6 +95,7 @@ public enum EpmetErrorCode { SIGN_IN_TIME_NO(8513, "签到时间还未到~"), SIGN_IN_TIME_END(8514, "签到时间已结束~"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), OPER_ADD_CUSTOMER_ROOT_AGENCY_EXISTS(8703, "添加客户根级组织失败,根级组织已存在"), @@ -106,8 +107,10 @@ public enum EpmetErrorCode { OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"), OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"), OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"), - OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"), - UNSUPPORT_AUTH_TYPE(8714, "不支持的认证方式"), + OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"), + OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"), + OPER_EXT_APP_SECRET_RESET_FAIL(8714, "秘钥更新失败"), + UNSUPPORT_AUTH_TYPE(8715, "不支持的认证方式"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), 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 0d623e2010..ea8f100f6c 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 @@ -295,14 +295,44 @@ public class RedisKeys { * @return */ public static String getExternalAppSecretKey(String appId) { - return String.format(rootPrefix+"externalapp:secret:%s",appId); + return String.format(rootPrefix + "externalapp:secret:%s", appId); } /** * 计算指标时获取指标code和fields关系缓存Key + * * @return */ public static String getIndexCodeFieldReKey() { - return rootPrefix.concat("data:index:indexcode:field"); + return rootPrefix.concat("stats:indexcal:indexcode:field"); + } + + /** + * 计算指标时获取指标权重缓存Key + * + * @return + */ + public static String getIndexCodeWeightKey(String customerId) { + return rootPrefix.concat("stats:indexcal:indexcode:weight").concat(customerId); + } + + /** + * 客户统计的计算标记。 + * 0:未在计算 + * 1:正在计算 + * + * @param customerId + * @return + */ + public static String getCustomerStatsCalFlag(String customerId) { + return getCustomerStatsCalKeyPrefix().concat(":").concat(customerId); + } + + /** + * 获取计算标记的key前缀 + * @return + */ + public static String getCustomerStatsCalKeyPrefix() { + return rootPrefix.concat("stats:calflag"); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java index 59016ccc88..d37ef464bd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java @@ -38,7 +38,7 @@ public class DingdingMsgSender { /** * 默认10 */ - private static Integer maxQueueSize = 10; + private static Integer maxQueueSize = 8; /** * 有序队列 diff --git a/epmet-gateway/Dockerfile b/epmet-gateway/Dockerfile index a237b2929f..fad72ba2ca 100644 --- a/epmet-gateway/Dockerfile +++ b/epmet-gateway/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-gateway.jar EXPOSE 8080 diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index 3329f89b6d..ad7aa38516 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-gateway.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-gateway/deploy/docker-compose-prod.yml b/epmet-gateway/deploy/docker-compose-prod.yml index c5c27e870b..412df3aa53 100644 --- a/epmet-gateway/deploy/docker-compose-prod.yml +++ b/epmet-gateway/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-gateway.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-gateway/deploy/docker-compose-test.yml b/epmet-gateway/deploy/docker-compose-test.yml index 57a4913b0e..b0b7024f33 100644 --- a/epmet-gateway/deploy/docker-compose-test.yml +++ b/epmet-gateway/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-gateway.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index e64e3f45c3..cef4109081 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -90,6 +90,8 @@ 8080 + dev + 0 192.168.1.130 @@ -206,6 +208,8 @@ 8080 + local + 0 192.168.1.130 @@ -322,6 +326,8 @@ 8080 + test + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -409,6 +415,8 @@ 8080 + prod + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 5af513a4a4..9748b1ca26 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -11,7 +11,7 @@ spring: name: epmet-gateway-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common @@ -442,6 +442,7 @@ epmet: urlWhiteList: - /data/report/test/test - /data/report/screen/** + - /data/report/kcscreen/** - /epmetuser/customerstaff/customerlist swaggerUrls: diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/PageFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/PageFormDTO.java new file mode 100644 index 0000000000..c3da303f4d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/PageFormDTO.java @@ -0,0 +1,9 @@ +package com.epmet.dto; + +import lombok.Data; + +@Data +public class PageFormDTO { + private Integer pageNo = 1; + private Integer pageSize = 10; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java new file mode 100644 index 0000000000..9e1b9c346b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class IssueAvgAuditTimeDTO { + + private String gridName; + private Integer avgAuditTime; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java new file mode 100644 index 0000000000..655df79505 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +@Data +public class IssueEffectResultDTO { + + private Double reportEffectiveRatio; + private Double conversionRatio; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueGridTotalRankDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueGridTotalRankDTO.java new file mode 100644 index 0000000000..0ddfcfbf80 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueGridTotalRankDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class IssueGridTotalRankDTO { + + private String gridId; + private String gridName; + private Integer issueCount; + + private List gridNameDataList = new ArrayList<>(); + private List issueCountDataList = new ArrayList<>(); + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java new file mode 100644 index 0000000000..9ae403b1c2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +@Data +public class KcIssueSummary { + + private String dateId; + private Integer reportCount; + private Integer issueCount; + private Integer pendingCount; + private Integer rejectedCount; + private Integer processingCount; + private Integer closedCount; + private Integer issueViewCount; + private Integer voteCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java new file mode 100644 index 0000000000..ee831f9761 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result.issue; + + +import java.util.ArrayList; +import java.util.List; + +public class KcPartiTrendResultDTO { + + private String monthId; + private Integer reportCount; + + private List xAxis = new ArrayList<>(); + private List reportCountDataList = new ArrayList<>(); + + public String getMonthId() { + return monthId; + } + + public void setMonthId(String monthId) { + this.monthId = monthId; + } + + public Integer getReportCount() { + return reportCount; + } + + public void setReportCount(Integer reportCount) { + this.reportCount = reportCount; + } + + public List getxAxis() { + return xAxis; + } + + public void setxAxis(List xAxis) { + this.xAxis = xAxis; + } + + public List getReportCountDataList() { + return reportCountDataList; + } + + public void setReportCountDataList(List reportCountDataList) { + this.reportCountDataList = reportCountDataList; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/GridProjectCountRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/GridProjectCountRankResultDTO.java new file mode 100644 index 0000000000..3e48b9798f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/GridProjectCountRankResultDTO.java @@ -0,0 +1,12 @@ +package com.epmet.dto.result.project; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class GridProjectCountRankResultDTO { + private List gridNameDataList = new ArrayList<>(); + private List projectCountDataList = new ArrayList<>(); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/GridProjectCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/GridProjectCountResultDTO.java new file mode 100644 index 0000000000..3f035afd94 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/GridProjectCountResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.dto.result.project; + +import lombok.Data; + +import java.util.List; + +@Data +public class GridProjectCountResultDTO { + + private String gridId; + private String gridName; + private Integer projectCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectAvgClosedTimeResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectAvgClosedTimeResultDTO.java new file mode 100644 index 0000000000..83ca38001d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectAvgClosedTimeResultDTO.java @@ -0,0 +1,9 @@ +package com.epmet.dto.result.project; + +import lombok.Data; + +@Data +public class ProjectAvgClosedTimeResultDTO { + private String gridName; + private Integer avgClosedCaseTime; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectCategoryAnalysisResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectCategoryAnalysisResultDTO.java new file mode 100644 index 0000000000..dd03a4c899 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectCategoryAnalysisResultDTO.java @@ -0,0 +1,10 @@ +package com.epmet.dto.result.project; + +import lombok.Data; + +@Data +public class ProjectCategoryAnalysisResultDTO { + private String categoryId; + private String categoryName; + private Integer projectCount; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectSatisfactionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectSatisfactionResultDTO.java new file mode 100644 index 0000000000..717fc32c23 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectSatisfactionResultDTO.java @@ -0,0 +1,87 @@ +package com.epmet.dto.result.project; + +import java.util.ArrayList; +import java.util.List; + +/** + * xAxis 被lombok生成后是XAxis,与nei不符,所以使用手动生成getter/setter方法 + */ +public class ProjectSatisfactionResultDTO { + + private List xAxis = new ArrayList<>(); + private List greatSatisDataList = new ArrayList<>(); + private List goodSatisDataList = new ArrayList<>(); + private List disSatisDataList = new ArrayList<>(); + + private String monthId; + // 满意 + private Integer goodSatis; + // 非常满意 + private Integer greatSatis; + // 不满意 + private Integer disSatis; + + public List getxAxis() { + return xAxis; + } + + public void setxAxis(List xAxis) { + this.xAxis = xAxis; + } + + public List getGreatSatisDataList() { + return greatSatisDataList; + } + + public void setGreatSatisDataList(List greatSatisDataList) { + this.greatSatisDataList = greatSatisDataList; + } + + public List getGoodSatisDataList() { + return goodSatisDataList; + } + + public void setGoodSatisDataList(List goodSatisDataList) { + this.goodSatisDataList = goodSatisDataList; + } + + public List getDisSatisDataList() { + return disSatisDataList; + } + + public void setDisSatisDataList(List disSatisDataList) { + this.disSatisDataList = disSatisDataList; + } + + public String getMonthId() { + return monthId; + } + + public void setMonthId(String monthId) { + this.monthId = monthId; + } + + public Integer getGoodSatis() { + return goodSatis; + } + + public void setGoodSatis(Integer goodSatis) { + this.goodSatis = goodSatis; + } + + public Integer getGreatSatis() { + return greatSatis; + } + + public void setGreatSatis(Integer greatSatis) { + this.greatSatis = greatSatis; + } + + public Integer getDisSatis() { + return disSatis; + } + + public void setDisSatis(Integer disSatis) { + this.disSatis = disSatis; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectSummaryResultDTO.java new file mode 100644 index 0000000000..f0b7ef4750 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/ProjectSummaryResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result.project; + +import lombok.Data; + +@Data +public class ProjectSummaryResultDTO { + + private String dateId; + private Integer projectCount; + private Integer processingCount; + private Integer closedCount; + private Integer moveCount; + private Integer closedCaseCount; + private Integer projectViewCount; + private Integer voteCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/UserSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/UserSummaryResultDTO.java new file mode 100644 index 0000000000..926310a31d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/UserSummaryResultDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.result.project; + +import lombok.Data; + +@Data +public class UserSummaryResultDTO { + + private String dateId; + private Integer vistorCount; + private Integer regUserCount; + private Integer partyUserCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserPointRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserPointRankResultDTO.java new file mode 100644 index 0000000000..51d156b993 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserPointRankResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class KcUserPointRankResultDTO { + + private List userNameDataList = new ArrayList<>(); + private List pointsDataList = new ArrayList<>(); + + @Data + public static class KcUserPoint { + private String userId; + private String userName; + private Integer pointTotal; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserPortrayalResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserPortrayalResultDTO.java new file mode 100644 index 0000000000..c87ddbc2cd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserPortrayalResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +@Data +public class KcUserPortrayalResultDTO { + + // 年龄分布 + private AgeDistribution ageDistribution; + // 性别分布 + private GenderDistribution genderDistribution; + + @Data + public static class AgeDistribution { + private Integer ageLevel1; + private Integer ageLevel2; + private Integer ageLevel3; + private Integer ageLevel4; + private Integer ageLevel5; + private Integer ageLevel6; + } + + @Data + public static class GenderDistribution { + private Integer malePartyUserCount; + private Integer femalePartyUserCount; + } + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserRankResultDTO.java new file mode 100644 index 0000000000..f29c9e3124 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserRankResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class KcUserRankResultDTO { + + // 网格名称 + private String gridName; + // 浏览用户数 + private Integer viewUserCount; + + private List gridNameDataList = new ArrayList<>(); + private List totalUserDataList = new ArrayList<>(); + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserTrendResultDTO.java new file mode 100644 index 0000000000..5c2ef112d7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/KcUserTrendResultDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.result.user; + +import java.util.ArrayList; +import java.util.List; + +public class KcUserTrendResultDTO { + + private String monthId; + private Integer regUserCount; + private Integer partyUserCount; + + private List xAxis = new ArrayList<>(); + private List userDataList = new ArrayList<>(); + private List partyUserDataList = new ArrayList<>(); + + public String getMonthId() { + return monthId; + } + + public void setMonthId(String monthId) { + this.monthId = monthId; + } + + public Integer getRegUserCount() { + return regUserCount; + } + + public void setRegUserCount(Integer regUserCount) { + this.regUserCount = regUserCount; + } + + public Integer getPartyUserCount() { + return partyUserCount; + } + + public void setPartyUserCount(Integer partyUserCount) { + this.partyUserCount = partyUserCount; + } + + public List getxAxis() { + return xAxis; + } + + public void setxAxis(List xAxis) { + this.xAxis = xAxis; + } + + public List getUserDataList() { + return userDataList; + } + + public void setUserDataList(List userDataList) { + this.userDataList = userDataList; + } + + public List getPartyUserDataList() { + return partyUserDataList; + } + + public void setPartyUserDataList(List partyUserDataList) { + this.partyUserDataList = partyUserDataList; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcCategoryNewsCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcCategoryNewsCountResultDTO.java new file mode 100644 index 0000000000..09d2fb8584 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcCategoryNewsCountResultDTO.java @@ -0,0 +1,12 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +@Data +public class ScreenKcCategoryNewsCountResultDTO { + + private String categoryName; + private Integer newsCount; + private Integer partiCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcCategoryNewsRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcCategoryNewsRankResultDTO.java new file mode 100644 index 0000000000..1d2d60f98d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcCategoryNewsRankResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result.user; + +import java.util.ArrayList; +import java.util.List; + +public class ScreenKcCategoryNewsRankResultDTO { + + private List xAxis = new ArrayList<>(); + private List partiCountDataList = new ArrayList<>(); + + public List getxAxis() { + return xAxis; + } + + public void setxAxis(List xAxis) { + this.xAxis = xAxis; + } + + public List getPartiCountDataList() { + return partiCountDataList; + } + + public void setPartiCountDataList(List partiCountDataList) { + this.partiCountDataList = partiCountDataList; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsHotRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsHotRankResultDTO.java new file mode 100644 index 0000000000..2fe7201164 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsHotRankResultDTO.java @@ -0,0 +1,12 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +@Data +public class ScreenKcNewsHotRankResultDTO { + + private String newsId; + private String newsTitle; + private Integer hotCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsPartiTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsPartiTrendResultDTO.java new file mode 100644 index 0000000000..c240f7da10 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsPartiTrendResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +public class ScreenKcNewsPartiTrendResultDTO { + + private List xAxis = new ArrayList<>(); + + private List partiCountDataList = new ArrayList<>(); + + @Data + public static class ScreenKcNewsPartyCount { + + private String monthId; + private Integer partiCount; + + } + + public List getxAxis() { + return xAxis; + } + + public void setxAxis(List xAxis) { + this.xAxis = xAxis; + } + + public List getPartiCountDataList() { + return partiCountDataList; + } + + public void setPartiCountDataList(List partiCountDataList) { + this.partiCountDataList = partiCountDataList; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsSummaryResultDTO.java new file mode 100644 index 0000000000..0cf7fab7cd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/ScreenKcNewsSummaryResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +@Data +public class ScreenKcNewsSummaryResultDTO { + + private String dateId; + private Integer newsCount; + private Integer readCount; + private Integer likeCount; + private Integer commentCount; + +} 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 e3ac468fcf..96005bfcc3 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,4 +16,7 @@ public interface ScreenConstant { String COMMA = ","; + 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/AnNingSubAgencyIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java new file mode 100644 index 0000000000..683aebbe7c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.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; + +/** + * 5、下级部门指数排行(安宁数据段用) 入参 + * @Author zhangyong + * @DateTime 2020/09/08 9:54 + */ +@Data +public class AnNingSubAgencyIndexRankFormDTO implements Serializable { + + private static final long serialVersionUID = -2920561669035794486L; + + public interface SubAgencyIndexRank{} + + /** + * 机关ID + */ + @NotBlank(message = "组织id不能为空",groups = {SubAgencyIndexRank.class}) + private String agencyId; + + /** + * 默认查询前几名 + */ + @NotNull(message = "默认查询名次不能为空",groups = {SubAgencyIndexRank.class}) + private Integer topNum; + + /** + * asc 正序, desc 降序 + */ + @NotNull(message = "排序方式不能为空",groups = {SubAgencyIndexRank.class}) + private String sort; + + /** + * 年度:year 月度:month + */ + @NotNull(message = "年度、月度不能为空",groups = {SubAgencyIndexRank.class}) + private String type; +} 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/GroupTopicShiftIssueRatioRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupTopicShiftIssueRatioRankFormDTO.java new file mode 100644 index 0000000000..fc1a44996d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupTopicShiftIssueRatioRankFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 邻里党群-社群人数排名-接口入参 + * @Author sun + */ +@Data +public class GroupTopicShiftIssueRatioRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + /** + * 页容量,默认10页 + */ + @Min(value = 1, message = "每页条数必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + /** + * 客户Id + */ + private String customerId; + public interface AddUserInternalGroup {} + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupUserCountRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupUserCountRankFormDTO.java new file mode 100644 index 0000000000..4b6c4a80ef --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupUserCountRankFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 邻里党群-社群人数排名-接口入参 + * @Author sun + */ +@Data +public class GroupUserCountRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + /** + * 页容量,默认10页 + */ + @Min(value = 1, message = "每页条数必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + /** + * 客户Id + */ + private String customerId; + public interface AddUserInternalGroup {} + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java new file mode 100644 index 0000000000..e4beb2b1cd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 公益互助-个人(志愿者)公益时长排名-接口入参 + * @Author sun + */ +@Data +public class HeartVolunteerrankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + public interface AddUserInternalGroup {} + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + /** + * 页容量,默认10页 + */ + @Min(value = 1, message = "每页条数必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + /** + * 客户Id + */ + private String customerId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ActTrendMonthlyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ActTrendMonthlyResultDTO.java new file mode 100644 index 0000000000..80019a15c4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ActTrendMonthlyResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 公益互助-公益活动次数 + * @Author sun + */ +@Data +public class ActTrendMonthlyResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 月id :yyyyMM + */ + private String monthId = ""; + + /** + * 活动数量(本月举行的活动) + */ + private Integer actCount = 0; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgeDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgeDistributionResultDTO.java new file mode 100644 index 0000000000..616d9207c4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgeDistributionResultDTO.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.util.LinkedList; + +/** + * 公益互助-志愿者画像 + * @Author sun + */ +@Data +public class AgeDistributionResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 小于20岁的志愿者总人数 + */ + private Integer ageLevel1 = 0; + /** + * 20-30岁的志愿者总人数 + */ + private Integer ageLevel2 = 0; + /** + * 31-40岁的志愿者总人数 + */ + private Integer ageLevel3 = 0; + /** + * 41-50岁的志愿者总人数 + */ + private Integer ageLevel4 = 0; + /** + * 51-60岁的志愿者总人数 + */ + private Integer ageLevel5 = 0; + /** + * 60+岁的志愿者总人数 + */ + private Integer ageLevel6 = 0; + /** + * 志愿者中男性总人数 + */ + @JsonIgnore + private Integer maleCount = 0; + /** + * 志愿者中女性总人数 + */ + @JsonIgnore + private Integer femaleCount = 0; + +} 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 new file mode 100644 index 0000000000..f93b98b16d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zhangyong + * @DateTime 2020/09/11 9:58 上午 + */ +@Data +public class AnNingSubAgencyIndexRankResultDTO implements Serializable { + + private static final long serialVersionUID = -2767000156092731932L; + + /** + * 名称(组织或者网格名称,部门名称) + */ + private String name = ""; + + /** + * 总指数 + */ + private Double totalIndex = 0.0; + + /** + * 党建能力 + */ + private Double governAbility = 0.0; + + /** + * 治理能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; + + /** + * 组织id或者网格id + */ + private String orgId = ""; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GenderDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GenderDistributionResultDTO.java new file mode 100644 index 0000000000..e36589103a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GenderDistributionResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedList; + +/** + * 公益互助-志愿者画像 + * @Author sun + */ +@Data +public class GenderDistributionResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 志愿者中男性总人数 + */ + private Integer maleCount = 0; + /** + * 志愿者中女性总人数 + */ + private Integer femaleCount = 0; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GridNameGroupCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GridNameGroupCountResultDTO.java new file mode 100644 index 0000000000..0f870ea551 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GridNameGroupCountResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 邻里党群-社群数量排名 + * @Author sun + */ +@Data +public class GridNameGroupCountResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 网格名称 + */ + private String gridName = ""; + + /** + * 社群数量 + */ + private Integer groupCount = 0; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupGridgroupcountrankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupGridgroupcountrankResultDTO.java new file mode 100644 index 0000000000..fc9799ef03 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupGridgroupcountrankResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedList; + +/** + * 邻里党群-社群数量排名 + * @Author sun + */ +@Data +public class GroupGridgroupcountrankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 网格名称集合 + */ + private LinkedList gridNameDataList; + + /** + * 社群数量集合 + */ + private LinkedList groupCountDataList; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupPartitopictrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupPartitopictrendResultDTO.java new file mode 100644 index 0000000000..8eb7a406ae --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupPartitopictrendResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedList; + +/** + * 邻里党群-话题参与趋势 + * @Author sun + */ +@Data +public class GroupPartitopictrendResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 横坐标月份集合 + */ + private LinkedList xAxis; + + /** + * 话题数量 集合 + */ + private LinkedList actCountDataList; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupSummaryResultDTO.java new file mode 100644 index 0000000000..31325b7b60 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupSummaryResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 公益互助-各类总数汇总 + * @Author sun + */ +@Data +public class GroupSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 日期Id, 数据更新至:yyyyMMdd + */ + private String dateId = ""; + + /** + * 社群总数 + */ + private Integer groupCount = 0; + /** + * 群员总数 + */ + private Integer memberCount = 0; + /** + * 话题数量 + */ + private Integer topicCount = 0; + /** + * 话题参与量 + */ + private Integer partiCount = 0; + /** + * 转化议题率,这个后端自己算 + */ + private String shiftIssueRatio = ""; + /** + * 话题转议题总数 + */ + @JsonIgnore + private Integer shiftIssueCount = 0; + +} 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 new file mode 100644 index 0000000000..e4677c0e5d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 公益互助-个人(志愿者)公益时长排名 + * @Author sun + */ +@Data +public class GroupTopicShiftIssueRatioRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 小组id + */ + private String groupId = ""; + /** + * 小组名称 + */ + private String groupName = ""; + /** + * 转为议题的话题数 + */ + private Integer shifitIssueCount = 0; + /** + * 群主名称 + */ + private String groupLeader = ""; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupUserCountRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupUserCountRankResultDTO.java new file mode 100644 index 0000000000..d183b967c4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupUserCountRankResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 公益互助-个人(志愿者)公益时长排名 + * @Author sun + */ +@Data +public class GroupUserCountRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 小组id + */ + private String groupId = ""; + /** + * 小组名称 + */ + private String groupName = ""; + /** + * 群成员数 + */ + private Integer memberCount = 0; + /** + * 群主名称 + */ + private String groupLeader = ""; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartActcounttrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartActcounttrendResultDTO.java new file mode 100644 index 0000000000..4ebc3422d0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartActcounttrendResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import rx.internal.util.LinkedArrayList; + +import java.io.Serializable; +import java.util.LinkedList; + +/** + * 公益互助-公益活动次数 + * @Author sun + */ +@Data +public class HeartActcounttrendResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 横坐标 月份集合 + */ + private LinkedList xAxis; + + /** + * 活动次数 集合 + */ + private LinkedList actCountDataList; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartSummaryResultDTO.java new file mode 100644 index 0000000000..a91482cebe --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartSummaryResultDTO.java @@ -0,0 +1,43 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 公益互助-各类总数汇总 + * @Author sun + */ +@Data +public class HeartSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 日期Id, 数据更新至:yyyyMMdd + */ + private String dateId = ""; + + /** + * 活动次数 + */ + private Integer actCount = 0; + /** + * 志愿者总数 + */ + private Integer volunteerCount = 0; + /** + * 参与人次 + */ + private Integer partiUserCount = 0; + /** + * 发放积分 + */ + private Integer rewardPointCount = 0; + /** + * 公益时长 + */ + private Integer heartTime = 0; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartVolunteerportrayalResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartVolunteerportrayalResultDTO.java new file mode 100644 index 0000000000..2bbcd82df1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartVolunteerportrayalResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedList; + +/** + * 公益互助-志愿者画像 + * @Author sun + */ +@Data +public class HeartVolunteerportrayalResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 个年龄段志愿者人数 + */ + private AgeDistributionResultDTO ageDistribution; + + /** + * 男、女志愿者人员 + */ + private GenderDistributionResultDTO genderDistribution; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartVolunteerrankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartVolunteerrankResultDTO.java new file mode 100644 index 0000000000..03f962e110 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartVolunteerrankResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 公益互助-个人(志愿者)公益时长排名 + * @Author sun + */ +@Data +public class HeartVolunteerrankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 用户id + */ + private String userId = ""; + /** + * 用户名称 + */ + private String userName = ""; + /** + * 公益时长分钟 + */ + private Integer heartTime = 0; + /** + * 积分 + */ + private Integer points = 0; + /** + * 所属网格名称 + */ + private String gridName = ""; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HomepageSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HomepageSummaryResultDTO.java new file mode 100644 index 0000000000..cbecba012c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HomepageSummaryResultDTO.java @@ -0,0 +1,71 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 首页-平台各类总数 + * @Author sun + */ +@Data +public class HomepageSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId = ""; + + /** + * 网格总数 + */ + private Integer gridCount = 0; + /** + * 已开通网格数 + */ + private Integer openedGridCount = 0; + /** + * 议题总数 + */ + private Integer issueCount = 0; + /** + * 项目总数 + */ + private Integer projectCount = 0; + /** + * 用户总数 + */ + private Integer userCount = 0; + /** + * 党员用户 + */ + private Integer partyUserCount = 0; + /** + * 社群总数 + */ + private Integer groupCount = 0; + /** + * 话题总数 + */ + private Integer topicCount = 0; + /** + * 新闻总数 + */ + private Integer newsCount = 0; + /** + * 阅读数量 + */ + private Integer readCount = 0; + /** + * 公益活动总数 + */ + private Integer actCount = 0; + /** + * 志愿者总数 + */ + private Integer volunteerCount = 0; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/KcTopicTrendGridMonthlyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/KcTopicTrendGridMonthlyResultDTO.java new file mode 100644 index 0000000000..c7febe5772 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/KcTopicTrendGridMonthlyResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 邻里党群-话题参与趋势 + * @Author sun + */ +@Data +public class KcTopicTrendGridMonthlyResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 月id :yyyyMM + */ + private String monthId = ""; + + /** + * 话题数量(所在月新增话题数) + */ + private Integer topicCount = 0; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java index 89ca2fd383..de0b16022b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java @@ -27,4 +27,9 @@ public class MonthPieChartResultDTO implements Serializable { * 治理能力 */ private Double governAbility = 0.0; + + /** + * 月份Id + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-server/Dockerfile b/epmet-module/data-report/data-report-server/Dockerfile index 1f773a109f..abb03ca056 100644 --- a/epmet-module/data-report/data-report-server/Dockerfile +++ b/epmet-module/data-report/data-report-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./data-report.jar EXPOSE 8109 diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 2d85c451a1..8be97cd85a 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./data-report.jar" restart: "unless-stopped" deploy: resources: 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 8fdb335fda..977c852354 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,14 +2,14 @@ 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.36 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.37 ports: - "8108:8108" network_mode: host # 使用现有网络 volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./data-report.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml index 78d38da205..8917a4f9e9 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./data-report.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 42d424c219..6dd6fefbcb 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.36 + 0.3.37 data-report-server diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java index 989bf71965..cee0ed9096 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java @@ -1,7 +1,5 @@ package com.epmet; -import com.epmet.commons.tools.enums.EnvEnum; -import com.epmet.commons.tools.utils.HttpClientManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @@ -15,6 +13,5 @@ import org.springframework.scheduling.annotation.EnableAsync; public class DataReportApplication { public static void main(String[] args) { SpringApplication.run(DataReportApplication.class, args); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } 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 1b063dd470..1828f19ac8 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,5 +1,6 @@ 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; @@ -7,12 +8,15 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletRequest; + /** * 组织相关api * @@ -32,9 +36,13 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:04 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("tree") - public Result tree(ExternalAppRequestParam externalAppRequestParam){ + 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)); } @@ -44,7 +52,7 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:33 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("compartment") public Result compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){ ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 248547cc4c..30f0f82584 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,5 +1,6 @@ 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; @@ -32,7 +33,7 @@ public class DistributionController { * @author zxc * @date 2020/8/18 10:59 上午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("branch") public Result> branch(@RequestBody BranchFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class); @@ -45,7 +46,7 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:10 上午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("user") public Result user(@RequestBody UserFormDTO userFormDTO){ ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class); @@ -58,7 +59,7 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:20 上午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("parymember") public Result parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){ ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class); @@ -71,7 +72,7 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:29 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("project") public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); @@ -84,7 +85,7 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:52 下午 */ - //@ExternalAppRequestAuth + @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 220fb0ca4a..1ee85baeb4 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,5 +1,6 @@ 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; @@ -38,7 +39,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 11:16 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("userpointrank") public Result userPointRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -53,7 +54,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 13:55 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("difficultprojects") public Result> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){ ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class); @@ -68,7 +69,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 14:37 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("publicpartiprofile") public Result publicPartiProfile(@RequestBody AgencyFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -83,7 +84,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 15:32 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("publicpartirank") public Result> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -98,7 +99,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 17:46 **/ - //@ExternalAppRequestAuth + @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 66b7555ac8..db7c83089f 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,5 +1,6 @@ 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; @@ -37,7 +38,7 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 16:59 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("basicinfo") public Result baseInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -52,7 +53,7 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 17:54 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("ageinfo") public Result ageInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -67,7 +68,7 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 11:02 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("branchbuildtrend") public Result branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class); @@ -82,7 +83,7 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 15:25 **/ - //@ExternalAppRequestAuth + @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 d670c65b1c..f2a7ebd151 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.extappauth.bean.ExternalAppRequestParam; 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.MonthBarchartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; -import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; -import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; -import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; +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; @@ -38,7 +35,7 @@ public class IndexController { * @author zxc * @date 2020/8/19 2:53 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("yearaverageindex") public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); @@ -51,7 +48,7 @@ public class IndexController { * @author zxc * @date 2020/8/19 3:17 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("monthindexanalysis/piechart") public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); @@ -64,7 +61,7 @@ public class IndexController { * @author zxc * @date 2020/8/19 5:27 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("monthindexanalysis/barchart") public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); @@ -72,16 +69,45 @@ public class IndexController { } /** - * @Description 4、下级部门指数排行 * @param subAgencyIndexRankFormDTO + * @Description 4、下级组织/部门指数排行 (不包含部门的数据) * @author zxc * @date 2020/8/20 10:02 上午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("subagencyindexrank") public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); return new Result>().ok(indexService.subAgencyIndexRank(subAgencyIndexRankFormDTO)); } + /** + * 5、下级部门指数排行(安宁数据段用) + * @param formDTO + * @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)); + } + + /** + * @param formDTO + * @Description 4、获取该客户下所有网格指标排行 + * @author jianjun.liu + * @date 2020/8/20 10:02 上午 + */ + @ExternalAppRequestAuth + @PostMapping("gridindexrank") + public Result> gridIndexRank(ExternalAppRequestParam extParam, @RequestBody GridIndexRankFormDTO formDTO) { + formDTO.setCustomerId(extParam.getCustomerId()); + ValidatorUtils.validateEntity(formDTO); + formDTO.setOrgType(OrgTypeEnum.GRID.getCode()); + return new Result>().ok(indexService.selectIndexRankByOrgType(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 new file mode 100644 index 0000000000..210c950e78 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java @@ -0,0 +1,412 @@ +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; +import com.epmet.dto.PageFormDTO; +import com.epmet.dto.result.project.*; +import com.epmet.dto.result.user.*; +import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +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 java.util.List; + +/** + * 孔村大屏api + * + * @author zhangyong + * @date 2020/9/10 10:21 + */ +@RestController +@RequestMapping("kcscreen") +public class KcScreenController { + + @Autowired + private KcScreenService kcScreenService; + + + /** + * @param externalAppRequestParam + * @Description 首页-平台各类总数 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("homepage/summary") + public Result homepageSummary(ExternalAppRequestParam externalAppRequestParam){ + return new Result().ok(kcScreenService.homepageSummary(externalAppRequestParam)); + } + + /** + * @param externalAppRequestParam + * @Description 公益互助-各类总数汇总 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("heart/summary") + public Result heartSummary(ExternalAppRequestParam externalAppRequestParam){ + return new Result().ok(kcScreenService.heartSummary(externalAppRequestParam)); + } + + /** + * @param externalAppRequestParam + * @Description 公益互助-公益活动次数 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("heart/actcounttrend") + public Result heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){ + return new Result().ok(kcScreenService.heartActcounttrend(externalAppRequestParam)); + } + /** + * 议题分析-各类总数 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("issue/summary") + public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + KcIssueSummary issueSummary = kcScreenService.getIssueSummary(customerId); + return new Result().ok(issueSummary); + } + + /** + * 参与趋势 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("issue/partitrend") + public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + 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"; + 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"; + return new Result().ok(kcScreenService.getAvgAuditTimeRank(customerId)); + } + + /** + * 议题分析-议题效率 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("issue/effective") + public Result getIssueEffective(ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + //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)); + } + + /** + * @param externalAppRequestParam + * @Description 公益互助-个人(志愿者)公益时长排名 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("heart/volunteerrank") + public Result> heartVolunteerrank(ExternalAppRequestParam externalAppRequestParam, @RequestBody HeartVolunteerrankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, HeartVolunteerrankFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + 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)); + } + + /** + * @param externalAppRequestParam + * @Description 邻里党群-话题参与趋势 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("group/partitopictrend") + public Result groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam){ + return new Result().ok(kcScreenService.groupPartitopictrend(externalAppRequestParam)); + } + + /** + * @param externalAppRequestParam + * @Description 邻里党群-社群数量排名 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("group/gridgroupcountrank") + public Result groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam){ + return new Result().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam)); + } + + /** + * @param externalAppRequestParam + * @Description 邻里党群-社群数量排名 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("group/usercountrank") + public Result> groupUserCountRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupUserCountRankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GroupUserCountRankFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + return new Result>().ok(kcScreenService.groupUserCountRank(formDTO)); + } + + /** + * @param externalAppRequestParam + * @Description 邻里党群-话题转化率排名 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("group/topicshiftissueratiorank") + public Result> groupTopicShiftIssueRatioRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GroupTopicShiftIssueRatioRankFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + 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(); + 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(); + 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(); + 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(); + return new Result>().ok(kcScreenService.getGridProjectAvgClosedTimeAnalysis(customerId)); + } + + /** + * 项目分析-居民满意度 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("project/statis") + public Result getProjectSatisfactionAnalyze(ExternalAppRequestParam externalAppRequestParam){ + String customerId = externalAppRequestParam.getCustomerId(); + 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"; + return new Result().ok(kcScreenService.getUserSummary(customerId)); + } + + /** + * 用户量趋势 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("user/trend") + public Result getUserTrend(ExternalAppRequestParam externalAppRequestParam){ + String customerId = externalAppRequestParam.getCustomerId(); + return new Result().ok(kcScreenService.getUserTrend(customerId)); + } + + /** + * 网格用户数量排名 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("user/griduserrank") + public Result getUserRank(ExternalAppRequestParam externalAppRequestParam){ + String customerId = externalAppRequestParam.getCustomerId(); + return new Result().ok(kcScreenService.getUserRank(customerId)); + } + + /** + * 用户画像 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("user/userportrayal") + public Result getUserPortrayal(ExternalAppRequestParam externalAppRequestParam){ + String customerId = externalAppRequestParam.getCustomerId(); + return new Result().ok(kcScreenService.getUserPortrayal(customerId)); + } + + /** + * 用户积分排名 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("user/pointsrank") + public Result getUserPointsRank(ExternalAppRequestParam externalAppRequestParam, + @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(); + return new Result().ok(kcScreenService.getNewsSummary(customerId)); + } + + /** + * 新闻阅读参与趋势 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("news/partitrend") + public Result getNewsPartiTrend(ExternalAppRequestParam externalAppRequestParam){ + String customerId = externalAppRequestParam.getCustomerId(); + return new Result().ok(kcScreenService.getNewsPartiTrend(customerId)); + } + + /** + * 党建声音-分类的news数量 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("news/category") + public Result> getNewsCountGroupByCategory(ExternalAppRequestParam externalAppRequestParam){ + String customerId = externalAppRequestParam.getCustomerId(); + return new Result>().ok(kcScreenService.getNewsCountOfCategory(customerId)); + } + + /** + * 党建声音-分类的用户参与数排行 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("news/userparticategoryrank") + public Result getNewsPartiCategoryRank(ExternalAppRequestParam externalAppRequestParam){ + String customerId = externalAppRequestParam.getCustomerId(); + return new Result().ok(kcScreenService.getNewsPartiCategoryRank(customerId)); + } + + /** + * 党建声音-热点新闻排行 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("news/hotrank") + public Result> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam, + @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 d3f4242013..5530fae8b0 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,5 +1,6 @@ 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; @@ -32,7 +33,7 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 1:56 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("fineexample") public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); @@ -45,7 +46,7 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 2:35 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("contactmasslinechart") public Result contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){ ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class); @@ -58,7 +59,7 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 3:19 下午 */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("volunteerservice") public Result volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){ ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class); @@ -73,7 +74,7 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 11:05 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("advancedbranchrank") Result> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -88,7 +89,7 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 14:22 **/ - //@ExternalAppRequestAuth + @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 dc80b5178e..5417767ee6 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,5 +1,6 @@ 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; @@ -30,7 +31,7 @@ public class ScreenProjectController { * @author zxc * @date 2020/8/19 4:36 下午 */ - //@ExternalAppRequestAuth + @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/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 372dacf9dd..6448f9902b 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,7 +17,10 @@ package com.epmet.datareport.dao.evaluationindex.screen; +import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GridIndexRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.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; @@ -52,11 +55,28 @@ public interface ScreenIndexDataMonthlyDao{ List selectMonthBarchart(@Param("agencyId")String agencyId); /** - * @Description 4、下级部门指数排行 * @param subAgencyIndexRankFormDTO + * @Description 4、下级组织/部门指数排行 (不包含部门的数据) * @author zxc * @date 2020/8/20 10:04 上午 */ List selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); - -} \ No newline at end of file + + /** + * 5、下级部门指数排行(安宁数据段用) - 月(上一个月) + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 09:38 2020-09-08 + **/ + List selectAnNingSubAgencyIndexMonthlyRank(AnNingSubAgencyIndexRankFormDTO formDTO); + + /** + * desc:获取网格指标排行 + * + * @param formDTO + * @return + */ + List selectIndexRankByOrgType(GridIndexRankFormDTO 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 c63c17fa57..70f0f1b5a6 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,10 +17,14 @@ package com.epmet.datareport.dao.evaluationindex.screen; +import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 指数-指数数据(按年统计) * @@ -37,5 +41,14 @@ public interface ScreenIndexDataYearlyDao{ * @date 2020/8/19 3:43 下午 */ YearAverageIndexResultDTO selectYearAverageIndex(@Param("agencyId")String agencyId); - -} \ No newline at end of file + + /** + * 5、下级部门指数排行(安宁数据段用) - 年 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 09:38 2020-09-08 + **/ + List selectAnNingSubAgencyIndexYearlyRank(AnNingSubAgencyIndexRankFormDTO 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 2c4358ce15..bc15ca191f 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 @@ -17,6 +17,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; +import com.epmet.dto.result.user.KcUserPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -51,4 +52,5 @@ public interface ScreenPartyUserRankDataDao{ **/ List selectPartymemberPointOrder(@Param("agencyId")String agencyId); + List listUserPoints(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/screenkc/ScreenKcActSummaryDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcActSummaryDailyDao.java new file mode 100644 index 0000000000..3de0da456c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcActSummaryDailyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.evaluationindex.screen.dto.result.HeartSummaryResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * KC-活动各类总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcActSummaryDailyDao { + + /** + * @param customerId + * @Description 公益互助-各类总数汇总 + * @author sun + */ + HeartSummaryResultDTO selectHeartSummary(@Param("customerId") String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcActTrendMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcActTrendMonthlyDao.java new file mode 100644 index 0000000000..173bd2c936 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcActTrendMonthlyDao.java @@ -0,0 +1,41 @@ +/** + * 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.screenkc; + +import com.epmet.evaluationindex.screen.dto.result.ActTrendMonthlyResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-活动(次数+时长)趋势(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcActTrendMonthlyDao { + + /** + * @param customerId + * @Description 按客户查询最近十二个月数据 + * @author sun + */ + List selectActTrendMonthly(@Param("customerId") String customerId); +} 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 new file mode 100644 index 0000000000..834a64c0ee --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java @@ -0,0 +1,50 @@ +/** + * 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.screenkc; + +import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.GroupTopicShiftIssueRatioRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GroupUserCountRankResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-小组详情(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcGroupDetailGridDailyDao { + + /** + * @param formDTO + * @Description 按客户查询最近一天所有网格数据 再按社群总数降序排列 + * @author sun + */ + List selectGroupUserCountRankList(GroupUserCountRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 按客户查询最近一天所有网格数据 再按转议题数量降序排列 + * @author sun + */ + List selectGroupTopicShiftIssueRatioRankList(GroupTopicShiftIssueRatioRankFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupSummaryGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupSummaryGridDailyDao.java new file mode 100644 index 0000000000..e6871db1b0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupSummaryGridDailyDao.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.evaluationindex.screenkc; + +import com.epmet.evaluationindex.screen.dto.result.GridNameGroupCountResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GroupSummaryResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.LinkedList; + +/** + * KC-小组分析各类总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcGroupSummaryGridDailyDao { + + /** + * @param customerId + * @Description 邻里党群-各类总数 + * @author sun + */ + GroupSummaryResultDTO selectGroupSummaryDaily(@Param("customerId") String customerId); + + /** + * @param customerId + * @Description 按日期降序,查询客户最近一天所有网格数据,按每个网格的社区总数降序排列 + * @author sun + */ + LinkedList selectGridDailyList(@Param("customerId") String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java new file mode 100644 index 0000000000..8693d6b52e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.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.screenkc; + +import com.epmet.dto.result.issue.IssueAvgAuditTimeDTO; +import com.epmet.dto.result.issue.IssueEffectResultDTO; +import com.epmet.dto.result.issue.IssueGridTotalRankDTO; +import com.epmet.dto.result.issue.KcIssueSummary; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-议题分析(各类总数) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcIssueSummaryGridDailyDao { + + KcIssueSummary getIssueSummary(@Param("customerId") String customerId); + + List getIssueGridTotalRank(@Param("customerId") String customerId); + + List getAvgAuditTimeRank(@Param("customerId") String customerId); + + IssueEffectResultDTO getIssueEffective(@Param("customerId") String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.java new file mode 100644 index 0000000000..fb9d9918ba --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.dto.result.issue.KcPartiTrendResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-议题参与趋势(每天上报当前月)customerId+monthId先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcIssueTrendGridMonthlyDao { + + List getIssuePartiTrend(@Param("customerId") String customerId); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsCategoryAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsCategoryAnalysisDao.java new file mode 100644 index 0000000000..ce34407ab0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsCategoryAnalysisDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.dto.result.user.ScreenKcCategoryNewsCountResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-新闻-按类别统计(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcNewsCategoryAnalysisDao { + + List getNewsCountOfCategory(String customerId); + + List listNewsPartiCategoryRank(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsRankDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsRankDao.java new file mode 100644 index 0000000000..bf42d979df --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsRankDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.dto.result.user.ScreenKcNewsHotRankResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-热点新闻排行-(先根据customerId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcNewsRankDao { + + List getNewsHotRank(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsSummaryDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsSummaryDailyDao.java new file mode 100644 index 0000000000..16b215f5f2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsSummaryDailyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.dto.result.user.ScreenKcNewsSummaryResultDTO; +import org.apache.ibatis.annotations.Mapper; + +/** + * KC-新闻-各类总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcNewsSummaryDailyDao { + + ScreenKcNewsSummaryResultDTO getNewsSummary(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsTrendMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsTrendMonthlyDao.java new file mode 100644 index 0000000000..92422cf436 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcNewsTrendMonthlyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.dto.result.user.ScreenKcNewsPartiTrendResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-新闻参与趋势-(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcNewsTrendMonthlyDao { + + List getNewsPartiTrend(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcPlatformSummaryDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcPlatformSummaryDailyDao.java new file mode 100644 index 0000000000..9772805fff --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcPlatformSummaryDailyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * KC-平台各汇总值(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcPlatformSummaryDailyDao { + + /** + * @param customerId + * @Description 首页-平台各类总数 + * @author sun + */ + HomepageSummaryResultDTO selectSummaryDaily(@Param("customerId") String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectCategoryGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectCategoryGridDailyDao.java new file mode 100644 index 0000000000..c7b7a6b68d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectCategoryGridDailyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.dto.result.project.ProjectCategoryAnalysisResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-项目按分类统计上报总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcProjectCategoryGridDailyDao { + + List listProjectCountGroupByCategory(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectSatisGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectSatisGridMonthlyDao.java new file mode 100644 index 0000000000..1a204bc242 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectSatisGridMonthlyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.dto.result.project.ProjectSatisfactionResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-项目满意度分析(customerId+monthId先删除记录,再插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcProjectSatisGridMonthlyDao { + + List getProjectSatisfactionAnalyze(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectSummaryGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectSummaryGridDailyDao.java new file mode 100644 index 0000000000..9ce1afc8cf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcProjectSummaryGridDailyDao.java @@ -0,0 +1,41 @@ +/** + * 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.screenkc; + +import com.epmet.dto.result.project.GridProjectCountResultDTO; +import com.epmet.dto.result.project.ProjectAvgClosedTimeResultDTO; +import com.epmet.dto.result.project.ProjectSummaryResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-项目分析(各类总数先根据customerId+dateId删除,后插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcProjectSummaryGridDailyDao { + + List getGridProjectCountRank(String customerId); + + ProjectSummaryResultDTO getProjectSummary(String customerId); + + List getGridProjectAvgClosedTimeAnalysis(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcTopicTrendGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcTopicTrendGridMonthlyDao.java new file mode 100644 index 0000000000..12ec47650b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcTopicTrendGridMonthlyDao.java @@ -0,0 +1,41 @@ +/** + * 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.screenkc; + +import com.epmet.evaluationindex.screen.dto.result.KcTopicTrendGridMonthlyResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-话题参与趋势(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcTopicTrendGridMonthlyDao { + + /** + * @param customerId + * @Description 按客户查询最近十二个月所有网格汇总数据 + * @author sun + */ + List selectActTrendMonthly(@Param("customerId") String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcUserSummaryDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcUserSummaryDailyDao.java new file mode 100644 index 0000000000..40bb9f7ae3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcUserSummaryDailyDao.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.screenkc; + +import com.epmet.dto.result.project.UserSummaryResultDTO; +import com.epmet.dto.result.user.KcUserPortrayalResultDTO; +import com.epmet.dto.result.user.KcUserRankResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-用户分析(先根据customerId+dateId删除,后插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcUserSummaryDailyDao { + + UserSummaryResultDTO getUserSummary(String customerId); + + List getUserRank(String customerId); + + KcUserPortrayalResultDTO.AgeDistribution getAgeDistribution(String customerId); + + KcUserPortrayalResultDTO.GenderDistribution getGenderDistribution(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcUserTrendGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcUserTrendGridMonthlyDao.java new file mode 100644 index 0000000000..c4010379cd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcUserTrendGridMonthlyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.dto.result.user.KcUserTrendResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-用户趋势分析(根据monthId+customerId先删后增) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcUserTrendGridMonthlyDao { + + List getUserTrend(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.java new file mode 100644 index 0000000000..d7646b243d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.HeartVolunteerrankResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * KC-志愿者公益时长排名(先根据customerId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcVolunteerHeatRankGridDailyDao { + + /** + * @param formDTO + * @Description 公益互助-个人(志愿者)公益时长排名 + * @author sun + */ + List selectHeartVolunteerrankList(HeartVolunteerrankFormDTO formDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerSummaryDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerSummaryDailyDao.java new file mode 100644 index 0000000000..27990e8bc3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerSummaryDailyDao.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.datareport.dao.evaluationindex.screenkc; + +import com.epmet.evaluationindex.screen.dto.result.AgeDistributionResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * KC-志愿者汇总(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcVolunteerSummaryDailyDao { + + /** + * @param customerId + * @Description 根据客户Id查询最近日期志愿者统计数据 + * @author sun + */ + AgeDistributionResultDTO selectVolunteerSummaryDaily(@Param("customerId") String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java new file mode 100644 index 0000000000..605b75cf34 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java @@ -0,0 +1,156 @@ +/** + * 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.issue; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * KC-议题分析(各类总数) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +public class ScreenKcIssueSummaryGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键(先根据customerId+dateId删除,后插入) + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 上报总数 + */ + private Integer reportCount; + + /** + * 议题总数 + */ + private Integer issueCount; + + /** + * 待审核数 + */ + private Integer pendingCount; + + /** + * 已驳回数 + */ + private Integer rejectedCount; + + /** + * 处理中数 + */ + private Integer processingCount; + + /** + * 已关闭数 + */ + private Integer closedCount; + + /** + * 议题浏览数 + */ + private Integer issueViewCount; + + /** + * 表态数 + */ + private Integer voteCount; + + /** + * 审核通过数 ?为了算议题效率 + */ + private Integer passedCount; + + /** + * 转化成项目数 ?为了算议题效率 + */ + private Integer shiftToProjectCount; + + /** + * 平均审核时间单位分钟 ? + */ + private Integer avgAuditTime; + + /** + * 删除标识 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-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.java new file mode 100644 index 0000000000..527aaa443c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.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.datareport.dao.issue; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * KC-议题参与趋势(每天上报当前月)customerId+monthId先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +public class ScreenKcIssueTrendGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键(每天上报当前月),按照customerId+monthId先删除记录,再插入 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月id :yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 议题上报数(本月内上报的议题数量) + */ + private Integer reportCount; + + /** + * 删除标识 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-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/evaluationindex/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java index 266898530d..a7742172d9 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 @@ -1,13 +1,7 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; -import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; -import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; -import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; import java.util.List; @@ -44,11 +38,28 @@ public interface IndexService { MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO); /** - * @Description 4、下级部门指数排行 * @param subAgencyIndexRankFormDTO + * @Description 4、下级组织/部门指数排行 (不包含部门的数据) * @author zxc * @date 2020/8/20 10:04 上午 */ List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); + /** + * 5、下级部门指数排行(安宁数据段用) + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 09:38 2020-09-08 + **/ + List anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO); + + /** + * desc:获取该客户下网格排行 + * + * @param formDTO + * @return + */ + List selectIndexRankByOrgType(GridIndexRankFormDTO 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 new file mode 100644 index 0000000000..d17df56ba1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java @@ -0,0 +1,137 @@ +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.*; +import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; + +import java.util.List; + +import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; + +/** + * 孔村大屏api + * + * @author zhangyong + * @date 2020/9/10 10:21 + */ +public interface KcScreenService { + + /** + * @param externalAppRequestParam + * @Description 首页-平台各类总数 + * @author sun + */ + HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam); + + /** + * @param externalAppRequestParam + * @Description 公益互助-各类总数汇总 + * @author sun + */ + HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam); + + /** + * @param externalAppRequestParam + * @Description 公益互助-公益活动次数 + * @author sun + */ + HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam); + + /** + * @param externalAppRequestParam + * @Description 公益互助-志愿者画像 + * @author sun + */ + HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam); + + /** + * @param formDTO + * @Description 公益互助-个人(志愿者)公益时长排名 + * @author sun + */ + List heartVolunteerrank(HeartVolunteerrankFormDTO formDTO); + KcIssueSummary getIssueSummary(String customerId); + + KcPartiTrendResultDTO getIssuePartiTrend(String customerId); + + IssueGridTotalRankDTO getIssueGridTotalRank(String customerId); + + List getAvgAuditTimeRank(String customerId); + + IssueEffectResultDTO getIssueEffective(String customerId); + + + /** + * @param externalAppRequestParam + * @Description 邻里党群-各类总数 + * @author sun + */ + GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam); + + /** + * @param externalAppRequestParam + * @Description 邻里党群-话题参与趋势 + * @author sun + */ + GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam); + + /** + * @param externalAppRequestParam + * @Description 邻里党群-社群数量排名 + * @author sun + */ + GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam); + + /** + * @param formDTO + * @Description 邻里党群-社群数量排名 + * @author sun + */ + List groupUserCountRank(GroupUserCountRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 邻里党群-话题转化率排名 + * @author sun + */ + List groupTopicShiftIssueRatioRank(GroupTopicShiftIssueRatioRankFormDTO formDTO); + /** + * 项目各类总数 + * @param customerId + * @return + */ + ProjectSummaryResultDTO getProjectSummary(String customerId); + + GridProjectCountRankResultDTO getGridProjectCountRank(String customerId); + + List getProjectCategoryAnalysis(String customerId); + + List getGridProjectAvgClosedTimeAnalysis(String customerId); + + ProjectSatisfactionResultDTO getProjectSatisfactionAnalyze(String customerId); + + UserSummaryResultDTO getUserSummary(String customerId); + + KcUserTrendResultDTO getUserTrend(String customerId); + + KcUserRankResultDTO getUserRank(String customerId); + + KcUserPortrayalResultDTO getUserPortrayal(String customerId); + + KcUserPointRankResultDTO getUserPointsRank(String customerId, Integer pageNo, Integer pageSize); + + ScreenKcNewsSummaryResultDTO getNewsSummary(String customerId); + + ScreenKcNewsPartiTrendResultDTO getNewsPartiTrend(String customerId); + + List getNewsCountOfCategory(String customerId); + + ScreenKcCategoryNewsRankResultDTO getNewsPartiCategoryRank(String customerId); + + List getNewsHotRank(String customerId, Integer pageNo, Integer pageSize); +} 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 6eef8b2387..6d6632dbdf 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 @@ -12,6 +12,7 @@ import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -43,13 +44,13 @@ public class AgencyServiceImpl implements AgencyService { @Override public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { // 1. 查询客户根组织ID -// String customerId = externalAppRequestParam.getCustomerId(); + String customerId = externalAppRequestParam.getCustomerId(); // 验签关闭,customerId无法获取,暂时写死 - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - - + if(StringUtils.isBlank(customerId)){ + customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + } TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); if (null == rootAgency){ return new TreeResultDTO(); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index 619eba4625..73ebfc5c14 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -86,7 +86,11 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) { - return screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + PartymemberAgeDistributionResultDTO ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + if(null == ageInfo){ + ageInfo = new PartymemberAgeDistributionResultDTO(); + } + return ageInfo; } /** 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 22f6aa376b..7777739c0c 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 @@ -7,16 +7,15 @@ 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.dto.form.MonthBarchartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; 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.time.LocalDate; import java.util.ArrayList; import java.util.Comparator; @@ -55,6 +54,10 @@ public class IndexServiceImpl implements IndexService { if (null == yearAverageIndexResultDTO){ return new YearAverageIndexResultDTO(); } + yearAverageIndexResultDTO.setPartyDevAbility(getRound(yearAverageIndexResultDTO.getPartyDevAbility())); + yearAverageIndexResultDTO.setGovernAbility(getRound(yearAverageIndexResultDTO.getGovernAbility())); + yearAverageIndexResultDTO.setServiceAbility(getRound(yearAverageIndexResultDTO.getServiceAbility())); + yearAverageIndexResultDTO.setYearAverageIndex(getRound(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility())); return yearAverageIndexResultDTO; } @@ -68,19 +71,23 @@ public class IndexServiceImpl implements IndexService { @Override public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { - MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),null); + MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), null); String monthId = dateUtils.getCurrentMonthId(); int time = NumConstant.TWELVE; //保证获取月度指数数据的最大可能性 - while(null == monthPieChartResultDTO && time > NumConstant.ONE){ + while ((null == pieChartDTO || StringUtils.isBlank(pieChartDTO.getMonthId())) && time > NumConstant.ONE) { time--; - monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); - monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),monthId); + monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); + pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), monthId); } - if (null == monthPieChartResultDTO){ + if (null == pieChartDTO) { return new MonthPieChartResultDTO(); } - return monthPieChartResultDTO; + // 处理小数四舍五入 + pieChartDTO.setPartyDevAbility(getRound(pieChartDTO.getPartyDevAbility())); + pieChartDTO.setGovernAbility(getRound(pieChartDTO.getGovernAbility())); + pieChartDTO.setServiceAbility(getRound(pieChartDTO.getServiceAbility())); + return pieChartDTO; } /** @@ -114,6 +121,13 @@ public class IndexServiceImpl implements IndexService { result.setTotalIndexData(totalIndexData); return result; } + // 处理小数四舍五入 + monthBarchartResults.forEach(barchart -> { + barchart.setPartyDevAbility(getRound(barchart.getPartyDevAbility())); + barchart.setGovernAbility(getRound(barchart.getGovernAbility())); + barchart.setServiceAbility(getRound(barchart.getServiceAbility())); + barchart.setIndexTotal(getRound(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility())); + }); List collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList()); //升序 当前月份在队尾 List _ymList = dateUtils.getXpro().keySet().stream().collect(Collectors.toList()); @@ -165,8 +179,8 @@ public class IndexServiceImpl implements IndexService { } /** - * @Description 4、下级部门指数排行 * @param subAgencyIndexRankFormDTO + * @Description 4、下级组织/部门指数排行 (不包含部门的数据) * @author zxc * @date 2020/8/20 10:04 上午 */ @@ -180,6 +194,64 @@ public class IndexServiceImpl implements IndexService { 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; } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public List anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO) { + List subAgencyIndexRankResultDTOS = new ArrayList<>(); + if (ScreenConstant.YEAR_ID.equals(formDTO.getType())){ + // 年 指数排行 + subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO); + } else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())){ + // 月(上一个月) 指数排行 + subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO); + subAgencyIndexRankResultDTOS.forEach(rank -> { + rank.setPartyDevAbility(getRound(rank.getPartyDevAbility())); + rank.setGovernAbility(getRound(rank.getGovernAbility())); + rank.setServiceAbility(getRound(rank.getServiceAbility())); + rank.setTotalIndex(getRound(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility())); + }); + } + 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; + } + + /** + * @param d + * @Description 小数四舍五入 + * @author zxc + * @date 2020/9/14 2:01 下午 + */ + 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()); + } } 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 new file mode 100644 index 0000000000..b82d6b654f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java @@ -0,0 +1,464 @@ +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; +import com.epmet.datareport.dao.evaluationindex.screenkc.*; +import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.dto.result.issue.*; +import com.epmet.dto.result.project.*; +import com.epmet.dto.result.user.*; +import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; +import com.epmet.dto.result.issue.KcIssueSummary; +import com.epmet.dto.result.issue.KcPartiTrendResultDTO; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.NumberFormat; +import java.util.LinkedList; +import java.util.List; + +/** + * 孔村大屏api + * + * @author zhangyong + * @date 2020/9/10 10:21 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class KcScreenServiceImpl implements KcScreenService { + + @Autowired + private DateUtils dateUtils; + + @Autowired + private ScreenKcPlatformSummaryDailyDao screenKcPlatformSummaryDailyDao; + @Autowired + private ScreenKcActSummaryDailyDao screenKcActSummaryDailyDao; + @Autowired + private ScreenKcActTrendMonthlyDao screenKcActTrendMonthlyDao; + @Autowired + private ScreenKcVolunteerSummaryDailyDao screenKcVolunteerSummaryDailyDao; + @Autowired + private ScreenKcVolunteerHeatRankGridDailyDao screenKcVolunteerHeatRankGridDailyDao; + + @Autowired + private ScreenKcIssueSummaryGridDailyDao screenKcIssueSummaryGridDailyDao; + + @Autowired + private ScreenKcIssueTrendGridMonthlyDao trendGridMonthlyDao; + + @Autowired + private ScreenKcGroupSummaryGridDailyDao screenKcGroupSummaryGridDailyDao; + + @Autowired + private ScreenKcTopicTrendGridMonthlyDao screenKcTopicTrendGridMonthlyDao; + + @Autowired + private ScreenKcGroupDetailGridDailyDao screenKcGroupDetailGridDailyDao; + + @Autowired + private ScreenKcProjectSummaryGridDailyDao screenKcProjectSummaryGridDailyDao; + + @Autowired + private ScreenKcProjectCategoryGridDailyDao screenKcProjectCategoryGridDailyDao; + + @Autowired + private ScreenKcProjectSummaryGridDailyDao projectSummaryGridDailyDao; + + @Autowired + private ScreenKcProjectSatisGridMonthlyDao projectSatisGridMonthlyDao; + + @Autowired + private ScreenKcUserSummaryDailyDao kcUserSummaryDailyDao; + + @Autowired + private ScreenKcUserTrendGridMonthlyDao userTrendGridMonthlyDao; + + @Autowired + private ScreenPartyUserRankDataDao partyUserRankDataDao; + + @Autowired + private ScreenKcNewsSummaryDailyDao screenKcNewsSummaryDailyDao; + + @Autowired + private ScreenKcNewsTrendMonthlyDao screenKcNewsTrendMonthlyDao; + + @Autowired + private ScreenKcNewsCategoryAnalysisDao screenKcNewsCategoryAnalysisDao; + + @Autowired + private ScreenKcNewsRankDao screenKcNewsRankDao; + + /** + * @param externalAppRequestParam + * @Description 首页-平台各类总数 + * @author sun + */ + @Override + public HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam) { + return screenKcPlatformSummaryDailyDao.selectSummaryDaily(externalAppRequestParam.getCustomerId()); + } + + /** + * @param externalAppRequestParam + * @Description 公益互助-各类总数汇总 + * @author sun + */ + @Override + public HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam) { + return screenKcActSummaryDailyDao.selectHeartSummary(externalAppRequestParam.getCustomerId()); + } + + /** + * @param externalAppRequestParam + * @Description 公益互助-公益活动次数 + * @author sun + */ + @Override + public HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam) { + HeartActcounttrendResultDTO resultDTO = new HeartActcounttrendResultDTO(); + LinkedList xAxis = new LinkedList<>(); + LinkedList actCountDataList = new LinkedList<>(); + //1.按客户查询最近十二个月数据 + List list = screenKcActTrendMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId()); + //2.倒序遍历封装数据 + for (int i = list.size() - 1; i >= 0; i--) { + xAxis.add(list.get(i).getMonthId()); + actCountDataList.add(list.get(i).getActCount().toString()); + } + //3.封装数据并返回 + resultDTO.setXAxis(xAxis); + resultDTO.setActCountDataList(actCountDataList); + return resultDTO; + } + + /** + * @param externalAppRequestParam + * @Description 公益互助-志愿者画像 + * @author sun + */ + @Override + public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam) { + HeartVolunteerportrayalResultDTO resultDTO = new HeartVolunteerportrayalResultDTO(); + GenderDistributionResultDTO genderDistribution = new GenderDistributionResultDTO(); + //1.根据客户Id查询最近日期志愿者统计数据 + AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(externalAppRequestParam.getCustomerId()); + //2.封装数据并返回 + if (null == ageDistribution) { + resultDTO.setAgeDistribution(new AgeDistributionResultDTO()); + resultDTO.setGenderDistribution(genderDistribution); + } else { + resultDTO.setAgeDistribution(ageDistribution); + genderDistribution.setMaleCount(ageDistribution.getMaleCount()); + genderDistribution.setFemaleCount(ageDistribution.getFemaleCount()); + resultDTO.setGenderDistribution(genderDistribution); + } + return resultDTO; + } + + /** + * @param formDTO + * @Description 公益互助-个人(志愿者)公益时长排名 + * @author sun + */ + @Override + public List heartVolunteerrank(HeartVolunteerrankFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + List list = screenKcVolunteerHeatRankGridDailyDao.selectHeartVolunteerrankList(formDTO); + return list; + } + + @Override + public KcIssueSummary getIssueSummary(String customerId) { + return screenKcIssueSummaryGridDailyDao.getIssueSummary(customerId); + } + + @Override + public KcPartiTrendResultDTO getIssuePartiTrend(String customerId) { + List trend = trendGridMonthlyDao.getIssuePartiTrend(customerId); + KcPartiTrendResultDTO result = new KcPartiTrendResultDTO(); + trend.stream().forEach(t -> { + String month = t.getMonthId().substring(4); + result.getxAxis().add(new Integer(month).toString().concat("月")); + result.getReportCountDataList().add(t.getReportCount()); + }); + return result; + } + + @Override + public IssueGridTotalRankDTO getIssueGridTotalRank(String customerId) { + List issueGridTotals = screenKcIssueSummaryGridDailyDao.getIssueGridTotalRank(customerId); + + IssueGridTotalRankDTO resultDTO = new IssueGridTotalRankDTO(); + issueGridTotals.stream().forEach(igt -> { + resultDTO.getGridNameDataList().add(igt.getGridName()); + resultDTO.getIssueCountDataList().add(igt.getIssueCount()); + }); + + return resultDTO; + } + + @Override + public List getAvgAuditTimeRank(String customerId) { + return screenKcIssueSummaryGridDailyDao.getAvgAuditTimeRank(customerId); + } + + @Override + public IssueEffectResultDTO getIssueEffective(String customerId) { + return screenKcIssueSummaryGridDailyDao.getIssueEffective(customerId); + } + + /** + * @param externalAppRequestParam + * @Description 邻里党群-各类总数 + * @author sun + */ + @Override + public GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam) { + //1.按客户查询最近一天各网格各项数据的汇总值 + GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(externalAppRequestParam.getCustomerId()); + if (null == resultDTO) { + return new GroupSummaryResultDTO(); + } + + //2.计算转化议题率,保留两位小数 + if (resultDTO.getTopicCount() < NumConstant.ONE || resultDTO.getShiftIssueCount() < NumConstant.ONE) { + resultDTO.setShiftIssueRatio("0%"); + } else { + NumberFormat numberFormat = NumberFormat.getInstance(); + //设置精确到小数点后2位 + numberFormat.setMaximumFractionDigits(2); + String ratio = numberFormat.format((float) resultDTO.getShiftIssueCount() / (float) resultDTO.getTopicCount() * 100); + resultDTO.setShiftIssueRatio(ratio + "%"); + } + + return resultDTO; + } + + /** + * @param externalAppRequestParam + * @Description 邻里党群-话题参与趋势 + * @author sun + */ + @Override + public GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam) { + GroupPartitopictrendResultDTO resultDTO = new GroupPartitopictrendResultDTO(); + LinkedList xAxis = new LinkedList<>(); + LinkedList actCountDataList = new LinkedList<>(); + //1.按客户查询最近十二个月所有网格汇总数据 + List list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId()); + //2.倒序遍历封装数据 + for (int i = list.size() - 1; i >= 0; i--) { + xAxis.add(list.get(i).getMonthId()); + actCountDataList.add(list.get(i).getTopicCount()); + } + //3.封装数据并返回 + resultDTO.setXAxis(xAxis); + resultDTO.setActCountDataList(actCountDataList); + return resultDTO; + } + + /** + * @param externalAppRequestParam + * @Description 邻里党群-社群数量排名 + * @author sun + */ + @Override + public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam) { + GroupGridgroupcountrankResultDTO resultDTO = new GroupGridgroupcountrankResultDTO(); + LinkedList gridNameDataList = new LinkedList<>(); + LinkedList groupCountDataList = new LinkedList<>(); + //1.按日期降序,查询客户最近一天所有网格数据,按每个网格的社区总数降序排列 + LinkedList list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(externalAppRequestParam.getCustomerId()); + //2.封装数据 + list.forEach(l -> { + gridNameDataList.add(l.getGridName()); + groupCountDataList.add(l.getGroupCount()); + }); + resultDTO.setGridNameDataList(gridNameDataList); + resultDTO.setGroupCountDataList(groupCountDataList); + + return resultDTO; + } + + /** + * @param formDTO + * @Description 邻里党群-社群数量排名 + * @author sun + */ + @Override + 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 邻里党群-话题转化率排名 + * @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; + } + + @Override + public ProjectSummaryResultDTO getProjectSummary(String customerId) { + return projectSummaryGridDailyDao.getProjectSummary(customerId); + } + + @Override + public GridProjectCountRankResultDTO getGridProjectCountRank(String customerId) { + List gridCounts = screenKcProjectSummaryGridDailyDao.getGridProjectCountRank(customerId); + GridProjectCountRankResultDTO rankResult = new GridProjectCountRankResultDTO(); + gridCounts.stream().forEach(gc -> { + rankResult.getGridNameDataList().add(gc.getGridName()); + rankResult.getProjectCountDataList().add(gc.getProjectCount()); + }); + return rankResult; + } + + @Override + public List getProjectCategoryAnalysis(String customerId) { + return screenKcProjectCategoryGridDailyDao.listProjectCountGroupByCategory(customerId); + } + + @Override + public List getGridProjectAvgClosedTimeAnalysis(String customerId) { + return screenKcProjectSummaryGridDailyDao.getGridProjectAvgClosedTimeAnalysis(customerId); + } + + @Override + public ProjectSatisfactionResultDTO getProjectSatisfactionAnalyze(String customerId) { + List pss = projectSatisGridMonthlyDao.getProjectSatisfactionAnalyze(customerId); + + ProjectSatisfactionResultDTO resultDTO = new ProjectSatisfactionResultDTO(); + pss.stream().forEach(ps -> { + String monthNo = ps.getMonthId().substring(4); + resultDTO.getxAxis().add(new Integer(monthNo).toString().concat("月")); + resultDTO.getGreatSatisDataList().add(ps.getGreatSatis()); + resultDTO.getGoodSatisDataList().add(ps.getGoodSatis()); + resultDTO.getDisSatisDataList().add(ps.getDisSatis()); + }); + return resultDTO; + } + + @Override + public UserSummaryResultDTO getUserSummary(String customerId) { + return kcUserSummaryDailyDao.getUserSummary(customerId); + } + + @Override + public KcUserTrendResultDTO getUserTrend(String customerId) { + List userSomeNums = userTrendGridMonthlyDao.getUserTrend(customerId); + KcUserTrendResultDTO trend = new KcUserTrendResultDTO(); + userSomeNums.stream().forEach(usm -> { + String monthStr = usm.getMonthId().substring(4); + trend.getxAxis().add(new Integer(monthStr).toString().concat("月")); + trend.getUserDataList().add(usm.getRegUserCount()); + trend.getPartyUserDataList().add(usm.getPartyUserCount()); + }); + + return trend; + } + + @Override + public KcUserRankResultDTO getUserRank(String customerId) { + List list = kcUserSummaryDailyDao.getUserRank(customerId); + + KcUserRankResultDTO rank = new KcUserRankResultDTO(); + list.stream().forEach(i -> { + rank.getGridNameDataList().add(i.getGridName()); + rank.getTotalUserDataList().add(i.getViewUserCount()); + }); + + return rank; + } + + @Override + public KcUserPortrayalResultDTO getUserPortrayal(String customerId) { + KcUserPortrayalResultDTO.AgeDistribution ageDistribution = kcUserSummaryDailyDao.getAgeDistribution(customerId); + KcUserPortrayalResultDTO.GenderDistribution genderDistribution = kcUserSummaryDailyDao.getGenderDistribution(customerId); + + KcUserPortrayalResultDTO portrayal = new KcUserPortrayalResultDTO(); + portrayal.setAgeDistribution(ageDistribution); + portrayal.setGenderDistribution(genderDistribution); + + return portrayal; + } + + @Override + public KcUserPointRankResultDTO getUserPointsRank(String customerId, Integer pageNo, Integer pageSize) { + if (pageNo != null && pageSize != null) { + PageHelper.startPage(pageNo, pageSize); + } + List userPoints = partyUserRankDataDao.listUserPoints(customerId); + KcUserPointRankResultDTO rank = new KcUserPointRankResultDTO(); + userPoints.stream().forEach(p -> { + rank.getUserNameDataList().add(p.getUserName()); + rank.getPointsDataList().add(p.getPointTotal()); + }); + return rank; + } + + @Override + public ScreenKcNewsSummaryResultDTO getNewsSummary(String customerId) { + return screenKcNewsSummaryDailyDao.getNewsSummary(customerId); + } + + @Override + public ScreenKcNewsPartiTrendResultDTO getNewsPartiTrend(String customerId) { + List partyCounts = + screenKcNewsTrendMonthlyDao.getNewsPartiTrend(customerId); + + ScreenKcNewsPartiTrendResultDTO trend = new ScreenKcNewsPartiTrendResultDTO(); + partyCounts.stream().forEach(pc -> { + String monthId = pc.getMonthId(); + trend.getxAxis().add(new Integer(monthId.substring(4)).toString().concat("月")); + trend.getPartiCountDataList().add(pc.getPartiCount()); + }); + + return trend; + } + + @Override + public List getNewsCountOfCategory(String customerId) { + return screenKcNewsCategoryAnalysisDao.getNewsCountOfCategory(customerId); + } + + @Override + public ScreenKcCategoryNewsRankResultDTO getNewsPartiCategoryRank(String customerId) { + List partiCounts = screenKcNewsCategoryAnalysisDao.listNewsPartiCategoryRank(customerId); + ScreenKcCategoryNewsRankResultDTO rank = new ScreenKcCategoryNewsRankResultDTO(); + partiCounts.stream().forEach(pc -> { + rank.getxAxis().add(pc.getCategoryName()); + rank.getPartiCountDataList().add(pc.getPartiCount()); + }); + return rank; + } + + @Override + public List getNewsHotRank(String customerId, Integer pageNo, Integer pageSize) { + if (pageNo != null && pageSize != null) { + PageHelper.startPage(pageNo, pageSize); + } + return screenKcNewsRankDao.getNewsHotRank(customerId); + } +} 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 5899ead6dd..d3ebec947d 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 @@ -10,7 +10,7 @@ spring: name: data-report-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index 793be083a1..1be215aa54 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml new file mode 100644 index 0000000000..607ea18a04 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml new file mode 100644 index 0000000000..889b92ae59 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml index fa89221e37..573c7501fa 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -15,7 +15,7 @@ screen_cpc_base_data WHERE DEL_FLAG = '0' - AND PARENT_ID = #{agencyId} + AND ORG_ID = #{agencyId} \ 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 37f45b8084..36b89ffefe 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 @@ -6,9 +6,10 @@ SELECT month_id AS monthId, - service_ablity AS serviceAbility, - party_dev_ablity AS partyDevAbility, - govern_ablity AS governAbility, - index_total AS indexTotal + service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, + party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, + govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility FROM screen_index_data_monthly WHERE @@ -43,11 +43,10 @@ LIMIT 12 - + - \ No newline at end of file + + + + + + 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 d224b92d4e..4aeae5361a 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 @@ -6,7 +6,6 @@ - \ No newline at end of file + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 8d865b6341..9366bc90f7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -35,4 +35,13 @@ ORDER BY POINT_TOTAL DESC + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActSummaryDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActSummaryDailyDao.xml new file mode 100644 index 0000000000..14cba9ef1a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActSummaryDailyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml new file mode 100644 index 0000000000..47ae608fc3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + 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 new file mode 100644 index 0000000000..76db75d09f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml @@ -0,0 +1,64 @@ + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupSummaryGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupSummaryGridDailyDao.xml new file mode 100644 index 0000000000..d461ab19d2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupSummaryGridDailyDao.xml @@ -0,0 +1,60 @@ + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml new file mode 100644 index 0000000000..57c743144f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml new file mode 100644 index 0000000000..731c8b8083 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsCategoryAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsCategoryAnalysisDao.xml new file mode 100644 index 0000000000..a93bd0d439 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsCategoryAnalysisDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsRankDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsRankDao.xml new file mode 100644 index 0000000000..ff51305086 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsRankDao.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsSummaryDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsSummaryDailyDao.xml new file mode 100644 index 0000000000..1094a408a4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsSummaryDailyDao.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsTrendMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsTrendMonthlyDao.xml new file mode 100644 index 0000000000..06d6826cbb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsTrendMonthlyDao.xml @@ -0,0 +1,15 @@ + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcPlatformSummaryDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcPlatformSummaryDailyDao.xml new file mode 100644 index 0000000000..5ef2a4780e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcPlatformSummaryDailyDao.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectCategoryGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectCategoryGridDailyDao.xml new file mode 100644 index 0000000000..1f51a6da8b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectCategoryGridDailyDao.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectSatisGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectSatisGridMonthlyDao.xml new file mode 100644 index 0000000000..0727b6fbb2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectSatisGridMonthlyDao.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectSummaryGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectSummaryGridDailyDao.xml new file mode 100644 index 0000000000..7c79e5da1c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcProjectSummaryGridDailyDao.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml new file mode 100644 index 0000000000..60f288f628 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserSummaryDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserSummaryDailyDao.xml new file mode 100644 index 0000000000..5e27540bb9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserSummaryDailyDao.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserTrendGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserTrendGridMonthlyDao.xml new file mode 100644 index 0000000000..f86c96af36 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserTrendGridMonthlyDao.xml @@ -0,0 +1,17 @@ + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.xml new file mode 100644 index 0000000000..527a33ce0a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerSummaryDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerSummaryDailyDao.xml new file mode 100644 index 0000000000..d6a88821a2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerSummaryDailyDao.xml @@ -0,0 +1,35 @@ + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CalculateStatus.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CalculateStatus.java new file mode 100644 index 0000000000..f4425ee714 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CalculateStatus.java @@ -0,0 +1,13 @@ +package com.epmet.constant; + +/** + * 计算状态 + * calculating:正在计算中。有实例正在计算 + * pendding:计算暂停,说明计算过程中实例发生重启,等待重新计算 + */ +public interface CalculateStatus { + + String PENDDING = "pendding"; + String CALCULATING = "calculating"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index f02185071f..819abb75c6 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -1,14 +1,25 @@ package com.epmet.constant; /** - * 描述一下 + * 指标计算 常量类 * * @author yinzuomei@elink-cn.com * @date 2020/8/27 15:20 */ public interface IndexCalConstant { - Integer PAGE_SIZE = 10; + /** + * 批量插入 最大数据量 + */ + Integer INSERT_SIZE= 100; + /** + * 批量删除 一次删除50 + */ + Integer DELETE_SIZE = 1000; + /** + * 分批计算,一次计算 10条 + */ + Integer PAGE_SIZE = 900; String GRID_ID="GRID_ID"; @@ -35,11 +46,27 @@ public interface IndexCalConstant { String COMMUNITY_RELATE = "shequxiangguan"; + /** + * 网格相关:党建能力 + */ + String GRID_DJ_ALL_PARENT_INDEX_CODE="wanggexiangguan:dangjiannengli"; + /** + * 网格相关:治理能力 + */ + String GRID_ZL_ALL_PARENT_INDEX_CODE="wanggexiangguan:zhilinengli"; + /** + * 网格相关:服务能力 + */ + String GRID_FW_ALL_PARENT_INDEX_CODE="wanggexiangguan:fuwunengli"; + /** + * 区直部门:治理能力 + */ + String DEPT_ZL_ALL_PARENT_INDEX_CODE="quzhibumen:zhilinengli"; // 测试插入数据用 - String customerId="b09527201c4409e19d1dbc5e3c3429a1"; + String customerId="epmettest"; //社区S1-C1 String SHE_QU_S1_C1="S1-C1"; //社区S1-C2 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyCalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyCalResultDTO.java new file mode 100644 index 0000000000..0287801453 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyCalResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/9 5:52 下午 + */ +@Data +public class AgencyCalResultDTO implements Serializable { + + private static final long serialVersionUID = 2482954776048082386L; + + private List oneTwoLevel; + + private List fiveLevel; +} 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 a9abd3411f..605f755064 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 @@ -17,14 +17,13 @@ package com.epmet.dto.indexcal; -import java.io.Serializable; -import java.util.Date; - import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.IndexCalConstant; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 区/街道相关分数表 @@ -80,20 +79,26 @@ public class AgencyScoreDTO implements Serializable { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** - * 数据类型 district :全区;street:街道 + * 数据类型 district :全区;street:街道 */ private String dataType; /** - * + * */ private Integer delFlag; @@ -115,18 +120,24 @@ public class AgencyScoreDTO implements Serializable { /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; + + /** + * 权重 + */ + private BigDecimal weight; public AgencyScoreDTO() { this.isTotal = NumConstant.ZERO_STR; this.score = new BigDecimal(NumConstant.ZERO); this.indexCode = ""; this.dataType = IndexCalConstant.STREET_LEVEL; + this.allParentIndexCode = ""; this.delFlag = 0; this.revision = 0; this.createdBy = "APP_USER"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java index 187f69c960..cfdc9f2ec9 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.indexcal; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -13,6 +15,9 @@ import java.io.Serializable; @Data public class CalculateCommonFormDTO implements Serializable { private static final long serialVersionUID = -5689788391963427717L; + + public interface CancelCalculateGroup extends CustomerClientShowGroup {} + /** * 月份id: yyyyMM */ @@ -21,6 +26,7 @@ public class CalculateCommonFormDTO implements Serializable { /** * 客户id */ + @NotBlank(message = "客户id不能为空", groups = { CancelCalculateGroup.class }) private String customerId; public CalculateCommonFormDTO() { diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CommunityCalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CommunityCalResultDTO.java new file mode 100644 index 0000000000..f8325206c8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CommunityCalResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.indexcal; + +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/10 9:19 上午 + */ +@Data +public class CommunityCalResultDTO implements Serializable { + + private static final long serialVersionUID = 2482954776048082386L; + + private List oneLevel; + + private List fiveLevel; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeotScore.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeotScore.java new file mode 100644 index 0000000000..351a4e9ad6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeotScore.java @@ -0,0 +1,47 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 区直部门-相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/10 18:13 + */ +@Data +public class DeotScore implements Serializable { + /** + * 部门id + */ + private String deptId; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门所属的机关Id + */ + private String agencyId; + + /** + * 季度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/indexcal/DeptScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java index 5051aa3d82..8c0ee008be 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java @@ -17,11 +17,11 @@ package com.epmet.dto.indexcal; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 区直部门分值表 @@ -77,12 +77,18 @@ public class DeptScoreDTO implements Serializable { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 治理能力:zhilinengli; */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** * @@ -114,4 +120,8 @@ public class DeptScoreDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file + /** + * 权重(同一组权重总和=1) 9.12新增 + */ + private BigDecimal weight; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDetailDTO.java new file mode 100644 index 0000000000..e5f63cab5b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDetailDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 区直部门相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/10 17:56 + */ +@Data +public class DeptScoreDetailDTO implements Serializable { + private static final long serialVersionUID = -1520962964833708922L; + + /** + * 1:总分;0不是 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:quzhibumen + */ + private String indexCode; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..fec0ca391a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 8、治理能力-部门相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class DeptGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..0e845a808f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 6、治理能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java new file mode 100644 index 0000000000..d6f2e68d5c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 2、党建能力-网格相关指标上报(按照月份) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridPartyAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java index 8738c5c3f2..3aa816cafd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java @@ -48,7 +48,7 @@ public class GridPartyAbilityFormDTO implements Serializable { /** * 网格党员人均提出的议题转项目数 */ - private Integer partyAvgShiftProjectCount; + private BigDecimal partyAvgShiftProjectCount; /** * 网格活跃群众用户数 @@ -78,7 +78,7 @@ public class GridPartyAbilityFormDTO implements Serializable { /** * 网格群众人均提出的议题转项目数 */ - private Integer userAvgShiftProjectCount; + private BigDecimal userAvgShiftProjectCount; /** * 建群党员数(累计值) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java index 5a0a9fb3c8..6e6eccd2e4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -29,5 +29,5 @@ public class GridPartyMemberDataFormDTO implements Serializable { */ private String monthId; - private List partyMemberDataList; + private List dataList; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java new file mode 100644 index 0000000000..1931275dd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 4、服务能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridServiceAbilityDataFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..59e03a058c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 7、治理能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java index c2eadf4dc7..dc91df6e08 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java @@ -71,7 +71,7 @@ public class OrgGovrnAbilityFormDTO implements Serializable { private BigDecimal satisfactionRatio; /** - * 社区超期项目率,dataTyp=commnuity有值 + * 社区超期项目率,dataTyp=community有值 */ private BigDecimal overdueProjectRatio; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java new file mode 100644 index 0000000000..2d018cf394 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 3、党建能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgPartyAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java new file mode 100644 index 0000000000..e29c218a20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 5、服务能力-组织(街道|社区|全区)相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgServiceAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} 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 8ad2ec6658..2888cc7706 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 @@ -17,11 +17,11 @@ package com.epmet.dto.screen; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 社区相关分数表 @@ -84,6 +84,11 @@ public class FactIndexCommunityScoreDTO implements Serializable { */ private String indexCode; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** * 删除状态 */ @@ -107,12 +112,17 @@ public class FactIndexCommunityScoreDTO implements Serializable { /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; + + /** + * 权重 + */ + private BigDecimal weight; public FactIndexCommunityScoreDTO() { this.customerId = ""; @@ -124,6 +134,7 @@ public class FactIndexCommunityScoreDTO implements Serializable { this.isTotal = "0"; this.score = new BigDecimal(0); this.indexCode = ""; + this.allParentIndexCode = ""; this.delFlag = 0; this.revision = 0; this.createdBy = "APP_USER"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java index d5be2db6e9..ed068f9a75 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java @@ -119,4 +119,8 @@ public class FactIndexGridScoreDTO implements Serializable { */ private Date updatedTime; + /** + * 权重(同一组权重总和=1) 9.12新增 + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java new file mode 100644 index 0000000000..760e48b3da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.screencoll; + +import com.alibaba.fastjson.JSON; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 大屏采集通用入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/9 10:25 + */ +@Data +public class ScreenCollFormDTO implements Serializable { + + private static final long serialVersionUID = 4605543711669000348L; + /** + * 当为true时后台将先删除当前维度的数据,后新增 + */ + private Boolean isFirst; + + /** + * 日期Id, 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyy + */ + private String yearId; + + /** + * 数据集合 + */ + private List dataList; + + @Override + public String toString() { + return JSON.toJSONString(this); + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java new file mode 100644 index 0000000000..1eb4f41225 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 2、党员基本情况 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CpcBaseDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java new file mode 100644 index 0000000000..bd9d9feaaa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 14、组织层级 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerAgencyListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java new file mode 100644 index 0000000000..3a10027b55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 16、部门信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerDeptListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java new file mode 100644 index 0000000000..ea7ec06874 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 15、网格信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerGridListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java index a0de181acb..edac6a656e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java @@ -21,6 +21,6 @@ public class DifficultyDataFormDTO implements Serializable { /** * 难点堵点数据 */ - private List diffcultyDataList; + private List dataList; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java new file mode 100644 index 0000000000..a84a217b60 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.screencoll.form; + +import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; +import com.epmet.dto.screencoll.ImgDataListDTO; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 4、事件数据(中央区-事件数据) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class EventDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java new file mode 100644 index 0000000000..8372ba293e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 5、基层治理-治理能力数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GovernRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java new file mode 100644 index 0000000000..f9a4ad6f48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 1、指数_按月统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataListMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java new file mode 100644 index 0000000000..186f5eb007 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 17、指数_按年统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataListYearlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyy + */ + private String yearId; + + private List dataList; +} 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 c27f75db87..4adf142a12 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 @@ -1,5 +1,6 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -64,4 +65,22 @@ public class IndexDataMonthlyFormDTO implements Serializable { * 治理能力指数 */ private BigDecimal governAblity; + +// PARTY_DEV_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 +// SERVICE_ABLITY_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 +// GOVERN_ABLITY_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 + /** + * 党建能力指数权重 + */ + private BigDecimal partyDevWeight = new BigDecimal(NumConstant.ZERO); + + /** + * 服务能力指数 权重 + */ + private BigDecimal serviceAblityWeight = new BigDecimal(NumConstant.ZERO); + + /** + * 治理能力分数,权重 + */ + private BigDecimal governAblityWeight = new BigDecimal(NumConstant.ZERO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcActSummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcActSummaryFormDTO.java new file mode 100644 index 0000000000..a942ef7c96 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcActSummaryFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 7、公益互助-活动各类总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcActSummaryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动总数 + */ + private Integer actCount; + + /** + * 志愿者总数 + */ + private Integer volunteerCount; + + /** + * 参与人次 + */ + private Integer partiUserCount; + + /** + * 发放积分 + */ + private Integer rewardPointCount; + + /** + * 公益时长单位分钟 + */ + private Integer heartTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcActTrendFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcActTrendFormDTO.java new file mode 100644 index 0000000000..26469e1ac4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcActTrendFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 8、公益互助-活动次数趋势 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcActTrendFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动数量(本月举行的活动) + */ + private Integer actCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcCategorySummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcCategorySummaryFormDTO.java new file mode 100644 index 0000000000..045e515fe1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcCategorySummaryFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 11、项目分析-按分类统计 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcCategorySummaryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 一级类别id + */ + private String categoryId; + + /** + * 一级分类名称 + */ + private String categoryName; + + /** + * 项目数量 + */ + private Integer projectCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupDetailFormDTO.java new file mode 100644 index 0000000000..5e29044533 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupDetailFormDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 18、邻里党群-小组详情 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcGroupDetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 小组id + */ + private String groupId; + + /** + * 群名称 + */ + private String groupName; + + /** + * 群主名称 + */ + private String groupLeader; + + /** + * 群成员数 + */ + private Integer memberCount; + + /** + * 话题总数 + */ + private Integer topicCount; + + /** + * 转为议题的话题数 + */ + private Integer shiftIssueCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupSummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupSummaryFormDTO.java new file mode 100644 index 0000000000..2018c4905d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupSummaryFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 17、邻里党群-各类总数汇总 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcGroupSummaryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 社群总数 + */ + private Integer groupCount; + + /** + * 群成员总数 + */ + private Integer memberCount; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题参与量 + */ + private Integer partiCount; + + /** + * 话题转议题总数 + */ + private Integer shiftIssueCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupTopicTrendFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupTopicTrendFormDTO.java new file mode 100644 index 0000000000..1ad02ab91c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcGroupTopicTrendFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 19、邻里党群-话题参与趋势 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcGroupTopicTrendFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 话题数量(所在月新增话题数) + */ + private Integer topicCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcHomePageFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcHomePageFormDTO.java new file mode 100644 index 0000000000..b12c97bb54 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcHomePageFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 1、首页-平台各类总数上报 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcHomePageFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格总数 + */ + private Integer gridCount; + + /** + * 已开通网格总数 + */ + private Integer openedGridCount; + + /** + * 议题总数 + */ + private Integer issueCount; + + /** + * 项目总数 + */ + private Integer projectCount; + + /** + * 用户总数 + */ + private Integer userCount; + + /** + * 党员用户 + */ + private Integer partyUserCount; + + /** + * 社群总数 + */ + private Integer groupCount; + + /** + * 话题总数 + */ + private Integer topicCount; + + /** + * 新闻数量 + */ + private Integer newsCount; + + /** + * 阅读数量 + */ + private Integer readCount; + + /** + * 公益活动数量 + */ + private Integer actCount; + + /** + * 志愿者总数 + */ + private Integer vounteerCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcIssueSummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcIssueSummaryFormDTO.java new file mode 100644 index 0000000000..ae08d2330f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcIssueSummaryFormDTO.java @@ -0,0 +1,92 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 2、议题分析-各类总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcIssueSummaryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 上报总数 + */ + private Integer reportCount; + + /** + * 议题总数 + */ + private Integer issueCount; + + /** + * 待审核数 + */ + private Integer pendingCount; + + /** + * 已驳回数 + */ + private Integer rejectedCount; + + /** + * 处理中数 + */ + private Integer processingCount; + + /** + * 已关闭数 + */ + private Integer closedCount; + + /** + * 议题浏览数 + */ + private Integer issueViewCount; + + /** + * 表态数 + */ + private Integer voteCount; + + /** + * 审核通过数 ?为了算议题效率 + */ + private Integer passedCount; + + /** + * 转化成项目数 ?为了算议题效率 + */ + private Integer shiftToProjectCount; + + /** + * 平均审核时间单位分钟 ? + */ + private Integer avgAuditTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcIssueTrendFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcIssueTrendFormDTO.java new file mode 100644 index 0000000000..3fe5df6075 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcIssueTrendFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 3、议题分析-参与趋势 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcIssueTrendFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 议题上报数(本月内上报的议题数量) + */ + private Integer reportCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsCategoryAnalysisFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsCategoryAnalysisFormDTO.java new file mode 100644 index 0000000000..ed16c44348 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsCategoryAnalysisFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 16、党建声音-新闻按类别统计 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcNewsCategoryAnalysisFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 类别id + */ + private String categoryId; + + /** + * 分类名称 + */ + private String categoryName; + + /** + * 新闻的数量 + */ + private Integer newsCount; + + /** + * 阅读的数量 + */ + private Integer readCount; + + /** + * 点赞的数量 + */ + private Integer likeCount; + + /** + * 点踩的数量 + */ + private Integer disLikeCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsHotRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsHotRankFormDTO.java new file mode 100644 index 0000000000..035fbd4971 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsHotRankFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 15、党建声音-热度新闻排行 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcNewsHotRankFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 新闻id + */ + private String newsId; + + /** + * 新闻标题 + */ + private String newsTitle; + + /** + * 新闻热点值 + */ + private Integer hotCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsSummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsSummaryFormDTO.java new file mode 100644 index 0000000000..276244a9f1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsSummaryFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 13、党建声音-新闻各类总数汇总 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcNewsSummaryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 文章总数 + */ + private Integer newsCount; + + /** + * 阅读量 + */ + private Integer readCount; + + /** + * 点赞量 + */ + private Integer likeCount; + + /** + * 评论量 + */ + private Integer commentCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsTrendFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsTrendFormDTO.java new file mode 100644 index 0000000000..5d00324e55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsTrendFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 14、党建声音-新闻阅读参与趋势 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcNewsTrendFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 参与数量 + */ + private Integer partiCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcProjectSatisanalysisFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcProjectSatisanalysisFormDTO.java new file mode 100644 index 0000000000..daccb603d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcProjectSatisanalysisFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 12、项目分析-满意度分析 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcProjectSatisanalysisFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 非常满意项目总数 + */ + private Integer greatSatisfaction; + + /** + * 满意项目总数 + */ + private Integer goodSatisfaction; + + /** + * 不满意的项目总数 + */ + private Integer disSatisfaction; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcProjectSummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcProjectSummaryFormDTO.java new file mode 100644 index 0000000000..1b723b68d1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcProjectSummaryFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 10、项目分析-各类总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcProjectSummaryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 项目总数 + */ + private Integer projectCount; + + /** + * 处理中数 + */ + private Integer processingCount; + + /** + * 已关闭数 + */ + private Integer closedCount; + + /** + * 流转次数 + */ + private Integer moveCount; + + /** + * 已结案数量 + */ + private Integer closedCaseCount; + + /** + * 项目浏览数 + */ + private Integer projectViewCount; + + /** + * 表态数 + */ + private Integer voteCount; + + /** + * 平均结案时间 单位分钟 ? + */ + private Integer avgClosedCaseTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcUserHeartRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcUserHeartRankFormDTO.java new file mode 100644 index 0000000000..d5a272c182 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcUserHeartRankFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 6、用户分析-用户趋势 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcUserHeartRankFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 本月内新增用户数量 + */ + private Integer regUserCount; + + /** + * 本月内新增党员数量 + */ + private Integer partyUserCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcUserSummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcUserSummaryFormDTO.java new file mode 100644 index 0000000000..79e7c0a448 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcUserSummaryFormDTO.java @@ -0,0 +1,93 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 4、用户分析-各类总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcUserSummaryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 浏览用户(首页的用户总数,原型上首页是叫注册用户) + */ + private Integer visitorCount; + + /** + * 注册用户=居民数量 + */ + private Integer regUserCount; + + /** + * 党员用户 + */ + private Integer partyCount; + + /** + * 小于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; + + /** + * 党员中男性总人数 + */ + private Integer malePartyUserCount; + + /** + * 党员中女性总人数 + */ + private Integer femalePartyUserCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcVolunteerHeartRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcVolunteerHeartRankFormDTO.java new file mode 100644 index 0000000000..d25d044750 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcVolunteerHeartRankFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 5、公益互助-志愿者公益时长排名 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcVolunteerHeartRankFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 用户id + */ + private String userId; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 爱心时长 单位分钟 + */ + private Integer heartTime; + + /** + * 积分09-11新增 + */ + private Integer points; + + /** + * 志愿者id 09-11新增 + */ + private String volunteerId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcVolunteerSummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcVolunteerSummaryFormDTO.java new file mode 100644 index 0000000000..ebfee5da52 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcVolunteerSummaryFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 孔村 + * 9、公益互助-志愿者画像 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class KcVolunteerSummaryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 小于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; + + /** + * 志愿者中男性总人数 + */ + private Integer maleCount; + + /** + * 志愿者中女性总人数 + */ + private Integer femaleCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java new file mode 100644 index 0000000000..0d3238ae2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 6、党建引领-组织排行 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java new file mode 100644 index 0000000000..8c6a92e7b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 7、基层党建-建设情况数据(支部、联建、志愿) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyBranchDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java new file mode 100644 index 0000000000..da0630fad1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 8、党建引领-党员联系群众数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyLinkMassesDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java new file mode 100644 index 0000000000..c1784728ae --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 9、党建引领|基层治理-居民(党员)积分排行榜 入参 + * @Auther: zhangyong + * @Date: 2020-08-21 09:59 + */ +@Data +public class PartyUserRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java new file mode 100644 index 0000000000..b8a6086721 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 10、党建引领-先锋模范数据 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PioneerDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java new file mode 100644 index 0000000000..4e2bcaca51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 18、公众参与各类总数 入参 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PublicPartiTotalDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java new file mode 100644 index 0000000000..3550be21ad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 11、基层治理-公众参与 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserJoinListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java new file mode 100644 index 0000000000..ebdcc2822a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 12、中央区各类总数 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserTotalDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} 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 1f1c1b10fe..107bc8f478 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 @@ -173,4 +173,11 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/statstopic/execute") Result execTopicStatistical(@RequestParam(value = "date",required = false) String date); + /** + * 处理暂停的计算 + * @return + */ + @PostMapping("/data/stats/indexcalculate/process-pendding-cals") + Result processPenddingCalculate(); + } 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 d58fa69ec4..1c79cfc56b 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 @@ -170,4 +170,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result execTopicStatistical(String date) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical",date); } + + @Override + public Result processPenddingCalculate() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate"); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/Dockerfile b/epmet-module/data-statistical/data-statistical-server/Dockerfile index e592acbf38..074bc1d2de 100644 --- a/epmet-module/data-statistical/data-statistical-server/Dockerfile +++ b/epmet-module/data-statistical/data-statistical-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./data-stats.jar EXPOSE 8108 diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 36afabff51..f9a01abc70 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -9,10 +9,10 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./data-stats.jar" restart: "unless-stopped" deploy: resources: limits: cpus: '0.1' - memory: 300M \ No newline at end of file + memory: 600M \ 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 b62847d615..03f501aceb 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,17 +2,17 @@ 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.48 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.49 ports: - "8108:8108" network_mode: host # 使用现有网络 volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./data-stats.jar" restart: "unless-stopped" deploy: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 1100M \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml index 075a43a0af..0f4d72c3e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml @@ -9,10 +9,10 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./data-stats.jar" restart: "unless-stopped" deploy: resources: limits: cpus: '0.1' - memory: 300M \ No newline at end of file + memory: 600M \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index d930651a68..a4aaa4ca34 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.48 + 0.3.49 data-statistical com.epmet diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index eee1f3bca7..3b93ce39a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -1,7 +1,5 @@ package com.epmet; -import com.epmet.commons.tools.enums.EnvEnum; -import com.epmet.commons.tools.utils.HttpClientManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -17,6 +15,5 @@ public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } 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 bf2e750a65..360571a1e4 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 @@ -157,14 +157,18 @@ public class DemoController { private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; @Autowired private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; // private static Integer testcal=100; @PostMapping("testcal") public Result testCal(){ - CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); + CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("epmettest","202008"); // //查询总记录数 // List gridScoreDTOList=gridScoreDao.selectList(formDTO); // return new Result>().ok(gridScoreDTOList); + +// cpcIndexCalculateService.cpcIndexCalculate(formDTO); gridCorreLationService.calculateGridCorreLation(formDTO); // deptScoreService.calculateDeptCorreLation(formDTO); 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 138ab5cbb7..0a8740c63b 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 @@ -4,12 +4,12 @@ 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.dto.screencoll.form.IndexDataMonthlyFormDTO; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; +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; /** * 指标采集相关api @@ -51,7 +51,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridpartyability") - public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -67,7 +67,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orgpartyability") - public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -83,7 +83,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridserviceability") - public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -99,7 +99,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orgserviceability") - public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -115,7 +115,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridgovrnability") - public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -131,7 +131,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orggovrnability") - public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -147,7 +147,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("deptgovrnability") - public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); 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 978181b3a4..c6e24b6893 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,12 +1,23 @@ 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; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.DateUtils; +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.CalculateStatus; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.model.CalculateFlagModel; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; 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.web.bind.annotation.PostMapping; @@ -14,7 +25,12 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.PreDestroy; import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.*; /** * 指标计算controller @@ -22,9 +38,16 @@ import java.util.Date; * @author liujianjun@elink-cn.com * @date 2020/8/24 14:38 */ +@Slf4j @RestController @RequestMapping("indexcalculate") public class IndexCalculateController { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("indexcalculate-pool-%d").build(); + ExecutorService singleThreadPool = new ThreadPoolExecutor(1, 1, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + @Autowired private IndexCalculateService indexCalculateService; @@ -32,19 +55,160 @@ public class IndexCalculateController { @Autowired private CpcIndexCalculateService cpcIndexCalculateService; + @Autowired + private RedisUtils redisUtils; + + // 计算同步锁 + private Object statsCalLock = new Object(); + + private Map futureMap = new HashMap<>(); + + @PreDestroy + public void saveCalStatus() { + // 实例销毁之前,将正在本实例中执行计算的客户列表的计算状态修改为pendding,等待其他实例重新计算 + futureMap.forEach((customerId, future) -> { + CalculateFlagModel flag = (CalculateFlagModel) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId)); + flag.setStatus(CalculateStatus.PENDDING); + redisUtils.set(RedisKeys.getCustomerStatsCalFlag(customerId), flag); + log.info("客户【%s】正在执行计算,实例发生重启,修改计算状态为:calculation->pendding", customerId); + }); + } + + /** + * 处理暂停中的计算 + */ + @PostMapping("process-pendding-cals") + public Result processPenddingCalculate() { + String keyPrefix = RedisKeys.getCustomerStatsCalKeyPrefix(); + Set calFlagKeys = redisUtils.keys(keyPrefix.concat("*")); + calFlagKeys.forEach(key -> { + CalculateFlagModel flag = (CalculateFlagModel) redisUtils.get(key); + if (flag != null && CalculateStatus.PENDDING.equals(flag.getStatus())) { + // 找到状态是pendding的key,执行计算 + CalculateCommonFormDTO form = new CalculateCommonFormDTO(); + form.setCustomerId(flag.getForm().getCustomerId()); + form.setMonthId(flag.getForm().getMonthId()); + indexCalculate(form); + } + }); + + return new Result(); + } + /** * 按照客户计算所有指标(按照月份) * * @param formDTO * @return com.epmet.commons.tools.utils.Result - * @Author zhangyong + * @Author zhangyongç * @Date 10:52 2020-08-20 **/ + @ExternalAppRequestAuth @PostMapping("all") - public Result indexCalculate(@RequestBody IndexCalculateForm formDTO) { - Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); - if (aBoolean){ - return new Result().ok(true); + public Result indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) { + String customerId = externalAppRequestParam.getCustomerId(); + //String customerId = "epmettest"; + formDTO.setCustomerId(customerId); + indexCalculate(formDTO); + return new Result().ok(true); + } + + /** + * 指标计算 + * + * @param formDTO + */ + private void indexCalculate(CalculateCommonFormDTO formDTO) { + CalculateFlagModel executeFlag = (CalculateFlagModel) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); + if (executeFlag == null || !CalculateStatus.CALCULATING.equals(executeFlag.getStatus())) { + // 可以计算 + synchronized (statsCalLock) { + CalculateFlagModel executingFlag2 = (CalculateFlagModel) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); + if (executingFlag2 != null && CalculateStatus.CALCULATING.equals(executingFlag2.getStatus())) { + //log.error(String.format("客户【%s】正在执行计算,请勿重复提交计算请求。", customerId)); + throw new RenException(String.format("客户【%s】正在执行计算,请勿重复提交计算请求。", formDTO.getCustomerId())); + } + // 提交异步计算 + submitCalculate(formDTO); + } + } else { + throw new RenException(String.format("客户【%s】正在执行计算,请勿重复提交计算请求。", formDTO.getCustomerId())); + } + } + + /** + * 提交异步计算 + * + * @param formDTO + * @return + */ + private void submitCalculate(CalculateCommonFormDTO formDTO) { + Future future = singleThreadPool.submit(() -> { + try { + long start = System.currentTimeMillis(); + Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); + if (aBoolean) { + log.error("客户Id:{},全部指标计算完成,总耗时:{}秒", formDTO.getCustomerId(), (System.currentTimeMillis() - start) / 1000); + } + + redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); + futureMap.remove(formDTO.getCustomerId()); + + //测试代码 + //try { + // Thread.sleep(20000l); + // System.out.println(System.currentTimeMillis()); + //} catch (InterruptedException e) { + // e.printStackTrace(); + //} + //redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); + //futureMap.remove(formDTO.getCustomerId()); + } catch (Exception e) { + log.warn("submitCalculate exception", e); + } + }); + + futureMap.put(formDTO.getCustomerId(), future); + + CalculateFlagModel flag = new CalculateFlagModel(); + flag.setStatus(CalculateStatus.CALCULATING); + flag.setForm(formDTO); + redisUtils.set(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId()), flag); + } + + /** + * 终止计算 + * + * @param form + * @return + */ + //@ExternalAppRequestAuth + @PostMapping("stopcalculate") + public Result stopcalculate(@RequestBody CalculateCommonFormDTO form) { + ValidatorUtils.validateEntity(form); + + String customerId = form.getCustomerId(); + Future future = this.futureMap.get(customerId); + if (future != null && !future.isCancelled()) { + future.cancel(true); + redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(customerId)); + futureMap.remove(customerId); + HttpClientManager.getInstance().sendAlarmMsg(String.format(EnvEnum.getCurrentEnv().getName() + "数据统计服务-中止计算成功,customerId:%s", customerId)); + } + return new Result(); + } + + @PostMapping("reAll") + public Result calculateAll(@RequestBody CalculateCommonFormDTO formDTO) { + long start = System.currentTimeMillis(); + try { + Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); + if (aBoolean) { + return new Result().ok(true); + } + } catch (Exception e) { + return new Result().error(e.getMessage()); } return new Result().error("指标计算失败"); } 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 new file mode 100644 index 0000000000..09d06df653 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -0,0 +1,388 @@ +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; + +/** + * 孔村大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/9 10:18 + */ +@RestController +@RequestMapping("kcscreencoll") +public class KcScreenCollController { + + @Autowired + private KcScreenCollService kcScreenCollService; + + /** + * 1、首页-平台各类总数上报 + * 当isFirst为true时,后台先按照customerId+dateId,清空数据,再插入。 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 2、议题分析-各类总数 + * 当isFirst为true时,后台先按照customerId+dateId,清空数据,再插入。 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 3、议题分析-参与趋势 + * 当isFirst为true时,customerId+monthId先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 4、用户分析-各类总数 + * 当isFirst为true时根据customerId+dateId删除,后插入 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 5、公益互助-志愿者公益时长排名 + * 当isFirst为true时, 根据customerId清空当前客户下所有用户的信息,再插入 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 6、用户分析-用户趋势 + * 当isFirst为true时,根据monthId+customerId先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 7、公益互助-活动各类总数 + * 当isFirst为true时,根据customerId+dateId先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 8、公益互助-活动次数趋势 + * 当isFirst为true时,根据customerId+monthId先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 9、公益互助-志愿者画像 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 10、项目分析-各类总数 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 11、项目分析-按分类统计 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 12、项目分析-满意度分析 + * 当isFirst为true时,根据 customerId+monthId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 13、党建声音-新闻各类总数汇总 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 14、党建声音-新闻阅读参与趋势 + * 当isFirst为true时,根据 customerId+monthId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 15、党建声音-热度新闻排行 + * 当isFirst为true时,根据 customerId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 16、党建声音-新闻按类别统计 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 17、邻里党群-各类总数汇总 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 18、邻里党群-小组详情 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } + + /** + * 19、邻里党群-话题参与趋势 + * 当isFirst为true时,根据 customerId+monthId 先删后增 + * 所以如果项目上是分批上传,第一次为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()); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java similarity index 73% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java index d83f8df3c5..73d6db7bb6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java @@ -4,27 +4,26 @@ import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.form.*; -import com.epmet.service.evaluationindex.screen.ScreenCollService; +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 java.util.List; /** - * 大屏数据采集api + * 市北大屏数据采集api * * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:25 */ @RestController @RequestMapping("screencoll") -public class ScreenCollController { +public class ShiBeiScreenCollController { @Autowired - private ScreenCollService screenCollService; + private ShiBeiScreenCollService shiBeiScreenCollService; /** * 9、党建引领|基层治理-居民(党员)积分排行榜 @@ -37,8 +36,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("partyuserrankdata") - public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -53,8 +52,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") - public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -69,8 +68,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("meetdata") - public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -85,8 +84,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("orgrankdata") - public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -101,8 +100,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("governrankdata") - public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -117,8 +116,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("eventdata") - public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) { + shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -134,7 +133,7 @@ public class ScreenCollController { @ExternalAppRequestAuth @PostMapping("difficultydata") public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { - screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -149,8 +148,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("cpcbasedata") - public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) { + shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -165,8 +164,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("indexdatamonthly") - public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -183,8 +182,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("indexdatayearly") - public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -199,8 +198,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customerdept") - public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -215,8 +214,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customergrid") - public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -231,8 +230,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customeragency") - public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -247,8 +246,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("usertotaldata") - public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -263,8 +262,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("userjoin") - public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) { + shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -279,8 +278,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("pioneerdata") - public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -296,8 +295,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("publicpartitotaldata") - public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 5cbcfb20e2..3046923a98 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -48,11 +48,10 @@ public interface AgencyScoreDao extends BaseDao { * @Description 删除旧记录 * @param customerId * @param monthId - * @param indexCode * @author zxc * @date 2020/9/2 15:47 */ - void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + Integer deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType,@Param("delNum")Integer delNum); /** * @Description 查询【fact_index_agency_score】相关信息 @@ -83,17 +82,6 @@ public interface AgencyScoreDao extends BaseDao { **/ List selectListAgencyScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - /** - * 批量插入区/街道相关分数表 - * - * @param list - * @param customerId - * @return void - * @Author zhangyong - * @Date 11:11 2020-09-04 - **/ - void batchInsertAgencyScoreData(@Param("list") List list, @Param("customerId")String customerId); - /** * 根据入参查询 区/街道相关分数表id * @param customerId 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 new file mode 100644 index 0000000000..970b671a7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.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.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 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-02 + */ +@Mapper +public interface AgencySubScoreDao extends BaseDao { + + /** + * @param lists + * @Description 【街道】中间表插入 + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertStreetRecord(@Param("lists") List lists); + + /** + * @param customerId + * @param monthId + * @Description 删除旧记录 + * @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); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java similarity index 80% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 40fd49e6ab..95d0f60e84 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -15,12 +15,12 @@ * along with this program. If not, see . */ -package com.epmet.dao.evaluationindex.screen; +package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; -import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunityScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,7 +33,7 @@ import java.util.List; * @since v1.0.0 2020-08-31 */ @Mapper -public interface FactIndexCommunityScoreDao extends BaseDao { +public interface CommunityScoreDao extends BaseDao { /** * @Description 【社区】中间表插入 @@ -47,11 +47,10 @@ public interface FactIndexCommunityScoreDao extends BaseDao selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); - /** - * 批量插入 社区相关分数表 - * - * @param list - * @param customerId - * @return void - * @Author zhangyong - * @Date 11:11 2020-09-04 - **/ - void batchInsertCommunityScoreData(@Param("list") List list, @Param("customerId")String customerId); - /** * 根据入参查询 查询社区id * @param customerId 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 new file mode 100644 index 0000000000..a8d5971cc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.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.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; +import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySubScoreEntity; +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-31 + */ +@Mapper +public interface CommunitySubScoreDao extends BaseDao { + + /** + * @param lists + * @Description 【社区】中间表插入 + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertCommunityPartyRecord(@Param("lists") List lists); + + /** + * @param customerId + * @param monthId + * @Description 删除旧记录 + * @author zxc + * @date 2020/9/1 9:03 上午 + */ + Integer deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("delNum")Integer delNum); + +} 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 9c3d339ae8..c03786ecfe 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 @@ -78,9 +78,9 @@ public interface CpcScoreDao extends BaseDao { **/ BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); - int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("deleteSize") Integer deleteSize, @Param("isTotal") String isTotal); - List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId); + 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); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java new file mode 100644 index 0000000000..cb9b840d60 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.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.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Collection; +import java.util.List; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Mapper +public interface CpcSubScoreDao extends BaseDao { + + /** + * @param customerId + * @param monthId + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值) + * @Date 2020/8/31 10:56 + **/ + BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("gridId") String gridId); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 + * @Date 2020/8/31 12:10 + **/ + List selectListGridContactMassesAvgValue(CalculateCommonFormDTO formDTO); + + /** + * @param calculateCommonFormDTO + * @return java.util.List + * @author yinzuomei + * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 + * @Date 2020/8/31 14:42 + **/ + List selectListJoinIssueAvgValue(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @param customerId + * @param monthId + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 组织内党员的参与议事能力考评分(平均值) + * @Date 2020/8/31 15:51 + **/ + BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode, @Param("deleteSize") Integer deleteSize); + + List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode); + + int insertBatch(@Param("list") Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index 4be461b59a..c236c31e6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -18,6 +18,8 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.DeotScore; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.indexcal.DeptScoreDTO; import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; @@ -45,17 +47,6 @@ public interface DeptScoreDao extends BaseDao { **/ List selectListDeptScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - /** - * 批量插入 区直部门分值表 - * - * @param list - * @param customerId - * @return void - * @Author zhangyong - * @Date 11:11 2020-09-04 - **/ - void batchInsertDeptScoreData(@Param("list") List list, @Param("customerId")String customerId); - /** * 根据入参查询 区直部门分值表id * @param customerId @@ -79,12 +70,34 @@ public interface DeptScoreDao extends BaseDao { /** * @return int - * @param customerId - * @param monthId - * @param deptId + * @param customerId 客户id + * @param monthId 月id + * @param indexCode 不必填 + * @param deleteSize * @author yinzuomei - * @description + * @description 根据客户id+monthId,删除这个月某个指标所有的数据 一次至多删除50条 * @Date 2020/9/7 14:30 **/ - int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, @Param("monthId")String monthId,@Param("deptId") String deptId); + int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, + @Param("monthId")String monthId, + @Param("indexCode") String indexCode, + @Param("deleteSize") Integer deleteSize); + + /** + * @return int + * @param deptScoreEntityList + * @author yinzuomei + * @description 批量插入计算结果 + * @Date 2020/9/10 10:40 + **/ + int insertBatchEntity(@Param("list") List deptScoreEntityList); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 查询每个部门下所有的指标对应的分值 + * @Date 2020/9/10 18:07 + **/ + List selectList(CalculateCommonFormDTO formDTO); } 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 new file mode 100644 index 0000000000..fe388c6b6b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.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.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +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; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface DeptSubScoreDao extends BaseDao { + + /** + * @param insertDeptSubList + * @return int + * @author yinzuomei + * @description 批量插入计算结果 五级指标分数值 + * @Date 2020/9/10 10:39 + **/ + int insertBatchEntity(@Param("list") List insertDeptSubList); + + /** + * @param customerId + * @param monthId + * @param allParentIndexCode + * @param deleteSize 一次至多删除XX条记录 + * @return int + * @author yinzuomei + * @description 批量删除 + * @Date 2020/9/10 12:28 + **/ + int deleteBatches(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("allParentIndexCode") String allParentIndexCode, + @Param("deleteSize") Integer deleteSize); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java index 2e4a10cde2..e4eef189fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java @@ -20,6 +20,8 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.GridScoreDTO; +import com.epmet.dto.screen.FactIndexGridScoreDTO; +import com.epmet.dto.screen.result.SubGridAvgResultDTO; import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -38,16 +40,16 @@ public interface GridScoreDao extends BaseDao { * @param customerId * @param monthId * @param indexCode - * @param isTotal 1:总分;0不是 + * @param deleteSize * @return int * @author yinzuomei * @description * @Date 2020/8/31 14:00 **/ - int deleteByCusAndMonthId(@Param("customerId") String customerId, + int deleteBatches(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, - @Param("isTotal") String isTotal); + @Param("deleteSize") Integer deleteSize); /** * @return int @@ -56,7 +58,7 @@ public interface GridScoreDao extends BaseDao { * @description * @Date 2020/8/31 14:01 **/ - int insertBatches(List gridScoreEntityList); + int insertBatches(@Param("list")List gridScoreEntityList); /** * @return java.util.List @@ -66,4 +68,35 @@ public interface GridScoreDao extends BaseDao { * @Date 2020/8/31 16:42 **/ List selectList(CalculateCommonFormDTO formDTO); + + /** + * @Description 下属所有网格的平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/28 3:20 下午 + */ + List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + + /** + * 根据入参查询 网格相关分值记录 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 根据入参查询 网格id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListGridId(@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/GridSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java new file mode 100644 index 0000000000..1005fcf781 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.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.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity; +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-31 + */ +@Mapper +public interface GridSubScoreDao extends BaseDao { + /** + * @param gridSubScoreEntityList + * @return int + * @author yinzuomei + * @description + * @Date 2020/8/31 14:01 + **/ + int insertBatches(@Param("list") List gridSubScoreEntityList); + + /** + * @param customerId + * @param monthId + * @param allParentIndexCode + * @param deleteSize 一次至多删除XX条记录 + * @return int + * @author yinzuomei + * @description 批量删除 + * @Date 2020/9/10 13:36 + **/ + int deleteBatches(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("allParentIndexCode") String allParentIndexCode, + @Param("deleteSize") Integer deleteSize); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index 5a9350a63e..b4f79644d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -37,24 +37,16 @@ import java.util.Map; public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao { /** * 8、治理能力-部门相关指标 - * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyId - * @param deptId - * @param yearId * @param monthId - * @param quarterId - * @param customerId + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, - @Param("agencyId") String agencyId, - @Param("deptId") String deptId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId); + Integer deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 8、治理能力-部门相关指标 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 55d0e5730b..5e0c308c5f 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 @@ -47,15 +47,12 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao { /** * 7、治理能力-街道及社区相关指标 - * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param quarterId - * @param agencyIds + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId, - @Param("agencyIds") String[] agencyIds); + Integer deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 7、治理能力-街道及社区相关指标 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 ffdc533581..824b7a04a1 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 @@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.GridPartyMemberDataDetailFormDTO; -import com.epmet.dto.indexcollect.form.GridPartyMemberDataFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -46,7 +45,7 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list, - @Param("customerId") String customerId); + @Param("customerId") String customerId); List> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); - Map getExtremeValue(@Param("customerId") String customerId); + Map getExtremeValue(@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/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index aeaf65e6b5..6e2dbcaee5 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 @@ -39,23 +39,16 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao { /** * 4、服务能力-网格相关指标 - * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyId - * @param gridId - * @param yearId * @param monthId - * @param quarterId + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, - @Param("agencyId") String agencyId, - @Param("gridId") String gridId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId); + Integer deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 4、服务能力-网格相关指标 @@ -91,7 +84,7 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao - * 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.screen.FactIndexGridScoreDTO; -import com.epmet.dto.screen.result.SubGridAvgResultDTO; -import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; -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-28 - */ -@Mapper -public interface FactIndexGridScoreDao extends BaseDao { - - /** - * @Description 下属所有网格的平均值 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/28 3:20 下午 - */ - List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); - - /** - * 根据入参查询 网格相关分值记录 - * @param customerId - * @param monthId - * @return java.util.List - * @Author zhangyong - * @Date 10:43 2020-09-03 - **/ - List selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - - /** - * 根据入参查询 网格id - * @param customerId - * @param monthId - * @return java.util.List - * @Author zhangyong - * @Date 10:43 2020-09-03 - **/ - List selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId); - - /** - * 批量插入 网格相关分值表 - * - * @param list - * @param customerId - * @return void - * @Author zhangyong - * @Date 11:11 2020-09-04 - **/ - void batchInsertGridScoreData(@Param("list") List list,@Param("customerId")String customerId); -} 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 17e7a7eb82..d67b86e887 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 @@ -34,4 +34,6 @@ import java.util.List; public interface IndexGroupDetailDao extends BaseDao { List getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode); + + List getAllIndexWeightList(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/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index 8cd75faff7..748d31d161 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 @@ -36,15 +36,14 @@ public interface ScreenCpcBaseDataDao extends BaseDao { /** * 2、党员基本情况 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCpcBaseData(@Param("customerId") String customerId, - @Param("orgIds") String[] orgIds); + Integer deleteCpcBaseData(@Param("customerId") String customerId); /** * 2、党员基本情况 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 4912171860..04e5a0027d 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 @@ -34,37 +34,37 @@ import java.util.List; @Mapper public interface ScreenCustomerAgencyDao extends BaseDao { /** - *14、组织层级 - * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * 14、组织层级 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyIds 组织id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerAgency(@Param("customerId") String customerId, - @Param("agencyIds") String[] agencyIds); + Integer deleteCustomerAgency(@Param("customerId") String customerId); /** * 14、组织层级 - * 2) 在批量新增 + * 2) 在批量新增 * * @param list * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertCustomerAgency(@Param("list") List list, @Param("customerId")String customerId); + void batchInsertCustomerAgency(@Param("list") List list, @Param("customerId") String customerId); /** - * 返回当前客户下,未匹配到的组织信息 - * @param customerId 客户id - * @param agencyIds 组织id集合 + * 返回当前客户下,未匹配到的 【社区级】 组织信息 + * + * @param customerId 客户id + * @param agencyIds 组织id集合 * @return java.util.List * @Author zhangyong * @Date 14:38 2020-09-04 **/ - List selectListMismatcAgencyInfo(@Param("customerId")String customerId, @Param("agencyIds") String[] agencyIds); + List selectListMismatcCommunityAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds); /** * 根据客户id,查询区/街道 组织名称、id @@ -74,5 +74,32 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListAgencyInfo(@Param("customerId")String customerId); + List selectListAgencyInfo(@Param("customerId") String customerId); + + /** + * @param agencyId + * @Description 根据agencyId查询上级组织Id + * @author zxc + * @date 2020/9/8 3:36 下午 + */ + String selectPid(@Param("agencyId") String agencyId); + + /** + * 返回当前客户下,未匹配到的 【乡(镇、街道)级、区县级】 组织信息 + * + * @param customerId 客户id + * @param agencyIds 组织id集合 + * @return java.util.List + * @Author zhangyong + * @Date 14:38 2020-09-04 + **/ + List selectListMismatcStreetAndDistrictAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds); + + /** + * desc:获取客户的组织条数 + * + * @param customerId + * @return + */ + int selectCountByCustomerId(@Param("customerId") String customerId); } 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 53a5fcf042..cbe11d059c 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 @@ -36,15 +36,14 @@ public interface ScreenCustomerDeptDao extends BaseDao /** *16、部门信息上传 - * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param deptIds 部门Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerDept(@Param("customerId") String customerId, - @Param("deptIds") String[] deptIds); + Integer deleteCustomerDept(@Param("customerId") String customerId); /** * 16、部门信息上传 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 005f69289b..c6aac179af 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 @@ -37,15 +37,14 @@ import java.util.List; public interface ScreenCustomerGridDao extends BaseDao { /** *15、网格信息上传 - * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param gridIds 网格Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerGrid(@Param("customerId") String customerId, - @Param("gridIds") String[] gridIds); + Integer deleteCustomerGrid(@Param("customerId") String customerId); /** * 15、网格信息上传 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 412ab70225..d6dfeac5f8 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 @@ -36,7 +36,7 @@ import java.util.List; public interface ScreenDifficultyDataDao extends BaseDao { /** * 3、难点赌点 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除 * @param customerId 一 * @Author zhangyong diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java index 14c0153f62..71c0f203e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java @@ -35,17 +35,14 @@ import java.util.List; public interface ScreenEventDataDao extends BaseDao { /** * 4、事件数据 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId 一 - * @param eventId 多 - * @param orgId 多 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteEventData(@Param("customerId")String customerId, - @Param("eventId")String eventId, - @Param("orgId")String orgId); + Integer deleteEventData(@Param("customerId")String customerId); /** * 4、事件数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java index 835b1f112d..fed3048bba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java @@ -22,6 +22,8 @@ import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 中央区-事件数据图片数据 * @@ -34,10 +36,12 @@ public interface ScreenEventImgDataDao extends BaseDao /** * 根据原始事件Id,进行物理删除 * - * @param eventId + * @param eventIds * @return void * @Author zhangyong * @Date 16:47 2020-08-18 **/ - void delEventImgDataByEventId(@Param("eventId") String eventId); + void delEventImgDataByEvent(@Param("eventIds") String[] eventIds); + + void batchInsertEventImgData(@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 3dca5cc281..24e3d65a09 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 @@ -35,19 +35,16 @@ import java.util.List; public interface ScreenGovernRankDataDao extends BaseDao { /** * 5、基层治理-治理能力数据 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteGovernRankData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteGovernRankData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 5、基层治理-治理能力数据 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 4ebfc825e4..925c5c728f 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 @@ -36,19 +36,16 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao * @Author zhangyong * @Date 15:51 2020-09-04 **/ List selectListIndexDataMonthlyByYear(@Param("customerId") String customerId, - @Param("yearId") String yearId, @Param("month") String month); + @Param("yearId") String yearId, @Param("monthCount") Integer monthCount); + + /** + * 统计 今年,汇总了几个月的 指数统计 + * @param customerId + * @param yearId + * @return java.lang.Integer + * @Author zhangyong + * @Date 18:04 2020-09-11 + **/ + Integer selectCountIndexDataMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId); + + /** + * 批量删除月表数据 + * 根据CUSTOMER_ID、MONTH_ID、ORG_TYPE进行查询,如果有数据,则先进行物理删除, 一次删除1000条 + * + * @param customerId + * @param monthId + * @param orgType + * @return java.util.Integer + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + Integer deleteIndexDataMonthlyByOrgType(@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/evaluationindex/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java index bb2a5eeb6e..7ff9585142 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java @@ -36,17 +36,16 @@ public interface ScreenIndexDataYearlyDao extends BaseDao + * 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.KcActSummaryFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcActSummaryDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-活动各类总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcActSummaryDailyDao extends BaseDao { + + /** + * 根据customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteActSummary(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertActSummary(@Param("list") List list, @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/ScreenKcActTrendMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcActTrendMonthlyDao.java new file mode 100644 index 0000000000..49d63fec9c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcActTrendMonthlyDao.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.KcActTrendFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcActTrendMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-活动(次数+时长)趋势(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcActTrendMonthlyDao extends BaseDao { + + /** + * 按照customerId+monthId,清空数据 + * + * @param customerId + * @param monthId 例:202008 + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteActTrend(@Param("customerId") String customerId, + @Param("monthId") String monthId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param monthId 例:202008 + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertActTrend (@Param("list") List list, @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/screen/ScreenKcGroupDetailGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcGroupDetailGridDailyDao.java new file mode 100644 index 0000000000..c94d1a0f14 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcGroupDetailGridDailyDao.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.KcGroupDetailFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcGroupDetailGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-小组详情(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcGroupDetailGridDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteGroupDetailGrid(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertGroupDetailGrid(@Param("list") List list, @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/ScreenKcGroupSummaryGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcGroupSummaryGridDailyDao.java new file mode 100644 index 0000000000..e942f1d7d7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcGroupSummaryGridDailyDao.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.KcGroupSummaryFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcGroupSummaryGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-小组分析各类总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcGroupSummaryGridDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteGroupSummaryGrid(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertGroupSummaryGrid(@Param("list") List list, @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/ScreenKcIssueSummaryGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcIssueSummaryGridDailyDao.java new file mode 100644 index 0000000000..6e905f0865 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcIssueSummaryGridDailyDao.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.KcIssueSummaryFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcIssueSummaryGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-议题分析(各类总数) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcIssueSummaryGridDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.util.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteIssueSummaryGrid(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertIssueSummaryGrid(@Param("list") List list, @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/ScreenKcIssueTrendGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcIssueTrendGridMonthlyDao.java new file mode 100644 index 0000000000..d6b2db2ef3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcIssueTrendGridMonthlyDao.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.KcIssueTrendFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcIssueTrendGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-议题参与趋势(每天上报当前月)customerId+monthId先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcIssueTrendGridMonthlyDao extends BaseDao { + + /** + * 按照customerId+monthId,清空数据 + * + * @param customerId + * @param monthId 例:202008 + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteIssueTrendGrid(@Param("customerId") String customerId, + @Param("monthId") String monthId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param monthId 例:202008 + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertIssueTrendGrid(@Param("list") List list, @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/screen/ScreenKcNewsCategoryAnalysisDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcNewsCategoryAnalysisDao.java new file mode 100644 index 0000000000..48be92ba09 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcNewsCategoryAnalysisDao.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.KcNewsCategoryAnalysisFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcNewsCategoryAnalysisEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-新闻-按类别统计(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcNewsCategoryAnalysisDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteNewsCategoryAnalysis(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertNewsCategoryAnalysis(@Param("list") List list, @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/ScreenKcNewsRankDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcNewsRankDao.java new file mode 100644 index 0000000000..37d7e0e31e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcNewsRankDao.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.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.KcNewsHotRankFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcNewsRankEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-热点新闻排行-(先根据customerId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcNewsRankDao extends BaseDao { + + /** + * 按照customerId,清空数据 + * + * @param customerId + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteNewsRank(@Param("customerId") String customerId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertNewsRank(@Param("list") List list, @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/ScreenKcNewsSummaryDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcNewsSummaryDailyDao.java new file mode 100644 index 0000000000..ca4414aaf6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcNewsSummaryDailyDao.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.KcNewsSummaryFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcNewsSummaryDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-新闻-各类总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcNewsSummaryDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteNewsSummary(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertNewsSummary(@Param("list") List list, @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/ScreenKcNewsTrendMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcNewsTrendMonthlyDao.java new file mode 100644 index 0000000000..26c018f6fb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcNewsTrendMonthlyDao.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.KcNewsTrendFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcNewsTrendMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-新闻参与趋势-(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcNewsTrendMonthlyDao extends BaseDao { + + /** + * 按照customerId+monthId,清空数据 + * + * @param customerId + * @param monthId 例:202008 + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteNewsTrend(@Param("customerId") String customerId, + @Param("monthId") String monthId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param monthId 例:202008 + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertNewsTrend(@Param("list") List list, @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/screen/ScreenKcPlatformSummaryDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcPlatformSummaryDailyDao.java new file mode 100644 index 0000000000..7762c772bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcPlatformSummaryDailyDao.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.KcHomePageFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcPlatformSummaryDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-平台各汇总值(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcPlatformSummaryDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.util.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deletePlatFormSummary(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertPlatFormSummary(@Param("list") List list, @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/ScreenKcProjectCategoryGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcProjectCategoryGridDailyDao.java new file mode 100644 index 0000000000..2f8e9236b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcProjectCategoryGridDailyDao.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.KcCategorySummaryFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcProjectCategoryGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-项目按分类统计上报总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcProjectCategoryGridDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteCategoryGrid(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertCategoryGrid(@Param("list") List list, @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/ScreenKcProjectSatisGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcProjectSatisGridMonthlyDao.java new file mode 100644 index 0000000000..c2bbdf98e8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcProjectSatisGridMonthlyDao.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.KcProjectSatisanalysisFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcProjectSatisGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-项目满意度分析(customerId+monthId先删除记录,再插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcProjectSatisGridMonthlyDao extends BaseDao { + + /** + * 按照customerId+monthId,清空数据 + * + * @param customerId + * @param monthId 例: 202008 + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteProjectSatisGrid(@Param("customerId") String customerId, + @Param("monthId") String monthId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param monthId 例: 202008 + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertProjectSatisGrid(@Param("list") List list, @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/screen/ScreenKcProjectSummaryGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcProjectSummaryGridDailyDao.java new file mode 100644 index 0000000000..cac89d10c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcProjectSummaryGridDailyDao.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.KcProjectSummaryFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcProjectSummaryGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-项目分析(各类总数先根据customerId+dateId删除,后插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcProjectSummaryGridDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteProjectSummary(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertProjectSummary(@Param("list") List list, @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/ScreenKcTopicTrendGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcTopicTrendGridMonthlyDao.java new file mode 100644 index 0000000000..66e554a9dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcTopicTrendGridMonthlyDao.java @@ -0,0 +1,62 @@ +/** + * 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.KcGroupTopicTrendFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcTopicTrendGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-话题参与趋势(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcTopicTrendGridMonthlyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param monthId 例:202008 + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteTopicTrendGrid(@Param("customerId") String customerId, + @Param("monthId") String monthId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param monthId 例:202008 + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertTopicTrendGrid(@Param("list") List list, @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/screen/ScreenKcUserSummaryDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcUserSummaryDailyDao.java new file mode 100644 index 0000000000..bfaa371bf8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcUserSummaryDailyDao.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.KcUserSummaryFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcUserSummaryDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-用户分析(先根据customerId+dateId删除,后插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcUserSummaryDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteUserSummary(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertUserSummary(@Param("list") List list, @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/ScreenKcUserTrendGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcUserTrendGridMonthlyDao.java new file mode 100644 index 0000000000..a3bb44b7fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcUserTrendGridMonthlyDao.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.KcUserHeartRankFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcUserTrendGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-用户趋势分析(根据monthId+customerId先删后增) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcUserTrendGridMonthlyDao extends BaseDao { + + /** + * 根据monthId+customerId先删后增 + * + * @param customerId + * @param monthId 例:202008 + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteUserTrendGrid(@Param("customerId") String customerId, + @Param("monthId") String monthId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param monthId 例:202008 + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertUserTrendGrid(@Param("list") List list, @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/screen/ScreenKcVolunteerHeatRankGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyDao.java new file mode 100644 index 0000000000..3e0de5f451 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyDao.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.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.KcVolunteerHeartRankFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcVolunteerHeatRankGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-志愿者公益时长排名(先根据customerId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcVolunteerHeatRankGridDailyDao extends BaseDao { + + /** + * 按照customerId,清空数据 + * + * @param customerId + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteVolunteerHeatRankGrid(@Param("customerId") String customerId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertVolunteerHeatRankGrid(@Param("list") List list, @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/ScreenKcVolunteerSummaryDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcVolunteerSummaryDailyDao.java new file mode 100644 index 0000000000..ae2d38d3e5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcVolunteerSummaryDailyDao.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.KcVolunteerSummaryFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenKcVolunteerSummaryDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * KC-志愿者汇总(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Mapper +public interface ScreenKcVolunteerSummaryDailyDao extends BaseDao { + + /** + * 按照customerId+dateId,清空数据 + * + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:14 2020-09-09 + **/ + Integer deleteVolunteerSummary(@Param("customerId") String customerId, + @Param("dateId") String dateId); + + /** + * 批量插入 + * + * @param list + * @param customerId + * @param dateId 日期Id, 数据更新至:yyyyMMdd + * @return void + * @Author zhangyong + * @Date 16:17 2020-09-09 + **/ + void batchInsertVolunteerSummary(@Param("list") List list, @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/ScreenOrgRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java index 00b4599fe4..a49376a255 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java @@ -35,19 +35,16 @@ import java.util.List; public interface ScreenOrgRankDataDao extends BaseDao { /** * 6、党建引领-组织排行 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteOrgRankData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteOrgRankData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 6、党建引领-组织排行 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 3f2de14703..385f27d2f9 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 @@ -35,19 +35,16 @@ import java.util.List; public interface ScreenPartyBranchDataDao extends BaseDao { /** * 7、基层党建-建设情况数据(支部、联建、志愿) - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deletePartyBranchData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deletePartyBranchData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 7、基层党建-建设情况数据(支部、联建、志愿) 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 931c05c6bf..857958ad1c 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 @@ -36,15 +36,14 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao { /** * 10、党建引领-先锋模范数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deletePioneerData(@Param("customerId") String customerId, - @Param("orgIds") String[] orgIds); + Integer deletePioneerData(@Param("customerId") String customerId); /** * 10、党建引领-先锋模范数据 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 5bc9ea4130..fd2fdac941 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 @@ -37,15 +37,14 @@ public interface ScreenPublicPartiTotalDataDao extends BaseDao { /** * 11、基层治理-公众参与 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteUserJoin(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteUserJoin(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 11、基层治理-公众参与 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 5595259af6..f09189dce0 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 @@ -36,15 +36,14 @@ public interface ScreenUserTotalDataDao extends BaseDao + * 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-02 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_agency_sub_score") +public class AgencySubScoreEntity 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; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; + + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java index 0b21c5de92..ee1a68f8eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java @@ -71,15 +71,25 @@ public class CpcScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 指标code */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 是否是总分 1是0不是 + */ + private String isTotal; /** - * 是否是总分 1是0不是 + * 权重(同一组权重总和=1) */ - private String isTotal; + private BigDecimal weight; } 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 new file mode 100644 index 0000000000..f1c79068a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.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.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-08-31 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_cpc_sub_score") +public class CpcSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + + /** + * 年维度Id: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 指标code + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 是否是总分 1是0不是 + */ + private String isTotal; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java index 29857fdc2c..41a5f19188 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java @@ -75,11 +75,20 @@ public class DeptScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 治理能力:zhilinengli; */ - private String indexCode; + private String indexCode; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } 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 new file mode 100644 index 0000000000..191ffb0157 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.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.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-02 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_dept_sub_score") +public class DeptSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门所属的组织id + */ + private String agencyId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 治理能力:zhilinengli; + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunityScoreEntity.java similarity index 85% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunityScoreEntity.java index d99cd7b506..1a2dbe1dfd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunityScoreEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.evaluationindex.screen; +package com.epmet.entity.evaluationindex.indexcal; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -75,11 +75,21 @@ public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } 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 new file mode 100644 index 0000000000..d8938d9018 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java @@ -0,0 +1,70 @@ +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-08-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_sub_score") +public class FactIndexCommunitySubScoreEntity extends BaseEpmetEntity { + private static final long serialVersionUID = -7046354032669198828L; + /** + * 客户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 score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java index 781dca54bf..6831a84e5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java @@ -77,14 +77,23 @@ public class GridScoreEntity extends BaseEpmetEntity { */ private String isTotal; - /** - * 分值 - */ - private BigDecimal score; + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; /** - * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + * 权重(同一组权重总和=1) */ - private String indexCode; - + private BigDecimal weight; } 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 new file mode 100644 index 0000000000..3404fda77d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java @@ -0,0 +1,99 @@ +/** + * 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-08-31 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_grid_sub_score") +public class GridSubScoreEntity 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; + + /** + * 1:总分;0不是 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java index e23472c6a4..fe8ee990b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -98,7 +98,7 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { private BigDecimal satisfactionRatio; /** - * 社区超期项目率,dataTyp=commnuity有值 + * 社区超期项目率,dataTyp=community有值 */ private BigDecimal overdueProjectRatio; 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 e0932daeef..149c4c128c 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 @@ -35,19 +35,24 @@ public class IndexDictEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; - /** - * 指标名 - */ + /** + * 指标名 + */ private String indexName; - /** - * 指标描述 - */ + /** + * 指标编码 + */ + private String indexCode; + + /** + * 指标描述 + */ private String indexDesc; - /** - * 指标级别(1,2,3,4,5) - */ + /** + * 指标级别(1,2,3,4,5) + */ private String level; /** 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 e8d16e858d..0a2fdd7455 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 @@ -92,4 +92,21 @@ public class ScreenIndexDataMonthlyEntity extends BaseEpmetEntity { */ private BigDecimal governAblity; +// PARTY_DEV_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 +// SERVICE_ABLITY_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 +// GOVERN_ABLITY_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 + /** + * 党建能力指数权重 + */ + private BigDecimal partyDevWeight; + + /** + * 服务能力指数 权重 + */ + private BigDecimal serviceAblityWeight; + + /** + * 治理能力分数,权重 + */ + private BigDecimal governAblityWeight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcActSummaryDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcActSummaryDailyEntity.java new file mode 100644 index 0000000000..1cda08cfa7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcActSummaryDailyEntity.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.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; + +/** + * KC-活动各类总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_act_summary_daily") +public class ScreenKcActSummaryDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 活动总数 + */ + private Integer actCount; + + /** + * 志愿者总数 + */ + private Integer volunteerCount; + + /** + * 参与人次 + */ + private Integer partiUserCount; + + /** + * 发放积分 + */ + private Integer rewardPointCount; + + /** + * 公益时长单位分钟 + */ + private Integer heartTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcActTrendMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcActTrendMonthlyEntity.java new file mode 100644 index 0000000000..86c991a114 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcActTrendMonthlyEntity.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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * KC-活动(次数+时长)趋势(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_act_trend_monthly") +public class ScreenKcActTrendMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月id :yyyyMM + */ + private String monthId; + + /** + * 活动数量(本月举行的活动) + */ + private Integer actCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcGroupDetailGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcGroupDetailGridDailyEntity.java new file mode 100644 index 0000000000..8247c51d97 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcGroupDetailGridDailyEntity.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; + +/** + * KC-小组详情(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_group_detail_grid_daily") +public class ScreenKcGroupDetailGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 小组id + */ + private String groupId; + + /** + * 群名称 + */ + private String groupName; + + /** + * 群主名称 + */ + private String groupLeader; + + /** + * 群成员数 + */ + private Integer memberCount; + + /** + * 话题总数 + */ + private Integer topicCount; + + /** + * 转为议题的话题数 + */ + private Integer shifitIssueCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcGroupSummaryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcGroupSummaryGridDailyEntity.java new file mode 100644 index 0000000000..8f29a2829e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcGroupSummaryGridDailyEntity.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; + +/** + * KC-小组分析各类总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_group_summary_grid_daily") +public class ScreenKcGroupSummaryGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 社群总数 + */ + private Integer groupCount; + + /** + * 群成员总数 + */ + private Integer memberCount; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题参与量 + */ + private Integer partiCount; + + /** + * 话题转议题总数 + */ + private Integer shiftIssueCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcIssueSummaryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcIssueSummaryGridDailyEntity.java new file mode 100644 index 0000000000..2d22bf38b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcIssueSummaryGridDailyEntity.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.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; + +/** + * KC-议题分析(各类总数) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_issue_summary_grid_daily") +public class ScreenKcIssueSummaryGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 上报总数 + */ + private Integer reportCount; + + /** + * 议题总数 + */ + private Integer issueCount; + + /** + * 待审核数 + */ + private Integer pendingCount; + + /** + * 已驳回数 + */ + private Integer rejectedCount; + + /** + * 处理中数 + */ + private Integer processingCount; + + /** + * 已关闭数 + */ + private Integer closedCount; + + /** + * 议题浏览数 + */ + private Integer issueViewCount; + + /** + * 表态数 + */ + private Integer voteCount; + + /** + * 审核通过数 ?为了算议题效率 + */ + private Integer passedCount; + + /** + * 转化成项目数 ?为了算议题效率 + */ + private Integer shiftToProjectCount; + + /** + * 平均审核时间单位分钟 ? + */ + private Integer avgAuditTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcIssueTrendGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcIssueTrendGridMonthlyEntity.java new file mode 100644 index 0000000000..85f9cd9d2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcIssueTrendGridMonthlyEntity.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.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; + +/** + * KC-议题参与趋势(每天上报当前月)customerId+monthId先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_issue_trend_grid_monthly") +public class ScreenKcIssueTrendGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月id :yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 议题上报数(本月内上报的议题数量) + */ + private Integer reportCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsCategoryAnalysisEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsCategoryAnalysisEntity.java new file mode 100644 index 0000000000..364a95575a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsCategoryAnalysisEntity.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.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; + +/** + * KC-新闻-按类别统计(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_news_category_analysis") +public class ScreenKcNewsCategoryAnalysisEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 类别id + */ + private String categoryId; + + /** + * 分类名称 + */ + private String categoryName; + + /** + * 新闻的数量 + */ + private Integer newsCount; + + /** + * 阅读的数量 + */ + private Integer readCount; + + /** + * 点赞的数量 + */ + private Integer likeCount; + + /** + * 点踩的数量 + */ + private Integer disLikeCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsRankEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsRankEntity.java new file mode 100644 index 0000000000..5b41cfbe2f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsRankEntity.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; + +import java.util.Date; + +/** + * KC-热点新闻排行-(先根据customerId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_news_rank") +public class ScreenKcNewsRankEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 新闻id + */ + private String newsId; + + /** + * 新闻标题 + */ + private String newsTitle; + + /** + * 新闻热点值 + */ + private Integer hotCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsSummaryDailyEntity.java similarity index 68% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsSummaryDailyEntity.java index 40a112d6d8..d344db9ad2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsSummaryDailyEntity.java @@ -18,58 +18,54 @@ 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; /** - * 社区相关-党建能力【五级权重】分数表 + * KC-新闻-各类总数(先根据customerId+dateId删除) * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 + * @since v1.0.0 2020-09-09 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("fact_index_community_five_score") -public class FactIndexCommunityFiveScoreEntity extends BaseEpmetEntity { +@TableName("screen_kc_news_summary_daily") +public class ScreenKcNewsSummaryDailyEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; /** - * 机关ID - */ - private String agencyId; - - /** - * 月度ID + * 客户Id */ - private String monthId; + private String customerId; /** - * 季度ID + * 数据更新至:yyyyMMdd */ - private String quarterId; + private String dateId; /** - * 年度ID + * 文章总数 */ - private String yearId; + private Integer newsCount; /** - * 指标ID + * 阅读量 */ - private String indexId; + private Integer readCount; /** - * 分数 + * 点赞量 */ - private BigDecimal score; + private Integer likeCount; /** - * 发文数量:publish_article + * 评论量 */ - private String type; + private Integer commentCount; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsTrendMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsTrendMonthlyEntity.java new file mode 100644 index 0000000000..d63a96ee08 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsTrendMonthlyEntity.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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * KC-新闻参与趋势-(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_news_trend_monthly") +public class ScreenKcNewsTrendMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月id :yyyyMM + */ + private String monthId; + + /** + * 参与数量 + */ + private Integer partiCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcPlatformSummaryDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcPlatformSummaryDailyEntity.java new file mode 100644 index 0000000000..2f9c5343c8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcPlatformSummaryDailyEntity.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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * KC-平台各汇总值(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_platform_summary_daily") +public class ScreenKcPlatformSummaryDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格总数 + */ + private Integer gridCount; + + /** + * 已开通网格数 + */ + private Integer openedGridCount; + + /** + * 议题总数 + */ + private Integer issueCount; + + /** + * 项目总数 + */ + private Integer projectCount; + + /** + * 用户总数 + */ + private Integer userCount; + + /** + * 党员用户 + */ + private Integer partyUserCount; + + /** + * 社群总数 + */ + private Integer groupCount; + + /** + * 话题总数 + */ + private Integer topicCount; + + /** + * 新闻数量 + */ + private Integer newsCount; + + /** + * 阅读数量 + */ + private Integer readCount; + + /** + * 公益活动总数 + */ + private Integer actCount; + + /** + * 志愿者总数 + */ + private Integer volunteerCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectCategoryGridDailyEntity.java new file mode 100644 index 0000000000..ba35584411 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectCategoryGridDailyEntity.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.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; + +/** + * KC-项目按分类统计上报总数(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_project_category_grid_daily") +public class ScreenKcProjectCategoryGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 一级类别id + */ + private String categoryId; + + /** + * 一级分类名称 + */ + private String categoryName; + + /** + * 项目数量 + */ + private Integer projectCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectSatisGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectSatisGridMonthlyEntity.java new file mode 100644 index 0000000000..be5d16142e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectSatisGridMonthlyEntity.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.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; + +/** + * KC-项目满意度分析(customerId+monthId先删除记录,再插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_project_satis_grid_monthly") +public class ScreenKcProjectSatisGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月id :yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 非常满意项目总数 + */ + private Integer greatSatis; + + /** + * 满意项目总数 + */ + private Integer goodSatis; + + /** + * 不满意的项目总数 + */ + private Integer disSatis; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectSummaryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectSummaryGridDailyEntity.java new file mode 100644 index 0000000000..85a387c49b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectSummaryGridDailyEntity.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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * KC-项目分析(各类总数先根据customerId+dateId删除,后插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_project_summary_grid_daily") +public class ScreenKcProjectSummaryGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 项目总数 + */ + private Integer projectCount; + + /** + * 处理中数 + */ + private Integer processingCount; + + /** + * 已关闭数 + */ + private Integer closedCount; + + /** + * 流转次数 + */ + private Integer moveCount; + + /** + * 已结案数量 + */ + private Integer closedCaseCount; + + /** + * 项目浏览数 + */ + private Integer projectViewCount; + + /** + * 表态数 + */ + private Integer voteCount; + + /** + * 平均结案时间 单位分钟 ? + */ + private Integer avgClosedCaseTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcTopicTrendGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcTopicTrendGridMonthlyEntity.java new file mode 100644 index 0000000000..0f0a5b4e6c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcTopicTrendGridMonthlyEntity.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.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; + +/** + * KC-话题参与趋势(先根据customerId+monthId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_topic_trend_grid_monthly") +public class ScreenKcTopicTrendGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月id :yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 话题数量(所在月新增话题数) + */ + private Integer topicCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcUserSummaryDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcUserSummaryDailyEntity.java new file mode 100644 index 0000000000..6c47a97487 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcUserSummaryDailyEntity.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.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; + +/** + * KC-用户分析(先根据customerId+dateId删除,后插入) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_user_summary_daily") +public class ScreenKcUserSummaryDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 浏览用户(首页的用户总数,原型上首页是叫注册用户) + */ + private Integer visitorCount; + + /** + * 注册用户=居民数量 + */ + private Integer regUserCount; + + /** + * 党员用户 + */ + private Integer partyUserCount; + + /** + * 小于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; + + /** + * 党员中男性总人数 + */ + private Integer malePartyUserCount; + + /** + * 党员中女性总人数 + */ + private Integer femalePartyUserCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcUserTrendGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcUserTrendGridMonthlyEntity.java new file mode 100644 index 0000000000..70b51169da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcUserTrendGridMonthlyEntity.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.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; + +/** + * KC-用户趋势分析(根据monthId+customerId先删后增) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_user_trend_grid_monthly") +public class ScreenKcUserTrendGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月id :yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 本月内新增用户数量 + */ + private Integer regUserCount; + + /** + * 本月内新增党员数量 + */ + private Integer partyUserCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyEntity.java new file mode 100644 index 0000000000..a681c2bca0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyEntity.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.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; + +/** + * KC-志愿者公益时长排名(先根据customerId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_volunteer_heat_rank_grid_daily") +public class ScreenKcVolunteerHeatRankGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 用户id + */ + private String userId; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 爱心时长 单位分钟 + */ + private Integer heartTime; + + /** + * 积分09-11新增 + */ + private Integer points; + + /** + * 志愿者id 09-11新增 + */ + private String volunteerId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcVolunteerSummaryDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcVolunteerSummaryDailyEntity.java new file mode 100644 index 0000000000..dc3f16f2c0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcVolunteerSummaryDailyEntity.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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * KC-志愿者汇总(先根据customerId+dateId删除) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_kc_volunteer_summary_daily") +public class ScreenKcVolunteerSummaryDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 小于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; + + /** + * 志愿者中男性总人数 + */ + private Integer maleCount; + + /** + * 志愿者中女性总人数 + */ + private Integer femaleCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index a49d1a1e13..04db895412 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -1,7 +1,5 @@ package com.epmet.eum; -import com.epmet.dto.indexcal.CalculateCommonFormDTO; - /** * 需要计算指标code枚举类 * @@ -9,43 +7,58 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO; * @date 2020-08-26 11:14 **/ public enum IndexCodeEnum { - DANG_YUAN_XIANG_GUAN("dangyuanxiangguan", "党员相关", 1), - WANG_GE_XIANG_GUAN("wanggexiangguan", "网格相关", 1), - SHE_QU_XIANG_GUAN("shequxiangguan", "社区相关", 1), - JIE_DAO_XIANG_GUAN("jiedaoxiangguan", "街道相关", 1), - QU_ZHI_BU_MEN("quzhibumen", "区直部门", 1), - QUAN_QU_XIANG_GUAN("quanquxiangguan", "全区相关", 1), + DANG_YUAN_XIANG_GUAN("dangyuanxiangguan", "党员相关", 1, false), + WANG_GE_XIANG_GUAN("wanggexiangguan", "网格相关", 1, false), + SHE_QU_XIANG_GUAN("shequxiangguan", "社区相关", 1, false), + JIE_DAO_XIANG_GUAN("jiedaoxiangguan", "街道相关", 1, false), + QU_ZHI_BU_MEN("quzhibumen", "区直部门", 1, false), + QUAN_QU_XIANG_GUAN("quanquxiangguan", "全区相关", 1, false), + + DANG_JIAN_NENG_LI("dangjiannengli", "党建能力", 2, false), + ZHI_LI_NENG_LI("zhilinengli", "治理能力", 2, false), + FU_WU_NENG_LI("fuwunengli", "服务能力", 2, false), - DANG_JIAN_NENG_LI("dangjiannengli", "党建能力", 2), - ZHI_LI_NENG_LI("zhilinengli", "治理能力", 2), - FU_WU_NENG_LI("fuwunengli", "服务能力", 2), + CAN_YU_YI_SHI("canyuyishi", "参与议事", 4, false), + DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4, false), + LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4, false), - CAN_YU_YI_SHI("canyuyishi", "参与议事", 4), - DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), - LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), - ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5), - ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), - XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz","下属所有网格的党建能力(平均值)",5), - SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz","社区下属所有网格治理能力汇总(平均值)",5), - SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz","社区下级所有网格服务能力得分(平均值) ",5), - JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ("jiedaoxiashusysqdjnlhzpjz","街道下属所有社区党建能力汇总(平均值)",5), - JIE_DAO_XIA_SHU_SYSQZLNLHZ("jiedaoxiashusysqzlnlhz","街道下属所有社区治理能力汇总 (平均值) ",5), - JIE_DAO_XIA_SHU_SQFWNLDFPYZ("jiedaoxiashusqfwnldfpjz","街道下属社区服务能力得分 (平均值) ",5), - QU_XIA_SHU_JIE_DFWNLHZPJZ("quxiashujiedfwnlhzpjz","区下属街道服务能力汇总(平均值)",5), - QU_XIA_JI_JIE_DDJNLHZPJZ("quxiajijieddjnlhzpjz","区下级街道党建能力汇总(平均值)",5), - SUO_YOU_JIE_DAO_ZLNLPJZ("suoyoujiedaozlnlpjz","所有街道治理能力(平均值)",5), - SUO_YOU_ZHI_SHU_BMZLNLPJZ("suoyouzhishubmzlnlpjz","所有直属部门治理能力(平均值)",5), + ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz", "组织内党员的联系群众能力考评分(平均值)", 5, true), + ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz", "组织内党员的参与议事能力考评分(平均值)", 5, true), + XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz", "下属所有网格的党建能力(平均值)", 5, true), + SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz", "社区下属所有网格治理能力汇总(平均值)", 5, true), + SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz", "社区下级所有网格服务能力得分(平均值) ", 5, true), + JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ("jiedaoxiashusysqdjnlhzpjz", "街道下属所有社区党建能力汇总(平均值)", 5, true), + JIE_DAO_XIA_SHU_SYSQZLNLHZ("jiedaoxiashusysqzlnlhz", "街道下属所有社区治理能力汇总 (平均值) ", 5, true), + JIE_DAO_XIA_SHU_SQFWNLDFPYZ("jiedaoxiashusqfwnldfpjz", "街道下属社区服务能力得分 (平均值) ", 5, true), + QU_XIA_SHU_JIE_DFWNLHZPJZ("quxiashujiedfwnlhzpjz", "区下属街道服务能力汇总(平均值)", 5, true), + QU_XIA_JI_JIE_DDJNLHZPJZ("quxiajijieddjnlhzpjz", "区下级街道党建能力汇总(平均值)", 5, true), + SUO_YOU_JIE_DAO_ZLNLPJZ("suoyoujiedaozlnlpjz", "所有街道治理能力(平均值)", 5, true), + SUO_YOU_ZHI_SHU_BMZLNLPJZ("suoyouzhishubmzlnlpjz", "所有直属部门治理能力(平均值)", 5, true), ; + /** + * code + */ private String code; + /** + * name + */ private String name; + /** + * 等级 + */ private Integer level; + /** + * 是否是平均值 + */ + private Boolean isAvgIndex; - IndexCodeEnum(String code, String name, Integer level) { + IndexCodeEnum(String code, String name, Integer level, Boolean isAvgIndex) { this.code = code; this.name = name; this.level = level; + this.isAvgIndex = isAvgIndex; } public static IndexCodeEnum getEnum(String code) { @@ -58,6 +71,16 @@ public enum IndexCodeEnum { return null; } + public static boolean isAvgIndex(String code) { + IndexCodeEnum[] values = IndexCodeEnum.values(); + for (IndexCodeEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value.isAvgIndex; + } + } + return false; + } + public String getCode() { return code; 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 new file mode 100644 index 0000000000..95d114ae16 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/CalculateFlagModel.java @@ -0,0 +1,20 @@ +package com.epmet.model; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import lombok.Data; + +@Data +public class CalculateFlagModel { + + /** + * 提交计算时候的参数 + */ + private CalculateCommonFormDTO form; + + /** + * 计算状态 + * CalculateStatus.java + */ + private String status; + +} 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 3fec1a9132..57eead6c35 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 @@ -92,7 +92,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { threshold = "-1"; } else if (data.getThreshold().contains("%")) { String thresholdStr = data.getThreshold().replace("%", ""); - threshold = new BigDecimal(thresholdStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP).toString(); + threshold = new BigDecimal(thresholdStr).toString(); } data.setThreshold(threshold); } @@ -266,6 +266,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity.setIndexName(data.getLevel1Index()); entity.setCorrelation(data.getCorrelation()); entity.setLevel("1"); + entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel1Index(), false, 4)); indexDicMap.put(data.getLevel1Index(), entity); } if (!indexDicMap.containsKey(data.getLevel2Index())) { @@ -273,6 +274,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity2.setIndexName(data.getLevel2Index()); entity2.setCorrelation(data.getCorrelation()); entity2.setLevel("2"); + entity2.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4)); indexDicMap.put(data.getLevel2Index(), entity2); } if (!indexDicMap.containsKey(data.getLevel3Index())) { @@ -280,6 +282,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity3.setIndexName(data.getLevel3Index()); entity3.setCorrelation(data.getCorrelation()); entity3.setLevel("3"); + entity3.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4)); indexDicMap.put(data.getLevel3Index(), entity3); } if (!indexDicMap.containsKey(data.getLevel4Index())) { @@ -287,6 +290,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity4.setIndexName(data.getLevel4Index()); entity4.setCorrelation(data.getCorrelation()); entity4.setLevel("4"); + entity4.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4)); indexDicMap.put(data.getLevel4Index(), entity4); } if (!indexDicMap.containsKey(data.getLevel5Index())) { @@ -294,6 +298,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity5.setIndexName(data.getLevel5Index()); entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); + entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); indexDicMap.put(data.getLevel5Index(), entity5); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCalRedis.java similarity index 67% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCalRedis.java index 8a99d62890..8e1c769d14 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCalRedis.java @@ -24,12 +24,13 @@ import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; +import java.math.BigDecimal; import java.util.Map; import java.util.concurrent.TimeUnit; @Slf4j @Component -public class IndexCodeFieldReRedis { +public class IndexCalRedis { @Autowired private RedisTemplate redisTemplate; @@ -54,9 +55,37 @@ public class IndexCodeFieldReRedis { /** * desc:删除指标字段关系缓存 + * * @return */ public Boolean deleteIndexCodeFromRedis() { return redisTemplate.delete(RedisKeys.getIndexCodeFieldReKey()); } + + /** + * @Description 获取指标权重 + */ + public Map getIndexCodeWeightMap(String customerId) { + HashOperations hashOperations = redisTemplate.opsForHash(); + Map values = hashOperations.entries(RedisKeys.getIndexCodeWeightKey(customerId)); + return values; + } + + /** + * @Description 存入指标权重 + */ + public void setIndexCodeWeightMap(String customerId, Map records) { + HashOperations hashOperations = redisTemplate.opsForHash(); + hashOperations.putAll(RedisKeys.getIndexCodeWeightKey(customerId), records); + redisTemplate.expire(RedisKeys.getIndexCodeFieldReKey(), 1, TimeUnit.DAYS); + } + + /** + * desc:删除指标权重缓存 + * + * @return + */ + public Boolean deleteIndexCodeWeightFromRedis(String customerId) { + return redisTemplate.delete(RedisKeys.getIndexCodeWeightKey(customerId)); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java index a93697ce12..994f8818fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java @@ -3,6 +3,7 @@ package com.epmet.service.evaluationindex.indexcal; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import java.math.BigDecimal; @@ -52,5 +53,5 @@ public interface GridCorreLationService { * @description 通用计算方法 * @Date 2020/9/3 16:07 **/ - HashMap calculate(Map> indexMap); + HashMap calculate(Map> indexMap); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java index a1ab0ad1bf..7866473d6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.indexcal; -import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; /** * 指标计算service @@ -11,8 +11,9 @@ import com.epmet.dto.screen.form.IndexCalculateForm; public interface IndexCalculateService { /** * desc:按照客户计算所有指标(按照月份) + * * @param formDTO * @return */ - Boolean indexCalculate(IndexCalculateForm formDTO); + Boolean indexCalculate(CalculateCommonFormDTO formDTO); } 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 52cb4e3fc6..71359d8b32 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 @@ -9,9 +9,11 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; 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.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; @@ -23,9 +25,11 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; 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; @@ -33,7 +37,11 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @Slf4j @@ -43,11 +51,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @Autowired - private IndexGroupDetailService getDetailListByParentCode; + private IndexGroupDetailService indexGroupDetailService; @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired private CpcScoreDao cpcScoreDao; + @Autowired + private CpcSubScoreDao cpcSubScoreDao; @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { @@ -63,39 +73,70 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { */ private void calculateTotalScore(CalculateCommonFormDTO formDTO) { //获取指标权重 - List parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + List parentIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); if (CollectionUtils.isEmpty(parentIndexDetails)) { - log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【党员相关】指标权重信息不存在"); + log.error("cpcIndexCalculate customerId:{} have not init index", formDTO.getCustomerId()); + throw new RenException("客户Id:" + formDTO.getCustomerId() + "【党员相关】指标权重信息不存在"); } - Map cpcScoreTotalMap = new HashMap<>(); Map indexWeightMap = parentIndexDetails.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o)); + int pageNo = NumConstant.ONE; + int pageSize = IndexCalConstant.PAGE_SIZE; + List list = null; - //获取数据 - List list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId()); - if (CollectionUtils.isEmpty(list)) { - log.error("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); - throw new RenException("客户四级指标分值记录不存在"); - } - Map> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); - userGroupMap.forEach((userId, partScoreList) -> { - CpcScoreEntity totalEntity = null; - for (CpcScoreEntity part : partScoreList) { - IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode()); - if (totalEntity == null) { - totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); - totalEntity.setIsTotal(NumConstant.ONE_STR); - totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); - totalEntity.setScore(new BigDecimal(0)); - cpcScoreTotalMap.put(userId, totalEntity); - } - //自建群活跃度——议题转项目率 有阈值 >60%按60%算 - BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); - log.info("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); - totalEntity.setScore(totalEntity.getScore().add(total)); + Map cpcScoreTotalMap = new HashMap<>(); + Map userTotalCount = new HashMap<>(); + //删除总分 然后插入 + int effectRow; + do { + effectRow = cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCalConstant.DELETE_SIZE, NumConstant.ONE_STR); + } while (effectRow > NumConstant.ZERO); + do { + List result = new ArrayList<>(); + //获取数据 + list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), (pageNo - NumConstant.ONE) * pageSize, pageSize); + pageNo++; + if (CollectionUtils.isEmpty(list)) { + log.warn("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); + } else { + Map> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); + userGroupMap.forEach((userId, partScoreList) -> { + CpcScoreEntity totalEntity = null; + for (CpcScoreEntity part : partScoreList) { + IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode()); + if (indexGroupDetailEntity == null) { + log.error(" indexCode:{} 在指标明细中不存在", part.getIndexCode()); + continue; + } + if (totalEntity == null) { + totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); + totalEntity.setIsTotal(NumConstant.ONE_STR); + totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + totalEntity.setScore(new BigDecimal(NumConstant.ZERO)); + totalEntity.setAllParentIndexCode(NumConstant.ZERO_STR); + totalEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + cpcScoreTotalMap.put(userId, totalEntity); + } + //自建群活跃度——议题转项目率 有阈值 >60%按60%算 + BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); + AtomicInteger atomicInteger = userTotalCount.get(part.getUserId()); + + if (atomicInteger == null) { + atomicInteger = new AtomicInteger(0); + userTotalCount.put(part.getUserId(), atomicInteger); + } + int totalCount = atomicInteger.addAndGet(1); + //todo 次代码限制了 党员的 4级指标的个数 看看是否还有更好的方式 + if (totalCount == 3) { + result.add(totalEntity); + } + log.info("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); + totalEntity.setScore(totalEntity.getScore().add(total)); + } + }); } - }); - deleteAndInsertBatch(formDTO, cpcScoreTotalMap.values().stream().collect(Collectors.toList()), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + insertCpcScoreBatch(formDTO, result, IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + } while (!CollectionUtils.isEmpty(list) && list.size() == pageSize); + } /** @@ -130,14 +171,18 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param indexCode 指标code 非必填 * @param values */ - private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection values, String indexCode) { - cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); - cpcScoreDao.insertBatch(values); + public void insertCpcScoreBatch(CalculateCommonFormDTO formDTO, List values, String indexCode) { + if (CollectionUtils.isEmpty(values)) { + log.warn("insertCpcScoreBatch要插入的数据为空,param:{},indexCode:{}", JSON.toJSONString(formDTO), indexCode); + return; + } + List> partition = ListUtils.partition(values, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> cpcScoreDao.insertBatch(list)); } private void calculatePartScore(CalculateCommonFormDTO formDTO) { //计算最大最小值 - Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); + 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("指标原始数据记录不存在"); @@ -150,34 +195,38 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } int pageNo = NumConstant.ONE; - int pageSize = NumConstant.ONE_THOUSAND; + int pageSize = IndexCalConstant.PAGE_SIZE; //分页查询 要计算的原始数据 List> list = null; + groupIndexDetailsMap.keySet().forEach(indexCode -> deleteOldData(formDTO, indexCode)); do { list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); if (!CollectionUtils.isEmpty(list)) { - //如果是第一页且仅有一条数据 则直接给50分 - if (pageNo == NumConstant.ONE && list.size() == NumConstant.ONE) { - List insertList = new ArrayList<>(); - for (String parentIndexCode : groupIndexDetailsMap.keySet()) { - insertList.add(handleOneGridScene(formDTO, parentIndexCode, list.get(0))); - } - if (CollectionUtils.isEmpty(insertList)) { - deleteAndInsertBatch(formDTO, insertList, null); - } - } else { - //遍历指标分组 计算分数 - for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { - String parentIndexCode = entry.getKey(); - List details = entry.getValue(); - calculateScore(formDTO, details, list, minAndMaxMap, parentIndexCode); - } + //遍历指标分组 计算分数 + for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { + String indexCode = entry.getKey(); + List details = entry.getValue(); + calculateScore(formDTO, details, list, minAndMaxMap, indexCode); } } pageNo++; } while (!CollectionUtils.isEmpty(list) && list.size() == pageSize); } + @Transactional(rollbackFor = Exception.class) + public void deleteOldData(CalculateCommonFormDTO formDTO, String indexCode) { + int effectRow; + do { + effectRow = cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, IndexCalConstant.DELETE_SIZE, NumConstant.ZERO_STR); + } while (effectRow > NumConstant.ZERO); + effectRow = NumConstant.ZERO; + do { + //删除 党员相关:(参与议事等4级指标的 明细数据) + String allParentCode = IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode().concat(StrConstant.COLON).concat(indexCode); + effectRow = cpcSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), allParentCode, IndexCalConstant.DELETE_SIZE); + } while (effectRow > NumConstant.ZERO); + } + /** * desc:计算并保存中间结果 * @@ -213,9 +262,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { cpcScoreEntity.setUserId(userId); cpcScoreEntity.setIsTotal(NumConstant.ZERO_STR); cpcScoreEntity.setMonthId(formDTO.getMonthId()); - cpcScoreEntity.setScore(new BigDecimal(0)); + cpcScoreEntity.setScore(new BigDecimal(NumConstant.ZERO)); cpcScoreEntity.setIndexCode(parentIndexCode); - + cpcScoreEntity.setAllParentIndexCode(value.getAllParentIndexCode()); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(formDTO.getCustomerId(), value.getAllParentIndexCode()); + cpcScoreEntity.setWeight(weight); scoreEntityMap.put(userId, cpcScoreEntity); //构造样本值对象 @@ -224,7 +275,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } } log.info("计算的参数:{}", JSON.toJSONString(indexMap)); - HashMap result = calculateScore(indexMap); + HashMap result = calculateScore(indexMap); log.info("计算的结果:{}", result); //处理结果 @@ -243,16 +294,48 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param parentIndexCode * @param result */ - @Transactional(rollbackFor = Exception.class) - public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { + public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { List list = new ArrayList<>(); - result.forEach((userId, score) -> { + List subList = new ArrayList<>(); + String allParentIndexCode = null; + for (Map.Entry entry : result.entrySet()) { + String userId = entry.getKey(); + CalculateResult score = entry.getValue(); CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); - cpcScoreEntity.setScore(score); + cpcScoreEntity.setScore(score.getTotalScore()); + allParentIndexCode = score.getDetails().get(NumConstant.ZERO).getAllParentIndexCode(); + cpcScoreEntity.setAllParentIndexCode(allParentIndexCode.substring(NumConstant.ZERO, allParentIndexCode.lastIndexOf(StrConstant.COLON))); list.add(cpcScoreEntity); - }); - this.deleteAndInsertBatch(formDTO, list, parentIndexCode); + CpcScoreEntity parent = ConvertUtils.sourceToTarget(cpcScoreEntity, CpcScoreEntity.class); + score.getDetails().forEach(o -> { + CpcSubScoreEntity child = ConvertUtils.sourceToTarget(parent, CpcSubScoreEntity.class); + child.setIndexCode(o.getIndexCode()); + child.setAllParentIndexCode(o.getAllParentIndexCode()); + child.setScore(o.getScore()); + child.setWeight(o.getWeight()); + subList.add(child); + }); + + } + this.insertCpcScoreBatch(formDTO, list, parentIndexCode); + this.insertCpcSubScoreBatch(formDTO, subList, allParentIndexCode); + } + + /** + * desc:根据客户id和月份Id 指标code 非必填 删除数据 + * + * @param formDTO + * @param subList + * @param parentIndexCode 指标code 非必填 + */ + public void insertCpcSubScoreBatch(CalculateCommonFormDTO formDTO, List subList, String parentIndexCode) { + if (CollectionUtils.isEmpty(subList)) { + log.warn("insertCpcScoreBatch要插入的数据为空,param:{},indexCode:{}", JSON.toJSONString(formDTO), parentIndexCode); + return; + } + List> partition = ListUtils.partition(subList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> cpcSubScoreDao.insertBatch(list)); } @@ -285,7 +368,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); //如果最大值超过阈值 则最大值为阈值 if (new BigDecimal(NumConstant.ONE_NEG).compareTo(index.getThreshold()) != NumConstant.ZERO - && maxValue.compareTo(new BigDecimal(NumConstant.ONE_NEG)) == NumConstant.ONE) { + && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) { maxValue = index.getThreshold(); } //分值计算器 @@ -295,7 +378,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { ScoreConstants.MAX_SCORE, Correlation.getCorrelation(index.getCorrelation()) ); - IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); + + IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), index.getAllParentIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), IndexCodeEnum.isAvgIndex(index.getIndexCode()), scoreCalculator); map.put(index.getIndexCode(), indexInputVO); } return map; @@ -307,11 +391,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param indexMap * @return */ - private HashMap calculateScore(Map> indexMap) { + private HashMap calculateScore(Map> indexMap) { //构造入参 List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + return batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); } @@ -323,17 +407,17 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { */ private Map> getIndexDetailMap(CalculateCommonFormDTO formDTO) { //获取指标权重信息 -参与议事 - List canyuyishiIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); + List canyuyishiIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); return null; } - List dangwuhongdongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); + List dangwuhongdongIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); return null; } - List lianxiqunzhongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); + List lianxiqunzhongIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); return null; 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 959f3caa64..6266d20651 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 @@ -17,21 +17,24 @@ package com.epmet.service.evaluationindex.indexcal.impl; -import com.alibaba.fastjson.JSON; 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.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.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcal.DeptSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; 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.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; @@ -43,9 +46,12 @@ 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 com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.IndexScoreVo; import com.epmet.support.normalizing.batch.SampleValue; 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; @@ -57,6 +63,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** @@ -70,7 +78,7 @@ import java.util.Map; @Service public class DeptScoreServiceImpl extends BaseServiceImpl implements DeptScoreService { @Autowired - private IndexGroupDetailService getDetailListByParentCode; + private IndexGroupDetailService indexGroupDetailService; @Autowired private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; @Autowired @@ -81,38 +89,48 @@ public class DeptScoreServiceImpl extends BaseServiceImpl indexGroupDetailEntityList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), + //1、区直部门-治理能力下五级指标分值计算+ 治理能力总分计算 + calculateZhiLiNengLiScore(formDTO); + //2、区直部门 总分计算 + calculateDeptTotalScore(formDTO); + return true; + } + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 区直部门-党建能力分值计算 + * @Date 2020/9/10 17:21 + **/ + private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) { + //获取区直部门的治理能力下,五级指标权重 + List indexGroupDetailEntityList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.QU_ZHI_BU_MEN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(indexGroupDetailEntityList)) { - log.warn("calculateDeptCorreLation customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【区直部门:治理能力】指标权重信息不存在"); + log.error("calculateDeptCorreLation customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【区直部门:治理能力】下级指标权重信息不存在"); } - log.info(JSON.toJSONString(indexGroupDetailEntityList)); - + // log.info(JSON.toJSONString(indexGroupDetailEntityList)); //1、查询总记录数 int total = factIndexGovrnAblityDeptMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId=%s,monthId=%s,fact_index_govrn_ablity_dept_monthly have not any fact record", formDTO.getCustomerId(), formDTO.getMonthId())); - return Boolean.FALSE; - } else if (NumConstant.ONE == total) { - //只有一个网格时 - log.warn(String.format("customerId:%s,monthId:%s,only one fact_index_govrn_ablity_dept_monthly record", formDTO.getCustomerId(), formDTO.getMonthId())); - this.handleOneGridScene(formDTO); - return Boolean.TRUE; + return; } - //2、计算最大最小值 Map minAndMaxMap = factIndexGovrnAblityDeptMonthlyDao.selectExtremeValue(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { @@ -121,7 +139,10 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> indexMap = buildDeptCorrelationIndexInputVO(indexGroupDetailEntityList, minAndMaxMap); - //4、分批计算 + //4、先全部删除,后批量插入 + //quzhibumen:zhilinengli + deleteBeforeDataList(formDTO,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.DEPT_ZL_ALL_PARENT_INDEX_CODE); + //5、分批计算 int pageNo = NumConstant.ONE; int pageSize = IndexCalConstant.PAGE_SIZE; //分页查询 要计算的原始数据 @@ -134,7 +155,96 @@ public class DeptScoreServiceImpl extends BaseServiceImpl 0); - return true; + log.info("区直部门-治理能力- 计算完成"); + } + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 区直部门总分 + * @Date 2020/9/10 17:20 + **/ + private void calculateDeptTotalScore(CalculateCommonFormDTO formDTO) { + //计算区直部门总分 + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateDeptTotalScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【区直部门】下级指标权重信息不存在"); + } + //查询总记录数 + List deptScoreDTOList = deptScoreDao.selectList(formDTO); + if(CollectionUtils.isEmpty(deptScoreDTOList)){ + log.warn("calculateDeptTotalScore deptScoreDao.selectList return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); +// throw new RenException("客户一级指标分值记录不存在"); + log.warn(String.format("customerId=%s,monthId=%s,fact_index_dept_score have not any fact record", formDTO.getCustomerId(), formDTO.getMonthId())); + return; + } + Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); + List deotScoreEntityList = new ArrayList<>(); + for (DeotScore deptScore : deptScoreDTOList) { + DeptScoreEntity deptScoreEntity = ConvertUtils.sourceToTarget(deptScore, DeptScoreEntity.class); + deptScoreEntity.setIsTotal(NumConstant.ONE_STR); + deptScoreEntity.setIndexCode(IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); + deptScoreEntity.setScore(BigDecimal.ZERO); + deptScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR); + deptScoreEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + for (DeptScoreDetailDTO deptScoreDetailDTO : deptScore.getDetailList()) { + BigDecimal indexScore = deptScoreDetailDTO.getScore().multiply(indexMap.get(deptScoreDetailDTO.getIndexCode()).getWeight()); + deptScoreEntity.setScore(deptScoreEntity.getScore().add(indexScore)); + } + deotScoreEntityList.add(deptScoreEntity); + } + //先删除 + int effectRow; + do { + effectRow = deptScoreDao.deleteByDeptIdAndMonthId(formDTO.getCustomerId(), + formDTO.getMonthId(), + IndexCodeEnum.QU_ZHI_BU_MEN.getCode(), + IndexCalConstant.DELETE_SIZE); + } while (effectRow > NumConstant.ZERO); + //后新增 + if (!CollectionUtils.isEmpty(deotScoreEntityList)) { + //批量插入 + List> partition = ListUtils.partition(deotScoreEntityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + deptScoreDao.insertBatchEntity(list); + }); + } + + } + + /** + * @param formDTO + * @param indexCode zhilinengli + * @param allParentIndexCode quzhibumen:zhilinengli + * @return void + * @author yinzuomei + * @description + * @Date 2020/9/10 12:15 + **/ + @Transactional(rollbackFor = Exception.class) + void deleteBeforeDataList(CalculateCommonFormDTO formDTO, String indexCode, String allParentIndexCode) { + int masterDeleteNum; + do { + //一次删除50条 + masterDeleteNum = deptScoreDao.deleteByDeptIdAndMonthId(formDTO.getCustomerId(), + formDTO.getMonthId(), + indexCode, + IndexCalConstant.DELETE_SIZE); + } while (masterDeleteNum > NumConstant.ZERO); + + //删除明细时,需要根据分组删,比方说当前计算的是区直部门治理能力,主表需要删除indexCode=zhilinengli的,明细需要删除区直部门:治理能力下面所有的指标明细 + int detailDelteNum; + do { + detailDelteNum = deptSubScoreDao.deleteBatches(formDTO.getCustomerId(), + formDTO.getMonthId(), + allParentIndexCode, + IndexCalConstant.DELETE_SIZE); + } while (detailDelteNum > NumConstant.ZERO); + + log.info("delete fact_index_dept_score and fact_index_dept_sub_score complete"); } /** @@ -152,7 +262,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl { if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 - String sampleValueStr =String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); //构造样本值对象 SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.DEPT_ID), new BigDecimal(sampleValueStr)); indexInputVO.getIndexValueVOs().add(currentGridIndexValue); @@ -161,9 +271,11 @@ public class DeptScoreServiceImpl extends BaseServiceImpl resultMap = gridCorreLationService.calculate(indexMap); - //保存中间表记录 - this.saveDeptScoreEntity(formDTO,resultMap); + HashMap resultMap = gridCorreLationService.calculate(indexMap); + if (!CollectionUtils.isEmpty(resultMap)) { + //保存中间表记录 + this.saveDeptScoreEntity(formDTO, resultMap); + } } /** @@ -175,10 +287,12 @@ public class DeptScoreServiceImpl extends BaseServiceImpl resultMap) { + public void saveDeptScoreEntity(CalculateCommonFormDTO formDTO, HashMap resultMap) { String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); - resultMap.forEach((deptId, governAblityScore) -> { + List deptScoreEntityList=new ArrayList<>(); + List deptSubScoreEntityList=new ArrayList<>(); + resultMap.forEach((deptId, calculateResult) -> { DeptScoreEntity deptScoreEntity = new DeptScoreEntity(); deptScoreEntity.setCustomerId(formDTO.getCustomerId()); deptScoreEntity.setDeptId(deptId); @@ -193,24 +307,31 @@ public class DeptScoreServiceImpl extends BaseServiceImpl resultMap = new HashMap<>(); - resultMap.put(entity.getDeptId(), new BigDecimal(NumConstant.FIFTY_STR)); - this.saveDeptScoreEntity(formDTO, resultMap); + //本身是分页计算的,主表一次性插入 + deptScoreDao.insertBatchEntity(deptScoreEntityList); + //明细表分组插入 + List> partitionDeptSubScoreList = ListUtils.partition(deptSubScoreEntityList, IndexCalConstant.INSERT_SIZE); + for (List insertDeptSubList : partitionDeptSubScoreList) { + deptSubScoreDao.insertBatchEntity(insertDeptSubList); + } } /** @@ -228,7 +349,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> sampleValueList = new ArrayList<>(); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + index.getAllParentIndexCode(), sampleValueList, index.getThreshold(), // new BigDecimal("-1"), //FOR TEST index.getWeight(), + IndexCodeEnum.isAvgIndex(index.getIndexCode()), scoreCalculator); map.put(index.getIndexCode(), indexInputVO1); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index abbe326a81..84c246eecc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; +import com.epmet.dao.evaluationindex.indexcal.GridSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; @@ -18,6 +19,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.*; import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; @@ -27,11 +29,9 @@ 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 com.epmet.support.normalizing.batch.BatchScoreCalculator; -import com.epmet.support.normalizing.batch.IndexInputVO; -import com.epmet.support.normalizing.batch.IndexOutputVO; -import com.epmet.support.normalizing.batch.SampleValue; +import com.epmet.support.normalizing.batch.*; 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; @@ -69,6 +69,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private CpcScoreDao cpcScoreDao; @Autowired private GridScoreDao gridScoreDao; + @Autowired + private GridSubScoreDao gridSubScoreDao; /** @@ -80,66 +82,38 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ @Override public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { - boolean resultFlag = false; //1、计算网格相关-党建能力 - List dangJianNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), - IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - if (CollectionUtils.isEmpty(dangJianNengLiList)) { - log.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); - } - calculateGridDangJian(formDTO, dangJianNengLiList); + calculateGridDangJian(formDTO); //2、计算网格相关-治理能力 - List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), - IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (CollectionUtils.isEmpty(zhiLiNengLiList)) { - log.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); - } - calculateGridZhiLi(formDTO, zhiLiNengLiList); + calculateGridZhiLi(formDTO); //3、计算网格相关-服务能力 - List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), - IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if (CollectionUtils.isEmpty(fuWuNengLiList)) { - log.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); - } - calculateGridFuWu(formDTO, fuWuNengLiList); + calculateGridFuWu(formDTO); //4、计算网格相关总分 - List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - if (CollectionUtils.isEmpty(wgxgList)) { - log.warn("calculateGridTotal customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【网格相关】指标权重信息不存在"); - } - calculateGridTotal(formDTO, wgxgList, IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - - resultFlag = true; - return resultFlag; + calculateGridTotal(formDTO); + return true; } /** * @param formDTO - * @param indexList * @return void * @author yinzuomei * @description 计算网格相关-党建能力 * @Date 2020/8/26 16:47 **/ @Transactional(rollbackFor = Exception.class) - public void calculateGridDangJian(CalculateCommonFormDTO formDTO, List indexList) { + public void calculateGridDangJian(CalculateCommonFormDTO formDTO) { + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); + } //查询总记录数 int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; - } else if (NumConstant.ONE == total) { - //只有一个网格时 - log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_party_ablity_grid_monthly record",IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); - this.handleOneGridScene(formDTO,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); @@ -147,12 +121,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { - log.error("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + log.warn("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; } //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); - List> resultMapList = new ArrayList<>(); + List> resultMapList = new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -166,7 +140,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { recordList.forEach(recordMap -> { //遍历所有的指标 indexMap.forEach((key, value) -> { - log.info("index_code :{}",key); +// log.info("index_code :{}",key); if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { //组织内党员的联系群众能力考评分(平均值) // log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); @@ -184,11 +158,15 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } }); }); - HashMap resultMap = calculate(indexMap); + HashMap resultMap = calculate(indexMap); resultMapList.add(resultMap); } // 保存中间表 - saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), NumConstant.ZERO_STR); + deleteBeforeDataList(formDTO,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.GRID_DJ_ALL_PARENT_INDEX_CODE); + saveGridCorreLationResult(formDTO, + resultMapList, + IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), + NumConstant.ZERO_STR); } /** @@ -199,7 +177,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 只有一条事实记录时,分值默认赋50 * @Date 2020/9/2 14:35 **/ - private void handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode) { + /*private void handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode) { List> resultMapList = new ArrayList<>(); HashMap resultMap = new HashMap<>(); String gridId =null; @@ -215,7 +193,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { // 保存中间表 saveGridCorreLationResult(formDTO, resultMapList, indexCode, NumConstant.ZERO_STR); } - +*/ /** * @param calculateCommonFormDTO * @return java.util.Map @@ -316,6 +294,36 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } + /** + * @return void + * @param formDTO + * @param indexCode 当前计算的指标(党建能力,治理能力,服务能力) + * @param allParentIndexCode + * @author yinzuomei + * @description + * @Date 2020/9/10 13:58 + **/ + private void deleteBeforeDataList(CalculateCommonFormDTO formDTO,String indexCode,String allParentIndexCode) { + //先删除 + int masterDeleteNum; + do { + //一次删除50条 + masterDeleteNum = gridScoreDao.deleteBatches(formDTO.getCustomerId(), + formDTO.getMonthId(), + indexCode, + IndexCalConstant.DELETE_SIZE); + } while (masterDeleteNum > NumConstant.ZERO); + //删除明细时,需要根据分组删,比方说当前计算的是网格相关-党建能力,主表需要删除indexCode=dangjiannengli的,明细需要删除网格相关:党建能力 下面所有的指标明细 + int detailDelteNum; + do { + detailDelteNum = gridSubScoreDao.deleteBatches(formDTO.getCustomerId(), + formDTO.getMonthId(), + allParentIndexCode, + IndexCalConstant.DELETE_SIZE); + } while (detailDelteNum > NumConstant.ZERO); + log.info("delete fact_index_grid_score and fact_index_grid_sub_score complete"); + } + /** * @param formDTO 客户id 月份id: yyyyMM * @param resultMapList @@ -327,15 +335,17 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/30 22:50 **/ private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO, - List> resultMapList, + List> resultMapList, String indexCode, String isTotal) { - List gridScoreEntityList = new ArrayList<>(); String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); - for (HashMap resultMap : resultMapList) { - resultMap.forEach((gridId, partyAblityScore) -> { - log.info("网格id:" + gridId + ";index_Code:"+indexCode+";分值:" + partyAblityScore); + //三大能力结果表 + List gridScoreEntityList = new ArrayList<>(); + //五级指标分值明细 + List gridSubScoreList = new ArrayList<>(); + for (HashMap resultMap : resultMapList) { + resultMap.forEach((gridId, calculateResult) -> { GridScoreEntity gridScoreEntity = new GridScoreEntity(); gridScoreEntity.setCustomerId(formDTO.getCustomerId()); gridScoreEntity.setGridId(gridId); @@ -346,21 +356,46 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){ gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); } - if(StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())){ + if (StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())) { gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); } } gridScoreEntity.setQuarterId(quarterId); gridScoreEntity.setYearId(yearId); gridScoreEntity.setMonthId(formDTO.getMonthId()); - gridScoreEntity.setScore(partyAblityScore); + gridScoreEntity.setScore(calculateResult.getTotalScore()); + //新增ALL_PARENT_INDEX_CODE 所有指标code拼接的字符串 冒号隔开 + gridScoreEntity.setAllParentIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(formDTO.getCustomerId(), gridScoreEntity.getAllParentIndexCode().concat(StrConstant.COLON).concat(gridScoreEntity.getIndexCode())); + gridScoreEntity.setWeight(weight); gridScoreEntityList.add(gridScoreEntity); + for (IndexScoreVo detail : calculateResult.getDetails()) { + GridSubScoreEntity gridSubScoreEntity = ConvertUtils.sourceToTarget(gridScoreEntity, GridSubScoreEntity.class); + //重新赋值 + gridSubScoreEntity.setIndexCode(detail.getIndexCode()); + gridSubScoreEntity.setAllParentIndexCode(detail.getAllParentIndexCode()); + gridSubScoreEntity.setScore(detail.getScore()); + gridSubScoreEntity.setWeight(detail.getWeight()); + gridSubScoreList.add(gridSubScoreEntity); + } }); } + //后新增 if (!CollectionUtils.isEmpty(gridScoreEntityList)) { - gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, isTotal); - gridScoreDao.insertBatches(gridScoreEntityList); + //批量插入 + List> partition = ListUtils.partition(gridScoreEntityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + gridScoreDao.insertBatches(list); + }); + } + if (!CollectionUtils.isEmpty(gridSubScoreList)) { + //批量插入 + List> subPartition = ListUtils.partition(gridSubScoreList, IndexCalConstant.INSERT_SIZE); + subPartition.forEach(subList -> { + gridSubScoreDao.insertBatches(subList); + }); } + log.info("insert fact_index_grid_score and fact_index_grid_sub_score complete"); } /** @@ -371,17 +406,17 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/30 21:40 **/ @Override - public HashMap calculate(Map> indexMap) { + public HashMap calculate(Map> indexMap) { //构造入参 List indexInputVOS = this.getIndexInputVOList(indexMap); log.info("计算的参数"+JSON.toJSONString(indexInputVOS)); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); //如果想看每一个指标的分值调用下面的方法 - List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - log.info("计算的结果(List)"+JSON.toJSONString(listTemp)); + /*List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + log.info("计算的结果(List)"+JSON.toJSONString(listTemp));*/ - HashMap resultMap = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + HashMap resultMap = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("计算的结果{}", resultMap); return resultMap; } @@ -431,7 +466,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); if (StringUtils.isBlank(fieldName)) { - log.error("index_code:{} not find field_name",index.getIndexCode()); + log.warn("index_code:{} not find field_name",index.getIndexCode()); continue; } // log.info("index_code2:{} ,field_name:{}",index.getIndexCode(),fieldName); @@ -454,11 +489,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { ); List> sampleValueList = new ArrayList<>(); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), - sampleValueList, - index.getThreshold(), + index.getAllParentIndexCode(), + sampleValueList, + index.getThreshold(), // new BigDecimal("-1"),//FOR TEST - index.getWeight(), - scoreCalculator); + index.getWeight(), + IndexCodeEnum.isAvgIndex(index.getIndexCode()), + scoreCalculator); map.put(index.getIndexCode(), indexInputVO1); } return map; @@ -466,22 +503,24 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** * @param formDTO - * @param indexList * @return void * @author yinzuomei * @description 计算网格相关-治理能力 * @Date 2020/8/26 16:47 **/ - private void calculateGridZhiLi(CalculateCommonFormDTO formDTO, List indexList) { + private void calculateGridZhiLi(CalculateCommonFormDTO formDTO) { + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); + } //查询总记录数 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; - }else if (NumConstant.ONE == total) { - //只有一个网格时 - log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_govrn_ablity_grid_monthly record",IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); - this.handleOneGridScene(formDTO,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); @@ -489,12 +528,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { - log.error("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + log.warn("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; } //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); - List> resultMapList = new ArrayList<>(); + List> resultMapList = new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -523,32 +562,38 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } }); }); - HashMap resultMap = calculate(indexMap); + HashMap resultMap = calculate(indexMap); resultMapList.add(resultMap); } // 保存中间表 - saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), NumConstant.ZERO_STR); + deleteBeforeDataList(formDTO,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.GRID_ZL_ALL_PARENT_INDEX_CODE); + saveGridCorreLationResult(formDTO, + resultMapList, + IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), + NumConstant.ZERO_STR); } /** * @param formDTO - * @param indexList * @return void * @author yinzuomei * @description 计算网格相关-服务能力 * @Date 2020/8/26 16:48 **/ - private void calculateGridFuWu(CalculateCommonFormDTO formDTO, List indexList) { + private void calculateGridFuWu(CalculateCommonFormDTO formDTO) { + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); + } //查询总记录数 int total = factIndexServiceAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; - }else if (NumConstant.ONE == total) { - //只有一个网格时 - log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_service_ablity_grid_monthly record",IndexCodeEnum.FU_WU_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); - this.handleOneGridScene(formDTO,IndexCodeEnum.FU_WU_NENG_LI.getCode()); } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); @@ -556,12 +601,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { - log.error("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + log.warn("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; } //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); - List> resultMapList = new ArrayList<>(); + List> resultMapList = new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -582,52 +627,73 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); value.getIndexValueVOs().add(currentGridIndexValue); } else { - log.error("index_code:" + key + " not find field_name"); + log.warn("index_code:" + key + " not find field_name"); } }); }); - HashMap resultMap = calculate(indexMap); + HashMap resultMap = calculate(indexMap); resultMapList.add(resultMap); } // 保存中间表 - saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.FU_WU_NENG_LI.getCode(), NumConstant.ZERO_STR); + deleteBeforeDataList(formDTO,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.GRID_FW_ALL_PARENT_INDEX_CODE); + saveGridCorreLationResult(formDTO, + resultMapList, + IndexCodeEnum.FU_WU_NENG_LI.getCode(), + NumConstant.ZERO_STR); } /** * @param formDTO - * @param indexList * @return void * @author yinzuomei * @description 计算网格相关总分 * @Date 2020/8/26 16:50 **/ - private void calculateGridTotal(CalculateCommonFormDTO formDTO, List indexList, String indexCode) { + private void calculateGridTotal(CalculateCommonFormDTO formDTO) { + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateGridTotal customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } //查询总记录数 List gridScoreDTOList = gridScoreDao.selectList(formDTO); if(CollectionUtils.isEmpty(gridScoreDTOList)){ - log.error("calculateGridTotal gridScoreDao.selectList return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); - throw new RenException("客户一级指标分值记录不存在"); + log.warn("calculateGridTotal gridScoreDao.selectList return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); +// throw new RenException("客户一级指标分值记录不存在"); + return; } Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); List gridScoreEntityList = new ArrayList<>(); for (GridScoreDTO gridScoreDTO : gridScoreDTOList) { GridScoreEntity gridScoreEntity = ConvertUtils.sourceToTarget(gridScoreDTO, GridScoreEntity.class); gridScoreEntity.setIsTotal(NumConstant.ONE_STR); - gridScoreEntity.setIndexCode(indexCode); + gridScoreEntity.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); gridScoreEntity.setScore(BigDecimal.ZERO); - if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { - log.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); - continue; - } + gridScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR); + gridScoreEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + log.warn("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失"); for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) { BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); gridScoreEntity.setScore(gridScoreEntity.getScore().add(indexScore)); } gridScoreEntityList.add(gridScoreEntity); } + //先删除 + int effectRow; + do { + effectRow =gridScoreDao.deleteBatches(formDTO.getCustomerId(), + formDTO.getMonthId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCalConstant.DELETE_SIZE); + } while (effectRow > NumConstant.ZERO); + //批量插入 if (!CollectionUtils.isEmpty(gridScoreEntityList)) { - gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, NumConstant.ONE_STR); - gridScoreDao.insertBatches(gridScoreEntityList); + //批量插入 + List> partition = ListUtils.partition(gridScoreEntityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + gridScoreDao.insertBatches(list); + }); } } 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 f25e27deb6..d7777dd540 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 @@ -4,15 +4,18 @@ import com.alibaba.druid.util.StringUtils; import com.alibaba.fastjson.JSON; 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.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; +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.FactIndexCommunityScoreDao; -import com.epmet.dao.evaluationindex.screen.FactIndexGridScoreDao; +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; @@ -26,6 +29,7 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; @@ -59,9 +63,38 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + private CommunityScoreDao factIndexCommunityScoreDao; @Autowired - private FactIndexGridScoreDao factIndexGridScoreDao; + private GridScoreDao factIndexGridScoreDao; + @Autowired + private CommunitySubScoreDao communitySubScoreDao; + + /** + * @param customerId + * @param monthId + * @Description 计算社区相关总分 + * @author zxc + * @date 2020/9/1 4:12 下午 + */ + public Boolean calCommunityAll(String customerId, String monthId) { + Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate community-party-ability failure ......"); + } + Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate community-govern-ability failure ......"); + } + Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate community-service-ability failure ......"); + } + Boolean dBoolean = communityRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate community-all insert failure ......"); + } + return true; + } /** * @param customerId @@ -78,31 +111,25 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 detailListByParentCode.forEach(detail -> { 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); - return; - }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - return; - }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + } else { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); - Integer indexEnd = NumConstant.TEN; - List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd); - subPartyAvgList.forEach( party -> { + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); + subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); indexInputVOS.add(index1VO); }); } @@ -111,29 +138,24 @@ 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); - return; } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); - return; - }else if (publishArticleCountList.size() == NumConstant.ONE){ - pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (publishArticleCountList.size() > NumConstant.ONE) { + } 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 -> { + 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()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } @@ -141,10 +163,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteOldRecord(customerId,monthId); + deleteAndInsert(result); return true; } @@ -162,30 +185,24 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { 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("社区下级治理能力平均分集合为空"); - return; - } - if (subGridGovernAvg.size() == NumConstant.ONE) { - pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (subGridGovernAvg.size() > NumConstant.ONE) { + }else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); indexInputVOS.add(index1VO); }); } @@ -194,12 +211,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); - return; - }else if (communityGovernAbility.size() == NumConstant.ONE) { - pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (communityGovernAbility.size() > NumConstant.ONE) { + }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); @@ -212,11 +224,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); governAbility.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } @@ -224,10 +236,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); return true; } @@ -245,27 +257,25 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if (subGridServiceAvg.size() == NumConstant.ONE) { - pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - return; - } else if (subGridServiceAvg.size() > NumConstant.ONE) { + if (CollectionUtils.isEmpty(subGridServiceAvg)) { + log.error("查询社区下级所有网格服务能力得分平均值集合为空"); + } else { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { 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.getAgencyId(),c.getParentId()); + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } @@ -273,12 +283,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); - return; - }else if (communityActivityCountList.size() == NumConstant.ONE) { - pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - return; - } else if (communityActivityCountList.size() > NumConstant.ONE) { + }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); @@ -291,11 +296,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); communityActivity.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } @@ -303,10 +308,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); return true; } @@ -338,39 +343,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setYearId(DateUtils.getYearId(monthId)); score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); - deleteAndInsert(customerId, monthId, IndexCalConstant.COMMUNITY_RELATE, result); - return true; - } - - /** - * @param customerId - * @param monthId - * @Description 计算社区相关总分 - * @author zxc - * @date 2020/9/1 4:12 下午 - */ - public Boolean calCommunityAll(String customerId, String monthId) { - Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 - if (!aBoolean.equals(true)) { - throw new RenException("calculate community-party-ability failure ......"); - } - Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 - if (!bBoolean.equals(true)) { - throw new RenException("calculate community-govern-ability failure ......"); - } - Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 - if (!cBoolean.equals(true)) { - throw new RenException("calculate community-service-ability failure ......"); - } - Boolean dBoolean = communityRelate(customerId, monthId); - if (!dBoolean.equals(true)) { - throw new RenException("calculate community-all insert failure ......"); + if (!CollectionUtils.isEmpty(result)){ + factIndexCommunityScoreDao.insertCommunityPartyRecord(result); } return true; } @@ -391,34 +373,59 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } /** - * @param customerId - * @param monthId - * @param indexCode - * @param subAllGridList + * @param result * @Description 先删除记录,在插入 * @author zxc * @date 2020/9/1 4:24 下午 */ @Transactional(rollbackFor = Exception.class) - public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllGridList) { - if (!CollectionUtils.isEmpty(subAllGridList)) { - factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); - factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); + public void deleteAndInsert(CommunityCalResultDTO result) { + if (!CollectionUtils.isEmpty(result.getOneLevel())) { + List> partition = ListUtils.partition(result.getOneLevel(), IndexCalConstant.INSERT_SIZE); + partition.forEach(p -> { + factIndexCommunityScoreDao.insertCommunityPartyRecord(p); + }); + } + if (!CollectionUtils.isEmpty(result.getFiveLevel())){ + List> partition = ListUtils.partition(result.getFiveLevel(), IndexCalConstant.INSERT_SIZE); + partition.forEach(p -> { + communitySubScoreDao.insertCommunityPartyRecord(p); + }); } } /** * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/10 2:50 下午 + */ + public void deleteOldRecord(String customerId,String monthId){ + Integer num; + do { + num = factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId,IndexCalConstant.DELETE_SIZE); + }while (num != NumConstant.ZERO); + Integer subNum; + do { + subNum = communitySubScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.DELETE_SIZE); + }while (subNum != NumConstant.ZERO); + } + + /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @Description * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { - List result = new ArrayList<>(); + public CommunityCalResultDTO getResultB(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,String allParentIndexCode, Map pid) { + CommunityCalResultDTO result = new CommunityCalResultDTO(); + List resultOne = new ArrayList<>(); + List resultFive = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); score.setCustomerId(customerId); @@ -428,29 +435,41 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setYearId(DateUtils.getYearId(monthId)); score.setIsTotal(isTotal); score.setIndexCode(indexCode); - score.setScore(v); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ + score.setScore(v.getTotalScore()); + score.setAllParentIndexCode(allParentIndexCode); + String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath); + score.setWeight(weight); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { score.setParentAgencyId(parentAgency); } }); - result.add(score); + if (!CollectionUtils.isEmpty(v.getDetails())) { + v.getDetails().forEach(fiveDetail -> { + FactIndexCommunityScoreDTO s = new FactIndexCommunityScoreDTO(); + s.setCustomerId(customerId); + s.setAgencyId(k); + s.setMonthId(monthId); + s.setQuarterId(DateUtils.getQuarterId(monthId)); + s.setYearId(DateUtils.getYearId(monthId)); + s.setIsTotal(isTotal); + s.setIndexCode(fiveDetail.getIndexCode()); + s.setScore(fiveDetail.getScore()); + s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode()); + s.setWeight(fiveDetail.getWeight()); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + s.setParentAgencyId(parentAgency); + } + }); + resultFive.add(s); + }); + } + resultOne.add(score); }); + result.setOneLevel(resultOne); + result.setFiveLevel(resultFive); return result; } - - /** - * @Description 当查询结果为一条时,调用此方法 - * @param agencyId - * @param customerId - * @param monthId - * @author zxc - * @date 2020/9/2 2:40 下午 - */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ - HashMap scoreCountOfSampleId = new HashMap<>(); - scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); - deleteAndInsert(customerId, monthId, indexCode, result); - } } 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 9baa63df36..0309f40eda 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 @@ -1,15 +1,20 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.druid.util.StringUtils; +import com.alibaba.fastjson.JSON; 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.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +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.ScreenCustomerAgencyDao; +import com.epmet.dto.indexcal.AgencyCalResultDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; @@ -23,6 +28,7 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; @@ -55,6 +61,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private AgencyScoreDao agencyScoreDao; @Autowired private DeptScoreDao deptScoreDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; + @Autowired + private AgencySubScoreDao agencySubScoreDao; /** * @Description 计算全区相关总分 @@ -99,30 +109,25 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { 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); - return; - }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - return; - }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + } 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 -> { + subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); indexInputVOS.add(index1VO); }); } @@ -131,38 +136,36 @@ 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); - return; } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (publishArticleCountList.size() == NumConstant.ONE){ - pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - return; - }else if (publishArticleCountList.size() > NumConstant.ONE) { + } 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 -> { + 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()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtPartyAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtPartyAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL); + insertDetail(result); return true; } @@ -180,36 +183,32 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + 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); - if (districtGovernAvgList.size() == NumConstant.ONE) { - pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (districtGovernAvgList.size() > NumConstant.ONE) { + if (CollectionUtils.isEmpty(districtGovernAvgList)) { + log.error("查询所有街道治理能力平均值集合为空"); + } 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.getAgencyId(),c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); indexInputVOS.add(index1VO); }); } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (deptScoreAvgList.size() == NumConstant.ONE) { - pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),deptScoreAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (deptScoreAvgList.size() > NumConstant.ONE) { + if (CollectionUtils.isEmpty(deptScoreAvgList)) { + log.error("查询所有直属部门治理能力平均值集合为空"); + } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { @@ -220,7 +219,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); indexInputVOS.add(index1VO); }); } @@ -229,9 +228,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtGovernAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + insertDetail(result); return true; } @@ -249,27 +250,25 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { 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); - if (subStreetAvgList.size() == NumConstant.ONE) { - pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - return; - } else if (subStreetAvgList.size() > NumConstant.ONE) { + if (CollectionUtils.isEmpty(subStreetAvgList)) { + log.error("查询区下属街道服务能力汇总平均值集合为空"); + } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { 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.getAgencyId(),c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } @@ -278,9 +277,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + if (!CollectionUtils.isEmpty(indexInputVOS)) { + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + insertDetail(result); + } return true; } @@ -313,13 +316,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); - deleteAndInsert(customerId, monthId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), result); + if (!CollectionUtils.isEmpty(result)){ + agencyScoreDao.insertStreetRecord(result); + } return true; } @@ -339,34 +346,60 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } /** + * @Description * @param customerId * @param monthId - * @param indexCode - * @param subAllDistrict + * @param dataType 数据类型 (街道:street,全区:district) + * @author zxc + * @date 2020/9/10 2:50 下午 + */ + public void deleteOldRecord(String customerId,String monthId,String dataType){ + Integer num; + do { + num = agencyScoreDao.deleteOldRecord(customerId, monthId,dataType,IndexCalConstant.DELETE_SIZE); + }while (num != NumConstant.ZERO); + Integer subNum; + do { + subNum = agencySubScoreDao.deleteOldRecord(customerId,monthId,dataType,IndexCalConstant.DELETE_SIZE); + }while (subNum != NumConstant.ZERO); + } + + /** + * @param result * @Description 先删除记录,在插入 * @author zxc * @date 2020/9/1 4:24 下午 */ @Transactional(rollbackFor = Exception.class) - public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllDistrict) { - if (!CollectionUtils.isEmpty(subAllDistrict)) { - agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL); - agencyScoreDao.insertStreetRecord(subAllDistrict); + public void insertDetail(AgencyCalResultDTO result) { + if (!CollectionUtils.isEmpty(result.getOneTwoLevel())){ + List> partition = ListUtils.partition(result.getOneTwoLevel(), IndexCalConstant.INSERT_SIZE); + partition.forEach(p -> { + agencyScoreDao.insertStreetRecord(p); + }); + } + if (!CollectionUtils.isEmpty(result.getFiveLevel())){ + List> partition = ListUtils.partition(result.getFiveLevel(), IndexCalConstant.INSERT_SIZE); + partition.forEach(p -> { + agencySubScoreDao.insertStreetRecord(p); + }); } } /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { - List result = new ArrayList<>(); + public AgencyCalResultDTO getResultB(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, String allParentIndexCode, Map pid) { + AgencyCalResultDTO result = new AgencyCalResultDTO(); + List resultOne = new ArrayList<>(); + List resultFive = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); score.setCustomerId(customerId); @@ -376,30 +409,46 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setYearId(DateUtils.getYearId(monthId)); score.setIsTotal(isTotal); score.setIndexCode(indexCode); - score.setScore(v); + score.setScore(v.getTotalScore()); + score.setAllParentIndexCode(allParentIndexCode); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ + String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath); + score.setWeight(weight); + pid.forEach((agency, parentAgency) -> { + //todo 确认 + if (k != null && k.equals(agency)) { score.setParentAgencyId(parentAgency); } }); - result.add(score); + if (!CollectionUtils.isEmpty(v.getDetails())) { + v.getDetails().forEach(streetScore -> { + AgencyScoreDTO s = new AgencyScoreDTO(); + s.setCustomerId(customerId); + s.setAgencyId(k); + s.setMonthId(monthId); + s.setQuarterId(DateUtils.getQuarterId(monthId)); + s.setYearId(DateUtils.getYearId(monthId)); + s.setIsTotal(isTotal); + s.setIndexCode(streetScore.getIndexCode()); + s.setScore(streetScore.getScore()); + s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); + s.setDataType(IndexCalConstant.DISTRICT_LEVEL); + s.setWeight(streetScore.getWeight()); + pid.forEach((agency, parentAgency) -> { + //todo 确认 + if (k != null && k.equals(agency)) { + s.setParentAgencyId(parentAgency); + } + }); + resultFive.add(s); + }); + } + resultOne.add(score); }); + result.setOneTwoLevel(resultOne); + result.setFiveLevel(resultFive); return result; } - /** - * @Description 当查询结果为一条时,调用此方法 - * @param agencyId - * @param customerId - * @param monthId - * @author zxc - * @date 2020/9/2 2:40 下午 - */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ - HashMap scoreCountOfSampleId = new HashMap<>(); - scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); - deleteAndInsert(customerId, monthId, indexCode, result); - } } 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 9385c1f121..a2703968ec 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 @@ -2,21 +2,23 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; -import com.epmet.redis.IndexCodeFieldReRedis; +import com.epmet.redis.IndexCalRedis; import com.epmet.service.evaluationindex.indexcal.*; +import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; 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.util.ArrayList; import java.util.Date; import java.util.List; @@ -35,7 +37,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { @Autowired private CpcIndexCalculateService cpcIndexCalculateService; @Autowired - private IndexCodeFieldReRedis indexCodeFieldReRedis; + private IndexCalRedis indexCalRedis; @Autowired private IndexCalculateCommunityService indexCalculateCommunityService; @Autowired @@ -44,86 +46,139 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private IndexCalculateDistrictService indexCalculateDistrictService; @Autowired private DeptScoreService deptScoreService; + @Autowired + private FactIndexCollectService factIndexCollectService; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Override - public Boolean indexCalculate(IndexCalculateForm formDTO) { + public Boolean indexCalculate(CalculateCommonFormDTO formDTO) { try { if (StringUtils.isBlank(formDTO.getMonthId())) { //默认 当前月份-1 formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); } //按照客户分组 - if (CollectionUtils.isEmpty(formDTO.getCustomerIds())) { + List customerIds = new ArrayList<>(); + if (StringUtils.isBlank(formDTO.getCustomerId())) { Result> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); if (!externalCustomerIdsResult.success()) { log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); return false; } - formDTO.setCustomerIds(externalCustomerIdsResult.getData()); + customerIds = externalCustomerIdsResult.getData(); + } else { + customerIds.add(formDTO.getCustomerId()); } Boolean flag = false; - for (String customerId : formDTO.getCustomerIds()) { - CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); + for (String customerId : customerIds) { + CalculateCommonFormDTO param = new CalculateCommonFormDTO(); + param.setCustomerId(customerId); + param.setMonthId(formDTO.getMonthId()); + flag = calulateCustomerIndexScore(param); + } + return flag; + } catch (Exception e) { + log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); + } finally { + //清除缓存 + indexCalRedis.deleteIndexCodeFromRedis(); + } + return false; + } + + private Boolean calulateCustomerIndexScore(CalculateCommonFormDTO formDTO) { + try { + String customerId = formDTO.getCustomerId(); + Boolean flag; + long start = System.currentTimeMillis(); + try { + //校验是否含有组织数据 + int agencyCount = screenCustomerAgencyDao.selectCountByCustomerId(formDTO.getCustomerId()); + if (agencyCount < 1) { + log.info("客户id:{},组织结构数据缺失,请先上传后再计算", formDTO.getCustomerId()); + throw new RenException("组织结构数据缺失,请先上传后再计算"); + } //计算党员相关的 try { - CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); - flag = cpcIndexCalculateService.cpcIndexCalculate(param); - log.info("indexCalculate cpcIndexCalculate return result:{}", flag); + + flag = cpcIndexCalculateService.cpcIndexCalculate(formDTO); + log.info("客户Id:{}【党员相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate cpcIndexCalculate exception", e); - break; + throw new RenException("indexCalculate cpcIndexCalculate exception", e); } + //测试用 //计算网格 + start = System.currentTimeMillis(); try { - flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); - log.info("indexCalculate calculateGridCorreLation return result:{}", flag); + flag = gridCorreLationService.calculateGridCorreLation(formDTO); + log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calculateGridCorreLation exception", e); - break; + throw new RenException("indexCalculate calculateGridCorreLation exception", e); } //计算社区 + start = System.currentTimeMillis(); try { - indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); - log.info("indexCalculate calAll return result:{}", flag); + flag = indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); + log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { - log.error("indexCalculate calAll exception", e); - break; + log.error("indexCalculate calCommunityAll exception", e); + throw new RenException("indexCalculate calAll exception", e); } //计算街道 + start = System.currentTimeMillis(); try { - indexCalculateStreetService.calStreetAll(customerId,formDTO.getMonthId()); - log.info("indexCalculate calAll return result:{}", flag); + flag = indexCalculateStreetService.calStreetAll(customerId, formDTO.getMonthId()); + log.info("客户Id:{}【街道相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { - log.error("indexCalculate calAll exception", e); - break; + log.error("indexCalculate calStreetAll exception", e); + throw new RenException("indexCalculate calStreetAll exception", e); } //计算区直属 + start = System.currentTimeMillis(); try { - deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO); - log.info("indexCalculate calAll return result:{}", flag); + flag = deptScoreService.calculateDeptCorreLation(formDTO); + log.info("客户Id:{}【区直部门】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { - log.error("indexCalculate calAll exception", e); - break; + log.error("indexCalculate calculateDeptCorreLation exception", e); + throw new RenException("indexCalculate calculateDeptCorreLation exception", e); } //计算全区 + start = System.currentTimeMillis(); try { - indexCalculateDistrictService.calDistrictAll(customerId,formDTO.getMonthId()); - log.info("indexCalculate calAll return result:{}", flag); + indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); + log.info("客户Id:{}【全区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { - log.error("indexCalculate calAll exception", e); - break; + log.error("indexCalculate calDistrictAll exception", e); + throw new RenException("indexCalculate calDistrictAll exception", e); + } + } catch (RenException e) { + flag = false; + } + + //计算完毕后 将结果插入大屏相关数据表 + if (flag) { + 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; } } return flag; } catch (Exception e) { - log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); + log.error("calulateCustomerIndexScore exception", e); } finally { - //清除缓存 - indexCodeFieldReRedis.deleteIndexCodeFromRedis(); + indexCalRedis.deleteIndexCodeWeightFromRedis(formDTO.getCustomerId()); } return false; } 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 e18de69bb2..5a4b2a8dcd 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 @@ -1,17 +1,21 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.druid.util.StringUtils; +import com.alibaba.fastjson.JSON; 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.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +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.FactIndexCommunityScoreDao; +import com.epmet.dto.indexcal.AgencyCalResultDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; @@ -25,6 +29,7 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; @@ -58,9 +63,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityScoreDao communityScoreDao; + private CommunityScoreDao communityScoreDao; @Autowired private AgencyScoreDao agencyScoreDao; + @Autowired + private AgencySubScoreDao agencySubScoreDao; /** * @Description 计算街道相关总分 @@ -105,19 +112,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { 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); - return; - }else if (subCommPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subCommPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - return; - }else if (subCommPartyAvgScore.size() > NumConstant.ONE) { + } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); @@ -129,7 +131,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); indexInputVOS.add(index1VO); }); } @@ -138,37 +140,35 @@ 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); - return; } String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldName)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); - return; - }else if (mapList.size() == NumConstant.ONE){ - pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (mapList.size() > NumConstant.ONE) { + }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()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetPartyAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetPartyAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + deleteOldRecord(customerId, monthId, IndexCalConstant.STREET_LEVEL); + insertDetail(result); return true; } @@ -186,15 +186,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (subGridGovernAvg.size() == NumConstant.ONE) { - pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (subGridGovernAvg.size() > NumConstant.ONE) { + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.error("查询街道下属所有社区治理能力汇总为空"); + }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); governAvg.forEach(avg -> { @@ -205,7 +203,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); indexInputVOS.add(index1VO); }); } @@ -214,12 +212,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); - return; - }else if (communityGovernAbility.size() == NumConstant.ONE) { - pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (communityGovernAbility.size() > NumConstant.ONE) { + }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); @@ -230,23 +223,24 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); governAbilityList.forEach(governAbility -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - System.err.println(detail.getCorrelation()); List index1SampleValues = new ArrayList<>(); governAbility.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetGovernAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + insertDetail(result); return true; } @@ -264,16 +258,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if (subCommServiceAvg.size() == NumConstant.ONE) { - pid.put(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),subCommServiceAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - return; - } else if (subCommServiceAvg.size() > NumConstant.ONE) { + if (CollectionUtils.isEmpty(subCommServiceAvg)) { + log.error("查询街道下属社区服务能力得分平均值为空"); + } 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); serviceAvgList.forEach(serviceAvg -> { @@ -284,7 +276,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } @@ -292,12 +284,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); - return; - }else if (communityActivityCountList.size() == NumConstant.ONE) { - pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - return; - } else if (communityActivityCountList.size() > NumConstant.ONE) { + }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); @@ -310,21 +297,22 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); communityActivity.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + 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.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); }); } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid - ); - deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + insertDetail(result); return true; } @@ -357,13 +345,17 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); score.setDataType(IndexCalConstant.STREET_LEVEL); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); value.forEach(street -> { score.setScore(score.getScore().add(street.getScore())); score.setParentAgencyId(street.getParentAgencyId()); }); result.add(score); }); - deleteAndInsert(customerId, monthId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), result); + if (!CollectionUtils.isEmpty(result)){ + agencyScoreDao.insertStreetRecord(result); + } return true; } @@ -383,34 +375,60 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } /** - * @param customerId - * @param monthId - * @param indexCode - * @param subAllCommunityList + * @param result * @Description 先删除记录,在插入 * @author zxc * @date 2020/9/1 4:24 下午 */ @Transactional(rollbackFor = Exception.class) - public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllCommunityList) { - if (!CollectionUtils.isEmpty(subAllCommunityList)) { - agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.STREET_LEVEL); - agencyScoreDao.insertStreetRecord(subAllCommunityList); + public void insertDetail(AgencyCalResultDTO result) { + if (!CollectionUtils.isEmpty(result.getOneTwoLevel())) { + List> partition = ListUtils.partition(result.getOneTwoLevel(), IndexCalConstant.INSERT_SIZE); + partition.forEach(p -> { + agencyScoreDao.insertStreetRecord(p); + }); + } + if (!CollectionUtils.isEmpty(result.getFiveLevel())){ + List> partition = ListUtils.partition(result.getFiveLevel(), IndexCalConstant.INSERT_SIZE); + partition.forEach(p -> { + agencySubScoreDao.insertStreetRecord(p); + }); } } /** * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @param customerId + * @param monthId + * @param dataType 数据类型 (街道:street,全区:district) + * @author zxc + * @date 2020/9/10 2:50 下午 + */ + public void deleteOldRecord(String customerId,String monthId,String dataType){ + Integer num; + do { + num = agencyScoreDao.deleteOldRecord(customerId, monthId,dataType,IndexCalConstant.DELETE_SIZE); + }while (num != NumConstant.ZERO); + Integer subNum; + do { + subNum = agencySubScoreDao.deleteOldRecord(customerId,monthId,dataType,IndexCalConstant.DELETE_SIZE); + }while (subNum != NumConstant.ZERO); + } + + /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @Description * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { - List result = new ArrayList<>(); + public AgencyCalResultDTO getResultB(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, String allParentIndexCode, Map pid) { + AgencyCalResultDTO result = new AgencyCalResultDTO(); + List resultOne = new ArrayList<>(); + List resultFive = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); score.setCustomerId(customerId); @@ -420,29 +438,43 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setYearId(DateUtils.getYearId(monthId)); score.setIsTotal(isTotal); score.setIndexCode(indexCode); - score.setScore(v); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ + score.setScore(v.getTotalScore()); + score.setAllParentIndexCode(allParentIndexCode); + score.setDataType(IndexCalConstant.STREET_LEVEL); + String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath); + score.setWeight(weight); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { score.setParentAgencyId(parentAgency); } }); - result.add(score); + if (!CollectionUtils.isEmpty(v.getDetails())) { + v.getDetails().forEach(streetScore -> { + AgencyScoreDTO s = new AgencyScoreDTO(); + s.setCustomerId(customerId); + s.setAgencyId(k); + s.setMonthId(monthId); + s.setQuarterId(DateUtils.getQuarterId(monthId)); + s.setYearId(DateUtils.getYearId(monthId)); + s.setIsTotal(isTotal); + s.setIndexCode(streetScore.getIndexCode()); + s.setScore(streetScore.getScore()); + s.setDataType(IndexCalConstant.STREET_LEVEL); + s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); + s.setWeight(streetScore.getWeight()); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + s.setParentAgencyId(parentAgency); + } + }); + resultFive.add(s); + }); + } + resultOne.add(score); }); + result.setOneTwoLevel(resultOne); + result.setFiveLevel(resultFive); return result; } - - /** - * @Description 当查询结果为一条时,调用此方法 - * @param agencyId - * @param customerId - * @param monthId - * @author zxc - * @date 2020/9/2 2:40 下午 - */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ - HashMap scoreCountOfSample = new HashMap<>(); - scoreCountOfSample.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); - deleteAndInsert(customerId, monthId, indexCode, result); - } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java index 3e89bee003..009dc1dc42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -4,7 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexCodeFieldReDao; import com.epmet.entity.evaluationindex.screen.IndexCodeFieldReEntity; -import com.epmet.redis.IndexCodeFieldReRedis; +import com.epmet.redis.IndexCalRedis; import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -25,18 +25,18 @@ public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { private IndexCodeFieldReDao indexCodeFieldReDao; @Autowired - private IndexCodeFieldReRedis indexCodeFieldReRedis; + private IndexCalRedis indexCalRedis; @Override public Map getIndexCodeFieldReMap() { - Map indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap(); + Map indexCodeFiledReMap = indexCalRedis.getIndexCodeFiledReMap(); if (CollectionUtils.isEmpty(indexCodeFiledReMap)) { List allData = indexCodeFieldReDao.getAllData(); if (CollectionUtils.isEmpty(allData)){ return new HashMap<>(); } indexCodeFiledReMap = allData.stream().collect(Collectors.toMap(IndexCodeFieldReEntity::getIndexCode, o -> o.getFieldId())); - indexCodeFieldReRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); + indexCalRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); } return indexCodeFiledReMap; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java index e88e5d55a3..98d0fc95af 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java @@ -26,7 +26,7 @@ public interface FactIndexCollectService { /** * 2、党建能力-网格相关指标上报(按照月份) - * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -34,11 +34,11 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridPartyAbility(List formDTO, String customerId); + void insertGridPartyAbility(GridPartyAbilityDataFormDTO formDTO, String customerId); /** * 3、党建能力-街道及社区相关指标 - * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -46,11 +46,11 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgPartyAbility(List formDTO, String customerId); + void insertOrgPartyAbility(OrgPartyAbilityDataFormDTO formDTO, String customerId); /** * 4、服务能力-网格相关指标 - * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -58,11 +58,11 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridServiceAbility(List formDTO, String customerId); + void insertGridServiceAbility(GridServiceAbilityDataFormDTO formDTO, String customerId); /** * 5、服务能力-组织(街道|社区|全区)相关指标 - * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -70,7 +70,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgServiceAbility(List formDTO, String customerId); + void insertOrgServiceAbility(OrgServiceAbilityDataFormDTO formDTO, String customerId); /** * 6、治理能力-网格相关指标 @@ -82,7 +82,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridGovrnAbility(List formDTO, String customerId); + void insertGridGovrnAbility(GridGovrnAbilityDataFormDTO formDTO, String customerId); /** * 7、治理能力-街道及社区相关指标 @@ -94,7 +94,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgGovrnAbility(List formDTO, String customerId); + void insertOrgGovrnAbility(OrgGovrnAbilityDataFormDTO formDTO, String customerId); /** * 8、治理能力-部门相关指标 @@ -106,7 +106,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertDeptGovrnAbility(List formDTO, String customerId); + void insertDeptGovrnAbility(DeptGovrnAbilityDataFormDTO formDTO, String customerId); /** * 将网格、社区、区直部门、区/街道分支记录表中的数据,抽取到 指数-指数数据(每月数值) 指数-指数数据(按年统计) 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 2d6a2c48ed..ade95f1c5d 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 @@ -1,14 +1,14 @@ package com.epmet.service.evaluationindex.indexcoll.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.tools.constant.FieldConstant; 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.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.*; import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.ScreenCustomerGridDTO; @@ -19,16 +19,11 @@ import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.FactIndexGridScoreDTO; import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; -import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; -import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; -import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; 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 lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,7 +43,6 @@ import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexCollectServiceImpl implements FactIndexCollectService { - private static final Logger log = LoggerFactory.getLogger(FactIndexCollectServiceImpl.class); @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @@ -67,9 +61,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; @Autowired - private FactIndexGridScoreDao factIndexGridScoreDao; + private GridScoreDao factIndexGridScoreDao; @Autowired - private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + private CommunityScoreDao factIndexCommunityScoreDao; @Autowired private DeptScoreDao deptScoreDao; @Autowired @@ -85,7 +79,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridPartyMemberData(GridPartyMemberDataFormDTO formDTO, String customerId) { @@ -94,136 +87,133 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { int deleteNum; do { deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, formDTO.getMonthId()); - } while (deleteNum != NumConstant.ZERO); + } while (deleteNum > NumConstant.ZERO); } - if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getPartyMemberDataList())) { - factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getPartyMemberDataList(), customerId); + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridPartyAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO, customerId); + public void insertGridPartyAbility(GridPartyAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if ( !CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgPartyAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO, customerId); + public void insertOrgPartyAbility(OrgPartyAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridServiceAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO, customerId); + public void insertGridServiceAbility(GridServiceAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgServiceAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO, customerId); + public void insertOrgServiceAbility(OrgServiceAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO, customerId); + public void insertGridGovrnAbility(GridGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO, customerId); + public void insertOrgGovrnAbility(OrgGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertDeptGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getDeptId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO, customerId); + public void insertDeptGovrnAbility(DeptGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { 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); @@ -233,7 +223,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { /** * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,在插入网格相关分值表。 一对四 + * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -242,6 +232,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 13:44 2020-09-04 **/ private void startHandleIndexGridScore(String monthId, String customerId){ + List mismatchGridList = new ArrayList<>(); // 查询网格相关分值记录 表已经存在的网格id List indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); if (indexGridIds.size() > NumConstant.ZERO){ @@ -251,22 +242,52 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { gridIds[i] = indexGridIds.get(i); } // 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 - List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); - // 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 - if (mismatchGridList.size() > NumConstant.ZERO){ - this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); - } + mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); } else { - // 将所有的网格按照 4种类型,各赋一遍默认值 - List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); - this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); + mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); + } + + if (!CollectionUtils.isEmpty(mismatchGridList)){ + // 如果进行不匹配查询,查到了其他网格信息,一律赋默认值 + this.insertIndexMonthlyByGridDefaultScore(monthId, customerId, mismatchGridList); } - // 开始处理实际分数 // fact_index_grid_score 网格相关分值记录表 grid List gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); + // 开始处理实际分数 this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS); } + /** + * 将网格相关分值记录表中缺少的网格 数据,赋默认值 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param gridScoreDTOS 网格相关分值记录表 当前客户不存在的网格数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexMonthlyByGridDefaultScore(String monthId, String customerId, List gridScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + for (int i = NumConstant.ZERO; i < gridScoreDTOS.size(); i++){ + IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); + monthlyDTO.setIndexTotal(zero); + monthlyDTO.setPartyDevAblity(zero); + monthlyDTO.setServiceAblity(zero); + monthlyDTO.setGovernAblity(zero); + // 9.12 增加权重 + monthlyDTO.setPartyDevWeight(zero); + monthlyDTO.setServiceAblityWeight(zero); + monthlyDTO.setGovernAblityWeight(zero); + // 补充表中其他字段 + monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScoreDTOS.get(i).getGridId(), + gridScoreDTOS.get(i).getParentAgencyId(), gridScoreDTOS.get(i).getGridName(), monthlyDTO); + monthlyFormDTOList.add(monthlyDTO); + } + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + /** * 将网格相关分值记录表 数据 插入月表 screenIndexDataMonthlyDao * @@ -283,13 +304,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); // 查询网格的 上级组织id 和 组织名称 List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> gridScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 网格id - orgIds[j] = gridScore.getKey(); - j++; + // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < gridScore.getValue().size(); i++){ @@ -302,6 +319,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } else { // 赋实际值 党建能力、治理能力、服务能力 monthlyFormDTO = this.setValueAbilityMonthlyFor(gridScore.getValue().get(i).getIndexCode(), + gridScore.getValue().get(i).getWeight(), gridScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -324,14 +342,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } /** * 目标:将社区的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入社区相关分值表。 一对四 + * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -340,6 +357,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 13:44 2020-09-04 **/ private void startHandleIndexCommunityScore(String monthId, String customerId){ + List mismatchAgencyList = new ArrayList<>(); // 查询社区相关分值记录id List indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); if (indexCommunityIds.size() > NumConstant.ZERO){ @@ -348,24 +366,54 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { for (int i = NumConstant.ZERO; i < indexCommunityIds.size(); i++){ communityIds[i] = indexCommunityIds.get(i); } - // 进行不匹配查询(即返回社区相关分值表 中不存在的社区信息)。 - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); - // 将 社区相关分数表 中,本月份没有的社区信息,按照 4种类型,各新增一遍,赋默认值 0 - if (mismatchAgencyList.size() > NumConstant.ZERO){ - this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); - } + // 进行不匹配查询(即返回社区相关分值表 中不存在的【社区级】 组织信息)。 + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, communityIds); } else { - // 将所有的社区按照 4种类型,各赋一遍默认值 - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); - this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, null); + } + + if (!CollectionUtils.isEmpty(mismatchAgencyList)){ + // 如果进行不匹配查询,查到了其他社区信息,一律赋默认值 + this.insertIndexMonthlyByAgencyDefaultScore(monthId, customerId, mismatchAgencyList); } - // 开始处理实际分数 // fact_index_community_score 社区相关分数表 agency // 查询社区相关分值记录 List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); + // 开始处理实际分数 this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS); } + /** + * 将 社区相关分数表 中缺少的部门 数据,赋默认值 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param communityScoreDTOS 社区相关分数表 当前客户不存在的网格数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexMonthlyByAgencyDefaultScore(String monthId, String customerId, List communityScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + for (int i = NumConstant.ZERO; i < communityScoreDTOS.size(); i++){ + IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); + monthlyDTO.setIndexTotal(zero); + monthlyDTO.setPartyDevAblity(zero); + monthlyDTO.setServiceAblity(zero); + monthlyDTO.setGovernAblity(zero); + // 9.12 增加权重 + monthlyDTO.setPartyDevWeight(zero); + monthlyDTO.setServiceAblityWeight(zero); + monthlyDTO.setGovernAblityWeight(zero); + // 补充表中其他字段 + monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScoreDTOS.get(i).getAgencyId(), + communityScoreDTOS.get(i).getPid(), communityScoreDTOS.get(i).getAgencyName(), monthlyDTO); + monthlyFormDTOList.add(monthlyDTO); + } + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + /** * 社区相关分数表 数据 插入月表 screenIndexDataMonthlyDao * @@ -382,13 +430,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); // 根据客户id,查询区/街道 组织名称、id List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> communityScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 组织id - orgIds[j] = communityScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < communityScore.getValue().size(); i++){ @@ -401,6 +444,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } else { // 赋值 党建能力、治理能力、服务能力 monthlyFormDTO = this.setValueAbilityMonthlyFor(communityScore.getValue().get(i).getIndexCode(), + communityScore.getValue().get(i).getWeight(), communityScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -425,14 +469,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } /** * 目标:将区直部门的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 区直部门分值表。 一对四 + * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -441,6 +484,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 13:44 2020-09-04 **/ private void startHandleIndexDeptScore(String monthId, String customerId){ + List mismatchDeptList = new ArrayList<>(); // 查询社 区直部门分值表 List indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); if (indexDeptIds.size() > NumConstant.ZERO){ @@ -448,21 +492,53 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { for (int i = NumConstant.ZERO; i < indexDeptIds.size(); i++){ depeIds[i] = indexDeptIds.get(i); } - List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); - if (mismatchDeptList.size() > NumConstant.ZERO){ - this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); - } + mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); } else { - List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); - this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); + mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); + } + + if (!CollectionUtils.isEmpty(mismatchDeptList)){ + // 如果进行不匹配查询,查到了其他部门信息,一律赋默认值 + this.insertIndexMonthlyByDeptDefaultScore(monthId, customerId, mismatchDeptList); } - // 开始处理实际分数 // fact_index_dept_score 区直部门分值表 department // 查询社 区直部门分值表 List deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); + // 开始处理实际分数 this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS); } + /** + * 将 区直部门分值表 中缺少的部门 数据,赋默认值 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param deptScoreDTOS 区直部门分值表 当前客户不存在的部门数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexMonthlyByDeptDefaultScore(String monthId, String customerId, List deptScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + for (int i = NumConstant.ZERO; i < deptScoreDTOS.size(); i++){ + IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); + monthlyDTO.setIndexTotal(zero); + monthlyDTO.setPartyDevAblity(zero); + monthlyDTO.setServiceAblity(zero); + monthlyDTO.setGovernAblity(zero); + // 9.12 增加权重 + monthlyDTO.setPartyDevWeight(zero); + monthlyDTO.setServiceAblityWeight(zero); + monthlyDTO.setGovernAblityWeight(zero); + // 补充表中其他字段 + monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScoreDTOS.get(i).getDeptId(), + deptScoreDTOS.get(i).getParentAgencyId(), deptScoreDTOS.get(i).getDeptName(), monthlyDTO); + monthlyFormDTOList.add(monthlyDTO); + } + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + /** * 将区直部门分值表 数据 插入月表 screenIndexDataMonthlyDao * @@ -478,20 +554,19 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据 Map> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> deptScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 部门id - orgIds[j] = deptScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < deptScore.getValue().size(); i++){ // 区直街道的总分 就是 治理能力 monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore()); + // 多余的权重,赋0 + monthlyFormDTO.setPartyDevWeight(new BigDecimal(NumConstant.ZERO)); + monthlyFormDTO.setServiceAblityWeight(new BigDecimal(NumConstant.ZERO)); // 赋值 治理能力 monthlyFormDTO = this.setValueAbilityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), + deptScore.getValue().get(i).getWeight(), deptScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -513,7 +588,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -529,23 +603,24 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 13:44 2020-09-04 **/ private void startHandleIndexAgencyScore(String monthId, String customerId){ + List mismatchAgencyList = new ArrayList<>(); List indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId); if (indexAgencyIds.size() > NumConstant.ZERO){ String[] agencyIds = new String[indexAgencyIds.size()]; for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){ agencyIds[i] = indexAgencyIds.get(i); } - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencyIds); - if (mismatchAgencyList.size() > NumConstant.ZERO){ - this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); - } + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, agencyIds); } else { - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); - this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, null); + } + + if (!CollectionUtils.isEmpty(mismatchAgencyList)){ + this.insertIndexMonthlyByAgencyDefaultScore(monthId, customerId, mismatchAgencyList); } - // 开始处理实际分数 // fact_index_agency_score 区/街道相关分数表 agency List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); + // 开始处理实际分数 this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS); } @@ -564,13 +639,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); - String[] orgIds = new String[collect.size()]; int j = 0; for(Map.Entry> agencyScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 组织id(eg:社区或者街道id) - orgIds[j] = agencyScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < agencyScore.getValue().size(); i++){ @@ -580,6 +651,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } else { // 赋值 党建能力、治理能力、服务能力 monthlyFormDTO = this.setValueAbilityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(), + agencyScore.getValue().get(i).getWeight(), agencyScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -602,7 +674,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -634,23 +705,28 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { /** * 赋实际值 党建能力、治理能力、服务能力 * @param IndexCode 组织类别 + * @param weight 权重(同一组权重总和=1) * @param Score 分数 * @param monthlyFormDTO 待保存的数据 * @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO * @Author zhangyong * @Date 09:26 2020-09-04 **/ - private IndexDataMonthlyFormDTO setValueAbilityMonthlyFor(String IndexCode, BigDecimal Score, IndexDataMonthlyFormDTO monthlyFormDTO){ + private IndexDataMonthlyFormDTO setValueAbilityMonthlyFor(String IndexCode, BigDecimal weight, BigDecimal Score, IndexDataMonthlyFormDTO monthlyFormDTO){ // 赋实际值 if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(IndexCode)){ // 党建能力 monthlyFormDTO.setPartyDevAblity(Score); + // 9.12 增加权重 + monthlyFormDTO.setPartyDevWeight(weight); } else if (IndexCodeEnum.ZHI_LI_NENG_LI.getCode().equals(IndexCode)){ // 治理能力 monthlyFormDTO.setGovernAblity(Score); + monthlyFormDTO.setGovernAblityWeight(weight); } else if (IndexCodeEnum.FU_WU_NENG_LI.getCode().equals(IndexCode)){ // 服务能力 monthlyFormDTO.setServiceAblity(Score); + monthlyFormDTO.setServiceAblityWeight(weight); } return monthlyFormDTO; } @@ -672,195 +748,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { return monthlyFormDTO; } - /** - * 新增 网格相关分值记录表 默认值,一条网格,按照组织类别的不同 需要插入4次 - * - * @param monthId 例:202008 - * @param customerId - * @param mismatchGridList 网格相关分值记录表 中缺少的网格集合 - * @return void - * @Author zhangyong - * @Date 14:02 2020-09-04 - **/ - private void insertIndexGridScoreDefaultValue(String monthId, String customerId, List mismatchGridList){ - List insertIndexGridScoreDTOS = new ArrayList<>(); - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - for (ScreenCustomerGridDTO gridDTO : mismatchGridList){ - FactIndexGridScoreDTO indexGridScoreDTO = new FactIndexGridScoreDTO(); - // 赋默认值 - 党建能力指数 - indexGridScoreDTO.setGridId(gridDTO.getGridId()); - indexGridScoreDTO.setAgencyId(gridDTO.getParentAgencyId()); - indexGridScoreDTO.setAllParentIds(gridDTO.getAllParentIds()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - indexGridScoreDTO.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO.setYearId(getYearStr(monthId)); - indexGridScoreDTO.setMonthId(monthId); - // 0 or 1 - indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR); - indexGridScoreDTO.setScore(zero); - indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR); - insertIndexGridScoreDTOS.add(indexGridScoreDTO); - - FactIndexGridScoreDTO indexGridScoreDTO1 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); - // 赋默认值 - 治理能力 - indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - insertIndexGridScoreDTOS.add(indexGridScoreDTO1); - - FactIndexGridScoreDTO indexGridScoreDTO2 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); - // 赋默认值 - 服务能力 - indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - insertIndexGridScoreDTOS.add(indexGridScoreDTO2); - - FactIndexGridScoreDTO indexGridScoreDTO3 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); - indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR); - // 赋默认值 - 网格相关 - indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - insertIndexGridScoreDTOS.add(indexGridScoreDTO3); - } - factIndexGridScoreDao.batchInsertGridScoreData(insertIndexGridScoreDTOS, customerId); - } - - /** - * 新增 社区相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 - * - * @param monthId - * @param customerId - * @param mismatchAgencyList - * @return void - * @Author zhangyong - * @Date 14:02 2020-09-04 - **/ - private void insertIndexCommunityScoreDefaultValue(String monthId, String customerId, List mismatchAgencyList){ - List insertIndexCommunityScore = new ArrayList<>(); - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ - FactIndexCommunityScoreEntity communityScore1 = new FactIndexCommunityScoreEntity(); - // 赋默认值 - 党建能力指数 - communityScore1.setAgencyId(agencyDTO.getAgencyId()); - communityScore1.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - communityScore1.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore1.setYearId(getYearStr(monthId)); - communityScore1.setMonthId(monthId); - // 0 or 1 - communityScore1.setIsTotal(NumConstant.ZERO_STR); - communityScore1.setScore(zero); - communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - insertIndexCommunityScore.add(communityScore1); - - // 赋默认值 - 治理能力 - FactIndexCommunityScoreEntity communityScore2 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); - communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - insertIndexCommunityScore.add(communityScore2); - - // 赋默认值 - 服务能力 - FactIndexCommunityScoreEntity communityScore3 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); - communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - insertIndexCommunityScore.add(communityScore3); - - // 赋默认值 - 社区相关 - FactIndexCommunityScoreEntity communityScore4 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); - communityScore4.setIsTotal(NumConstant.ONE_STR); - communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); - insertIndexCommunityScore.add(communityScore4); - } - factIndexCommunityScoreDao.batchInsertCommunityScoreData(insertIndexCommunityScore, customerId); - } - - /** - * 新增 区直部门分值表 默认值,一条部门id,按照组织类别的不同 需要插入1次 - * - * @param monthId - * @param customerId - * @param mismatchDeptList - * @return void - * @Author zhangyong - * @Date 14:02 2020-09-04 - **/ - private void insertIndexDeptScoreDefaultValueFor(String monthId, String customerId, List mismatchDeptList){ - List insertIndexDeptScore = new ArrayList<>(); - for (ScreenCustomerDeptEntity deptDTO : mismatchDeptList){ - DeptScoreEntity deptScore2 = new DeptScoreEntity(); - // 赋默认值 - 治理能力 - deptScore2.setDeptId(deptDTO.getDeptId()); - deptScore2.setAgencyId(deptDTO.getParentAgencyId()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - deptScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - deptScore2.setYearId(getYearStr(monthId)); - deptScore2.setMonthId(monthId); - deptScore2.setIsTotal(NumConstant.ZERO_STR); - deptScore2.setScore(new BigDecimal(NumConstant.ZERO)); - deptScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - deptScore2.setDelFlag(NumConstant.ZERO_STR); - insertIndexDeptScore.add(deptScore2); - } - deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId); - } - - /** - * 新增 区/街道相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 - * - * @param monthId - * @param customerId - * @param mismatchAgencyList - * @return void - * @Author zhangyong - * @Date 14:02 2020-09-04 - **/ - private void insertIndexAgencyScoreDefaultValueFor(String monthId, String customerId, List mismatchAgencyList){ - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - List insertIndexAgencyScore = new ArrayList<>(); - for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ - if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel()) || OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) - || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ - AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); - // 赋默认值 - 党建能力指数 - agencyScore1.setAgencyId(agencyDTO.getAgencyId()); - agencyScore1.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore1.setYearId(getYearStr(monthId)); - agencyScore1.setMonthId(monthId); - // 0 or 1 - agencyScore1.setIsTotal(NumConstant.ZERO_STR); - agencyScore1.setScore(zero); - agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - - AgencyScoreEntity agencyScore2 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); - // 赋默认值 - 治理能力 - agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - - AgencyScoreEntity agencyScore3 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); - // 赋默认值 - 服务能力 - agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - - AgencyScoreEntity agencyScore4 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); - agencyScore4.setIsTotal(NumConstant.ONE_STR); - if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel())){ - // 赋默认值 - 全区相关 - agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); - agencyScore4.setDataType(OrgTypeConstant.DISTRICT); - agencyScore1.setDataType(OrgTypeConstant.DISTRICT); - agencyScore2.setDataType(OrgTypeConstant.DISTRICT); - agencyScore3.setDataType(OrgTypeConstant.DISTRICT); - } else if (OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ - // 赋默认值 - 街道相关 - agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); - agencyScore4.setDataType(OrgTypeConstant.STREET); - agencyScore1.setDataType(OrgTypeConstant.STREET); - agencyScore2.setDataType(OrgTypeConstant.STREET); - agencyScore3.setDataType(OrgTypeConstant.STREET); - } - insertIndexAgencyScore.add(agencyScore1); - insertIndexAgencyScore.add(agencyScore2); - insertIndexAgencyScore.add(agencyScore3); - insertIndexAgencyScore.add(agencyScore4); - } - } - agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId); - } - /** * 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly * @@ -871,13 +758,14 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 22:06 2020-09-04 **/ private void insertIndexDataYear(String monthId, String customerId){ - List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), getMonthStr(monthId)); - String[] orgIds = new String[monthlyFormList.size()]; - for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){ - orgIds[i] = monthlyFormList.get(i).getOrgId(); - } + // 查询今年,上报了几个月的指数统计 + Integer monthCount = screenIndexDataMonthlyDao.selectCountIndexDataMonthly(customerId, getYearStr(monthId)); + List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), monthCount); if (monthlyFormList.size() > NumConstant.ZERO){ - screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId), orgIds); + int deleteNum; + do { + deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); + } while (deleteNum > NumConstant.ZERO); List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); } @@ -907,4 +795,21 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { private String getMonthStr(String monthId){ return monthId.substring(NumConstant.FOUR, NumConstant.SIX); } + + /** + * 批量删除 指数-指数数据(每月数值) 表数据 + * + * @param customerId + * @param monthId 202008 + * @param orgType 组织类别 agency:组织;部门:department;网格:grid + * @return void + * @Author zhangyong + * @Date 09:55 2020-09-12 + **/ + private void batchDelIndexDataMonthly( String customerId, String monthId, String orgType){ + int deleteNum; + do { + deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthlyByOrgType(customerId, monthId, orgType); + } while (deleteNum > NumConstant.ZERO); + } } 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 f202beca1b..eb77f2cf63 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 @@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import java.math.BigDecimal; import java.util.List; /** @@ -31,8 +32,18 @@ import java.util.List; public interface IndexGroupDetailService extends BaseService { /** * desc:根据all_parent_index_code 获取指标明细 + * * @param customerId * @param indexCode */ - List getDetailListByParentCode(String customerId,String... indexCode); + List getDetailListByParentCode(String customerId, String... indexCode); + + /** + * desc:根据all_parent_index_code 获取指标权重 + * 如果获取不到 返回-1 表明数据有误 + * + * @param customerId + * @param allPathIndexCode + */ + BigDecimal getWeightByAllPathIndexCode(String customerId, String allPathIndexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java new file mode 100644 index 0000000000..492a951156 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java @@ -0,0 +1,260 @@ +package com.epmet.service.evaluationindex.screen; + +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.dto.screencoll.form.*; + +/** + * 大屏数据采集api - kc + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface KcScreenCollService { + + /** + * 1、首页-平台各类总数上报 + * 当isFirst为true时,后台先按照customerId+dateId,清空数据,再插入。 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertPlatFormSummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 2、议题分析-各类总数 + * 当isFirst为true时,后台先按照customerId+dateId,清空数据,再插入。 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertIssueSummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 3、议题分析-参与趋势 + * 当isFirst为true时,customerId+monthId先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertIssueTrend(ScreenCollFormDTO formDTO, String customerId); + + /** + * 4、用户分析-各类总数 + * 当isFirst为true时根据customerId+dateId删除,后插入 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertUserSummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 5、公益互助-志愿者公益时长排名 + * 当isFirst为true时根据customerId删除,后插入 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertVolunteerHeartRank(ScreenCollFormDTO formDTO, String customerId); + + /** + * 6、用户分析-用户趋势 + * 当isFirst为true时,根据monthId+customerId先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertUserHeartRank(ScreenCollFormDTO formDTO, String customerId); + + /** + * 7、公益互助-活动各类总数 + * 当isFirst为true时,根据customerId+dateId先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertActSummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 8、公益互助-活动次数趋势 + * 当isFirst为true时,根据customerId+monthId先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertActTrend(ScreenCollFormDTO formDTO, String customerId); + + /** + * 9、公益互助-志愿者画像 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertVolunteerSummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 10、项目分析-各类总数 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertProjectSummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 11、项目分析-按分类统计 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertCategorySummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 12、项目分析-满意度分析 + * 当isFirst为true时,根据 customerId+monthId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertProjectSatisanalysis(ScreenCollFormDTO formDTO, String customerId); + + /** + * 13、党建声音-新闻各类总数汇总 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertNewsSummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 14、党建声音-新闻阅读参与趋势 + * 当isFirst为true时,根据 customerId+monthId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertNewsTrend(ScreenCollFormDTO formDTO, String customerId); + + /** + * 15、党建声音-热度新闻排行 + * 当isFirst为true时,根据 customerId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertNewsHotRank(ScreenCollFormDTO formDTO, String customerId); + + /** + * 16、党建声音-新闻按类别统计 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO, String customerId); + + /** + * 17、邻里党群-各类总数汇总 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertGroupSummary(ScreenCollFormDTO formDTO, String customerId); + + /** + * 18、邻里党群-小组详情 + * 当isFirst为true时,根据 customerId+dateId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertGroupDetail(ScreenCollFormDTO formDTO, String customerId); + + /** + * 19、邻里党群-话题参与趋势 + * 当isFirst为true时,根据 customerId+monthId 先删后增 + * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false + * + * @param formDTO + * @param customerId + * @return void + * @Author zhangyong + * @Date 15:57 2020-09-09 + **/ + void insertGroupTopicTrend(ScreenCollFormDTO formDTO, String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java similarity index 61% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java index 1e6dca0080..12d46a16f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java @@ -9,11 +9,11 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:25 */ -public interface ScreenCollService { +public interface ShiBeiScreenCollService { /** * 9、党建引领|基层治理-居民(党员)积分排行榜 - * 1) 根据CUSTOMER_ID、GRID_ID、USER_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -22,11 +22,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyUserRankData(List formDTO, String customerId); + void insertPartyUserRankData(PartyUserRankDataListFormDTO formDTO, String customerId); /** * 8、党建引领-党员联系群众数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -35,11 +35,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyLinkMassesData(List formDTO, String customerId); + void insertPartyLinkMassesData(PartyLinkMassesDataListFormDTO formDTO, String customerId); /** * 7、基层党建-建设情况数据(支部、联建、志愿) - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -48,11 +48,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyBranchData(List formDTO, String customerId); + void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId); /** * 6、党建引领-组织排行 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -61,11 +61,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertOrgRankData(List formDTO, String customerId); + void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId); /** * 5、基层治理-治理能力数据 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -74,11 +74,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertGovernRankData(List formDTO, String customerId); + void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId); /** * 4、事件数据 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -87,11 +87,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertEventData(List formDTO, String customerId); + void insertEventData(EventDataListFormDTO formDTO, String customerId); /** * 3、难点赌点 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除 * 2) 在新增 * * @param formDTO @@ -104,7 +104,7 @@ public interface ScreenCollService { /** * 2、党员基本情况 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -113,11 +113,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCpcbaseData(List formDTO, String customerId); + void insertCpcbaseData(CpcBaseDataListFormDTO formDTO, String customerId); /** * 1、指数_按月统计 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -126,11 +126,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertIndexDataMonthly(List formDTO, String customerId); + void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId); /** * 17、指数_按年统计 - * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、YEAR_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -139,11 +139,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertIndexDataYearly(List formDTO, String customerId); + void insertIndexDataYearly(IndexDataListYearlyFormDTO formDTO, String customerId); /** * 16、部门信息上传 - * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -152,11 +152,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerDept(List formDTO, String customerId); + void insertCustomerDept(CustomerDeptListFormDTO formDTO, String customerId); /** * 15、网格信息上传 - * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -165,11 +165,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerGrid(List formDTO, String customerId); + void insertCustomerGrid(CustomerGridListFormDTO formDTO, String customerId); /** * 14、组织层级 - * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -178,7 +178,7 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerAgency(List formDTO, String customerId); + void insertCustomerAgency(CustomerAgencyListFormDTO formDTO, String customerId); /** * 12、中央区各类总数 @@ -191,11 +191,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertUserTotalData(List formDTO, String customerId); + void insertUserTotalData(UserTotalDataListFormDTO formDTO, String customerId); /** * 11、基层治理-公众参与 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -204,11 +204,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertUserJoin(List formDTO, String customerId); + void insertUserJoin(UserJoinListFormDTO formDTO, String customerId); /** * 10、党建引领-先锋模范数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -217,12 +217,12 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPioneerData(List formDTO, String customerId); + void insertPioneerData(PioneerDataListFormDTO formDTO, String customerId); /** * 18、公众参与各类总数 * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * @param formDTO * @param formDTO @@ -230,5 +230,5 @@ public interface ScreenCollService { * @Author zhangyong * @Date 09:44 2020-08-25 **/ - void insertPublicPartiTotalData(List formDTO, String customerId); + void insertPublicPartiTotalData(PublicPartiTotalDataListFormDTO formDTO, String customerId); } 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 7a8935bd02..26fb5b8cc2 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 @@ -19,15 +19,23 @@ 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.constant.StrConstant; 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.redis.IndexCalRedis; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 客户指标详情 @@ -35,20 +43,40 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-19 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService { - + @Autowired + private IndexCalRedis indexCalRedis; @Override - public List getDetailListByParentCode(String customerId,String... indexCode) { - if (indexCode == null || indexCode.length == 0){ + public List getDetailListByParentCode(String customerId, String... indexCode) { + if (indexCode == null || indexCode.length == 0) { throw new RenException("参数错误"); } StringBuilder sb = new StringBuilder(); - for (String code:indexCode){ + for (String code : indexCode) { sb.append(code).append(StrConstant.COLON); } - return baseDao.getDetailListByParentCode(customerId,sb.deleteCharAt(sb.length()-1).toString()); + return baseDao.getDetailListByParentCode(customerId, sb.deleteCharAt(sb.length() - 1).toString()); } + + @Override + public BigDecimal getWeightByAllPathIndexCode(String customerId, String allPathIndexCode) { + Map indexCodeFiledReMap = indexCalRedis.getIndexCodeWeightMap(customerId); + if (CollectionUtils.isEmpty(indexCodeFiledReMap)) { + List allData = baseDao.getAllIndexWeightList(customerId); + if (CollectionUtils.isEmpty(allData)) { + log.warn("getAllIndexWeightList return empty"); + return null; + } + indexCodeFiledReMap = allData.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o.getWeight())); + indexCalRedis.setIndexCodeWeightMap(customerId, indexCodeFiledReMap); + } + BigDecimal weight = indexCodeFiledReMap.get(allPathIndexCode); + + return weight == null ? new BigDecimal(NumConstant.ONE_NEG) : weight; + } + } \ 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/KcScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java new file mode 100644 index 0000000000..2e4abd79df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java @@ -0,0 +1,367 @@ +/** + * 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.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.*; +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.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +/** + * 大屏数据采集 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class KcScreenCollServiceImpl implements KcScreenCollService { + + @Autowired + private ScreenKcPlatformSummaryDailyDao screenKcPlatformSummaryDailyDao; + @Autowired + private ScreenKcIssueSummaryGridDailyDao screenKcIssueSummaryGridDailyDao; + @Autowired + private ScreenKcIssueTrendGridMonthlyDao screenKcIssueTrendGridMonthlyDao; + @Autowired + private ScreenKcUserSummaryDailyDao screenKcUserSummaryDailyDao; + @Autowired + private ScreenKcVolunteerHeatRankGridDailyDao screenKcVolunteerHeatRankGridDailyDao; + @Autowired + private ScreenKcUserTrendGridMonthlyDao screenKcUserTrendGridMonthlyDao; + @Autowired + private ScreenKcActSummaryDailyDao screenKcActSummaryDailyDao; + @Autowired + private ScreenKcActTrendMonthlyDao screenKcActTrendMonthlyDao; + @Autowired + private ScreenKcVolunteerSummaryDailyDao screenKcVolunteerSummaryDailyDao; + @Autowired + private ScreenKcProjectSummaryGridDailyDao screenKcProjectSummaryGridDailyDao; + @Autowired + private ScreenKcProjectCategoryGridDailyDao screenKcProjectCategoryGridDailyDao; + @Autowired + private ScreenKcProjectSatisGridMonthlyDao screenKcProjectSatisGridMonthlyDao; + @Autowired + private ScreenKcNewsSummaryDailyDao screenKcNewsSummaryDailyDao; + @Autowired + private ScreenKcNewsTrendMonthlyDao screenKcNewsTrendMonthlyDao; + @Autowired + private ScreenKcNewsRankDao screenKcNewsRankDao; + @Autowired + private ScreenKcNewsCategoryAnalysisDao screenKcNewsCategoryAnalysisDao; + @Autowired + private ScreenKcGroupSummaryGridDailyDao screenKcGroupSummaryGridDailyDao; + @Autowired + private ScreenKcGroupDetailGridDailyDao screenKcGroupDetailGridDailyDao; + @Autowired + private ScreenKcTopicTrendGridMonthlyDao screenKcTopicTrendGridMonthlyDao; + + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPlatFormSummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcPlatformSummaryDailyDao.deletePlatFormSummary(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcPlatformSummaryDailyDao.batchInsertPlatFormSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIssueSummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcIssueSummaryGridDailyDao.deleteIssueSummaryGrid(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcIssueSummaryGridDailyDao.batchInsertIssueSummaryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIssueTrend(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcIssueTrendGridMonthlyDao.deleteIssueTrendGrid(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcIssueTrendGridMonthlyDao.batchInsertIssueTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserSummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcUserSummaryDailyDao.deleteUserSummary(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcUserSummaryDailyDao.batchInsertUserSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertVolunteerHeartRank(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcVolunteerHeatRankGridDailyDao.deleteVolunteerHeatRankGrid(customerId); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcVolunteerHeatRankGridDailyDao.batchInsertVolunteerHeatRankGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserHeartRank(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcUserTrendGridMonthlyDao.deleteUserTrendGrid(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcUserTrendGridMonthlyDao.batchInsertUserTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertActSummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcActSummaryDailyDao.deleteActSummary(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcActSummaryDailyDao.batchInsertActSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertActTrend(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcActTrendMonthlyDao.deleteActTrend(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcActTrendMonthlyDao.batchInsertActTrend(formDTO.getDataList(), customerId, formDTO.getMonthId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertVolunteerSummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcVolunteerSummaryDailyDao.deleteVolunteerSummary(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcVolunteerSummaryDailyDao.batchInsertVolunteerSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertProjectSummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcProjectSummaryGridDailyDao.deleteProjectSummary(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcProjectSummaryGridDailyDao.batchInsertProjectSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCategorySummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcProjectCategoryGridDailyDao.deleteCategoryGrid(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcProjectCategoryGridDailyDao.batchInsertCategoryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertProjectSatisanalysis(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcProjectSatisGridMonthlyDao.deleteProjectSatisGrid(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcProjectSatisGridMonthlyDao.batchInsertProjectSatisGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertNewsSummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcNewsSummaryDailyDao.deleteNewsSummary(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcNewsSummaryDailyDao.batchInsertNewsSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertNewsTrend(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcNewsTrendMonthlyDao.deleteNewsTrend(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcNewsTrendMonthlyDao.batchInsertNewsTrend(formDTO.getDataList(), customerId, formDTO.getMonthId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertNewsHotRank(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcNewsRankDao.deleteNewsRank(customerId); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcNewsRankDao.batchInsertNewsRank(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcNewsCategoryAnalysisDao.deleteNewsCategoryAnalysis(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcNewsCategoryAnalysisDao.batchInsertNewsCategoryAnalysis(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGroupSummary(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcGroupSummaryGridDailyDao.deleteGroupSummaryGrid(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcGroupSummaryGridDailyDao.batchInsertGroupSummaryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGroupDetail(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcGroupDetailGridDailyDao.deleteGroupDetailGrid(customerId, formDTO.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcGroupDetailGridDailyDao.batchInsertGroupDetailGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGroupTopicTrend(ScreenCollFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenKcTopicTrendGridMonthlyDao.deleteTopicTrendGrid(customerId, formDTO.getMonthId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenKcTopicTrendGridMonthlyDao.batchInsertTopicTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + } + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java deleted file mode 100644 index 6018622deb..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java +++ /dev/null @@ -1,470 +0,0 @@ -/** - * 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.ConvertUtils; -import com.epmet.constant.CompareConstant; -import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.evaluationindex.screen.*; -import com.epmet.dto.screencoll.form.*; -import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; -import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; -import com.epmet.service.evaluationindex.screen.ScreenCollService; -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.util.ArrayList; -import java.util.Calendar; -import java.util.List; - -/** - * 大屏数据采集 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-05-11 - */ -@Service -@DataSource(DataSourceConstant.EVALUATION_INDEX) -public class ScreenCollServiceImpl implements ScreenCollService { - - @Autowired - private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; - @Autowired - private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; - @Autowired - private ScreenPartyBranchDataDao screenPartyBranchDataDao; - @Autowired - private ScreenOrgRankDataDao screenOrgRankDataDao; - @Autowired - private ScreenGovernRankDataDao screenGovernRankDataDao; - @Autowired - private ScreenEventDataDao screenEventDataDao; - @Autowired - private ScreenEventImgDataDao screenEventImgDataDao; - @Autowired - private ScreenDifficultyDataDao screenDifficultyDataDao; - @Autowired - private ScreenCpcBaseDataDao screenCpcBaseDataDao; - @Autowired - private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; - @Autowired - private ScreenCustomerDeptDao screenCustomerDeptDao; - @Autowired - private ScreenCustomerGridDao screenCustomerGridDao; - @Autowired - private ScreenCustomerAgencyDao screenCustomerAgencyDao; - @Autowired - private ScreenUserTotalDataDao screenUserTotalDataDao; - @Autowired - private ScreenUserJoinDao screenUserJoinDao; - @Autowired - private ScreenPioneerDataDao screenPioneerDataDao; - @Autowired - private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; - @Autowired - private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPartyUserRankData(List formDTO,String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenPartyUserRankDataDao.deletePartyUserRankData(customerId, - formDTO.get(NumConstant.ZERO).getGridId(), - formDTO.get(NumConstant.ZERO).getUserId()); - } - - screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO,customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPartyLinkMassesData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId, orgIds); - - screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPartyBranchData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPartyBranchDataDao.deletePartyBranchData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertOrgRankData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenOrgRankDataDao.deleteOrgRankData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenOrgRankDataDao.batchInsertOrgRankData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertGovernRankData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenGovernRankDataDao.deleteGovernRankData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenGovernRankDataDao.batchInsertGovernRankData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertEventData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenEventDataDao.deleteEventData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); - } - - screenEventDataDao.batchInsertEventData(formDTO, customerId); - - for (int i = NumConstant.ZERO; i < formDTO.size(); i++) { - if (null != formDTO.get(i).getImgDataList() && formDTO.get(i).getImgDataList().size() > NumConstant.ZERO) { - // 根据原始事件ID,物理删除 - 事件数据图片数据 - screenEventImgDataDao.delEventImgDataByEventId(formDTO.get(i).getEventId()); - for (int j = NumConstant.ZERO; j < formDTO.get(i).getImgDataList().size(); j++){ - // 新增 中央区-事件数据图片数据 表 - ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); - imgDataEntity.setEventId(formDTO.get(i).getImgDataList().get(j).getEventId()); - imgDataEntity.setEventImgUrl(formDTO.get(i).getImgDataList().get(j).getImgUrl()); - imgDataEntity.setSort(formDTO.get(i).getImgDataList().get(j).getSort()); - screenEventImgDataDao.insert(imgDataEntity); - } - } - } - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId) { - if(formDTO.getIsFirst()){ - //直接删除当前客户下所有的数据 - screenDifficultyDataDao.deleteDifficultyData(customerId); - } - if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDiffcultyDataList())){ - screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDiffcultyDataList(), customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCpcbaseData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenCpcBaseDataDao.deleteCpcBaseData(customerId, orgIds); - - screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertIndexDataMonthly(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertIndexDataYearly(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - orgIds); - - screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCustomerDept(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] deptIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - deptIds[i] = formDTO.get(i).getDeptId(); - } - screenCustomerDeptDao.deleteCustomerDept(customerId, deptIds); - - screenCustomerDeptDao.batchInsertCustomerDept(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCustomerGrid(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] gridIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - gridIds[i] = formDTO.get(i).getGridId(); - } - screenCustomerGridDao.deleteCustomerGrid(customerId, gridIds); - - screenCustomerGridDao.batchInsertCustomerGrid(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCustomerAgency(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - screenCustomerAgencyDao.deleteCustomerAgency(customerId, agencyIds); - - screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertUserTotalData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenUserTotalDataDao.deleteUserTotalData(customerId, orgIds); - - screenUserTotalDataDao.batchInsertUserTotalData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertUserJoin(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenUserJoinDao.deleteUserJoin(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - String[] lastMonth = this.lastMonthDate(); - // 获取上个月的基本数据 - String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; - List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, - lastMonth[NumConstant.ZERO], - moneth, - orgIds); - - // 定义本月待添加数据的集合 - List curMonthJoinEntityList = new ArrayList<>(); - // 增加率计算 - if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO){ - // 存在上个月的数据 (本月-上月)/上月 *100 - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++){ - if (formDTO.get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())){ - ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); - entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); - entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); - entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); - entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); - entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); - entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); - curMonthJoinEntityList.add(entity); - } - } - } - } else { - // 计算增长率后的 待新增数据 - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - // 不存在上个月的数据 - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); - entity.setJoinTotalUpRate(zero); - entity.setJoinTotalUpFlag(""); - entity.setAvgIssueUpRate(zero); - entity.setAvgIssueUpFlag(""); - entity.setAgvgJoinUpRate(zero); - entity.setAgvgJoinUpFlag(""); - curMonthJoinEntityList.add(entity); - } - } - screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); - } - } - - /** - * 获取当前日期的前一个月的日期 - * @param - * @return java.lang.String[] - * @Author zhangyong - * @Date 15:33 2020-08-21 - **/ - private String[] lastMonthDate(){ - String[] date = new String[NumConstant.TWO]; - //Java获取当前日期的前一个月的日期 - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.MONTH, NumConstant.ONE_NEG); - 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] = NumConstant.ZERO_STR + month; - } - return date; - } - - /** - * 计算 本月数值 相较于 上月数值,的增长率 - * - * @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.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; - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPioneerData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPioneerDataDao.deletePioneerData(customerId, orgIds); - - screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPublicPartiTotalData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPublicPartiTotalDataDao.deletePublicPartiTotalData(customerId, orgIds); - - screenPublicPartiTotalDataDao.batchInsertPublicPartiTotalData(formDTO, customerId); - } - } -} 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 new file mode 100644 index 0000000000..bbb0585d44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -0,0 +1,472 @@ +/** + * 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.ConvertUtils; +import com.epmet.constant.CompareConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dto.screencoll.form.*; +import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; +import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; +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.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +/** + * 大屏数据采集 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + @Autowired + private ScreenOrgRankDataDao screenOrgRankDataDao; + @Autowired + private ScreenGovernRankDataDao screenGovernRankDataDao; + @Autowired + private ScreenEventDataDao screenEventDataDao; + @Autowired + private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + @Autowired + private ScreenCpcBaseDataDao screenCpcBaseDataDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + @Autowired + private ScreenUserJoinDao screenUserJoinDao; + @Autowired + private ScreenPioneerDataDao screenPioneerDataDao; + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyUserRankData(PartyUserRankDataListFormDTO formDTO,String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyUserRankDataDao.deletePartyUserRankData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyLinkMassesData(PartyLinkMassesDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyBranchDataDao.deletePartyBranchData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenOrgRankDataDao.deleteOrgRankData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenOrgRankDataDao.batchInsertOrgRankData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenGovernRankDataDao.deleteGovernRankData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenGovernRankDataDao.batchInsertGovernRankData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertEventData(EventDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenEventDataDao.deleteEventData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenEventDataDao.batchInsertEventData(formDTO.getDataList(), customerId); + + // 处理图片 + String[] events = new String[formDTO.getDataList().size()]; + List eventImgDataList = new ArrayList<>(); + Boolean isImgUrl = false; + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { + 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++){ + // 新增 中央区-事件数据图片数据 表 + ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); + imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); + imgDataEntity.setEventImgUrl(formDTO.getDataList().get(i).getImgDataList().get(j).getImgUrl()); + imgDataEntity.setSort(formDTO.getDataList().get(i).getImgDataList().get(j).getSort()); + eventImgDataList.add(imgDataEntity); + isImgUrl = true; + } + } + } + if (isImgUrl){ + screenEventImgDataDao.delEventImgDataByEvent(events); + screenEventImgDataDao.batchInsertEventImgData(eventImgDataList); + } + + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId) { + if(formDTO.getIsFirst()){ + //直接删除当前客户下所有的数据 + screenDifficultyDataDao.deleteDifficultyData(customerId); + } + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDataList())){ + screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCpcbaseData(CpcBaseDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCpcBaseDataDao.deleteCpcBaseData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIndexDataYearly(IndexDataListYearlyFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, formDTO.getYearId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerDept(CustomerDeptListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerDeptDao.deleteCustomerDept(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerDeptDao.batchInsertCustomerDept(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerGrid(CustomerGridListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerGridDao.deleteCustomerGrid(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerGridDao.batchInsertCustomerGrid(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerAgency(CustomerAgencyListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerAgencyDao.deleteCustomerAgency(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserTotalData(UserTotalDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenUserTotalDataDao.deleteUserTotalData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenUserTotalDataDao.batchInsertUserTotalData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserJoin(UserJoinListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenUserJoinDao.deleteUserJoin(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + if (formDTO.getDataList().size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.getDataList().size()]; + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ + orgIds[i] = formDTO.getDataList().get(i).getOrgId(); + } + + String[] lastMonth = this.lastMonthDate(); + // 获取上个月的基本数据 + String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; + List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, + lastMonth[NumConstant.ZERO], + moneth, + orgIds); + + // 定义本月待添加数据的集合 + List curMonthJoinEntityList = new ArrayList<>(); + // 增加率计算 + 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())){ + 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())); + entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), formDTO.getDataList().get(j).getAvgIssue())); + entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), formDTO.getDataList().get(j).getAvgIssue())); + entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), formDTO.getDataList().get(j).getAvgJoin())); + entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), formDTO.getDataList().get(j).getAvgJoin())); + curMonthJoinEntityList.add(entity); + } + } + } + } else { + // 计算增长率后的 待新增数据 + 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); + entity.setJoinTotalUpRate(zero); + entity.setJoinTotalUpFlag(""); + entity.setAvgIssueUpRate(zero); + entity.setAvgIssueUpFlag(""); + entity.setAgvgJoinUpRate(zero); + entity.setAgvgJoinUpFlag(""); + curMonthJoinEntityList.add(entity); + } + } + screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); + } + } + } + + /** + * 获取当前日期的前一个月的日期 + * @param + * @return java.lang.String[] + * @Author zhangyong + * @Date 15:33 2020-08-21 + **/ + private String[] lastMonthDate(){ + String[] date = new String[NumConstant.TWO]; + //Java获取当前日期的前一个月的日期 + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MONTH, NumConstant.ONE_NEG); + 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] = NumConstant.ZERO_STR + month; + } + return date; + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率 + * + * @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.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; + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPioneerData(PioneerDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPioneerDataDao.deletePioneerData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPioneerDataDao.batchInsertPioneerData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPublicPartiTotalData(PublicPartiTotalDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPublicPartiTotalDataDao.deletePublicPartiTotalData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPublicPartiTotalDataDao.batchInsertPublicPartiTotalData(formDTO.getDataList(), customerId); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java index 698a7c2881..e63a135590 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java @@ -1,6 +1,8 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.DimYearDao; import com.epmet.entity.stats.DimYearEntity; import com.epmet.service.stats.DemoDataStatsService; @@ -14,6 +16,7 @@ import java.util.Date; * 默认为统计数据源,不需要手动指定 */ @Service +@DataSource(DataSourceConstant.STATS) public class DemoDataStatsServiceImpl implements DemoDataStatsService { @Autowired 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 d24fec3ee8..ee4c56db29 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 @@ -55,6 +55,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class DimAgencyServiceImpl extends BaseServiceImpl implements DimAgencyService { @Autowired @@ -210,7 +211,6 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAgencyListByCustomerId(String customerId) { if (StringUtils.isBlank(customerId)){ 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 384c07c6da..cd5a1bad1d 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 @@ -19,12 +19,14 @@ 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.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.RobotConstant; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimCustomerDao; @@ -52,6 +54,7 @@ import java.util.Map; */ @Service @Slf4j +@DataSource(DataSourceConstant.STATS) public class DimCustomerServiceImpl extends BaseServiceImpl implements DimCustomerService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java index b754794b8a..9860f1937c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -19,17 +19,17 @@ 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.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.RobotConstant; -import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.stats.DimDateDTO; import com.epmet.entity.stats.DimDateEntity; -import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimDateService; import com.epmet.service.stats.LastExecRecordService; import com.epmet.util.DimIdGenerator; @@ -39,7 +39,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.*; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * 日期维度表 @@ -48,6 +51,7 @@ import java.util.*; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class DimDateServiceImpl extends BaseServiceImpl implements DimDateService { @Autowired 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 2c6fc13d8c..bbc261910c 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 @@ -19,10 +19,12 @@ 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.constant.RobotConstant; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimDepartmentDao; @@ -50,6 +52,7 @@ import java.util.Map; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class DimDepartmentServiceImpl extends BaseServiceImpl implements DimDepartmentService { @Autowired 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 cf1b8810ea..aa4091f60b 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 @@ -19,12 +19,14 @@ 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.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimGridDao; import com.epmet.dao.stats.LastExecRecordDao; @@ -33,9 +35,7 @@ import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; import com.epmet.dto.stats.DimGridDTO; import com.epmet.entity.stats.DimGridEntity; -import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimGridService; -import com.epmet.service.stats.LastExecRecordService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -53,6 +53,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class DimGridServiceImpl extends BaseServiceImpl implements DimGridService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java index 30dd3e210d..4cc6e03fd3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java @@ -19,23 +19,22 @@ 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.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.RobotConstant; -import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.stats.DimMonthDTO; import com.epmet.entity.stats.DimMonthEntity; -import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimMonthService; import com.epmet.service.stats.LastExecRecordService; import com.epmet.util.DimIdGenerator; import org.apache.commons.lang3.StringUtils; import org.joda.time.LocalDate; -import org.joda.time.LocalTime; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -52,6 +51,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class DimMonthServiceImpl extends BaseServiceImpl implements DimMonthService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java index a6e38147c3..5bad47d7f0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java @@ -19,21 +19,20 @@ 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.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.RobotConstant; -import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimQuarterDao; import com.epmet.dto.stats.DimQuarterDTO; import com.epmet.entity.stats.DimQuarterEntity; -import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimQuarterService; import com.epmet.service.stats.LastExecRecordService; import com.epmet.util.DimIdGenerator; -import com.sun.org.apache.xpath.internal.operations.Bool; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +40,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.*; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * 季度维度表 @@ -50,6 +52,7 @@ import java.util.*; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class DimQuarterServiceImpl extends BaseServiceImpl implements DimQuarterService { private Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java index 67d733976f..26e5815422 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java @@ -19,17 +19,17 @@ 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.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.RobotConstant; -import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimWeekDao; import com.epmet.dto.stats.DimWeekDTO; import com.epmet.entity.stats.DimWeekEntity; -import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimWeekService; import com.epmet.service.stats.LastExecRecordService; import org.apache.commons.lang3.StringUtils; @@ -50,6 +50,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class DimWeekServiceImpl extends BaseServiceImpl implements DimWeekService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java index 1c51a6babe..a1ed3bd2f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java @@ -19,17 +19,17 @@ 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.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.RobotConstant; -import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimYearDao; import com.epmet.dto.stats.DimYearDTO; import com.epmet.entity.stats.DimYearEntity; -import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimYearService; import com.epmet.service.stats.LastExecRecordService; import org.apache.commons.lang3.StringUtils; @@ -50,6 +50,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class DimYearServiceImpl extends BaseServiceImpl implements DimYearService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java index bbb1b39e44..ddf18955ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.stats.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.stats.FactAgencyProjectDailyDao; import com.epmet.dto.project.form.MonthProjectListFormDTO; import com.epmet.entity.stats.FactAgencyProjectDailyEntity; @@ -33,6 +35,7 @@ import java.util.List; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactAgencyProjectDailyServiceImpl extends BaseServiceImpl implements FactAgencyProjectDailyService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java index df869107f9..f96333f178 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.stats.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.stats.FactAgencyProjectMonthlyDao; import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; import com.epmet.service.stats.FactAgencyProjectMonthlyService; @@ -30,6 +32,7 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactAgencyProjectMonthlyServiceImpl extends BaseServiceImpl implements FactAgencyProjectMonthlyService { /** 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 9068ca2bdb..c12d4b176f 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 @@ -18,7 +18,9 @@ package com.epmet.service.stats.impl; import com.alibaba.fastjson.JSON; +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.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; @@ -37,6 +39,7 @@ import java.util.Collection; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedAgencyDailyService { 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 6f9e172dce..b21b0bb942 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 @@ -17,7 +17,9 @@ package com.epmet.service.stats.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.stats.FactArticlePublishedDepartmentDailyDao; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; @@ -35,6 +37,7 @@ import java.util.Collection; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedDepartmentDailyService { 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 c13a282916..9ad55d632f 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 @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; @@ -41,6 +43,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactArticlePublishedGridDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedGridDailyService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java index 1b54cd7686..d585bbfda7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.stats.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.stats.FactGridProjectDailyDao; import com.epmet.dto.project.form.MonthProjectListFormDTO; import com.epmet.entity.stats.FactAgencyProjectDailyEntity; @@ -34,6 +36,7 @@ import java.util.List; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactGridProjectDailyServiceImpl extends BaseServiceImpl implements FactGridProjectDailyService { /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java index 1d026d2891..4677b1dfa5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.stats.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.stats.FactGridProjectMonthlyDao; import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; import com.epmet.entity.stats.FactGridProjectMonthlyEntity; @@ -31,6 +33,7 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactGridProjectMonthlyServiceImpl extends BaseServiceImpl implements FactGridProjectMonthlyService { /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java index 30262fc6f7..21df7a0da4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -19,11 +19,13 @@ 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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactGroupAgencyDailyDao; import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; @@ -32,7 +34,6 @@ import com.epmet.dto.stats.FactGroupAgencyDailyDTO; import com.epmet.entity.stats.FactGroupAgencyDailyEntity; import com.epmet.service.stats.FactGroupAgencyDailyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,6 +49,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl implements FactGroupAgencyDailyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java index a9ba8ff7ac..5411842a38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java @@ -19,11 +19,13 @@ 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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactGroupAgencyMonthlyDao; import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.stats.FactGroupAgencyMonthlyDTO; @@ -44,6 +46,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactGroupAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactGroupAgencyMonthlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java index 6556ba92b6..d59d82e1e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java @@ -19,17 +19,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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.group.result.GroupGridDailyResultDTO; -import com.epmet.dto.stats.FactGroupGridDailyDTO; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactGroupGridDailyDao; +import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.dto.stats.FactGroupGridDailyDTO; import com.epmet.entity.stats.FactGroupGridDailyEntity; import com.epmet.service.StatsGroupService; -import com.epmet.service.group.GroupDataService; import com.epmet.service.stats.FactGroupGridDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -47,6 +48,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactGroupGridDailyServiceImpl extends BaseServiceImpl implements FactGroupGridDailyService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java index e6007e90d2..7f8b199438 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java @@ -19,16 +19,17 @@ 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.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactIssueAgencyDailyDao; import com.epmet.dto.stats.FactIssueAgencyDailyDTO; import com.epmet.entity.stats.FactIssueAgencyDailyEntity; import com.epmet.service.stats.FactIssueAgencyDailyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +44,7 @@ import java.util.Map; * @since v1.0.0 2020-06-17 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactIssueAgencyDailyServiceImpl extends BaseServiceImpl implements FactIssueAgencyDailyService { @Override 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 7215ecb179..2c3b7d46af 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 @@ -19,16 +19,17 @@ 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.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactIssueAgencyMonthlyDao; import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; import com.epmet.service.stats.FactIssueAgencyMonthlyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +44,7 @@ import java.util.Map; * @since v1.0.0 2020-06-17 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactIssueAgencyMonthlyService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java index 063e2ef8c5..e076194ef0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java @@ -19,16 +19,17 @@ 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.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactIssueGridDailyDao; import com.epmet.dto.stats.FactIssueGridDailyDTO; import com.epmet.entity.stats.FactIssueGridDailyEntity; import com.epmet.service.stats.FactIssueGridDailyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +44,7 @@ import java.util.Map; * @since v1.0.0 2020-06-17 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactIssueGridDailyServiceImpl extends BaseServiceImpl implements FactIssueGridDailyService { @Override 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 d3b0468011..97d6f29242 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 @@ -19,16 +19,17 @@ 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.commons.tools.constant.FieldConstant; +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.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +44,7 @@ import java.util.Map; * @since v1.0.0 2020-06-17 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl implements FactIssueGridMonthlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java index 7eef72f9d7..2c267d7bc5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java @@ -17,12 +17,13 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedAgencyDailyDao; import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; -import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import com.epmet.service.stats.FactTagUsedAgencyDailyService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -41,6 +42,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedAgencyDailyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyDailyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java index 85c51f9fdb..8ab508c5bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedAgencyMonthlyDao; import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; import com.epmet.service.stats.FactTagUsedAgencyMonthlyService; @@ -39,6 +41,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyMonthlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java index ec83b4b9b6..9f80d9eeea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedAgencyQuarterlyDao; import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; import com.epmet.service.stats.FactTagUsedAgencyQuarterlyService; @@ -39,6 +41,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedAgencyQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyQuarterlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java index 32f24e5836..340bc6b5cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedAgencyYearlyDao; import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; import com.epmet.service.stats.FactTagUsedAgencyYearlyService; @@ -39,6 +41,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedAgencyYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyYearlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java index f88f1f330a..ef85d1742f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedDepartmentDailyDao; import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; import com.epmet.service.stats.FactTagUsedDepartmentDailyService; @@ -40,6 +42,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentDailyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java index e0411038be..81bea68cf5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedDepartmentMonthlyDao; import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; import com.epmet.service.stats.FactTagUsedDepartmentMonthlyService; @@ -39,6 +41,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedDepartmentMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentMonthlyService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java index bb51750412..5b0abbbeec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedDepartmentQuarterlyDao; import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; import com.epmet.service.stats.FactTagUsedDepartmentQuarterlyService; @@ -37,6 +39,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedDepartmentQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentQuarterlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java index 6614095001..fb66d73fe2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedDepartmentYearlyDao; import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; import com.epmet.service.stats.FactTagUsedDepartmentYearlyService; @@ -38,6 +40,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedDepartmentYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentYearlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java index 95081992f2..dc0411850b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedGridDailyDao; import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import com.epmet.service.stats.FactTagUsedGridDailyService; @@ -40,6 +42,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedGridDailyServiceImpl extends BaseServiceImpl implements FactTagUsedGridDailyService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java index 05dc9a8942..c62068bee9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedGridMonthlyDao; import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; import com.epmet.service.stats.FactTagUsedGridMonthlyService; @@ -37,6 +39,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedGridMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridMonthlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java index 4e6bf21e2c..d4e34af163 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedGridQuarterlyDao; import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; import com.epmet.service.stats.FactTagUsedGridQuarterlyService; @@ -37,6 +39,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedGridQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridQuarterlyService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java index 02c7902ec2..ec981e83ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagUsedGridYearlyDao; import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; import com.epmet.service.stats.FactTagUsedGridYearlyService; @@ -37,6 +39,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagUsedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridYearlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java index 9e9500e96e..180be0459a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagViewedAgencyDailyDao; import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; import com.epmet.service.stats.FactTagViewedAgencyDailyService; @@ -39,6 +41,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagViewedAgencyDailyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyDailyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java index 0b7f08a6ed..3a56ffddc3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagViewedAgencyMonthlyDao; import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; import com.epmet.service.stats.FactTagViewedAgencyMonthlyService; @@ -36,6 +38,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagViewedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyMonthlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java index ba226febc9..6c69a4e92f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagViewedAgencyQuarterlyDao; import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; import com.epmet.service.stats.FactTagViewedAgencyQuarterlyService; @@ -36,6 +38,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagViewedAgencyQuarterlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyQuarterlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java index d5a0f0c123..3be2719703 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagViewedAgencyYearlyDao; import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; import com.epmet.service.stats.FactTagViewedAgencyYearlyService; @@ -36,6 +38,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagViewedAgencyYearlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyYearlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java index 2f3d9c0781..c129d5f7f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagViewedGridDailyDao; import com.epmet.entity.stats.FactTagViewedGridDailyEntity; import com.epmet.service.stats.FactTagViewedGridDailyService; @@ -40,6 +42,7 @@ import java.util.List; */ @Slf4j @Service +@DataSource(DataSourceConstant.STATS) public class FactTagViewedGridDailyServiceImpl extends BaseServiceImpl implements FactTagViewedGridDailyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java index 59e0726914..771d6acb30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagViewedGridMonthlyDao; import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; import com.epmet.service.stats.FactTagViewedGridMonthlyService; @@ -36,6 +38,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagViewedGridMonthlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridMonthlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java index 1671a6f4ef..e34601b5fc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagViewedGridQuarterlyDao; import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; import com.epmet.service.stats.FactTagViewedGridQuarterlyService; @@ -36,6 +38,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagViewedGridQuarterlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridQuarterlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java index a7dd6a6242..00bcb8a245 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactTagViewedGridYearlyDao; import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; import com.epmet.service.stats.FactTagViewedGridYearlyService; @@ -36,6 +38,7 @@ import java.util.List; * @since v1.0.0 2020-06-18 */ @Service +@DataSource(DataSourceConstant.STATS) public class FactTagViewedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridYearlyService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java index ba6e33d157..f37ac3b712 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java @@ -1,5 +1,7 @@ package com.epmet.service.stats.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.RobotConstant; import com.epmet.dao.stats.LastExecRecordDao; import com.epmet.entity.stats.LastExecRecordEntity; @@ -7,13 +9,13 @@ import com.epmet.service.stats.LastExecRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Date; - @Service +@DataSource(DataSourceConstant.STATS) public class LastExecRecordServiceImpl implements LastExecRecordService { @Autowired private LastExecRecordDao lastExecRecordDao; + @Override public LastExecRecordEntity getLastExecRecord(String statsSubject) { return lastExecRecordDao.getLastExecRecord(statsSubject); } 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 1ede9a4aae..786ec50233 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 @@ -4,6 +4,7 @@ import com.epmet.support.normalizing.ScoreCalculator; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -12,6 +13,7 @@ public class BatchScoreCalculator { /** * 执行计算,每个指标中每个样本的得分明细 + * * @return 每一条都是一个指标的,所有样本对应的,得分值 */ public List getScoreDetailOfIndexId(List indexInputVOS) { @@ -26,7 +28,7 @@ public class BatchScoreCalculator { // 循环同一个指标内的多个样本值的SampleValue列表 List scores4OneIndex = indexValueVOs.stream().map(vo -> { - BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP);; + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP); return new SampleScore(vo.getSampleId(), score); }).collect(Collectors.toList()); @@ -35,32 +37,51 @@ public class BatchScoreCalculator { } /** - * 执行计算,以样本的所有指标总得分 + * 执行计算,以样本的所有指标总得分(原始值)及明细分数(归一后的值 不乘以权重)值 + * * @param indexInputVOS * @return */ - public HashMap getScoreCountOfSampleId(List indexInputVOS) { + public HashMap getScoreTotalOfSampleId(List indexInputVOS) { // 每个样本的总得分 - HashMap scoreCountOfSamples = new HashMap<>(); - + HashMap scoreCountOfSamples = new HashMap<>(); + //遍历指标 for (IndexInputVO idx : indexInputVOS) { // 每个指标循环一次 List indexValueVOs = idx.getIndexValueVOs(); BigDecimal weight = idx.getWeight(); ScoreCalculator scoreCalculator = idx.getScoreCalculator(); BigDecimal threshold = idx.getThreshold(); - + //遍历该指标下的每个数据 for (SampleValue vo : indexValueVOs) { String sampleId = vo.getSampleId(); - BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight); - if (scoreCountOfSamples.containsKey(sampleId)) { - BigDecimal newScore = scoreCountOfSamples.get(sampleId).add(score).setScale(6, RoundingMode.HALF_UP); - scoreCountOfSamples.put(sampleId, newScore); + //归一后的值 + BigDecimal normalizeValue;// = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); + //如果不需要归一 则 直接value*权重 + if (idx.isScore()) { + 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); + } + BigDecimal score = normalizeValue.multiply(weight).setScale(6, RoundingMode.HALF_UP); + CalculateResult result = scoreCountOfSamples.get(sampleId); + + if (result == null) { score.setScale(6, RoundingMode.HALF_UP); - scoreCountOfSamples.put(sampleId, score); + result = new CalculateResult(); + result.setSampleId(sampleId); + result.setTotalScore(new BigDecimal(0)); + result.setDetails(new ArrayList<>()); + scoreCountOfSamples.put(sampleId, result); } + IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), normalizeValue, idx.getWeight()); + result.getDetails().add(sampleScore); + result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); } } @@ -69,6 +90,7 @@ public class BatchScoreCalculator { /** * 获取最终样本值 + * * @param realValue * @param threshold * @return @@ -81,6 +103,6 @@ public class BatchScoreCalculator { } return (bdRealValue.compareTo(threshold) < 0) || (bdRealValue.equals(threshold)) ? bdRealValue - : threshold ; + : threshold; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java new file mode 100644 index 0000000000..4765c023ba --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java @@ -0,0 +1,25 @@ +package com.epmet.support.normalizing.batch; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +public class CalculateResult implements Serializable { + private static final long serialVersionUID = -7966247924916816940L; + + /** + * 样本Id 对应inputVO中的sampleId + */ + private String sampleId; + /** + * 总得分 + */ + private BigDecimal totalScore; + /** + * 每项具体的分支 + */ + private List details; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java index 57c6fbc396..64d73ad3f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java @@ -19,6 +19,11 @@ public class IndexInputVO implements Serializable { */ private String indexId; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** * 指标的样本值 */ @@ -34,5 +39,10 @@ public class IndexInputVO implements Serializable { */ private BigDecimal weight; + /** + * 是否是分数 如果是分数 直接不用计算 乘以权重即可 + */ + private boolean isScore; + private ScoreCalculator scoreCalculator; } 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 new file mode 100644 index 0000000000..dd971eadc3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -0,0 +1,35 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author liujianjun + */ +@Data +@AllArgsConstructor +public class IndexScoreVo implements Serializable { + + private static final long serialVersionUID = 65642416224721650L; + /** + * 指标code + */ + private String indexCode; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** + * 分值 + */ + private BigDecimal score; + /** + * 该指标的权重 + */ + private BigDecimal weight; + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.3__add_index_table.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.3__add_index_table.sql new file mode 100644 index 0000000000..6a6ca63849 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.3__add_index_table.sql @@ -0,0 +1,687 @@ +# /* +# Navicat Premium Data Transfer +# +# Source Server : 亿联开发 +# Source Server Type : MySQL +# Source Server Version : 50728 +# Source Host : 192.168.1.130:3306 +# Source Schema : epmet_evaluation_index +# +# Target Server Type : MySQL +# Target Server Version : 50728 +# File Encoding : 65001 +# +# Date: 12/09/2020 09:10:38 +# */ +# +# SET NAMES utf8mb4; +# SET FOREIGN_KEY_CHECKS = 0; +# +# -- ---------------------------- +# -- Table structure for fact_index_agency_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_agency_score`; +# CREATE TABLE `fact_index_agency_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id(eg:社区或者街道id)', +# `PARENT_AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '上级组织id', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `DATA_TYPE` varchar(100) NOT NULL DEFAULT '' COMMENT '数据类型 district :全区;street:街道', +# `IS_TOTAL` varchar(1) NOT NULL DEFAULT '0' COMMENT '1:总分;0不是;默认0', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(255) NOT NULL COMMENT '党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` int(1) NOT NULL COMMENT '1删除,默认0', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间' +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='区/街道相关分数表 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_agency_sub_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_agency_sub_score`; +# CREATE TABLE `fact_index_agency_sub_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id(eg:社区或者街道id)', +# `PARENT_AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '上级组织id', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `DATA_TYPE` varchar(100) NOT NULL DEFAULT '' COMMENT '数据类型 district :全区;street:街道', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` int(1) NOT NULL COMMENT '1删除,默认0', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='区/街道相关分数表 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_community_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_community_score`; +# CREATE TABLE `fact_index_community_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', +# `PARENT_AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '社区上一级组织id', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `IS_TOTAL` varchar(1) NOT NULL DEFAULT '0' COMMENT '1:总分;0不是;默认0', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(255) NOT NULL COMMENT '党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` int(1) NOT NULL, +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='社区相关分数表 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_community_sub_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_community_sub_score`; +# CREATE TABLE `fact_index_community_sub_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', +# `PARENT_AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '社区上一级组织id', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` int(1) NOT NULL, +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='社区相关分数表 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_cpc_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_cpc_score`; +# CREATE TABLE `fact_index_cpc_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '网格所属的机关Id', +# `GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `USER_ID` varchar(64) NOT NULL COMMENT '用户id', +# `IS_TOTAL` varchar(1) NOT NULL DEFAULT '0' COMMENT '1:总分;0不是 默认0', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '参与议事分值:canyuyishi;\r\n党务活动分值:dangwuhuodong;\r\n联系群众分值:lianxiqunzhong;\r\n党建能力分值:dangjiannengli', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党员相关分值'; +# +# -- ---------------------------- +# -- Table structure for fact_index_cpc_sub_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_cpc_sub_score`; +# CREATE TABLE `fact_index_cpc_sub_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '网格所属的机关Id', +# `GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `USER_ID` varchar(64) NOT NULL COMMENT '用户id', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '参与议事分值:canyuyishi;\r\n党务活动分值:dangwuhuodong;\r\n联系群众分值:lianxiqunzhong;\r\n党建能力分值:dangjiannengli', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党员相关分值'; +# +# -- ---------------------------- +# -- Table structure for fact_index_dept_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_dept_score`; +# CREATE TABLE `fact_index_dept_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `DEPT_ID` varchar(64) NOT NULL COMMENT '部门id', +# `AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '部门所属的机关Id', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `IS_TOTAL` varchar(1) NOT NULL DEFAULT '0' COMMENT '1:总分;0不是;默认0', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '治理能力:zhilinengli;区直部门:quzhibumen', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='区直部门分值表'; +# +# -- ---------------------------- +# -- Table structure for fact_index_dept_sub_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_dept_sub_score`; +# CREATE TABLE `fact_index_dept_sub_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `DEPT_ID` varchar(64) NOT NULL COMMENT '部门id', +# `AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '部门所属的机关Id', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '治理能力:zhilinengli;', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='区直部门分值表'; +# +# -- ---------------------------- +# -- Table structure for fact_index_govrn_ablity_dept_monthly +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_govrn_ablity_dept_monthly`; +# CREATE TABLE `fact_index_govrn_ablity_dept_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '部门所属机关Id', +# `DEPT_ID` varchar(64) NOT NULL COMMENT '部门id', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id:yyyyMM', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id:yyyy', +# `TRANSFERED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '区直部门被吹哨次数', +# `CLOSED_PROJECT_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '区直部门办结项目数', +# `RESP_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '区直部门项目响应度 所有被吹哨后的滞留时间除以项目数', +# `HANDLE_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '区直部门办结项目的处理效率', +# `CLOSED_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '区直部门项目办结率', +# `SATISFACTION_RATIO` decimal(10,6) NOT NULL COMMENT '办结项目满意度', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='治理能力-区直部门相关数据 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_govrn_ablity_grid_monthly +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_govrn_ablity_grid_monthly`; +# CREATE TABLE `fact_index_govrn_ablity_grid_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '网格所属机关Id', +# `GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id:yyyyMM', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id:yyyy', +# `ISSUE_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '网格总议题数', +# `AVG_ISSUE_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格人均议题数目', +# `ISSUE_TO_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '网格议题转项目率', +# `PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '网格总项目数', +# `SELF_SOLVE_PROJECT_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格自治项目数 统计期网格自身内办结的项目数目', +# `RESOLVE_PROJECT_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格办结项目数 统计期内办结的项目数目', +# `TRANSFER_RIGHT_RATIO` decimal(10,6) NOT NULL COMMENT '网格吹哨部门准确率', +# `SATISFACTION_RATIO` decimal(10,6) NOT NULL COMMENT '网格内解决的项目的满意度', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='治理能力-网格相关事实表 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_govrn_ablity_org_monthly +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_govrn_ablity_org_monthly`; +# CREATE TABLE `fact_index_govrn_ablity_org_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关Id', +# `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id,如果是根级组织,此列为0', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id:yyyyMM', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id:yyyy', +# `DATA_TYPE` varchar(100) NOT NULL DEFAULT '' COMMENT '数据类型 district :全区;community:社区;street:街道', +# `TRANSFERED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '被吹哨次数', +# `CLOSED_PROJECT_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '办结项目数', +# `RESP_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '项目响应度 所有被吹哨后的滞留时间除以项目数', +# `OVERDUE_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '社区超期项目率,dataTyp=commnuity有值', +# `CLOSED_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '办结项目率', +# `SATISFACTION_RATIO` decimal(10,6) NOT NULL COMMENT '办结项目满意度', +# `HANDLE_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '街道办结项目的处理效率, data_type=street时有值', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='治理能力-街道及社区相关数据 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_grid_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_grid_score`; +# CREATE TABLE `fact_index_grid_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', +# `AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '网格所属的机关Id', +# `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `IS_TOTAL` varchar(1) NOT NULL DEFAULT '0' COMMENT '1:总分;0不是;默认0', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(255) NOT NULL COMMENT '党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间' +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格相关分值记录表'; +# +# -- ---------------------------- +# -- Table structure for fact_index_grid_sub_score +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_grid_sub_score`; +# CREATE TABLE `fact_index_grid_sub_score` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', +# `AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '网格所属的机关Id', +# `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID: yyyy', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyyMM', +# `SCORE` decimal(10,6) NOT NULL COMMENT '分值', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格相关分值记录表'; +# +# -- ---------------------------- +# -- Table structure for fact_index_party_ablity_cpc_monthly +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_party_ablity_cpc_monthly`; +# CREATE TABLE `fact_index_party_ablity_cpc_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '网格所属的机关Id', +# `PARENT_ID` varchar(64) DEFAULT NULL COMMENT 'agency_id的上级组织Id', +# `GRID_ID` varchar(64) NOT NULL COMMENT '党员所属的网格Id', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id: yyyMM', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id : yyyy', +# `USER_ID` varchar(64) NOT NULL COMMENT '用户id', +# `CREATE_TOPIC_COUNT` int(11) NOT NULL COMMENT '党员提出的话题数', +# `JOIN_TOPIC_COUNT` int(11) NOT NULL COMMENT '党员参与话题数(支持,反对,评论,浏览)', +# `SHIFT_ISSUE_COUNT` int(11) NOT NULL COMMENT '党员提出的话题转议题数', +# `SHIFT_PROJECT_COUNT` int(11) NOT NULL COMMENT '党员提出的议题转项目数', +# `JOIN_THREE_MEETS_COUNT` int(11) NOT NULL COMMENT '参加三会一课次数', +# `GROUP_USER_COUNT` int(11) NOT NULL COMMENT '党员自建群群众人数', +# `GROUP_ACTIVE_USER_COUNT` int(11) NOT NULL COMMENT '党员自建群活跃群众人数(08-24)', +# `GROUP_TOPIC_COUNT` int(11) NOT NULL COMMENT '党员自建群活跃度——话题数', +# `TOPIC_TO_ISSUE_RATIO` decimal(10,6) NOT NULL COMMENT '自建群活跃度——议题转项目率', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建能力-党员相关的事实表 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_party_ablity_grid_monthly +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_party_ablity_grid_monthly`; +# CREATE TABLE `fact_index_party_ablity_grid_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关Id', +# `GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id:yyyyMM', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度Id yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年Idyyyy', +# `USER_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格群众用户数', +# `PARTY_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格党员用户数', +# `ACTIVE_USER_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格活跃群众用户数', +# `ACTIVE_PARTY_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格活跃党员用户数', +# `PARTY_AVG_TOPIC_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格党员人均提出话题数', +# `USER_AVG_TOPIC_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格群众人均提出话题数', +# `PARTY_AVG_SHIFT_PROJECT_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格党员人均提出的议题转项目数', +# `USER_AVG_SHIFT_PROJECT_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格群众人均提出的议题转项目数', +# `CREATE_GROUP_PARTY_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '建群党员数(累计值) 去重', +# `PUBLISH_ARTICLE_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格发文数', +# `ISSUE_TO_PROJECT_RATIO` decimal(10,6) NOT NULL COMMENT '网格议题转项目率', +# `CREATE_THREE_MEETS_COUNT` int(11) NOT NULL COMMENT '组织三会一课次数', +# `JOIN_THREE_MEETS_COUNT` int(11) NOT NULL COMMENT '党员参加三会一课人次', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建能力-网格相关事实表 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_party_ablity_org_monthly +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_party_ablity_org_monthly`; +# CREATE TABLE `fact_index_party_ablity_org_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关Id', +# `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度Id', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', +# `PUBLISH_ARTICLE_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT 'XXX名义发文数', +# `DATA_TYPE` varchar(100) NOT NULL DEFAULT '' COMMENT '数据类型district :全区;community:社区;street:街道', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建能力-街道及社区相关事实表 '; +# +# -- ---------------------------- +# -- Table structure for fact_index_service_ablity_grid_monthly +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_service_ablity_grid_monthly`; +# CREATE TABLE `fact_index_service_ablity_grid_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '网格所属组织Id', +# `GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id:yyyyMM', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL DEFAULT '0' COMMENT '年Id: yyyy', +# `ACTIVITY_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '网格活动组织次数 爱心活动', +# `VOLUNTEER_RATIO` decimal(10,6) NOT NULL COMMENT '网格志愿者占比', +# `PARTY_VOLUNTEER_RATIO` decimal(10,6) NOT NULL COMMENT '网格党员志愿者率', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务能力-网格相关事实表'; +# +# -- ---------------------------- +# -- Table structure for fact_index_service_ablity_org_monthly +# -- ---------------------------- +# DROP TABLE IF EXISTS `fact_index_service_ablity_org_monthly`; +# CREATE TABLE `fact_index_service_ablity_org_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织Id', +# `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月维度Id:yyyyMM', +# `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4', +# `YEAR_ID` varchar(32) NOT NULL DEFAULT '0' COMMENT '年Id:yyyy', +# `ACTIVITY_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '社区/街道活动组织次数 爱心活动', +# `DATA_TYPE` varchar(100) NOT NULL DEFAULT '' COMMENT '数据类型 district :全区;community:社区;street:街道', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务能力-组织(街道|社区|全区)相关事实表 '; +# +# -- ---------------------------- +# -- Table structure for index_dict +# -- ---------------------------- +# DROP TABLE IF EXISTS `index_dict`; +# CREATE TABLE `index_dict` ( +# `ID` varchar(64) NOT NULL COMMENT '主键id', +# `INDEX_NAME` varchar(255) NOT NULL COMMENT '指标名', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '指标code', +# `INDEX_DESC` varchar(1024) DEFAULT NULL COMMENT '指标描述', +# `LEVEL` varchar(1) NOT NULL COMMENT '指标级别(1,2,3,4,5)', +# `CORRELATION` varchar(32) DEFAULT NULL COMMENT '正相关:positive;负相关:negative', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='评价指标字典'; +# +# -- ---------------------------- +# -- Table structure for index_group +# -- ---------------------------- +# DROP TABLE IF EXISTS `index_group`; +# CREATE TABLE `index_group` ( +# `ID` varchar(64) NOT NULL COMMENT '主键id', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', +# `INDEX_ID` varchar(64) NOT NULL COMMENT '指标id', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '指标code', +# `STATUS` varchar(32) NOT NULL DEFAULT 'enable' COMMENT '是否启用:启用:enable 禁用:disabled', +# `PARENT_INDEX_GROUP_ID` varchar(64) DEFAULT NULL COMMENT '当前指标关联的上一级指标分组,如果没有上一级,则为0', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户指标分组'; +# +# -- ---------------------------- +# -- Table structure for index_group_detail +# -- ---------------------------- +# DROP TABLE IF EXISTS `index_group_detail`; +# CREATE TABLE `index_group_detail` ( +# `ID` varchar(64) NOT NULL COMMENT '主键id', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', +# `INDEX_GROUP_ID` varchar(64) NOT NULL COMMENT 'index_group.id', +# `INDEX_ID` varchar(64) NOT NULL COMMENT '指标id', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '指标code', +# `WEIGHT` decimal(5,4) NOT NULL COMMENT '权重(同一组权重总和=1)', +# `THRESHOLD` decimal(16,4) NOT NULL DEFAULT '-1.0000' COMMENT '计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `STATUS` varchar(32) NOT NULL DEFAULT 'enable' COMMENT '是否启用:启用:enable 禁用:disabled', +# `CORRELATION` varchar(32) DEFAULT NULL COMMENT '正相关:positive;负相关:negative', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户指标详情'; +# +# -- ---------------------------- +# -- Table structure for index_group_detail_template +# -- ---------------------------- +# DROP TABLE IF EXISTS `index_group_detail_template`; +# CREATE TABLE `index_group_detail_template` ( +# `ID` varchar(64) NOT NULL COMMENT '主键id', +# `INDEX_GROUP_ID` varchar(64) NOT NULL COMMENT 'index_group_template.id', +# `INDEX_ID` varchar(64) NOT NULL COMMENT '指标id', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '指标code', +# `WEIGHT` decimal(5,4) NOT NULL COMMENT '权重(同一组权重总和=1)', +# `THRESHOLD` decimal(16,4) NOT NULL DEFAULT '-1.0000' COMMENT '计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值', +# `ALL_PARENT_INDEX_CODE` varchar(256) NOT NULL COMMENT '所有指标code拼接的字符串 冒号隔开', +# `CORRELATION` varchar(32) DEFAULT NULL COMMENT '正相关:positive;负相关:negative', +# `STATUS` varchar(32) NOT NULL DEFAULT 'enable' COMMENT '是否启用:启用:enable 禁用:disabled', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户指标详情'; +# +# -- ---------------------------- +# -- Table structure for index_group_template +# -- ---------------------------- +# DROP TABLE IF EXISTS `index_group_template`; +# CREATE TABLE `index_group_template` ( +# `ID` varchar(64) NOT NULL COMMENT '主键id', +# `INDEX_ID` varchar(64) NOT NULL COMMENT '指标id', +# `INDEX_CODE` varchar(64) NOT NULL COMMENT '指标code', +# `STATUS` varchar(32) NOT NULL DEFAULT 'enable' COMMENT '是否启用:启用:enable 禁用:disabled', +# `PARENT_INDEX_GROUP_ID` varchar(64) DEFAULT NULL COMMENT '当前指标关联的上一级指标分组,如果没有上一级,则为0', +# `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户指标分组'; +# +# -- ---------------------------- +# -- Table structure for index_code_field_re +# -- ---------------------------- +# DROP TABLE IF EXISTS `index_code_field_re`; +# CREATE TABLE `index_code_field_re` ( +# `ID` varchar(64) NOT NULL COMMENT '主键id', +# `INDEX_CODE` varchar(256) NOT NULL COMMENT '指标code', +# `FIELD_ID` varchar(32) DEFAULT '' COMMENT '是否启用:启用:enable 禁用:disabled', +# `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', +# `REVISION` int(11) NOT NULL COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE, +# UNIQUE KEY `unx_index_code` (`INDEX_CODE`) +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指标code和原始数据对应的字段关系表'; +# +# -- ---------------------------- +# -- Records of index_code_field_re +# -- ---------------------------- +# BEGIN; +# INSERT INTO `index_code_field_re` VALUES ('1', 'dangyuantichuhts', 'CREATE_TOPIC_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('10', 'wanggequnzhongyhs', 'USER_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('11', 'wanggedangyuanyhs', 'PARTY_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('12', 'wanggehuoyueqzyhs', 'ACTIVE_USER_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('13', 'wanggehuoyuedyyhs', 'ACTIVE_PARTY_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('14', 'wanggedangyuanrjtchts', 'PARTY_AVG_TOPIC_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('15', 'wanggequnzhongrjtchts', 'USER_AVG_TOPIC_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('16', 'wanggedangyuanrjtcdytzxms', 'PARTY_AVG_SHIFT_PROJECT_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('17', 'wanggequnzhongrjtcdytzxms', 'USER_AVG_SHIFT_PROJECT_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('18', 'jianqundangyuans', 'CREATE_GROUP_PARTY_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('19', 'zuzhineidangydlxqznlkpfpjz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('2', 'dangyuancanyuhtszcfdplll', 'JOIN_TOPIC_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('20', 'wanggedifawsl', 'PUBLISH_ARTICLE_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('21', 'wanggeyitizxml', 'ISSUE_TO_PROJECT_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:22:45'); +# INSERT INTO `index_code_field_re` VALUES ('22', 'zuzhisanhykcs', 'CREATE_THREE_MEETS_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('23', 'dangyuancanjiashykrc', 'JOIN_THREE_MEETS_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:05:13'); +# INSERT INTO `index_code_field_re` VALUES ('24', 'xiashusuoyouwgddjnlpjz', 'PARTY_ABLITY_SCORE', '0', 0, '', '0000-00-00 00:00:00', 'z', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('25', 'shequmingyifwsl', 'PUBLISH_ARTICLE_COUNT', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('26', 'jiedaoxiashusysqdjnlhzpyz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('27', 'jiedaomingyifwsl', 'PUBLISH_ARTICLE_COUNT', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('28', 'quxiajijieddjnlhzpyz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('29', 'qumingyifawsl', 'PUBLISH_ARTICLE_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('3', 'dangyuantichudhtzyts', 'SHIFT_ISSUE_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('30', 'zuzhineidangydcyysnlkpfpjz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('31', 'wanggezongyitsm', 'ISSUE_TOTAL', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:22:45'); +# INSERT INTO `index_code_field_re` VALUES ('32', 'wanggerenjunytsm', 'AVG_ISSUE_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:22:45'); +# INSERT INTO `index_code_field_re` VALUES ('33', 'wanggezongxiangms', 'PROJECT_TOTAL', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:22:45'); +# INSERT INTO `index_code_field_re` VALUES ('34', 'wanggezizhixms', 'SELF_SOLVE_PROJECT_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:22:45'); +# INSERT INTO `index_code_field_re` VALUES ('35', 'wanggebanjiexms', 'RESOLVE_PROJECT_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:22:45'); +# INSERT INTO `index_code_field_re` VALUES ('36', 'wanggechuishaobmzql', 'TRANSFER_RIGHT_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:22:45'); +# INSERT INTO `index_code_field_re` VALUES ('37', 'wanggeneijiejdxmdmyd', 'SATISFACTION_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:22:45'); +# INSERT INTO `index_code_field_re` VALUES ('38', 'shequxiashusywgzlnlhzpyz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('39', 'shequbeichuiscs', 'TRANSFERED_COUNT', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('4', 'dangyuantichudytzxms', 'SHIFT_PROJECT_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('40', 'shequbanjiexms', 'CLOSED_PROJECT_COUNT', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('41', 'shequxiangmuxyd', 'RESP_PROJECT_RATIO', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('42', 'shequchaoqixml', 'OVERDUE_PROJECT_RATIO', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('43', 'shequbanjiexml', 'CLOSED_PROJECT_RATIO', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('44', 'shequbanjiexmmyd', 'SATISFACTION_RATIO', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('45', 'jiedaoxiashusysqzlnlhz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('46', 'jiedaobeichuiscs', 'TRANSFERED_COUNT', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('47', 'jiedaobanjiexms', 'CLOSED_PROJECT_COUNT', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('48', 'jiedaoxiangmuxyd', 'RESP_PROJECT_RATIO', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('49', 'jiedaobanjiexmdclxl', 'HANDLE_PROJECT_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('5', 'canjiasanhykcs', 'JOIN_THREE_MEETS_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('50', 'jiedaoxiangmubjl', 'CLOSED_PROJECT_RATIO', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('51', 'jiedaojixiangmumyd', 'SATISFACTION_RATIO', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('52', 'quzhibumenbcscs', 'TRANSFERED_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-09-03 17:09:31'); +# INSERT INTO `index_code_field_re` VALUES ('53', 'quzhibumenbjxms', 'CLOSED_PROJECT_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-09-03 17:09:31'); +# INSERT INTO `index_code_field_re` VALUES ('54', 'quzhibumenxmxyd', 'RESP_PROJECT_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-09-03 17:09:31'); +# INSERT INTO `index_code_field_re` VALUES ('55', 'quzhibumenbjxmdclxl', 'HANDLE_PROJECT_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-09-03 17:09:31'); +# INSERT INTO `index_code_field_re` VALUES ('56', 'quzhibumenxmbjl', 'CLOSED_PROJECT_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-09-03 17:09:31'); +# INSERT INTO `index_code_field_re` VALUES ('57', 'quzhibumenxmmyd', 'SATISFACTION_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-09-03 17:09:31'); +# INSERT INTO `index_code_field_re` VALUES ('58', 'suoyoujiedaozlnlpjz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('59', 'suoyouzhizhubmzlnlpjz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('6', 'dangyuanzijianqqzrs', 'GROUP_USER_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('60', 'wanggehuodongzzcs', 'ACTIVITY_COUNT', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:15:06'); +# INSERT INTO `index_code_field_re` VALUES ('61', 'wanggezhiyuanzzb', 'VOLUNTEER_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:15:06'); +# INSERT INTO `index_code_field_re` VALUES ('62', 'wanggedangyuanzyzl', 'PARTY_VOLUNTEER_RATIO', '0', 0, '', '0000-00-00 00:00:00', 'yinzuomei', '2020-08-30 18:15:06'); +# INSERT INTO `index_code_field_re` VALUES ('63', 'shequxiajisywgfwnldfpjz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('64', 'shequhuodongzzcs', 'ACTIVITY_COUNT', '0', 0, 'zxc', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('65', 'jiedaoxiashusqfwnldfpyz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('66', 'jiedaohuodongzzcs', 'ACTIVITY_COUNT', '0', 0, 'zxc', '0000-00-00 00:00:00', 'zxc', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('67', 'quxiazhujiedfwnlhzpyz', '1', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('68', 'jiedaojixiangmmyd', 'SATISFACTION_RATIO', '0', 0, 'zxc', '2020-09-04 17:50:33', 'zxc', '2020-09-04 17:50:39'); +# INSERT INTO `index_code_field_re` VALUES ('7', 'dangyuanzijianqhyqzrs', 'GROUP_ACTIVE_USER_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('8', 'dangyuanzijianqhydhts', 'GROUP_TOPIC_COUNT', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# INSERT INTO `index_code_field_re` VALUES ('9', 'zijianqunhuoydytzxml', 'TOPIC_TO_ISSUE_RATIO', '0', 0, '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +# COMMIT; +# +# SET FOREIGN_KEY_CHECKS = 1; +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 8ad6400d13..99ae63af58 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 @@ -139,7 +139,7 @@ - + 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 211e573c3c..65922677e5 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 @@ -5,7 +5,8 @@ - INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, + WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( @@ -20,6 +21,8 @@ #{item.isTotal}, #{item.score}, #{item.indexCode}, + #{item.allParentIndexCode}, + #{item.weight}, #{item.delFlag}, #{item.revision}, #{item.createdBy}, @@ -39,8 +42,8 @@ del_flag = '0' AND customer_id = #{customerId} AND month_id = #{monthId} - AND index_code = #{indexCode} AND data_type = #{dataType} + LIMIT #{delNum} - - insert into fact_index_agency_score - ( - ID, - CUSTOMER_ID, - - AGENCY_ID, - PARENT_AGENCY_ID, - YEAR_ID, - QUARTER_ID, - MONTH_ID, - DATA_TYPE, - IS_TOTAL, - SCORE, - INDEX_CODE, - - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.parentAgencyId}, - - #{item.yearId}, - #{item.quarterId}, - #{item.monthId}, - #{item.dataType}, - #{item.isTotal}, - #{item.score}, - #{item.indexCode}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - - insert into fact_index_community_score - ( - ID, - CUSTOMER_ID, - AGENCY_ID, - PARENT_AGENCY_ID, - YEAR_ID, - QUARTER_ID, - MONTH_ID, - IS_TOTAL, - SCORE, - INDEX_CODE, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.parentAgencyId}, - #{item.yearId}, - #{item.quarterId}, - - #{item.monthId}, - #{item.isTotal}, - #{item.score}, - #{item.indexCode}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - SELECT - AVG( SCORE ) AS AVG_JOIN_ISSUE_SCORE + round(AVG( SCORE ),6) AS AVG_JOIN_ISSUE_SCORE FROM fact_index_cpc_score m WHERE @@ -85,7 +92,7 @@ @@ -110,6 +115,8 @@ `IS_TOTAL`, `SCORE`, `INDEX_CODE`, + `ALL_PARENT_INDEX_CODE`, + WEIGHT, `DEL_FLAG`, `REVISION`, `CREATED_BY`, @@ -130,6 +137,8 @@ #{item.isTotal}, #{item.score}, #{item.indexCode}, + #{item.allParentIndexCode}, + #{item.weight}, 0, 0, 'APP_USER', 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 new file mode 100644 index 0000000000..848323447a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml @@ -0,0 +1,147 @@ + + + + + + + delete from fact_index_cpc_sub_score + where + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + and ALL_PARENT_INDEX_CODE = #{allParentCode,jdbcType=VARCHAR} + + limit #{deleteSize,jdbcType=INTEGER} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO `fact_index_cpc_sub_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `YEAR_ID`, + `MONTH_ID`, + `USER_ID`, + `SCORE`, + `INDEX_CODE`, + `ALL_PARENT_INDEX_CODE`, + 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.yearId}, + #{item.monthId}, + #{item.userId}, + #{item.score}, + #{item.indexCode}, + #{item.allParentIndexCode}, + #{item.weight}, + 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/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index 077c6a7430..b70d136989 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -11,7 +11,8 @@ MONTH_ID monthId, IS_TOTAL isTotal, SCORE score, - INDEX_CODE indexCode + INDEX_CODE indexCode, + WEIGHT weight FROM fact_index_dept_score WHERE @@ -43,7 +44,33 @@ GROUP BY fidc.agency_id - + + + + + + delete from fact_index_dept_score where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + + and INDEX_CODE=#{indexCode} + + + limit #{deleteSize} + + + + + insert into fact_index_dept_score ( ID, @@ -56,7 +83,8 @@ IS_TOTAL, SCORE, INDEX_CODE, - + ALL_PARENT_INDEX_CODE, + WEIGHT, DEL_FLAG, REVISION, CREATED_BY, @@ -67,17 +95,18 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, + #{item.customerId}, #{item.deptId}, #{item.agencyId}, #{item.quarterId}, #{item.yearId}, - #{item.monthId}, #{item.isTotal}, #{item.score}, #{item.indexCode}, - #{item.delFlag}, + #{item.allParentIndexCode}, + #{item.weight}, + 0, 0, 'APP_USER', now(), @@ -87,21 +116,38 @@ - - - delete from fact_index_dept_score where CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} - and DEPT_ID=#{deptId} - + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml new file mode 100644 index 0000000000..b9715ead72 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml @@ -0,0 +1,60 @@ + + + + + + + insert into fact_index_dept_sub_score + ( + ID, + CUSTOMER_ID, + DEPT_ID, + AGENCY_ID, + QUARTER_ID, + YEAR_ID, + MONTH_ID, + SCORE, + INDEX_CODE, + ALL_PARENT_INDEX_CODE, + WEIGHT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.deptId}, + #{item.agencyId}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.score}, + #{item.indexCode}, + #{item.allParentIndexCode}, + #{item.weight}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + delete from fact_index_dept_sub_score + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + and ALL_PARENT_INDEX_CODE=#{allParentIndexCode} + + limit #{deleteSize} + + + 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 e45dcb04ef..499f3349f4 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 @@ -15,6 +15,7 @@ + @@ -23,7 +24,7 @@ - + DELETE FROM fact_index_grid_score @@ -31,9 +32,12 @@ CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} AND INDEX_CODE = #{indexCode} - and IS_TOTAL=#{isTotal} + + limit #{deleteSize} + + INSERT INTO `fact_index_grid_score` ( `ID`, @@ -47,6 +51,8 @@ `IS_TOTAL`, `SCORE`, `INDEX_CODE`, + ALL_PARENT_INDEX_CODE, + WEIGHT, `DEL_FLAG`, `REVISION`, `CREATED_BY`, @@ -68,6 +74,8 @@ #{item.isTotal}, #{item.score}, #{item.indexCode}, + #{item.allParentIndexCode}, + #{item.weight}, 0, 0, 'APP_USER', @@ -112,4 +120,62 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} - \ 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 new file mode 100644 index 0000000000..536f834564 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml @@ -0,0 +1,66 @@ + + + + + + + + INSERT INTO `fact_index_grid_sub_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `ALL_PARENT_IDS`, + `QUARTER_ID`, + `YEAR_ID`, + `MONTH_ID`, + `SCORE`, + `INDEX_CODE`, + ALL_PARENT_INDEX_CODE, + 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.score}, + #{item.indexCode}, + #{item.allParentIndexCode}, + #{item.weight}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + DELETE + FROM + fact_index_grid_sub_score + WHERE + CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND ALL_PARENT_INDEX_CODE = #{allParentIndexCode} + + limit #{deleteSize} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index 67165f1bf7..b4475c72cd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -27,8 +27,8 @@ delete from fact_index_govrn_ablity_dept_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND DEPT_ID = #{deptId} - AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + 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/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 870e2596ec..a84dff6a5c 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 @@ -29,8 +29,8 @@ delete from fact_index_govrn_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + 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 a703174aee..eb9a582759 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 @@ -30,11 +30,8 @@ delete from fact_index_govrn_ablity_org_monthly where CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - AND AGENCY_ID IN - - #{item} - + AND MONTH_ID = #{monthId} + limit 1000; 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 8336f33e9a..443d22edfa 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 @@ -93,7 +93,9 @@ FROM fact_index_party_ablity_cpc_monthly WHERE - CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DEL_FLAG = '0' + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + AND DEL_FLAG = '0' - SELECT - figc.agency_id AS agencyId, - figc.month_id as monthId, - figc.quarter_id as quarterId, - figc.year_id as yearId, - AVG( figc.score ) AS score, - figc.customer_id as customerId, - sca.pid AS parentId - FROM - fact_index_grid_score figc - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID - WHERE - figc.del_flag = '0' - AND sca.DEL_FLAG = 0 - AND figc.customer_id = #{customerId} - AND figc.month_id = #{monthId} - AND figc.index_code = #{indexCode} - GROUP BY figc.agency_id - - - - - - insert into fact_index_grid_score - ( - ID, - CUSTOMER_ID, - GRID_ID, - AGENCY_ID, - ALL_PARENT_IDS, - QUARTER_ID, - YEAR_ID, - MONTH_ID, - IS_TOTAL, - SCORE, - INDEX_CODE, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.gridId}, - #{item.agencyId}, - #{item.allParentIds}, - #{item.quarterId}, - - #{item.yearId}, - #{item.monthId}, - #{item.isTotal}, - #{item.score}, - #{item.indexCode}, - #{item.delFlag}, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - - - 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 c2ab3e07c6..76bec7b257 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 @@ -12,4 +12,10 @@ CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0' and ALL_PARENT_INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + + \ 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 1059fe5518..03270712ee 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 @@ -6,10 +6,7 @@ delete from screen_cpc_base_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + 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 36ac049262..49ce41b17c 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 @@ -6,10 +6,7 @@ delete from screen_customer_agency where CUSTOMER_ID = #{customerId} - AND AGENCY_ID IN - - #{item} - + limit 1000; @@ -60,7 +57,7 @@ - SELECT AGENCY_ID agencyId, AGENCY_NAME agencyName, @@ -72,6 +69,7 @@ WHERE DEL_FLAG = '0' AND CUSTOMER_ID =#{customerId} + AND `LEVEL` = 'community' AND AGENCY_ID NOT IN @@ -90,4 +88,49 @@ DEL_FLAG = '0' AND CUSTOMER_ID =#{customerId} + + + + + + + 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 31717d6dd2..1533203d14 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 @@ -6,10 +6,7 @@ delete from screen_customer_dept where CUSTOMER_ID = #{customerId} - AND DEPT_ID IN - - #{item} - + limit 1000; 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 c85dc0af60..92486a3f10 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 @@ -6,10 +6,7 @@ delete from screen_customer_grid where CUSTOMER_ID = #{customerId} - AND GRID_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml index fa22c8ad79..f395b4bdce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml @@ -5,7 +5,8 @@ delete from screen_event_data - where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + where CUSTOMER_ID = #{customerId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml index 9623ede0b9..bc5228b426 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml @@ -3,9 +3,42 @@ - + delete from screen_event_img_data - where DEL_FLAG = '0' AND EVENT_ID = #{eventId} + where DEL_FLAG = '0' + AND EVENT_ID IN + + #{item} + + + insert into screen_event_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, + 'APP_USER', + now(), + 'APP_USER', + 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 9a8da4e40e..f569cb89a9 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 @@ -5,11 +5,8 @@ delete from screen_govern_rank_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + 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/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml index 4c8369dd0a..f192c1373c 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 @@ -5,11 +5,8 @@ delete from screen_index_data_monthly - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; @@ -27,6 +24,9 @@ PARTY_DEV_ABLITY, SERVICE_ABLITY, GOVERN_ABLITY, + PARTY_DEV_WEIGHT, + SERVICE_ABLITY_WEIGHT, + GOVERN_ABLITY_WEIGHT, DEL_FLAG, REVISION, CREATED_BY, @@ -49,6 +49,9 @@ #{item.partyDevAblity}, #{item.serviceAblity}, #{item.governAblity}, + #{item.partyDevWeight}, + #{item.serviceAblityWeight}, + #{item.governAblityWeight}, 0, 0, 'APP_USER', @@ -67,10 +70,10 @@ ORG_ID orgId, PARENT_ID parentId, ORG_NAME orgName, - SUM(INDEX_TOTAL) / #{month} as indexTotal, - SUM(PARTY_DEV_ABLITY) / #{month} as partyDevAblity, - SUM(SERVICE_ABLITY) / #{month} as serviceAblity, - SUM(GOVERN_ABLITY) / #{month} as governAblity + SUM(INDEX_TOTAL) / #{monthCount} as indexTotal, + SUM(PARTY_DEV_ABLITY * PARTY_DEV_WEIGHT) / #{monthCount} as partyDevAblity, + SUM(SERVICE_ABLITY * SERVICE_ABLITY_WEIGHT) / #{monthCount} as serviceAblity, + SUM(GOVERN_ABLITY * GOVERN_ABLITY_WEIGHT) / #{monthCount} as governAblity FROM screen_index_data_monthly WHERE DEL_FLAG = '0' AND YEAR_ID = #{yearId} @@ -78,4 +81,22 @@ GROUP BY ORG_ID + + + + delete from screen_index_data_monthly + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} AND ORG_TYPE = #{orgType} + limit 1000; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml index 75eb13d280..aed08ebfed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml @@ -6,10 +6,7 @@ delete from screen_index_data_yearly where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcActSummaryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcActSummaryDailyDao.xml new file mode 100644 index 0000000000..b7867b1098 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcActSummaryDailyDao.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_act_summary_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_act_summary_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + ACT_COUNT, + VOLUNTEER_COUNT, + PARTI_USER_COUNT, + REWARD_POINT_COUNT, + HEART_TIME, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.actCount}, + #{item.volunteerCount}, + #{item.partiUserCount}, + #{item.rewardPointCount}, + #{item.heartTime}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcActTrendMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcActTrendMonthlyDao.xml new file mode 100644 index 0000000000..b8762aa572 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcActTrendMonthlyDao.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + delete from screen_kc_act_trend_monthly + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; + + + + insert into screen_kc_act_trend_monthly + ( + ID, + CUSTOMER_ID, + MONTH_ID, + ACT_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{item.actCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcGroupDetailGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcGroupDetailGridDailyDao.xml new file mode 100644 index 0000000000..4dca3289ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcGroupDetailGridDailyDao.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_group_detail_grid_daily + where CUSTOMER_ID = #{customerId} + limit 1000; + + + + insert into screen_kc_group_detail_grid_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + GROUP_ID, + GROUP_NAME, + GROUP_LEADER, + MEMBER_COUNT, + TOPIC_COUNT, + SHIFIT_ISSUE_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.groupId}, + #{item.groupName}, + #{item.groupLeader}, + #{item.memberCount}, + #{item.topicCount}, + #{item.shiftIssueCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcGroupSummaryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcGroupSummaryGridDailyDao.xml new file mode 100644 index 0000000000..380d1e540f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcGroupSummaryGridDailyDao.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_group_summary_grid_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_group_summary_grid_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + GROUP_COUNT, + MEMBER_COUNT, + TOPIC_COUNT, + PARTI_COUNT, + SHIFT_ISSUE_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.groupCount}, + #{item.memberCount}, + #{item.topicCount}, + #{item.partiCount}, + #{item.shiftIssueCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcIssueSummaryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcIssueSummaryGridDailyDao.xml new file mode 100644 index 0000000000..741fd14534 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcIssueSummaryGridDailyDao.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_issue_summary_grid_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_issue_summary_grid_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + REPORT_COUNT, + ISSUE_COUNT, + PENDING_COUNT, + REJECTED_COUNT, + PROCESSING_COUNT, + CLOSED_COUNT, + ISSUE_VIEW_COUNT, + VOTE_COUNT, + PASSED_COUNT, + SHIFT_TO_PROJECT_COUNT, + AVG_AUDIT_TIME, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.reportCount}, + #{item.issueCount}, + #{item.pendingCount}, + #{item.rejectedCount}, + #{item.processingCount}, + #{item.closedCount}, + #{item.issueViewCount}, + #{item.voteCount}, + #{item.passedCount}, + #{item.shiftToProjectCount}, + #{item.avgAuditTime}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcIssueTrendGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcIssueTrendGridMonthlyDao.xml new file mode 100644 index 0000000000..1957824176 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcIssueTrendGridMonthlyDao.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_issue_trend_grid_monthly + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; + + + + insert into screen_kc_issue_trend_grid_monthly + ( + ID, + CUSTOMER_ID, + MONTH_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + REPORT_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.reportCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsCategoryAnalysisDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsCategoryAnalysisDao.xml new file mode 100644 index 0000000000..64b3a8578a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsCategoryAnalysisDao.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_news_category_analysis + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_news_category_analysis + ( + ID, + CUSTOMER_ID, + DATE_ID, + + CATEGORY_ID, + CATEGORY_NAME, + NEWS_COUNT, + READ_COUNT, + LIKE_COUNT, + DIS_LIKE_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.categoryId}, + #{item.categoryName}, + #{item.newsCount}, + #{item.readCount}, + #{item.likeCount}, + #{item.disLikeCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsRankDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsRankDao.xml new file mode 100644 index 0000000000..08886ea7d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsRankDao.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_news_rank + where CUSTOMER_ID = #{customerId} + limit 1000; + + + + insert into screen_kc_news_rank + ( + ID, + CUSTOMER_ID, + DATE_ID, + NEWS_ID, + NEWS_TITLE, + HOT_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.newsId}, + #{item.newsTitle}, + #{item.hotCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsSummaryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsSummaryDailyDao.xml new file mode 100644 index 0000000000..f2cd35dd00 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsSummaryDailyDao.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_news_summary_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_news_summary_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + NEWS_COUNT, + READ_COUNT, + LIKE_COUNT, + COMMENT_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.newsCount}, + #{item.readCount}, + #{item.likeCount}, + #{item.commentCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsTrendMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsTrendMonthlyDao.xml new file mode 100644 index 0000000000..60bebaa7d7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsTrendMonthlyDao.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + delete from screen_kc_news_trend_monthly + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; + + + + insert into screen_kc_news_trend_monthly + ( + ID, + CUSTOMER_ID, + MONTH_ID, + PARTI_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{item.partiCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcPlatformSummaryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcPlatformSummaryDailyDao.xml new file mode 100644 index 0000000000..855456a973 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcPlatformSummaryDailyDao.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_platform_summary_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_platform_summary_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + GRID_COUNT, + OPENED_GRID_COUNT, + ISSUE_COUNT, + PROJECT_COUNT, + USER_COUNT, + PARTY_USER_COUNT, + GROUP_COUNT, + TOPIC_COUNT, + NEWS_COUNT, + READ_COUNT, + ACT_COUNT, + VOLUNTEER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridCount}, + #{item.openedGridCount}, + #{item.issueCount}, + #{item.projectCount}, + #{item.userCount}, + #{item.partyUserCount}, + #{item.groupCount}, + #{item.topicCount}, + #{item.newsCount}, + #{item.readCount}, + #{item.actCount}, + #{item.vounteerCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectCategoryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectCategoryGridDailyDao.xml new file mode 100644 index 0000000000..1a06d2959a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectCategoryGridDailyDao.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_project_category_grid_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_project_category_grid_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + CATEGORY_ID, + CATEGORY_NAME, + PROJECT_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.categoryId}, + #{item.categoryName}, + #{item.projectCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectSatisGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectSatisGridMonthlyDao.xml new file mode 100644 index 0000000000..740caa71e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectSatisGridMonthlyDao.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_project_satis_grid_monthly + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; + + + + insert into screen_kc_project_satis_grid_monthly + ( + ID, + CUSTOMER_ID, + MONTH_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + GREAT_SATIS, + GOOD_SATIS, + DIS_SATIS, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.greatSatisfaction}, + #{item.goodSatisfaction}, + #{item.disSatisfaction}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectSummaryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectSummaryGridDailyDao.xml new file mode 100644 index 0000000000..cd19511251 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcProjectSummaryGridDailyDao.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_project_summary_grid_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_project_summary_grid_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + PROJECT_COUNT, + PROCESSING_COUNT, + CLOSED_COUNT, + MOVE_COUNT, + CLOSED_CASE_COUNT, + PROJECT_VIEW_COUNT, + VOTE_COUNT, + AVG_CLOSED_CASE_TIME, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.projectCount}, + #{item.processingCount}, + #{item.closedCount}, + #{item.moveCount}, + #{item.closedCaseCount}, + #{item.projectViewCount}, + #{item.voteCount}, + #{item.avgClosedCaseTime}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcTopicTrendGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcTopicTrendGridMonthlyDao.xml new file mode 100644 index 0000000000..868d8b70ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcTopicTrendGridMonthlyDao.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_topic_trend_grid_monthly + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; + + + + insert into screen_kc_topic_trend_grid_monthly + ( + ID, + CUSTOMER_ID, + MONTH_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + TOPIC_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.topicCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcUserSummaryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcUserSummaryDailyDao.xml new file mode 100644 index 0000000000..001b32e398 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcUserSummaryDailyDao.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_user_summary_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_user_summary_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + VISITOR_COUNT, + REG_USER_COUNT, + PARTY_USER_COUNT, + AGE_LEVEL_1, + AGE_LEVEL_2, + AGE_LEVEL_3, + AGE_LEVEL_4, + AGE_LEVEL_5, + AGE_LEVEL_6, + MALE_PARTY_USER_COUNT, + FEMALE_PARTY_USER_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.visitorCount}, + #{item.regUserCount}, + #{item.partyCount}, + #{item.ageLevel1}, + #{item.ageLevel2}, + #{item.ageLevel3}, + #{item.ageLevel4}, + #{item.ageLevel5}, + #{item.ageLevel6}, + #{item.malePartyUserCount}, + #{item.femalePartyUserCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcUserTrendGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcUserTrendGridMonthlyDao.xml new file mode 100644 index 0000000000..4ba017252f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcUserTrendGridMonthlyDao.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_user_trend_grid_monthly + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; + + + + insert into screen_kc_user_trend_grid_monthly + ( + ID, + CUSTOMER_ID, + MONTH_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + REG_USER_COUNT, + PARTY_USER_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.regUserCount}, + #{item.partyUserCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyDao.xml new file mode 100644 index 0000000000..dffc71ae0c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyDao.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_volunteer_heat_rank_grid_daily + where CUSTOMER_ID = #{customerId} + limit 1000; + + + + insert into screen_kc_volunteer_heat_rank_grid_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + USER_ID, + USER_NAME, + HEART_TIME, + POINTS, + VOLUNTEER_ID, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.userId}, + #{item.userName}, + #{item.heartTime}, + #{item.points}, + #{item.volunteerId}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcVolunteerSummaryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcVolunteerSummaryDailyDao.xml new file mode 100644 index 0000000000..2e7de8203d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcVolunteerSummaryDailyDao.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_kc_volunteer_summary_daily + where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + limit 1000; + + + + insert into screen_kc_volunteer_summary_daily + ( + ID, + CUSTOMER_ID, + DATE_ID, + + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + ALL_PARENT_IDS, + AGE_LEVEL_1, + AGE_LEVEL_2, + AGE_LEVEL_3, + AGE_LEVEL_4, + AGE_LEVEL_5, + AGE_LEVEL_6, + MALE_COUNT, + FEMALE_COUNT, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.allParentIds}, + #{item.ageLevel1}, + #{item.ageLevel2}, + #{item.ageLevel3}, + #{item.ageLevel4}, + #{item.ageLevel5}, + #{item.ageLevel6}, + #{item.maleCount}, + #{item.femaleCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + 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 64c79965e9..2cf5f7dc33 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 @@ -5,11 +5,8 @@ delete from screen_org_rank_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + 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/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml index 12bc3a4755..a7058e4a08 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 @@ -5,11 +5,8 @@ delete from screen_party_branch_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + 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/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index c9e4e65e5f..f6760538d1 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 @@ -6,10 +6,7 @@ delete from screen_party_link_masses_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; 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 fe88da6d76..d4089fcc30 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 @@ -5,7 +5,8 @@ delete from screen_party_user_rank_data - where CUSTOMER_ID = #{customerId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + where CUSTOMER_ID = #{customerId} + limit 1000; 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 ceff6812fb..91d8537c19 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 @@ -6,10 +6,7 @@ delete from screen_pioneer_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; 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 69701d3f17..0c2bfa9c51 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 @@ -27,10 +27,7 @@ delete from screen_public_parti_total_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml index 678b2b960c..e4e5b7ac0f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml @@ -22,11 +22,8 @@ delete from screen_user_join - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + 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/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index 032739c71c..ecf0039810 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 @@ -6,10 +6,7 @@ delete from screen_user_total_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java index d573765b6b..556e4a6029 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java @@ -1,10 +1,8 @@ package com.epmet.stats.test.normalizing; +import com.alibaba.fastjson.JSON; import com.epmet.support.normalizing.*; -import com.epmet.support.normalizing.batch.BatchScoreCalculator; -import com.epmet.support.normalizing.batch.IndexInputVO; -import com.epmet.support.normalizing.batch.IndexOutputVO; -import com.epmet.support.normalizing.batch.SampleValue; +import com.epmet.support.normalizing.batch.*; import org.junit.Test; import java.math.BigDecimal; @@ -78,8 +76,8 @@ public class DemoScoreCal { List> index2SampleValues = Arrays.asList(new SampleValue<>("id1", 1), new SampleValue<>("id2", 8), new SampleValue<>("id3", 3)); // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO<>("aaa", index1SampleValues, new BigDecimal(10), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO<>("bbb", index2SampleValues, new BigDecimal(10), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO<>("aaa", "a:bbb2", index1SampleValues, new BigDecimal(10), new BigDecimal(1), false, sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", "a:bbb2", index2SampleValues, new BigDecimal(10), new BigDecimal(1), false, sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -104,8 +102,8 @@ public class DemoScoreCal { List index2SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(1)), new SampleValue<>("id2", new BigDecimal(8)), new SampleValue<>("id3", new BigDecimal(3))); // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO("bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO("aaa", "a:aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), false, sc1); + IndexInputVO index2VO = new IndexInputVO("bbb", "b:bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), false, sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -163,22 +161,31 @@ public class DemoScoreCal { // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa1", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), sc1); - IndexInputVO index2VO = new IndexInputVO("aaa2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), sc2); - IndexInputVO index3VO = new IndexInputVO("aaa3", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), sc3); - IndexInputVO index4VO = new IndexInputVO("aaa4", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), sc4); + IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb2", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), false, sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), false, sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb2", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), false, sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb2", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), false, sc4); - List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + HashMap result = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + + HashMap result2 = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); System.err.println("----------------1----------------"); result.forEach((key, value) -> { System.out.println(key.concat("的得分为:").concat(value.toString())); }); System.err.println("-----------------2---------------"); + + + System.err.println("----------------123123123123----------------"); + result2.forEach((key, value) -> { + System.out.println(key.concat("的得分为:").concat(value.toString())); + }); + System.err.println("-----------------2---------------"); } @@ -227,22 +234,55 @@ public class DemoScoreCal { // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa1", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.3), sc1); - IndexInputVO index2VO = new IndexInputVO("aaa2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.2), sc2); - IndexInputVO index3VO = new IndexInputVO("aaa3", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.2), sc3); - IndexInputVO index4VO = new IndexInputVO("aaa4", index1SampleValues4, new BigDecimal(0.6), new BigDecimal(0.3), sc4); + IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb1", index1SampleValues, new BigDecimal(-1), new BigDecimal("0.3"), false, sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal("0.2"), false, sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb3", index1SampleValues3, new BigDecimal(-1), new BigDecimal("0.2"), false, sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb4", index1SampleValues4, new BigDecimal(0.6), new BigDecimal("0.3"), false, sc4); - List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + System.out.println("param:" + JSON.toJSONString(indexInputVOS)); + HashMap result2 = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); - System.err.println("----------------1----------------"); + System.err.println("-----------------2---------------"); + + System.err.println("----------------11111111----------------"); + result2.forEach((key, value) -> { + System.out.println(key.concat("的总得分为:") + value.getTotalScore()); + //System.out.println(JSON.toJSONString(indexInputVOS)); + value.getDetails().forEach(o -> System.out.println(JSON.toJSONString(o))); + }); + System.err.println("-----------------2222222222---------------"); + } + + @Test + public void testMath() { + // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(8), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(10), new BigDecimal(10), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + + List> index1SampleValues = Arrays.asList(new SampleValue<>("id1", 4), new SampleValue<>("id2", 1), new SampleValue<>("id3", 8)); + List> index2SampleValues = Arrays.asList(new SampleValue<>("id1", 1), new SampleValue<>("id2", 8), new SampleValue<>("id3", 3)); + + // 每个指标的信息,包括样本列表,权重,指标标记 + IndexInputVO index1VO = new IndexInputVO<>("aaa", "a:bbb2", index1SampleValues, new BigDecimal(10), new BigDecimal(1), false, sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", "a:bbb2", index2SampleValues, new BigDecimal(10), new BigDecimal(1), false, sc2); + + List indexInputVOS = Arrays.asList(index1VO, index2VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap result = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + + System.err.println("--------------------------------"); result.forEach((key, value) -> { - System.out.println(key.concat("的得分为:").concat(value.toString())); + System.out.println(key.concat("的总得分为:") + value.getTotalScore()); + //System.out.println(JSON.toJSONString(indexInputVOS)); + value.getDetails().forEach(o -> System.out.println(JSON.toJSONString(o))); }); - System.err.println("-----------------2---------------"); + + System.err.println("--------------------------------"); } 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 new file mode 100644 index 0000000000..bed5fc95b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java @@ -0,0 +1,17 @@ +package com.epmet.stats.test.normalizing; + +public class MathUtilTest { + public static void main(String[] args) { + double tan = Math.atan(4); + double tan2 = Math.atan(1); + double tan3 = Math.atan(8); + double tan4 = Math.atan(3); + + + 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)); + } + +} diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile b/epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile index a1d2ad6f1a..40a62488b2 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile +++ b/epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-activiti.jar EXPOSE 8086 diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-dev.yml index 8c5dcd8823..d2925901c9 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-activiti.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml index ce9db6deb1..088bfeb2dd 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-activiti.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-test.yml b/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-test.yml index aea13ac662..74e66105f0 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-activiti.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml index d0f69c2502..f9a372c94e 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml @@ -8,7 +8,7 @@ spring: name: epmet-activiti-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-common-service/common-service-server/Dockerfile b/epmet-module/epmet-common-service/common-service-server/Dockerfile index 46b45ca2e0..fe3d1a6f63 100644 --- a/epmet-module/epmet-common-service/common-service-server/Dockerfile +++ b/epmet-module/epmet-common-service/common-service-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./common-service.jar EXPOSE 8103 diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml index 047408c5df..e575112640 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./common-service.jar" restart: "unless-stopped" deploy: resources: 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 1a43e02ffb..acc32b8306 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 @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./common-service.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml index 80cb75cbb5..c3ed2186f6 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./common-service.jar" restart: "unless-stopped" deploy: resources: 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 a81498d9a8..b22388767b 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -178,7 +178,7 @@ --> 8103 - dev + test 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 2e49c80102..490b2445e8 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 @@ -75,13 +75,23 @@ public class ExtAppJwtTokenUtils { public static void genToken() { HashMap claim = new HashMap<>(); - claim.put("appId", "2c448b7da527055fbeebb628f8d3dcb0"); - claim.put("customerId", "c1"); + //市北 + //String secret = "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970"; + //String appId = "acc4ad66c82a7b46e741364b4c62dce2"; + // String customrId = "b09527201c4409e19d1dbc5e3c3429a1"; + //孔村 + String secret = "657cd46d385a4c2ba6d9355aee24654ac3951deab7e6436e91201561b94969b5"; + String appId = "5efcfb775125d656f39583b8110a3d7d"; + String customrId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + + claim.put("customerId", customrId); + claim.put("appId", appId); + claim.put("customerId", customrId); long ts = System.currentTimeMillis() - 1000 * 60 * 4; System.out.println("时间戳:" + ts); claim.put("ts", ts); - String abc = new ExtAppJwtTokenUtils().createToken(claim, "d4b73db4cf8e46ef99fa1f95149c2791ef2396fded114dd09e406cbce83fc88a"); + String abc = new ExtAppJwtTokenUtils().createToken(claim, secret); System.out.println(abc); } 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/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index ec2f2c7a2b..e521fd36ff 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: common-service-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql new file mode 100644 index 0000000000..2b6542405d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql @@ -0,0 +1,9 @@ +INSERT INTO `external_customer` ( `ID`, `CUSTOMER_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` ) +VALUES + ( '6c67e54f0ce4ba92a33f503082c92fc9', '安宁e家', 0, 0, 'APP_USER', '2020-09-08 09:11:56', 'APP_USER', '2020-09-08 09:11:56' ); +INSERT INTO `external_app` ( `ID`, `APP_NAME`, `CUSTOMER_ID`, `CUSTOMER_TYPE`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`, `DEL_FLAG` ) +VALUES + ( 'c67d2bb17112e9aabdf137cb4f8072fe', '安宁e家数据端', '6c67e54f0ce4ba92a33f503082c92fc9', 'external', 0, 'APP_USER', '2020-09-08 09:13:32', 'APP_USER', '2020-09-08 09:13:32', 0 ); +INSERT INTO `external_app_secret` ( `ID`, `APP_ID`, `SECRET`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` ) +VALUES + ( '3e7d65039e25570777216cecfadfa304', 'c67d2bb17112e9aabdf137cb4f8072fe', '8c3e52923720460093b59184ffbdcb44a7f9e752991348aba861e8b43e109836', 0, 0, 'APP_USER', '2020-09-08 09:13:32', 'APP_USER', '2020-09-08 09:13:32' ); \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.6__add_anningejia_screenandcaiji.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.6__add_anningejia_screenandcaiji.sql new file mode 100644 index 0000000000..388515832b --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.6__add_anningejia_screenandcaiji.sql @@ -0,0 +1,5 @@ +INSERT INTO `external_app`(`ID`, `APP_NAME`, `CUSTOMER_ID`, `CUSTOMER_TYPE`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`, `DEL_FLAG`) VALUES ('091a71fdc9e69b214bc32efb3508b4a7', '安宁e家大屏', '6c67e54f0ce4ba92a33f503082c92fc9', 'external', 0, 'APP_USER', '2020-09-11 13:14:20', 'APP_USER', '2020-09-11 13:14:20', 0); +INSERT INTO `external_app`(`ID`, `APP_NAME`, `CUSTOMER_ID`, `CUSTOMER_TYPE`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`, `DEL_FLAG`) VALUES ('444c4fa4813bfe9414c0bb4609aea405', '安宁e家数据采集', '6c67e54f0ce4ba92a33f503082c92fc9', 'external', 0, 'APP_USER', '2020-09-11 13:28:24', 'APP_USER', '2020-09-11 13:28:24', 0); + +INSERT INTO `external_app_secret`(`ID`, `APP_ID`, `SECRET`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('184ff0e132550cc2563df0fdf34a204f', '091a71fdc9e69b214bc32efb3508b4a7', '3b7e7a865d4042e79079f4973e3e27b9401c11964a41402999b94f0b472c32b5', 0, 0, 'APP_USER', '2020-09-11 13:14:20', 'APP_USER', '2020-09-11 13:14:20'); +INSERT INTO `external_app_secret`(`ID`, `APP_ID`, `SECRET`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('f5ea18989511fc3d24d6dccd72faea25', '444c4fa4813bfe9414c0bb4609aea405', 'cd6e8859fd594204a9a6e8c1d50180f9c3746530211649d490030cbdd833182f', 0, 0, 'APP_USER', '2020-09-11 13:28:24', 'APP_USER', '2020-09-11 13:28:24'); \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.7__add_kongcun_app.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.7__add_kongcun_app.sql new file mode 100644 index 0000000000..5114b07688 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.7__add_kongcun_app.sql @@ -0,0 +1,9 @@ +INSERT INTO `epmet_common_service`.`external_customer`(`ID`, `CUSTOMER_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2fe0065f70ca0e23ce4c26fca5f1d933', '大美孔村', 0, 0, 'APP_USER', '2020-09-15 09:00:57', 'APP_USER', '2020-09-15 09:00:57'); + + +INSERT INTO `epmet_common_service`.`external_app`(`ID`, `APP_NAME`, `CUSTOMER_ID`, `CUSTOMER_TYPE`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`, `DEL_FLAG`) VALUES ('4733fda58aba5024b776f22f135350df', '孔村数据采集', '2fe0065f70ca0e23ce4c26fca5f1d933', 'external', 0, 'APP_USER', '2020-09-15 09:01:31', 'APP_USER', '2020-09-15 09:01:31', 0); +INSERT INTO `epmet_common_service`.`external_app`(`ID`, `APP_NAME`, `CUSTOMER_ID`, `CUSTOMER_TYPE`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`, `DEL_FLAG`) VALUES ('5efcfb775125d656f39583b8110a3d7d', '孔村大屏', '2fe0065f70ca0e23ce4c26fca5f1d933', 'external', 0, 'APP_USER', '2020-09-15 09:01:39', 'APP_USER', '2020-09-15 09:01:39', 0); + + +INSERT INTO `epmet_common_service`.`external_app_secret`(`ID`, `APP_ID`, `SECRET`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('362d4fce3311f67edb40b0e5291d37eb', '5efcfb775125d656f39583b8110a3d7d', '657cd46d385a4c2ba6d9355aee24654ac3951deab7e6436e91201561b94969b5', 0, 0, 'APP_USER', '2020-09-15 09:01:39', 'APP_USER', '2020-09-15 09:01:39'); +INSERT INTO `epmet_common_service`.`external_app_secret`(`ID`, `APP_ID`, `SECRET`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7853487c79dab384b4c681d734d9eb3a', '4733fda58aba5024b776f22f135350df', '61224b4d747f4853b9551fe078b90b2355f72c3256a14bdb8faac4a4d7ed68a0', 0, 0, 'APP_USER', '2020-09-15 09:01:31', 'APP_USER', '2020-09-15 09:01:31'); diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml index c34d1822b8..1352c66f87 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: allow-bean-definition-overriding: true #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-ext/epmet-ext-server/Dockerfile b/epmet-module/epmet-ext/epmet-ext-server/Dockerfile index 2a18b4bf3a..d6734953ee 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/Dockerfile +++ b/epmet-module/epmet-ext/epmet-ext-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-ext.jar EXPOSE 8113 diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml index 392769e158..7792a04b31 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-ext.jar" restart: "unless-stopped" deploy: resources: 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 709b384c7a..bf71f1b198 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 @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-ext.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml index 36c753627a..90c7053d1f 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-ext.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml index 8f43acbf19..a1948620e3 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-ext-server # dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss 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 312d36843e..0f5033e02a 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,9 +139,13 @@ public class ResiActDetailResultDTO implements Serializable { private Boolean isSignUp; /** - * 用户是否已报名该活动 true用户已报名;false用户未报名 + * 用户报名活动后,当前状态 + * --(已报名/待审核auditing, + * -- 审核通过passed, + * -- 未报名(审核不通过 或 取消报名)canceled, + * -- ) */ - private Boolean isRegistration; + private String isRegistration; /** * 打卡开始时间(yyyy-MM-dd HH:mm) diff --git a/epmet-module/epmet-heart/epmet-heart-server/Dockerfile b/epmet-module/epmet-heart/epmet-heart-server/Dockerfile index 696964e45a..94fd0f1809 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/Dockerfile +++ b/epmet-module/epmet-heart/epmet-heart-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-heart.jar EXPOSE 8090 diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml index 4d32065b75..53e5098667 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-heart.jar" restart: "unless-stopped" deploy: resources: 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 297fb4a40f..df1de492cb 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 @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-heart.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml index a5cef7fb1f..e259e170a4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-heart.jar" restart: "unless-stopped" deploy: resources: 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 9f3649d421..4f539675fb 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,12 +221,18 @@ public class ActInfoServiceImpl extends BaseServiceImpl /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-job.jar EXPOSE 8084 diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml index eb9aa984f8..c9999c47d8 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-job.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml index 4816a4cd30..7e5a917177 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-job.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml index 5c02cae59e..a245199249 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-job.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DataStatsProcessPenddingCalService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DataStatsProcessPenddingCalService.java new file mode 100644 index 0000000000..9b5d049284 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DataStatsProcessPenddingCalService.java @@ -0,0 +1,9 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +public interface DataStatsProcessPenddingCalService { + + Result processPenddingCal(); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DataStatsProcessPenddingCalServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DataStatsProcessPenddingCalServiceImpl.java new file mode 100644 index 0000000000..55381b40b0 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DataStatsProcessPenddingCalServiceImpl.java @@ -0,0 +1,19 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.DataStatsProcessPenddingCalService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class DataStatsProcessPenddingCalServiceImpl implements DataStatsProcessPenddingCalService { + + @Autowired + private DataStatisticalOpenFeignClient feignClient; + + @Override + public Result processPenddingCal() { + return feignClient.processPenddingCalculate(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DataStatsProcessPenddingCalTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DataStatsProcessPenddingCalTask.java new file mode 100644 index 0000000000..b02396846c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DataStatsProcessPenddingCalTask.java @@ -0,0 +1,26 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.DataStatsProcessPenddingCalService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Slf4j +@Component("dataStatsProcessPenddingCalTask") +public class DataStatsProcessPenddingCalTask implements ITask { + + @Autowired + private DataStatsProcessPenddingCalService dataStatsProcessPenddingCalService; + + @Override + public void run(String params) { + log.debug("DataStatsProcessPenddingCalTask定时任务正在执行,参数为:{}", params); + Result result = dataStatsProcessPenddingCalService.processPenddingCal(); + if (result.success()){ + log.debug("DataStatsProcessPenddingCalTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("DataStatsProcessPenddingCalTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-message/epmet-message-server/Dockerfile b/epmet-module/epmet-message/epmet-message-server/Dockerfile index 1a3aea849b..49f97b4c0e 100644 --- a/epmet-module/epmet-message/epmet-message-server/Dockerfile +++ b/epmet-module/epmet-message/epmet-message-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-message.jar EXPOSE 8085 diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml index 6edefa45a8..5ab5ecb83d 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-message.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml index 360d07d79e..67da25bdf4 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-message.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml index bbda7e873c..7630cefa81 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-message.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml index 0f7b365814..0f9afbef03 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-message-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-oss/epmet-oss-server/Dockerfile b/epmet-module/epmet-oss/epmet-oss-server/Dockerfile index 678d2b3ff2..ca3830ee6c 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/Dockerfile +++ b/epmet-module/epmet-oss/epmet-oss-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-oss.jar EXPOSE 8083 diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml index 2a5fc11a89..2fa7b84b34 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml @@ -10,7 +10,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-oss.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml index dbb2282e8e..5fae8446ce 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml @@ -10,7 +10,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-oss.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml index 4dc76991bb..3a7181f4a8 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml @@ -10,7 +10,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-oss.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index 390608e0f4..115f991f57 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-oss-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-point/epmet-point-client/pom.xml b/epmet-module/epmet-point/epmet-point-client/pom.xml index c43496fa40..479b51156e 100644 --- a/epmet-module/epmet-point/epmet-point-client/pom.xml +++ b/epmet-module/epmet-point/epmet-point-client/pom.xml @@ -27,6 +27,12 @@ io.springfox springfox-swagger-ui + + com.epmet + epmet-user-client + 2.0.0 + compile + 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 3dd0e34ac9..c37afa2921 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 @@ -26,4 +26,7 @@ public class CommonPageUserFormDTO implements Serializable { private Integer pageNo = 1; private Integer pageSize = 10; + + @NotBlank(message = "获取不到用户Id" , groups = PageUserGroup.class) + private String customerId; } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java index 7920d68c66..8726a2659b 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java @@ -52,4 +52,6 @@ public class PointVerificationFormDTO implements Serializable { @NotBlank(message = "缺失地址信息" , groups = PointVerificationGroup.class) private String address; + + private String customerId; } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java index deaa7bb6d5..d5b9edd6c6 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java @@ -1,13 +1,12 @@ package com.epmet.feign; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -20,11 +19,11 @@ public interface EpmetPointOpenFeignClient { /** * @Description 获取指定居民的积分信息 - * @param dto + * @param * @return * @author wangc * @date 2020.07.22 15:58 **/ - @GetMapping("/point/resi/point/mypoint") - Result myPoint(TokenDto dto); + @PostMapping("/point/resi/point/mypoint") + Result myPoint(CommonUserFormDTO param); } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java index 8901a0724b..7d5cda718f 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java @@ -1,9 +1,9 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.EpmetPointOpenFeignClient; import org.springframework.stereotype.Component; @@ -17,7 +17,7 @@ import org.springframework.stereotype.Component; @Component public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignClient { @Override - public Result myPoint(TokenDto dto) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint", dto); + public Result myPoint(CommonUserFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint",param); } } diff --git a/epmet-module/epmet-point/epmet-point-server/Dockerfile b/epmet-module/epmet-point/epmet-point-server/Dockerfile index 696964e45a..eccf5af01b 100644 --- a/epmet-module/epmet-point/epmet-point-server/Dockerfile +++ b/epmet-module/epmet-point/epmet-point-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-point.jar EXPOSE 8090 diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml index 615c0d0b94..f9c7734508 100644 --- a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-point.jar" restart: "unless-stopped" deploy: resources: 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 8fff39478d..9797b08b02 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 @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-point.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml index 4a175b6c3f..a4cc8a4af1 100644 --- a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-point.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java index 21336dccb2..535b717e0c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum; 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.CommonUserFormDTO; import com.epmet.dto.form.CustomerUserFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.PointAdjustmentFormDTO; @@ -59,7 +60,8 @@ public class AdjustmentController { **/ @PostMapping("userdetail") @RequirePermission(requirePermission = RequirePermissionEnum.MORE_POINT_USER_MANAGE_DETAIL_VIEW) - public Result userDetail(@RequestBody IssueInitiatorFormDTO param){ + public Result userDetail(@LoginUser TokenDto staffToken,@RequestBody CommonUserFormDTO param){ + param.setCustomerId(staffToken.getCustomerId()); ValidatorUtils.validateEntity(param,IssueInitiatorFormDTO.UserIdGroup.class); return new Result().ok(pointAdjustmentLogService.userDetail(param)); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java index ff4bdd2285..8bb1d31cc5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java @@ -39,6 +39,7 @@ public class ExchangeController { @PostMapping("execute") public Result execute(@LoginUser TokenDto token, @RequestBody PointVerificationFormDTO verificationParam){ verificationParam.setOperatorId(token.getUserId()); + verificationParam.setCustomerId(token.getCustomerId()); ValidatorUtils.validateEntity(verificationParam, PointVerificationFormDTO.PointVerificationGroup.class); return new Result().ok(pointVerificationLogService.verifyPoint(verificationParam)); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index bca69b050a..f4e5ce6bb4 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -5,7 +5,7 @@ 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.CommonPageUserFormDTO; -import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.PointExchangeResponseResultDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; @@ -46,12 +46,11 @@ public class ResiPointController { * @author wangc * @date 2020.07.22 15:58 **/ - @GetMapping("mypoint") - public Result myPoint(@LoginUser TokenDto dto){ - ResiCommonUserIdFormDTO param = new ResiCommonUserIdFormDTO(); - param.setUserId(dto.getUserId()); - ValidatorUtils.validateEntity(param,ResiCommonUserIdFormDTO.UserIdGroup.class); - return new Result().ok(userPointTotalService.getMyPoint(param)); + @PostMapping("mypoint") + public Result myPoint(@LoginUser TokenDto dto, @RequestBody CommonUserFormDTO userParam){ + userParam.setUserId(dto.getUserId()); + ValidatorUtils.validateEntity(userParam, CommonUserFormDTO.CustomerId_UserIdGroup.class); + return new Result().ok(userPointTotalService.getMyPoint(userParam)); } /** diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java index 5b90380b88..52c76a7c4c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java @@ -43,7 +43,7 @@ public interface PointVerificationLogDao extends BaseDao selectVerificationLog(@Param("userId") String userId); + List selectVerificationLog(@Param("userId") String userId,@Param("customerId")String customerId); /** * @Description 获取工作人员月度核销记录 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java index a16ce26c67..42d7cb404b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java @@ -42,7 +42,8 @@ public interface UserPointActionLogDao extends BaseDao * @author wangc * @date 2020.07.22 13:56 **/ - List selectPointActionLogList(@Param("userId") String userId); + List selectPointActionLogList(@Param("userId") String userId,@Param("customerId")String customerId); + /** * @Description 查询指定用户在某条规则下所得的积分总和 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java index 36b2540ac1..c78d265734 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java @@ -44,6 +44,15 @@ public interface UserPointTotalDao extends BaseDao { **/ ResiPointDetailResultDTO selectPointByUserId(@Param("userId")String userId); + /** + * @Description 根据用户Id和客户Id查询他的累计积分以及可用积分 + * @param userId + * @return + * @author wangc + * @date 2020.07.21 13:38 + **/ + ResiPointDetailResultDTO selectPointByCustomerUserId(@Param("userId")String userId,@Param("customerId")String customerId); + /** * @Description 查询客户下的用户累计积分排名榜 * @param customerId diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java index 02df12d652..6e77b0f7c8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.PointAdjustmentLogDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.PointAdjustmentFormDTO; import com.epmet.dto.result.CustomerUserDetailResultDTO; @@ -113,7 +114,7 @@ public interface PointAdjustmentLogService extends BaseService /** * @Description 获取指定居民的积分信息 - * @param userId + * @param param * @return * @author wangc * @date 2020.07.22 15:58 **/ - ResiPointDetailResultDTO getMyPoint(ResiCommonUserIdFormDTO userId); + ResiPointDetailResultDTO getMyPoint(CommonUserFormDTO param); /** * @Description 获取客户下用户积分排名榜 @@ -125,4 +126,13 @@ public interface UserPointTotalService extends BaseService void insertOrUpdate(UserPointTotalEntity entity); void testInsertOrUpdate(UserPointTotalEntity entity); + + /** + * @Description 获取指定居民的积分信息 - 使用客户Id匹配,兼容多客户情况 + * @param customerUserParam + * @return + * @author wangc + * @date 2020.07.22 15:58 + **/ + ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java index a78e6f70bf..cdbf4e882b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dao.PointAdjustmentLogDao; import com.epmet.dao.UserPointActionLogDao; import com.epmet.dto.PointAdjustmentLogDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.PointAdjustmentFormDTO; import com.epmet.dto.form.ResiCommonUserIdFormDTO; @@ -150,13 +151,14 @@ public class PointAdjustmentLogServiceImpl extends BaseServiceImpl detailResult = epmetUserOpenFeignClient.customerUserDetail(param); + public CustomerUserDetailResultDTO userDetail(CommonUserFormDTO param) { + IssueInitiatorFormDTO userParam = new IssueInitiatorFormDTO(); + userParam.setUserId(param.getUserId()); + Result detailResult = epmetUserOpenFeignClient.customerUserDetail(userParam); if(!detailResult.success()){ throw new RenException(detailResult.getCode()); } - ResiCommonUserIdFormDTO userParam = ConvertUtils.sourceToTarget(param,ResiCommonUserIdFormDTO.class); - ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPoint(userParam); + ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPointGroupByCustomer(param); if(null != detailResult.getData()){ CustomerUserDetailResultDTO result = new CustomerUserDetailResultDTO(); result.setPoint(null != pointDto ? pointDto.getUsablePoint() : NumConstant.ZERO); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java index f8f3974e80..8dec019109 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java @@ -147,7 +147,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl getMyExchangeRecord(CommonPageUserFormDTO pageUser) { PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize()); - List logList = baseDao.selectVerificationLog(pageUser.getUserId()); + List logList = baseDao.selectVerificationLog(pageUser.getUserId(),pageUser.getCustomerId()); List result = new LinkedList<>(); if(null != logList && !logList.isEmpty()){ Map> map = @@ -256,9 +256,10 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl getMyPointRecord(CommonPageUserFormDTO pageUser) { PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize()); - List logList = baseDao.selectPointActionLogList(pageUser.getUserId()); + List logList = baseDao.selectPointActionLogList(pageUser.getUserId(),pageUser.getCustomerId()); List result = new LinkedList<>(); if(null != logList && !logList.isEmpty()){ Map> map = diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 6be4ae538e..a36a0c39d9 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -38,6 +38,7 @@ import com.epmet.service.UserPointStatisticalDailyService; import com.epmet.utils.DimIdGenerator; import com.epmet.utils.ModuleConstant; import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -53,6 +54,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2020-07-20 */ @Service +@Slf4j public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl implements UserPointStatisticalDailyService { @Autowired @@ -131,6 +133,8 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl implements UserPointTotalService { + @Autowired EpmetUserOpenFeignClient epmetUserOpenFeignClient; @@ -111,14 +115,14 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst(); @@ -244,4 +250,20 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml index 9777f506d3..994bca4ad4 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml @@ -36,6 +36,8 @@ DEL_FLAG = '0' AND USER_ID = #{userId} + AND + CUSTOMER_ID = #{customerId} ORDER BY CREATED_TIME DESC diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml index d84b1b02ed..e64d984a00 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml @@ -31,6 +31,21 @@ USER_ID = #{userId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml index 7a31b83279..f70597f4d5 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml @@ -64,4 +64,10 @@ AND user_name = #{toUserName} LIMIT 1 + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml index 11d1b50262..9926104565 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml @@ -196,4 +196,16 @@ AND SOURCE = #{source} + \ 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 new file mode 100644 index 0000000000..f3b46b3c42 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PublicTemplateDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PublicTemplateDao.xml new file mode 100644 index 0000000000..a1baf39ef4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PublicTemplateDao.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + DELETE FROM public_template WHERE 1=1 + + CATEGORY_ID = #{item} + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/Dockerfile b/epmet-module/gov-access/gov-access-server/Dockerfile index 3ef453e6ca..660d423d2b 100644 --- a/epmet-module/gov-access/gov-access-server/Dockerfile +++ b/epmet-module/gov-access/gov-access-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./gov-access.jar EXPOSE 8099 diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml index 6f7c7fe6d8..75fbb038c9 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-access.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml index 72ebb1216f..ababaa4a99 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-access.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml index 2bbc8ec394..b7e4bcfdf0 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-access.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml index 9aaa3e9556..e8a2685e37 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-access-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/epmet-module/gov-grid/gov-grid-server/Dockerfile b/epmet-module/gov-grid/gov-grid-server/Dockerfile index def4428089..0151c7accb 100644 --- a/epmet-module/gov-grid/gov-grid-server/Dockerfile +++ b/epmet-module/gov-grid/gov-grid-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./gov-grid.jar EXPOSE 8097 diff --git a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml index d3ff3abf31..f9e02900e6 100644 --- a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-grid.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-prod.yml b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-prod.yml index f842a906c8..f595a8eb2a 100644 --- a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-grid.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml index dfc9a03899..e01844b7fb 100644 --- a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-grid.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml index c56eefd656..6b8729cd4e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-grid-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/gov-issue/gov-issue-server/Dockerfile b/epmet-module/gov-issue/gov-issue-server/Dockerfile index c3261f957f..b40bf4b24e 100644 --- a/epmet-module/gov-issue/gov-issue-server/Dockerfile +++ b/epmet-module/gov-issue/gov-issue-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./gov-issue.jar EXPOSE 8101 diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml index 1195217951..1f112f1abb 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-issue.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml index dd8ce37dfa..a24f850367 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-issue.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml index fc86765bf1..731ed393a6 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-issue.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java index bdbf47bc78..c6334dd86e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java @@ -148,4 +148,15 @@ public interface IssueVoteStatisticalService extends BaseService imp //5:缓存中网格下表决中的议题总数减1 govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId()); + try { + issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + }catch (RenException e){ + logger.error(e.getMsg()); + } } /** @@ -581,6 +586,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp //6:缓存中网格下表决中的议题总数减1 govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId()); + try{ + issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + }catch(RenException e){ + logger.error(e.getMsg()); + } } /** diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index 320138bfc5..60b0aabbc3 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -252,7 +252,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl issues = issueDao.selectIssueIdsByCondition(issueParam); - if(null == issues || issues.size()< NumConstant.ONE){ + if(null == issues || issues.isEmpty()){ return; } Set ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet()); @@ -285,9 +285,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl listToUpdate = new ArrayList<>(); setVotableCountsAndUpdateCache(listToUpdate, existedIds.stream().flatMap(existedId -> issues.stream().filter(issue -> - StringUtils.equals(issue.getId(),existedId)).map(issueDTO -> { - return issueDTO; - })).collect(Collectors.toSet()), + StringUtils.equals(issue.getId(),existedId))).collect(Collectors.toSet()), votableCountMap); // 批量更新listToUpdate @@ -417,8 +415,10 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl votableCount = + resiGroupFeignClient.votableCount(gridParam); + if(votableCount.success() && null != votableCount.getData()){ + toUpd.setVotableCount(votableCount.getData()); + } + + if(StringUtils.isNotBlank(statisticalId)){ + toUpd.setId(statisticalId); + update(toUpd); + }else{ + IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueId); + if(null != existedStatistical && StringUtils.isNotBlank(existedStatistical.getId())){ + toUpd.setId(existedStatistical.getId()); + update(toUpd); + } + } + + } + /** * @Description 遍历应表决数 * @param list - List | Set | Map diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml index 93f2568a4b..e523016b91 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-issue-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/epmet-module/gov-mine/gov-mine-server/Dockerfile b/epmet-module/gov-mine/gov-mine-server/Dockerfile index 583d3041e9..61472572db 100644 --- a/epmet-module/gov-mine/gov-mine-server/Dockerfile +++ b/epmet-module/gov-mine/gov-mine-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./gov-mine.jar EXPOSE 8098 diff --git a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml index 9fce06f6fd..3bc86de1dc 100644 --- a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-mine.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml index 7c1d15c36f..fb5899dbc5 100644 --- a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-mine.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml index 3e88d5d67c..265d79c930 100644 --- a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-mine.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml index 372d057000..f19d228c96 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-mine-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/epmet-module/gov-org/gov-org-server/Dockerfile b/epmet-module/gov-org/gov-org-server/Dockerfile index b079f1ff77..57ac019c29 100644 --- a/epmet-module/gov-org/gov-org-server/Dockerfile +++ b/epmet-module/gov-org/gov-org-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./gov-org.jar EXPOSE 8092 diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml index 4d59daef61..902ce5e8d0 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-org.jar" restart: "unless-stopped" deploy: resources: 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 9418cc9ef2..08aec5c665 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 @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-org.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml index f2be2009e9..d8a3a119a0 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-org.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 215e32b471..140bd8cd43 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -215,18 +215,22 @@ public class CustomerGridServiceImpl extends BaseServiceImpl addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) { - CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId()); + CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(addGridFormDTO.getAgencyId()); // 1. 查询该客户下可创建网格的最大数量 GridCountFormDTO gridCount = new GridCountFormDTO(); String customerId = customerAgencyDTO.getCustomerId(); gridCount.setCustomerId(customerId); GridCountResultDTO grid = operCrmOpenFeignClient.getGridCount(gridCount).getData(); - if (grid.getGridCount().equals(NumConstant.ZERO)){ + log.info("客户信息为:" + grid); + if (null == grid) { + throw new RenException("未查出该客户信息"); + } + if (null == grid.getGridCount() || grid.getGridCount().equals(NumConstant.ZERO)) { throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode()); } // 2. 判断当前客户下存在的网格数量 Integer gridCounts = customerGridDao.selectGridCount(customerId); - if (gridCounts >= grid.getGridCount()){ + if (gridCounts >= grid.getGridCount()) { throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode()); } // 3. 查询网格名称是否重名 diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index 123fa48ad4..4657c30354 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-org-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/gov-project/gov-project-server/Dockerfile b/epmet-module/gov-project/gov-project-server/Dockerfile index 88b6575415..372d5097ca 100644 --- a/epmet-module/gov-project/gov-project-server/Dockerfile +++ b/epmet-module/gov-project/gov-project-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./gov-project.jar EXPOSE 8102 diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index 405b05715e..1d61afd8af 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-project.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml index e7aae13868..218398a4da 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-project.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml index 3a8c39669b..d7bf5d6939 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-project.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index ddd3113ac5..31d7d1ef6d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-project-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/epmet-module/gov-voice/gov-voice-server/Dockerfile b/epmet-module/gov-voice/gov-voice-server/Dockerfile index 915e6100bc..3f3ecf336d 100644 --- a/epmet-module/gov-voice/gov-voice-server/Dockerfile +++ b/epmet-module/gov-voice/gov-voice-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./gov-voice.jar EXPOSE 8105 diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml index a188027a21..b301615811 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-voice.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml index 1821a379dc..edf7b68936 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-voice.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml index f1de18f7ed..85cace2d57 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-voice.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml index 8504cb2d5a..8e85f694ed 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-voice-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/epmet-module/oper-access/oper-access-server/Dockerfile b/epmet-module/oper-access/oper-access-server/Dockerfile index 48f2a3dea5..eb72900e52 100644 --- a/epmet-module/oper-access/oper-access-server/Dockerfile +++ b/epmet-module/oper-access/oper-access-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./oper-access.jar EXPOSE 8093 diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml index 1c81fdec99..c2fe2f3963 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./oper-access.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml index 6c6bd28509..94231275a1 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./oper-access.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-test.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-test.yml index 97fcbe7dbb..0ef28f8ed5 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-test.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./oper-access.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml index b57b255fe6..b7cbcbe1af 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: oper-access-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/oper-crm/oper-crm-server/Dockerfile b/epmet-module/oper-crm/oper-crm-server/Dockerfile index 696964e45a..98146177a2 100644 --- a/epmet-module/oper-crm/oper-crm-server/Dockerfile +++ b/epmet-module/oper-crm/oper-crm-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./oper-crm.jar EXPOSE 8090 diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml index 1bc90fa0c0..ae71928e4e 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./oper-crm.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml index a75df6848f..4f9efd0f12 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./oper-crm.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml index a2ceb4d72e..f0c305d782 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./oper-crm.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml index c434e9de81..422a4459a9 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: oper-crm-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java index 2cc9b89b0e..9a33b3161d 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java @@ -43,6 +43,11 @@ public class CustomerFootBarDTO implements Serializable { */ private String barName; + /** + * 默认的bar名称 + */ + private String defaultBarName; + /** * KEY */ @@ -93,4 +98,6 @@ public class CustomerFootBarDTO implements Serializable { */ private Date updatedTime; + private Boolean display; + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionRoleDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionRoleDTO.java new file mode 100644 index 0000000000..548e8b9996 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionRoleDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户定制功能角色列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-07 + */ +@Data +public class CustomerFunctionRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 所属APP(工作端:gov、居民端:resi) + */ + private String fromApp; + + /** + * 角色Key值 + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 删除标识: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/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java index 1d5218fd4b..d5981860fd 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java @@ -1,17 +1,98 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.List; @Data public class CustomerFootBarFormDTO { - //@NotBlank(message = "客户ID不能为空") + // 创建footbar的分组 + public interface CreateFootBarGroup extends CustomerClientShowGroup {} + + // 查询footbar列表分组 + public interface ListFootBarGroup extends CustomerClientShowGroup {} + + // 运营端查询footbar列表分组 + public interface ListFootBarGroup4Oper extends CustomerClientShowGroup {} + + // 更新footbar + public interface UpdateFootBarGroup extends CustomerClientShowGroup {} + + // 保存顺序 + public interface SaveOrderGroup extends CustomerClientShowGroup {} + + // 明细分组 + public interface FootBarDetailGroup extends CustomerClientShowGroup {} + + // 更新显示状态分组 + public interface UpdateDisplayStatusGroup extends CustomerClientShowGroup {} + + // 为客户添加默认footbar + public interface AddDefaultFootbars4Customer extends CustomerClientShowGroup {} + + // 删除footbar + public interface DeleteFootbarsGroup extends CustomerClientShowGroup {} + + @NotBlank(message = "FootBar的ID不能为空", groups = { UpdateFootBarGroup.class, FootBarDetailGroup.class, UpdateDisplayStatusGroup.class, DeleteFootbarsGroup.class }) + private String id; + + @NotBlank(message = "客户ID不能为空", groups = { CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class }) private String customerId; // 哪一个端:gov,resi - @NotBlank(message = "app类型不能为空") + @NotBlank(message = "app类型不能为空", groups = { ListFootBarGroup.class, CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class }) private String appType; + @NotBlank(message = "名称不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class }) + private String barName; + + @NotBlank(message = "key不能为空", groups = { CreateFootBarGroup.class }) + private String barKey; + + @NotBlank(message = "页面标题不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class }) + private String pageTitle; + + //@NotBlank(message = "图标路径不能为空", groups = { UpdateFootBarGroup.class }) + private String iconPath; + + //@NotBlank(message = "选中的图标路径不能为空", groups = { UpdateFootBarGroup.class }) + private String selectedIconPath; + + @NotEmpty(message = "顺序不能为空", groups = { SaveOrderGroup.class }) + private List orderList; + + @NotNull(message = "显示状态不能为空", groups = { UpdateDisplayStatusGroup.class }) + private Boolean display; + + /** + * 排序索引号dto + */ + public static class OrderIndexDTO { + private String id; + private Integer orderIndex; + + public OrderIndexDTO() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getOrderIndex() { + return orderIndex; + } + + public void setOrderIndex(Integer orderIndex) { + this.orderIndex = orderIndex; + } + } } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionRoleListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionRoleListFormDTO.java new file mode 100644 index 0000000000..717e0d3c46 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionRoleListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 查询客户定制功能角色列表--接口入参 + * + * @author sun + */ +@Data +public class CustomerFunctionRoleListFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {AddUserInternalGroup.class }) + private String customerId; + /** + * 定制功能ID + */ + @NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class }) + private String functionId; + public interface AddUserInternalGroup {} + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java index ee133cd136..dc8c61b904 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * 查询客户定制功能列表-接口入参 @@ -25,11 +26,26 @@ public class FunctionDetailFromDTO implements Serializable { */ @NotBlank(message = "客户Id不能为空", groups = {AddUserShowGroup.class}) private String customerId; + /** + * 网格ID + */ + @NotBlank(message = "网格Id不能为空", groups = {AddUserShowGroup.class}) + private String gridId; /** - * resi:居民端,work:工作端 + * resi:居民端,gov:工作端 */ @NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) private String clientType; + /** + * token中userId + */ + private String userId; + + /** + * 用户角色key集合 + */ + private List roleKeyList; + } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/RoleListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/RoleListFormDTO.java new file mode 100644 index 0000000000..e88bf9393f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/RoleListFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 客户定制功能角色设置--接口入参 + * + * @author sun + */ +@Data +public class RoleListFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 角色Key + */ + @NotBlank(message = "角色key不能为空", groups = {AddUserInternalGroup.class }) + private String roleKey; + /** + * 角色名称 + */ + @NotBlank(message = "角色名称不能为空", groups = {AddUserInternalGroup.class }) + private String roleName; + public interface AddUserInternalGroup {} +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveCustomerFunctionRoleFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveCustomerFunctionRoleFormDTO.java new file mode 100644 index 0000000000..16a89de55e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveCustomerFunctionRoleFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 客户定制功能角色设置--接口入参 + * + * @author sun + */ +@Data +public class SaveCustomerFunctionRoleFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {AddUserInternalGroup.class }) + private String customerId; + /** + * 定制功能ID + */ + @NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class }) + private String functionId; + /** + * 所属APP(工作端:gov、居民端:resi) + */ + @NotBlank(message = "所属App不能为空", groups = {AddUserInternalGroup.class }) + private String fromApp; + /** + * 角色信息集合 + */ + private List roleList; + public interface AddUserInternalGroup {} +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java index 832e06944c..c517c835ad 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java @@ -39,6 +39,10 @@ public class CustomerFootBarResultDTO implements Serializable { */ private String id; + private String customerId; + + private String appType; + /** * bar名称 */ @@ -94,4 +98,14 @@ public class CustomerFootBarResultDTO implements Serializable { */ private Date updatedTime; + private Boolean display; + + private String defaultBarName; + + private String defaultIconPath; + + private String defaultSelectedIconPath; + + private String defaultPageTitle; + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionRoleListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionRoleListResultDTO.java new file mode 100644 index 0000000000..cbb4db6fb8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionRoleListResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import com.epmet.dto.form.RoleListFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询客户定制功能角色列表--接口返参 + * + * @author sun + */ +@Data +public class CustomerFunctionRoleListResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 角色Key + */ + private String roleKey; + /** + * 角色名称 + */ + private String roleName; +} diff --git a/epmet-module/oper-customize/oper-customize-server/Dockerfile b/epmet-module/oper-customize/oper-customize-server/Dockerfile index 08eccce004..d9b10d355b 100644 --- a/epmet-module/oper-customize/oper-customize-server/Dockerfile +++ b/epmet-module/oper-customize/oper-customize-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./oper-customize.jar EXPOSE 8089 diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 91e39f33c5..b0df052225 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./oper-customize.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml index 0b2cba4848..8a3c6771b2 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./oper-customize.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml index 459037c1e6..ff15600fc8 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./oper-customize.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index ff5abc3d03..1e8bb2216c 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -64,6 +64,12 @@ 2.0.0 compile + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java index 1be0943b60..5b9c7a0da8 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.CustomerFootBarDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.result.CustomerFootBarResultDTO; import com.epmet.entity.CustomerFootBarEntity; import com.epmet.excel.CustomerFootBarExcel; import com.epmet.service.CustomerFootBarService; @@ -35,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import javax.validation.constraints.NotBlank; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -103,17 +103,130 @@ public class CustomerFootBarController { */ @PostMapping("customerfootbars") public Result> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, CustomerFootBarFormDTO.ListFootBarGroup.class); String customerId = formDTO.getCustomerId(); String appType = formDTO.getAppType(); List footbars = customerFootBarService.listCustomerFootBars(customerId, appType); List barDTOS = new LinkedList<>(); footbars.forEach(barEntity -> { + CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey()); + CustomerFootBarDTO barDTO = new CustomerFootBarDTO(); BeanUtils.copyProperties(barEntity, barDTO); + barDTO.setDefaultBarName(defaultFootBarEntity.getBarName()); barDTOS.add(barDTO); }); return new Result>().ok(barDTOS); } + + /** + * 运营端查询footbar列表 + * @param formDTO + * @return + */ + @PostMapping("customerfootbars4oper") + public Result> getCustomerfootbars4Oper(@RequestBody CustomerFootBarFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CustomerFootBarFormDTO.ListFootBarGroup4Oper.class); + String customerId = formDTO.getCustomerId(); + String appType = formDTO.getAppType(); + + List footbars = customerFootBarService.listAllCustomerFootBars(customerId, appType); + List barDTOS = new LinkedList<>(); + footbars.forEach(barEntity -> { + CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey()); + + CustomerFootBarDTO barDTO = new CustomerFootBarDTO(); + BeanUtils.copyProperties(barEntity, barDTO); + barDTO.setDefaultBarName(defaultFootBarEntity.getBarName()); + barDTOS.add(barDTO); + }); + return new Result>().ok(barDTOS); + } + + + /** + * 创建footbar,只能创建默认的,不能直接为客户创建 + * @param form + * @return + */ + @PostMapping("createfootbar") + public Result createFootBar(@RequestBody CustomerFootBarFormDTO form) { + ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.CreateFootBarGroup.class); + customerFootBarService.createFootBar(form); + return new Result(); + } + + /** + * 更新footbar + * @param form + * @return + */ + @PostMapping("updatefootbar") + public Result updateFootbar(@RequestBody CustomerFootBarFormDTO form) { + ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.UpdateFootBarGroup.class); + customerFootBarService.updateFootBar(form); + return new Result(); + } + + /** + * + * @param form + * @return + */ + @PostMapping("footbardetail") + public Result footbarDetail(@RequestBody CustomerFootBarFormDTO form) { + ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.FootBarDetailGroup.class); + CustomerFootBarResultDTO dto = customerFootBarService.getFootBarDetail(form.getId()); + return new Result().ok(dto); + } + + /** + * 保存排序 + * @param form + * @return + */ + @PostMapping("saveorder") + public Result saveOrder(@RequestBody CustomerFootBarFormDTO form) { + ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.SaveOrderGroup.class); + customerFootBarService.saveOrder(form.getOrderList()); + return new Result(); + } + + /** + * 更新显示状态 + * @param form + * @return + */ + @PostMapping("updatedisplaystatus") + public Result updateDisplayStatus(@RequestBody CustomerFootBarFormDTO form) { + ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.UpdateDisplayStatusGroup.class); + customerFootBarService.updateDisplayStatus(form.getId(), form.getDisplay()); + return new Result(); + } + + /** + * 为客户初始化默认的footbar + * @param form + * @return + */ + @PostMapping("initdefault4customer") + public Result initDefault4Customer(@RequestBody CustomerFootBarFormDTO form) { + ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.AddDefaultFootbars4Customer.class); + customerFootBarService.addDefault4Customer(form.getCustomerId(), form.getAppType()); + return new Result(); + } + + /** + * 删除footbar + * @param form + * @return + */ + @PostMapping("deletefootbar") + public Result deleteFootBar(@RequestBody CustomerFootBarFormDTO form) { + ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.DeleteFootbarsGroup.class); + customerFootBarService.deleteFootBar(form.getId()); + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java index 245d5018a2..0778f3d989 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -105,6 +106,7 @@ public class CustomerFunctionDetailController { @PostMapping("resifunctiondetaillist") public Result> resiFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); } @@ -118,6 +120,7 @@ public class CustomerFunctionDetailController { public Result> workFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserInternalGroup.class); formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionRoleController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionRoleController.java new file mode 100644 index 0000000000..7ed5dc4b50 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionRoleController.java @@ -0,0 +1,123 @@ +/** + * 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.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +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.CustomerFunctionRoleDTO; +import com.epmet.dto.form.CustomerFunctionRoleListFormDTO; +import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO; +import com.epmet.dto.result.CustomerFunctionRoleListResultDTO; +import com.epmet.excel.CustomerFunctionRoleExcel; +import com.epmet.service.CustomerFunctionRoleService; +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-09-07 + */ +@RestController +@RequestMapping("customerfunctionrole") +public class CustomerFunctionRoleController { + + @Autowired + private CustomerFunctionRoleService customerFunctionRoleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerFunctionRoleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerFunctionRoleDTO data = customerFunctionRoleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerFunctionRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerFunctionRoleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerFunctionRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerFunctionRoleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerFunctionRoleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerFunctionRoleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerFunctionRoleExcel.class); + } + + /** + * @param tokenDTO formDTO + * @return + * @author sun + * @Description 客户定制功能角色设置 + */ + @PostMapping("savecustomerfunctionrole") + public Result saveCustomerFunctionRole(@LoginUser TokenDto tokenDTO, @RequestBody SaveCustomerFunctionRoleFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SaveCustomerFunctionRoleFormDTO.AddUserInternalGroup.class); + customerFunctionRoleService.saveCustomerFunctionRole(formDTO); + return new Result(); + } + + /** + * @param tokenDTO formDTO + * @return + * @author sun + * @Description 查询客户定制功能角色列表 + */ + @PostMapping("customerfunctionrolelist") + public Result> customerFunctionRoleList(@LoginUser TokenDto tokenDTO, @RequestBody CustomerFunctionRoleListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CustomerFunctionRoleListFormDTO.AddUserInternalGroup.class); + return new Result>().ok(customerFunctionRoleService.customerFunctionRoleList(formDTO)); + } +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java index 480e148b60..30fac6164c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java @@ -33,6 +33,55 @@ import java.util.List; @Mapper public interface CustomerFootBarDao extends BaseDao { - List listCustomerFootBars(@Param("customerId") String customerId, + List listDisplayCustomerFootBars(@Param("customerId") String customerId, @Param("appType") String appType); + + List listAllCustomerFootBars(@Param("customerId") String customerId, + @Param("appType") String appType); + + /** + * 唯一性count + * @param appType + * @param barKey + * @return + */ + int count4Unique(@Param("customerId") String customerId, + @Param("appType") String appType, + @Param("barKey") String barKey, + @Param("barName") String barName); + + /** + * 获取下一个顺序号 + * @param customerId + * @param appType + * @return + */ + Integer fetchNextOrder(@Param("customerId") String customerId, @Param("appType") String appType); + + /** + * 更新顺序号 + * @param id + * @param orderIndex + * @return + */ + Integer updateOrder(@Param("id") String id, @Param("orderIndex") Integer orderIndex); + + CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(@Param("customerId") String customerId, + @Param("appType") String appType, + @Param("barKey") String barKey); + + CustomerFootBarEntity getByAppTypeAndBarNameOfCustomer(@Param("customerId") String customerId, + @Param("appType") String appType, + @Param("barName") String barName); + + List listByAppTypeAndCustomerId(@Param("customerId") String customerId, + @Param("appType") String appType); + + void updateDisplayStatus(@Param("id") String id, @Param("display") Boolean display); + + List listFootBarOwnerCustomerIds(); + + void physicsDeleteById(@Param("id") String id); + + void physicsDeleteByAppTypeAndBarKey(@Param("appType") String appType, @Param("barKey") String barKey); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java new file mode 100644 index 0000000000..5a00d7e20a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java @@ -0,0 +1,62 @@ +/** + * 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.CustomerFunctionRoleDTO; +import com.epmet.dto.form.CustomerFunctionRoleListFormDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO; +import com.epmet.dto.result.CustomerFunctionRoleListResultDTO; +import com.epmet.entity.CustomerFunctionRoleEntity; +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-07 + */ +@Mapper +public interface CustomerFunctionRoleDao extends BaseDao { + + /** + * @author sun + * @Description 根据客户Id删除客户功能角色信息 + */ + void delByCustomerId(SaveCustomerFunctionRoleFormDTO formDTO); + + /** + * @param formDTO + * @return + * @author sun + * @Description 查询客户定制功能角色列表 + */ + List selectCustomerFunctionRoleList(CustomerFunctionRoleListFormDTO formDTO); + + /** + * @param formDTO + * @return + * @author sun + * @Description 根据用户拥有的角色查询客户的定制功能 + */ + List selectFunctionList(FunctionDetailFromDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java index 2161fc4bdc..9abc736b13 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java @@ -38,6 +38,11 @@ public class CustomerFootBarEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; + /** + * 客户id + */ + private String customerId; + /** * bar名称 */ @@ -65,6 +70,14 @@ public class CustomerFootBarEntity extends BaseEpmetEntity { */ private String selectedIconPath; - private Integer order; + /** + * 顺序号 + */ + private Integer orderIndex; + + /** + * 是否显示 + */ + private Boolean display; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionRoleEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionRoleEntity.java new file mode 100644 index 0000000000..65a0c7ffc3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionRoleEntity.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; + +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-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_function_role") +public class CustomerFunctionRoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 所属APP(工作端:gov、居民端:resi) + */ + private String fromApp; + + /** + * 角色Key值 + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionRoleExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionRoleExcel.java new file mode 100644 index 0000000000..78da1939dc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionRoleExcel.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.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-09-07 + */ +@Data +public class CustomerFunctionRoleExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id ") + private String customerId; + + @Excel(name = "功能ID(function.ID)") + private String functionId; + + @Excel(name = "所属APP(工作端:gov、居民端:resi)") + private String fromApp; + + @Excel(name = "角色Key值") + private String roleKey; + + @Excel(name = "角色名称") + private String roleName; + + @Excel(name = "删除标识:0.未删除 1.已删除") + 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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionRoleRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionRoleRedis.java new file mode 100644 index 0000000000..3e81389629 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionRoleRedis.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-09-07 + */ +@Component +public class CustomerFunctionRoleRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java index f38eab950d..0ed3c9e0e5 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.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.CustomerFootBarDTO; +import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.result.CustomerFootBarResultDTO; import com.epmet.entity.CustomerFootBarEntity; import java.util.List; @@ -94,4 +96,22 @@ public interface CustomerFootBarService extends BaseService listCustomerFootBars(String customerId, String appType); + + List listAllCustomerFootBars(String customerId, String appType); + + void createFootBar(CustomerFootBarFormDTO form); + + void updateFootBar(CustomerFootBarFormDTO form); + + CustomerFootBarResultDTO getFootBarDetail(String id); + + void saveOrder(List orderList); + + CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(String customerId, String appType, String barKey); + + void updateDisplayStatus(String id, Boolean display); + + void addDefault4Customer(String customerId, String appType); + + void deleteFootBar(String id); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java index d0561093e3..88c8e6d3bc 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -102,7 +102,7 @@ public interface CustomerFunctionDetailService extends BaseService resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionRoleService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionRoleService.java new file mode 100644 index 0000000000..7b4d747d46 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionRoleService.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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerFunctionRoleDTO; +import com.epmet.dto.form.CustomerFunctionRoleListFormDTO; +import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO; +import com.epmet.dto.result.CustomerFunctionRoleListResultDTO; +import com.epmet.entity.CustomerFunctionRoleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能角色列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-07 + */ +public interface CustomerFunctionRoleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-07 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-07 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerFunctionRoleDTO + * @author generator + * @date 2020-09-07 + */ + CustomerFunctionRoleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-07 + */ + void save(CustomerFunctionRoleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-07 + */ + void update(CustomerFunctionRoleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-07 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @author sun + * @Description 客户定制功能角色设置 + */ + void saveCustomerFunctionRole(SaveCustomerFunctionRoleFormDTO formDTO); + + /** + * @param formDTO + * @return + * @author sun + * @Description 查询客户定制功能角色列表 + */ + List customerFunctionRoleList(CustomerFunctionRoleListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java index 417555be13..594674b283 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java @@ -20,11 +20,15 @@ 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.exception.EpmetErrorCode; +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.dao.CustomerFootBarDao; import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.result.CustomerFootBarResultDTO; import com.epmet.entity.CustomerFootBarEntity; import com.epmet.redis.CustomerFootBarRedis; import com.epmet.service.CustomerFootBarService; @@ -103,7 +107,157 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl listCustomerFootBars(String customerId, String appType) { - return baseDao.listCustomerFootBars(customerId, appType); + return baseDao.listDisplayCustomerFootBars(customerId, appType); } + @Override + public List listAllCustomerFootBars(String customerId, String appType) { + return baseDao.listAllCustomerFootBars(customerId, appType); + } + + @Override + public void createFootBar(CustomerFootBarFormDTO form) { + + validateBeforeCreate(form); + + CustomerFootBarEntity entity = new CustomerFootBarEntity(); + entity.setAppType(form.getAppType()); + entity.setCustomerId("default"); // 只能为默认客户创建 + entity.setBarKey(form.getBarKey()); + entity.setBarName(form.getBarName()); + entity.setIconPath(form.getIconPath()); + entity.setPageTitle(form.getPageTitle()); + entity.setSelectedIconPath(form.getSelectedIconPath()); + entity.setOrderIndex(baseDao.fetchNextOrder(form.getCustomerId(), form.getAppType())); + entity.setDisplay(true); + baseDao.insert(entity); + + sync2Customers(entity); + } + + /** + * 同步到客户 + * @param entity + */ + private void sync2Customers(CustomerFootBarEntity entity) { + List customerIds = baseDao.listFootBarOwnerCustomerIds(); + for (String customerId : customerIds) { + CustomerFootBarEntity bar = baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, entity.getAppType(), entity.getBarKey()); + if (bar == null) { + // 该客户还没有该bar + CustomerFootBarEntity newBar = new CustomerFootBarEntity(); + newBar.setCustomerId(customerId); + newBar.setIconPath(entity.getIconPath()); + newBar.setPageTitle(entity.getPageTitle()); + newBar.setBarKey(entity.getBarKey()); + newBar.setBarName(entity.getBarName()); + newBar.setSelectedIconPath(entity.getSelectedIconPath()); + newBar.setOrderIndex(baseDao.fetchNextOrder(customerId, entity.getAppType())); + newBar.setAppType(entity.getAppType()); + newBar.setDisplay(true); + baseDao.insert(newBar); + } + } + } + + @Override + public void updateFootBar(CustomerFootBarFormDTO form) { + validateBeforeUpdate(form); + CustomerFootBarEntity entity = baseDao.selectById(form.getId()); + if (entity == null) { + throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_NOT_FOUND.getCode(), + EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_NOT_FOUND.getMsg()); + } + entity.setSelectedIconPath(form.getSelectedIconPath()); + entity.setBarName(form.getBarName()); + entity.setPageTitle(form.getPageTitle()); + entity.setIconPath(form.getIconPath()); + + baseDao.updateById(entity); + } + + @Override + public CustomerFootBarResultDTO getFootBarDetail(String id) { + CustomerFootBarEntity entity = baseDao.selectById(id); + if (entity == null) { + return new CustomerFootBarResultDTO(); + } + CustomerFootBarResultDTO dto = ConvertUtils.sourceToTarget(entity, CustomerFootBarResultDTO.class); + CustomerFootBarEntity defaultBar = baseDao.getByAppTypeAndBarKeyOfCustomer("default", entity.getAppType(), entity.getBarKey()); + dto.setDefaultBarName(defaultBar.getBarName()); + dto.setDefaultIconPath(defaultBar.getIconPath()); + dto.setDefaultSelectedIconPath(defaultBar.getSelectedIconPath()); + dto.setDefaultPageTitle(defaultBar.getPageTitle()); + return dto; + } + + @Transactional + @Override + public void saveOrder(List orderList) { + for (CustomerFootBarFormDTO.OrderIndexDTO idx : orderList) { + baseDao.updateOrder(idx.getId(), idx.getOrderIndex()); + } + } + + @Override + public CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(String customerId, String appType, String barKey) { + return baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, appType, barKey); + } + + @Override + public void updateDisplayStatus(String id, Boolean display) { + baseDao.updateDisplayStatus(id, display); + } + + @Transactional + @Override + public void addDefault4Customer(String customerId, String appType) { + List defaultBars = baseDao.listByAppTypeAndCustomerId("default", appType); + for (CustomerFootBarEntity defaultBar : defaultBars) { + CustomerFootBarEntity bar = baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, appType, defaultBar.getBarKey()); + if (bar != null) { + // 该客户已经有该bar了,不再添加 + continue; + } + + defaultBar.setCustomerId(customerId); + defaultBar.setId(null); + defaultBar.setCreatedTime(null); + defaultBar.setCreatedBy(null); + defaultBar.setUpdatedTime(null); + defaultBar.setUpdatedBy(null); + baseDao.insert(defaultBar); + } + } + + @Override + public void deleteFootBar(String id) { + CustomerFootBarEntity defaultFootbar = baseDao.selectById(id); + baseDao.physicsDeleteByAppTypeAndBarKey(defaultFootbar.getAppType(), defaultFootbar.getBarKey()); + } + + /** + * 添加footbar之前的校验 + * @param form + */ + private void validateBeforeCreate(CustomerFootBarFormDTO form) { + synchronized (this) { + int uniqueCount1 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), form.getBarKey(), null); + int uniqueCount2 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), null, form.getBarName()); + if (uniqueCount1 > 0 || uniqueCount2 > 0) { + throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(), + EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getMsg()); + } + } + } + + private void validateBeforeUpdate(CustomerFootBarFormDTO form) { + synchronized (this) { + CustomerFootBarEntity entity = baseDao.getByAppTypeAndBarNameOfCustomer(form.getCustomerId(), form.getAppType(), form.getBarName()); + if (entity != null && !entity.getId().equals(form.getId())) { + throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(), + EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getMsg()); + } + } + } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java index d57623db5d..1473a18675 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -20,6 +20,7 @@ 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.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -28,10 +29,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dao.CustomerFunctionDao; -import com.epmet.dao.CustomerFunctionDetailDao; -import com.epmet.dao.FunctionCustomizedDao; -import com.epmet.dao.FunctionShoppingHistoryDao; +import com.epmet.dao.*; import com.epmet.dto.CustomerFunctionDetailDTO; import com.epmet.dto.FunctionCustomizedDTO; import com.epmet.dto.FunctionShoppingHistoryDTO; @@ -40,6 +38,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.CustomerFunctionDetailEntity; import com.epmet.entity.CustomerFunctionEntity; import com.epmet.entity.FunctionShoppingHistoryEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.CustomerFunctionDetailRedis; import com.epmet.service.CustomerFunctionDetailService; import com.epmet.service.FunctionShoppingHistoryService; @@ -49,6 +48,7 @@ import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import rx.internal.util.LinkedArrayList; import java.util.*; import java.util.stream.Collectors; @@ -73,6 +73,10 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -127,27 +131,63 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO) { - //根据客户Id和所属端查询客户定制功能列表数据 + List restltList = new LinkedList<>(); + //1.根据客户Id和所属端查询客户定制功能列表数据 logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); List list = baseDao.selectFunctionDetailList(formDTO); - try { - String join = String.join(",", new ArrayList<>()); - String customerParameter = java.net.URLEncoder.encode(join, "utf-8"); - list.forEach(l->{ - l.setCustomerParameter(customerParameter); + if (null != list && list.size() > NumConstant.ZERO) { + //1-1.设置自定义json数据(暂时为空) + try { + String join = String.join(",", new ArrayList<>()); + String customerParameter = java.net.URLEncoder.encode(join, "utf-8"); + list.forEach(l -> { + l.setCustomerParameter(customerParameter); + }); + } catch (Exception e) { + logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + + //2.调用user服务,获取用户角色信息 + GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO(); + dto.setUserId(formDTO.getUserId()); + dto.setFromApp(formDTO.getClientType()); + //居民端需要传网格Id 热心居民的角色是在网格里的 + if(AppClientConstant.APP_RESI.equals(formDTO.getClientType())){ + dto.setGridId(formDTO.getGridId()); + } + Result> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto); + if (!result.success()) { + logger.error(String.format("调用user服务,获取用户角色信息失败,用户Id:%s ,所属端:%s", formDTO.getUserId(), formDTO.getClientType())); + throw new RenException(result.getCode()); + } + //未查询到角色数据则不能查看定制功能(居民端陌生人无任何角色) + if (null == result || result.getData().size() < NumConstant.ONE) { + return restltList; + } + formDTO.setRoleKeyList(result.getData()); + + //3.根据用户拥有的角色查询客户的定制功能 + List listFunctionIds = customerFunctionRoleDao.selectFunctionList(formDTO); + + //4.封装结果数据 + list.forEach(l -> { + listFunctionIds.forEach(id -> { + if (id.equals(l.getFunctionId())) { + restltList.add(l); + } + }); }); - } catch (Exception e) { - logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败"); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); } - return list; + + return restltList; } @Override diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java new file mode 100644 index 0000000000..f930ee6bdc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java @@ -0,0 +1,154 @@ +/** + * 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.exception.ErrorCode; +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.dao.CustomerFunctionRoleDao; +import com.epmet.dto.CustomerFunctionRoleDTO; +import com.epmet.dto.form.CustomerFunctionRoleListFormDTO; +import com.epmet.dto.form.RoleListFormDTO; +import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO; +import com.epmet.dto.result.CustomerFunctionRoleListResultDTO; +import com.epmet.entity.CustomerFunctionRoleEntity; +import com.epmet.redis.CustomerFunctionRoleRedis; +import com.epmet.service.CustomerFunctionRoleService; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能角色列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-07 + */ +@Service +public class CustomerFunctionRoleServiceImpl extends BaseServiceImpl implements CustomerFunctionRoleService { + + @Autowired + private CustomerFunctionRoleRedis customerFunctionRoleRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerFunctionRoleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerFunctionRoleDTO.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 CustomerFunctionRoleDTO get(String id) { + CustomerFunctionRoleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerFunctionRoleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerFunctionRoleDTO dto) { + CustomerFunctionRoleEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionRoleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerFunctionRoleDTO dto) { + CustomerFunctionRoleEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionRoleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @author sun + * @Description 客户定制功能角色设置 + */ + @Override + public void saveCustomerFunctionRole(SaveCustomerFunctionRoleFormDTO formDTO) { + List listEntity = new ArrayList<>(); + //1.封装数据 + List roleList = formDTO.getRoleList(); + roleList.forEach(role->{ + CustomerFunctionRoleEntity entity = new CustomerFunctionRoleEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setFunctionId(formDTO.getFunctionId()); + entity.setFromApp(formDTO.getFromApp()); + entity.setRoleKey(role.getRoleKey()); + entity.setRoleName(role.getRoleName()); + listEntity.add(entity); + }); + + //2.先按客户Id、功能Id执行删除操作 + baseDao.delByCustomerId(formDTO); + + //3.批量新增 + if(!insertBatch(listEntity)){ + throw new RenException("定制功能角色设置失败"); + } + + } + + /** + * @param formDTO + * @return + * @author sun + * @Description 查询客户定制功能角色列表 + */ + @Override + public List customerFunctionRoleList(CustomerFunctionRoleListFormDTO formDTO) { + //1.根据客户Id、功能Id查询客户定制功能设置的角色列表 + return baseDao.selectCustomerFunctionRoleList(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml index f65f7d24eb..14755776eb 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: oper-customize-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.6__footbar_add_column.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.6__footbar_add_column.sql new file mode 100644 index 0000000000..d6301a196a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.6__footbar_add_column.sql @@ -0,0 +1,2 @@ +alter table customer_foot_bar add column DISPLAY tinyint(1) default 1; +alter table customer_foot_bar change `ORDER` ORDER_INDEX tinyint(1) default 1; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.7__customer_function_role.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.7__customer_function_role.sql new file mode 100644 index 0000000000..ca1b9d2be1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.7__customer_function_role.sql @@ -0,0 +1,15 @@ +CREATE TABLE `customer_function_role` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id ', + `FUNCTION_ID` varchar(64) NOT NULL COMMENT '功能ID(function.ID)', + `FROM_APP` varchar(32) NOT NULL COMMENT '所属APP(工作端:gov、居民端:resi)', + `ROLE_KEY` varchar(32) NOT NULL COMMENT '角色Key值', + `ROLE_NAME` varchar(32) NOT NULL COMMENT '角色名称', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户定制功能角色列表'; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml index e41b42ddb3..b320a9c1d2 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml @@ -11,7 +11,8 @@ - + + @@ -20,34 +21,194 @@ + + + update customer_foot_bar + set ORDER_INDEX = #{orderIndex} + where ID = #{id} + + + + update customer_foot_bar + set DISPLAY=#{display} + where ID = #{id} + + + + + delete + from customer_foot_bar + where ID = #{id} + + + + delete + from customer_foot_bar + where app_type = #{appType} + and BAR_KEY = #{barKey} + + - SELECT id, customer_id, app_type, bar_key, bar_name, - app_type, page_title, icon_path, selected_icon_path, - `order`, + display, + order_index, del_flag, revision, created_by, created_time, updated_by, - updated_time, - `order` + updated_time FROM customer_foot_bar DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND APP_TYPE = #{appType} + AND DISPLAY = 1 + + ORDER BY `ORDER_INDEX` ASC + + + + + + + + + + + + + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionRoleDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionRoleDao.xml new file mode 100644 index 0000000000..2789f2c2a4 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionRoleDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + DELETE + FROM customer_function_role + WHERE customer_id = #{customerId} + AND function_id = #{functionId} + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/Dockerfile b/epmet-module/resi-group/resi-group-server/Dockerfile index b4a767cfc8..b1fd9f6fab 100644 --- a/epmet-module/resi-group/resi-group-server/Dockerfile +++ b/epmet-module/resi-group/resi-group-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./resi-group.jar EXPOSE 8095 diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml index 29a259a5d2..7a0d7418f8 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-group.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml index a4aecd5dbf..1ac691b016 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./resi-group.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml index f88d341ad0..73a38f0279 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./resi-group.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index dd17343ed3..6f73407d1a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-group-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/resi-guide/resi-guide-server/Dockerfile b/epmet-module/resi-guide/resi-guide-server/Dockerfile index 10b908b3bf..b305936b9e 100644 --- a/epmet-module/resi-guide/resi-guide-server/Dockerfile +++ b/epmet-module/resi-guide/resi-guide-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./resi-guide.jar EXPOSE 8091 diff --git a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-dev.yml b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-dev.yml index f65e0d6954..902a0e4bb6 100644 --- a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-guide.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-prod.yml b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-prod.yml index cfac504f95..9cadb53ff2 100644 --- a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./resi-guide.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml index 2f769d6a98..c4a3d796f0 100644 --- a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-guide.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml index 1108340bce..ed94f661c3 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-guide-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/resi-hall/resi-hall-server/Dockerfile b/epmet-module/resi-hall/resi-hall-server/Dockerfile index 59cacab9be..c1ec1e0ba0 100644 --- a/epmet-module/resi-hall/resi-hall-server/Dockerfile +++ b/epmet-module/resi-hall/resi-hall-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./resi-hall.jar EXPOSE 8100 diff --git a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml index 4ded433cc3..b85358a70e 100644 --- a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-hall.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-prod.yml b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-prod.yml index 5effa21314..21b8308936 100644 --- a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./resi-hall.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-test.yml b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-test.yml index 7727b4788c..6d675b03b8 100644 --- a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-hall.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml index 00e752f20a..58e251be5b 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-hall-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/resi-home/resi-home-server/Dockerfile b/epmet-module/resi-home/resi-home-server/Dockerfile index 00ce6c09fe..2917a9be89 100644 --- a/epmet-module/resi-home/resi-home-server/Dockerfile +++ b/epmet-module/resi-home/resi-home-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./resi-home.jar EXPOSE 8104 diff --git a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-dev.yml b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-dev.yml index fa06f9f3c3..e0cdb9b16c 100644 --- a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-home.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-prod.yml b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-prod.yml index e4dbbe5a60..50abf2bb7b 100644 --- a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./resi-home.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-test.yml b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-test.yml index 3374b39296..754c7d9398 100644 --- a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-home.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml index 78690a6d9f..afb7ab3e38 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-home-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/resi-mine/resi-mine-server/Dockerfile b/epmet-module/resi-mine/resi-mine-server/Dockerfile index 1278acc61a..5237c843ec 100644 --- a/epmet-module/resi-mine/resi-mine-server/Dockerfile +++ b/epmet-module/resi-mine/resi-mine-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./resi-mine.jar EXPOSE 8094 diff --git a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml index 420beafcf5..57e2434372 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-mine.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml index 3c154c7eec..3f125978dc 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./resi-mine.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml index f5643beb81..2fa05668ea 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-mine.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml index ad3ec82fe3..6e5eb54cc2 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-mine-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/resi-partymember/resi-partymember-server/Dockerfile b/epmet-module/resi-partymember/resi-partymember-server/Dockerfile index 98190f2cd2..11a783524f 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/Dockerfile +++ b/epmet-module/resi-partymember/resi-partymember-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./resi-partymember.jar EXPOSE 8096 diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml index 80b020b242..680f45f751 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-partymember.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml index 65ad6ccbc8..89ec555713 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./resi-partymember.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml index 6770043a38..8ca40ddf75 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-partymember.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 93aa5af28c..2004930351 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -477,9 +477,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService Result gridInfoResult = govOrgFeignClient.queryGridInfo(partyMemberInfo.getGridId()); String gridFullPath = ""; if (gridInfoResult.success() && null != gridInfoResult.getData()) { - gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), - gridInfoResult.getData().getCommnuityName(), - gridInfoResult.getData().getGridName()); + gridFullPath = String.format("%s-%s-%s", null == gridInfoResult.getData().getStreetName() ? "" : gridInfoResult.getData().getStreetName(), + null == gridInfoResult.getData().getCommnuityName() ? "" : gridInfoResult.getData().getCommnuityName(), + null == gridInfoResult.getData().getGridName() ? "" : gridInfoResult.getData().getGridName()); gridFullPath = gridFullPath.replaceAll("--", "").trim(); } resultDTO.setGridFullPath(gridFullPath); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml index 9a2b17a333..a2118ff3a3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-partymember-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/resi-voice/resi-voice-server/Dockerfile b/epmet-module/resi-voice/resi-voice-server/Dockerfile index ae49b60d2b..abb56beb1c 100644 --- a/epmet-module/resi-voice/resi-voice-server/Dockerfile +++ b/epmet-module/resi-voice/resi-voice-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./resi-voice.jar EXPOSE 8106 diff --git a/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml index 7a023873b2..b92e25f3c6 100644 --- a/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./resi-voice.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-prod.yml b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-prod.yml index a32d313f2d..6962aaca73 100644 --- a/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./resi-voice.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml index 187294fb94..d37cc30473 100644 --- a/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./resi-voice.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml index e77e88368d..03891ed01a 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-voice-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/epmet-openapi/epmet-openapi-scan/Dockerfile b/epmet-openapi/epmet-openapi-scan/Dockerfile index e619f718b9..972fb78535 100644 --- a/epmet-openapi/epmet-openapi-scan/Dockerfile +++ b/epmet-openapi/epmet-openapi-scan/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-openapi-scan.jar EXPOSE 8107 diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml index 1e20c49e26..7593b66a08 100644 --- a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-openapi-scan.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-prod.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-prod.yml index 693ba1cb4c..69873777e7 100644 --- a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-prod.yml +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-openapi-scan.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml index 4c9bbec505..37c53b9557 100644 --- a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-openapi-scan.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml index 6c9dba5543..84000daee9 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-openapi-scan #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java index 9b2eec5757..89c1145e31 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -15,15 +16,17 @@ import java.io.Serializable; public class CommonUserFormDTO implements Serializable{ private static final long serialVersionUID = -7994579456530273809L; + public interface CustomerId_UserIdGroup extends CustomerClientShowGroup{} + /** * 用户Id * */ - @NotBlank(message = "用户Id不能为空") + @NotBlank(message = "用户Id不能为空" , groups = CustomerId_UserIdGroup.class) private String userId; /** * 客户Id * */ - @NotBlank(message = "客户Id不能为空") + @NotBlank(message = "客户Id不能为空" , groups = CustomerId_UserIdGroup.class) private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java new file mode 100644 index 0000000000..263b263a8f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 获取用户拥有的角色key集合-接口入参 + * @Author sun + */ +@Data +public class GetRoleKeyListFormDTO implements Serializable{ + private static final long serialVersionUID = -7994579456530273809L; + + /** + * 用户Id + * */ + private String userId; + /** + * 网格Id + * */ + private String gridId; + /** + * 所属端(居民端:resi 工作端:gov) + * */ + private String fromApp; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleListResultDTO.java new file mode 100644 index 0000000000..5221f37c67 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleListResultDTO.java @@ -0,0 +1,46 @@ +/** + * 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.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 获取居民端、工作端人员角色列表--接口返参 + * + * @author sun + */ +@Data +public class ResiGovRoleListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 居民端角色列表 + */ + private List resiRoleList; + + /** + * 工作端角色列表 + */ + private List govRoleList; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleResultDTO.java new file mode 100644 index 0000000000..49b05f0804 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleResultDTO.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.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 获取居民端、工作端人员角色列表--接口返参 + * + * @author sun + */ +@Data +public class ResiGovRoleResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 角色key + */ + private String roleKey; + /** + * 角色名称 + */ + private String roleName; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 4e3da40627..c5a50bc818 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -300,10 +300,17 @@ public interface EpmetUserOpenFeignClient { /** * 更改角色所属组织 * @author zhaoqifeng - * @date 2020/8/31 10:36 + * @date 2020/8/31 10:36 * @param formDTO * @return com.epmet.commons.tools.utils.Result */ @PostMapping("epmetuser/staffrole/changeroleorg") Result changeRoleOrg(@RequestBody StaffRoleDTO formDTO); + + /** + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + @PostMapping("epmetuser/role/getuserrolekeylist") + Result> getUserRoleKeyList(@RequestBody GetRoleKeyListFormDTO dto); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index a60c9611ae..2a6db644e7 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -205,4 +205,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result changeRoleOrg(StaffRoleDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeRoleOrg", formDTO); } + + @Override + public Result> getUserRoleKeyList(GetRoleKeyListFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleKeyList", dto); + } } diff --git a/epmet-user/epmet-user-server/Dockerfile b/epmet-user/epmet-user-server/Dockerfile index 2495f36a46..a105a5bb0e 100644 --- a/epmet-user/epmet-user-server/Dockerfile +++ b/epmet-user/epmet-user-server/Dockerfile @@ -4,7 +4,7 @@ RUN export LANG="zh_CN.UTF-8" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone -COPY ./target/*.jar ./app.jar +COPY ./target/*.jar ./epmet-user.jar EXPOSE 8087 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index e1af81c0ce..0a8be8c147 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-user.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index 183968322f..08e09c8b18 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-user.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml index 0dfe4fac89..eb18d181c1 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml @@ -9,7 +9,7 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-user.jar" restart: "unless-stopped" deploy: resources: diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java index 38081f88cd..2411ec1079 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java @@ -1,11 +1,16 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.RoleDTO; import com.epmet.dto.form.GovStaffRoleFormDTO; +import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; +import com.epmet.dto.result.IssueInitiatorResultDTO; +import com.epmet.dto.result.ResiGovRoleListResultDTO; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; import org.springframework.beans.factory.annotation.Autowired; @@ -59,4 +64,16 @@ public class GovStaffRoleController { return new Result>().ok(roleDTOS); } + + /** + * @param tokenDTO + * @return ResiGovRoleListResultDTO + * @author sun + * @Description 获取居民端、工作端人员角色列表 + */ + @PostMapping("resigovrolelist") + public Result resiGovRoleList(@LoginUser TokenDto tokenDTO){ + return new Result().ok(govStaffRoleService.resiGovRoleList()); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java index e7c82100a6..98ec4c998f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -26,6 +28,7 @@ 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.RoleDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.excel.RoleExcel; import com.epmet.service.RoleService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +94,15 @@ public class RoleController { ExcelUtils.exportExcelToTarget(response, null, list, RoleExcel.class); } + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + @PostMapping("getuserrolekeylist") + public Result> getUserRoleKeyList(@RequestBody GetRoleKeyListFormDTO formDTO) { + return new Result>().ok(roleService.getUserRoleKeyList(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleTemplateDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleTemplateDao.java index 4622b81f79..62af0e097c 100755 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleTemplateDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleTemplateDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.GovStaffRoleTemplateDTO; +import com.epmet.dto.result.ResiGovRoleResultDTO; import com.epmet.entity.GovStaffRoleTemplateEntity; import org.apache.ibatis.annotations.Mapper; @@ -38,4 +39,10 @@ public interface GovStaffRoleTemplateDao extends BaseDao listValidateRoles(); + + /** + * @author sun + * @Description 获取工作端角色列表 + */ + List selectGovRoleList(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java index 398406a8cf..c8ceda37c5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.RoleDTO; +import com.epmet.dto.result.ResiGovRoleResultDTO; import com.epmet.entity.RoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -41,4 +42,10 @@ public interface RoleDao extends BaseDao { * @return RoleEntity */ RoleEntity selectRoleByKey(RoleEntity param); + + /** + * @author sun + * @Description 获取居民端角色列表 + */ + List selectResiRoleList(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index dfc5407272..3124fc68c7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.CustomerStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; @@ -122,4 +123,12 @@ public interface StaffRoleDao extends BaseDao { * @return void */ void updateStaffRoleOrgId(StaffRoleDTO dto); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 工作端-查询用户角色key列表 + **/ + List selectStaffRoleKeyList(GetRoleKeyListFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java index e91e0c8d46..3801f0fcf4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserRoleDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.dto.form.UserRoleFormDTO; import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.entity.UserRoleEntity; @@ -63,4 +64,12 @@ public interface UserRoleDao extends BaseDao { * @Date 14:24 2020-07-23 **/ List getUserRoleInfoByUserId(@Param("userId") String userId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + List selectUserRoleKeyList(GetRoleKeyListFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index 1322bf06d1..d7347a597f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; +import com.epmet.dto.result.ResiGovRoleListResultDTO; import com.epmet.entity.GovStaffRoleEntity; import java.util.List; @@ -127,4 +128,10 @@ public interface GovStaffRoleService extends BaseService { List listRoleTemplates(); GovStaffRoleResultDTO getDTOById(String roleId); + + /** + * @author sun + * @Description 获取居民端、工作端人员角色列表 + */ + ResiGovRoleListResultDTO resiGovRoleList(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java index 72e055c4b1..21ac0465b0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.RoleDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.entity.RoleEntity; import java.util.List; @@ -99,4 +100,12 @@ public interface RoleService extends BaseService { * @return RoleDTO */ RoleDTO getRoleByKey(RoleDTO role); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + List getUserRoleKeyList(GetRoleKeyListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 72f9c416b2..ec85e7b960 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -626,23 +626,25 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); - if (!customerInfo.success()) { - logger.error(String.format("获取根管理员信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); - } else { - if (null != customerInfo.getData()){ - CustomerListResultDTO resultDTO = new CustomerListResultDTO(); - resultDTO.setCustomerId(customerInfo.getData().getId()); - resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); - listResultDTO.add(resultDTO); - } - } - } + if (null != roleKey){ + // 3.根据roleId + staff_id(即 userId) 查 staff_role表的主键id, 如果查到了,那这个userId就是 根管理员 + StaffRoleDTO staffRoleDTO = staffRoleDao.selectStaffRoleByStaffIdAndRoleId(staffDTO.getUserId(), roleKey.getId()); + if (null != staffRoleDTO){ + // 4.如果userID是根管理员的话,则根据customerId 去 customer表 查询 id、customer_name + customerDTO.setId(staffDTO.getCustomerId()); + Result customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); + if (!customerInfo.success()) { + logger.error(String.format("获取根管理员信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); + } else { + if (null != customerInfo.getData()){ + CustomerListResultDTO resultDTO = new CustomerListResultDTO(); + resultDTO.setCustomerId(customerInfo.getData().getId()); + resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); + listResultDTO.add(resultDTO); + } + } + } + } } return new Result>().ok(listResultDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index 6da54b7c69..29f782b14a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -27,10 +27,13 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.GovStaffRoleDao; import com.epmet.dao.GovStaffRoleTemplateDao; +import com.epmet.dao.RoleDao; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.InitDefaultOperationsFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; +import com.epmet.dto.result.ResiGovRoleListResultDTO; +import com.epmet.dto.result.ResiGovRoleResultDTO; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.feign.GovAccessFeignClient; import com.epmet.redis.GovStaffRoleRedis; @@ -66,6 +69,9 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -181,4 +187,25 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl resiRoleList = roleDao.selectResiRoleList(); + + //2.查询工作端角色列表 + List govRoleList = govStaffRoleTemplateDao.selectGovRoleList(); + + //3.封装数据并返回 + resultDTO.setResiRoleList(resiRoleList); + resultDTO.setGovRoleList(govRoleList); + return resultDTO; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java index 8322ee7226..40b1e478ff 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java @@ -20,11 +20,15 @@ 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.constant.AppClientConstant; 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.RoleDao; +import com.epmet.dao.StaffRoleDao; +import com.epmet.dao.UserRoleDao; import com.epmet.dto.RoleDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.entity.RoleEntity; import com.epmet.redis.RoleRedis; import com.epmet.service.RoleService; @@ -33,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -48,6 +53,10 @@ public class RoleServiceImpl extends BaseServiceImpl implem @Autowired private RoleRedis roleRedis; + @Autowired + private UserRoleDao userRoleDao; + @Autowired + private StaffRoleDao staffRoleDao; @Override public PageData page(Map params) { @@ -106,4 +115,21 @@ public class RoleServiceImpl extends BaseServiceImpl implem RoleEntity entity = baseDao.selectRoleByKey(ConvertUtils.sourceToTarget(role, RoleEntity.class)); return ConvertUtils.sourceToTarget(entity, RoleDTO.class); } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + @Override + public List getUserRoleKeyList(GetRoleKeyListFormDTO formDTO) { + List list = new ArrayList<>(); + if(AppClientConstant.APP_RESI.equals(formDTO.getFromApp())){ + list = userRoleDao.selectUserRoleKeyList(formDTO); + }else if(AppClientConstant.APP_GOV.equals(formDTO.getFromApp())){ + list = staffRoleDao.selectStaffRoleKeyList(formDTO); + } + return list; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 2f32b59b5f..da356f3e5c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -3,7 +3,6 @@ package com.epmet.service.impl; 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.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; @@ -203,9 +202,9 @@ public class UserServiceImpl extends BaseServiceImpl implem userRoleFormDTO.setGridId(myResiUserInfoFormDTO.getGridId()); result.setRoleList(userRoleDao.getUserRoleList(userRoleFormDTO)); - TokenDto dto = new TokenDto(); - dto.setUserId(myResiUserInfoFormDTO.getUserId()); - Result pointResult = epmetPointOpenFeignClient.myPoint(dto); + CommonUserFormDTO pointParam = new CommonUserFormDTO(); + pointParam.setCustomerId(myResiUserInfoFormDTO.getCustomerId()); + Result pointResult = epmetPointOpenFeignClient.myPoint(pointParam); if(pointResult.success() && null != pointResult.getData()){ //累计积分 result.setPoint(pointResult.getData().getUsablePoint()); diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 00a9025891..4f732d5ac9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-user-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 48fd117891..4d88329d42 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -230,9 +230,11 @@ cs.del_flag = 0 AND cs.enable_flag = 'enable' AND - - cs.user_id = #{userId} - + ( + + cs.user_id = #{userId} + + ) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index a9da37f9d9..c8bd19b151 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -82,8 +82,10 @@ gsr.del_flag = 0 AND sr.del_flag = 0 AND - - sr.staff_id = #{userId} - + ( + + sr.staff_id = #{userId} + + ) \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleTemplateDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleTemplateDao.xml index 263d76beec..a06b408917 100755 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleTemplateDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleTemplateDao.xml @@ -23,5 +23,14 @@ WHERE DEL_FLAG = 0 + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml index 2bc5147051..8fbf38a62a 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml @@ -27,4 +27,12 @@ and ROLE_KEY = #{roleKey} and DEL_FLAG = 0 + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index aabdfd6d71..0b39b350b7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -181,4 +181,16 @@ and sr.ROLE_ID = #{roleId} and sr.DEL_FLAG='0' + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml index 803fa40621..d7726d3b7b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml @@ -88,4 +88,16 @@ ur.USER_ID = #{userId} + +