diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 9058e3065d..df371df8a9 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -84,12 +84,41 @@ dev + + 8082 + dev + + + + + + epmet_admin_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8082 - dev + local @@ -103,7 +132,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -116,9 +145,6 @@ test - 8082 test diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index c26333a04a..f533348156 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.68 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.69 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index aaff93a013..7a7fcd5f9c 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -156,9 +156,6 @@ dev - - true - 8081 dev @@ -192,12 +189,46 @@ e5e72147737cfeb2b0f3a43624cadb3f--> + + local + + true + + + 8081 + local + + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + wxcb6ce2ed0c5ae54c + c7f74941ee97fa9b2e1065772d34c397 + 12345678Yzm + jiKrJoPQsUIP9ayAwmuJQeAVPBjFOh5D1JxFDd7ZSU3 + + wx07674c23af51b521 + a2fd0d29b007cbbcf8c8dda8c693d99b + + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b + + + test - 8081 test diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/enums/DataSourceEnum.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/enums/DataSourceEnum.java index bca4441435..e540bdc6fe 100644 --- a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/enums/DataSourceEnum.java +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/enums/DataSourceEnum.java @@ -5,9 +5,9 @@ package com.epmet.commons.dynamic.datasource.enums; */ public enum DataSourceEnum { - DATA_STATISTICAL_REAL("data-statistical-server", "real", "stats"), + DATA_STATISTICAL_REAL("data-statistical-server", "real", "evaluationIndex"), DATA_STATISTICAL_FAKE("data-statistical-server", "fake", "statsDisplay"), - DATA_REPORT_REAL("data-report-server", "real", "stats"), + DATA_REPORT_REAL("data-report-server", "real", "evaluationIndex"), DATA_REPORT_FAKE("data-report-server", "fake", "statsDisplay"), ; 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 new file mode 100644 index 0000000000..8e065c792a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.aspect; + +import com.epmet.commons.tools.dto.form.DingTalkTextMsg; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.cloud.commons.util.InetUtils; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +/** + * 应用 启动健康检查 通知类 + * CustomerApplicationRunner + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +@Order(value = 99) +public class CustomerApplicationRunner implements ApplicationRunner { + private static Logger logger = LogManager.getLogger(CustomerApplicationRunner.class); + @Value("${spring.application.name}") + private String appName; + + @Override + public void run(ApplicationArguments args) { + //发送启动成功消息 + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + logger.info(currentEnv); + if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode())) { + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + + //开发小组 群机器人地址 + String url = "https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"; + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(EnvEnum.getCurrentEnv().getName()) + .append("【") + .append(appName) + .append("】") + .append("ip地址: ") + .append(serverIp) + .append("部署完毕!"); + DingTalkTextMsg msg = new DingTalkTextMsg(); + msg.setWebHook(url); + msg.setAtAll(true); + msg.setContent(stringBuilder.toString()); + Result stringResult = HttpClientManager.getInstance().sendPostByJSON(url, msg.getMsgContent()); + logger.info(stringResult); + } + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 0ac7dbf706..e906535166 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -1,5 +1,7 @@ package com.epmet.commons.tools.constant; +import java.math.BigDecimal; + /** * 常用数字常量 * @@ -56,4 +58,6 @@ public interface NumConstant { String POSITIVE_EIGHT_STR = "+8"; String EMPTY_STR = ""; String ONE_NEG_STR = "-1"; + + String FIFTY_STR="50"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index 655635e6d7..03233b7c47 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -77,4 +77,8 @@ public interface StrConstant { String NULL_STR="null"; String NOT_FILLED = "无"; + + String MIN="MIN"; + + String MAX="MAX"; } 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 ed265248e6..0c3f798318 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 @@ -1,5 +1,8 @@ package com.epmet.commons.tools.enums; +import com.epmet.commons.tools.utils.SpringContextUtils; +import org.springframework.core.env.Environment; + /** * 系统环境变量枚举类 * dev|test|prod @@ -34,6 +37,20 @@ public enum EnvEnum { return EnvEnum.UN_KNOWN; } + public static EnvEnum getCurrentEnv(){ + try { + Environment environment = SpringContextUtils.getBean(Environment.class); + String[] activeProfiles = environment.getActiveProfiles(); + if (activeProfiles != null && activeProfiles.length > 0) { + return getEnum(activeProfiles[0]); + } + } catch (Exception e) { + e.printStackTrace(); + } + return EnvEnum.UN_KNOWN; + } + + public String getCode() { return code; } 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 939378fc26..20a0b534f6 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 @@ -79,6 +79,7 @@ public enum EpmetErrorCode { GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"), EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"), EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"), + CAN_NOT_SELF(8410,"无法对自己进行操作"), ALREADY_EVALUATE(8501,"您已评价"), ALREADY_VOTE(8502,"您已表态"), @@ -106,7 +107,7 @@ 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(8712, "秘钥更新失败"), + OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"), // 党建声音 前端提示 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 a5be29eb58..0d623e2010 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 @@ -297,4 +297,12 @@ public class RedisKeys { public static String getExternalAppSecretKey(String appId) { return String.format(rootPrefix+"externalapp:secret:%s",appId); } + + /** + * 计算指标时获取指标code和fields关系缓存Key + * @return + */ + public static String getIndexCodeFieldReKey() { + return rootPrefix.concat("data:index:indexcode:field"); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 0a45a6b290..75174f4216 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -9,6 +9,7 @@ package com.epmet.commons.tools.utils; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -33,6 +34,11 @@ public class DateUtils { public static final List Q3Months = Arrays.asList(7, 8, 9); public static final List Q4Months = Arrays.asList(10, 11, 12); + public static final List Q1MonthsStrList = Arrays.asList("1", "2", "3","01","02","03"); + public static final List Q2MonthsStrList = Arrays.asList("4", "5", "6","04", "05", "06"); + public static final List Q3MonthsStrList = Arrays.asList("7", "8", "9","07", "08", "09"); + public static final List Q4MonthsStrList = Arrays.asList("10", "11", "12"); + /** 时间格式(yyyy-MM-dd) */ public final static String DATE_PATTERN = "yyyy-MM-dd"; /** 时间格式(yyyy-MM-dd HH:mm:ss) */ @@ -298,6 +304,29 @@ public class DateUtils { return 4; } + /** + * 获取季度 + * @param monthId yyyyMM + * @return yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + public static String getQuarterId(String monthId) { + String year = monthId.substring(0, 4); + String month = monthId.substring(4, 6); + if (Q1MonthsStrList.contains(month)) { + return year.concat("Q1"); + } + if (Q2MonthsStrList.contains(month)) { + return year.concat("Q2"); + } + if (Q3MonthsStrList.contains(month)) { + return year.concat("Q3"); + } + if(Q4MonthsStrList.contains(month)){ + return year.concat("Q4"); + } + return StrConstant.EPMETY_STR; + } + /** * 根据季度查询季度的月份列表 * @param quarterIndex @@ -557,4 +586,11 @@ public class DateUtils { System.out.println(comparteDate(yesterDay,today)); System.out.println(comparteDate(tomorrow,today)); } + + public static String getYearId(String monthId) { + if (StringUtils.isNotBlank(monthId) && monthId.length() > 4) { + return monthId.substring(NumConstant.ZERO, NumConstant.FOUR); + } + return StrConstant.EPMETY_STR; + } } diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index 82a1bb2c15..3329f89b6d 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.32 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.35 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 43269581b5..e64e3f45c3 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.33 + 0.3.35 com.epmet epmet-cloud @@ -87,9 +87,6 @@ dev - - true - 8080 @@ -201,6 +198,122 @@ + + local + + true + + + 8080 + + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + lb://epmet-auth-server + + lb://epmet-admin-server + + lb://epmet-oss-server + + lb://epmet-message-server + + lb://epmet-activiti-server + + lb://epmet-job-server + + + + lb://epmet-user-server + + lb://epmet-demo-server + + lb://oper-customize-server + + lb://oper-crm-server + + + lb://resi-guide-server + + + lb://gov-org-server + + + lb://oper-access-server + + + lb://resi-mine-server + + + lb://resi-group-server + + + lb://resi-partymember-server + + + lb://gov-grid-server + + + lb://gov-access-server + + + + lb://gov-mine-server + + lb://resi-hall-server + + + lb://gov-issue-server + + + lb://gov-project-server + + lb://common-service-server + + lb://resi-home-server + + + lb://gov-voice-server + + + lb://resi-voice-server + + + lb://data-report-server + + + lb://data-statistical-server + + + lb://epmet-openapi-scan + + + lb://epmet-third-server + + + + lb://epmet-heart-server + + + lb://epmet-point-server + + + lb://epmet-ext-server + + + test 0 192.168.1.130 @@ -140,6 +143,62 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local + + true + + + 8109 + local + + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -158,6 +217,19 @@ epmet elink@833066 + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -175,6 +247,10 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -193,6 +269,18 @@ epmet_data_statistical EpmEt-db-UsEr + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com @@ -210,6 +298,10 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 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 cee0ed9096..989bf71965 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,5 +1,7 @@ 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; @@ -13,5 +15,6 @@ 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 d671c4cd05..1b063dd470 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,23 +1,18 @@ 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.annotation.LoginUser; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.screen.dto.form.CompartmentFormDTO; -import com.epmet.screen.dto.result.CompartmentResultDTO; -import com.epmet.screen.dto.result.TreeResultDTO; -import com.epmet.datareport.service.screen.AgencyService; +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.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 * @@ -37,7 +32,7 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:04 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("tree") public Result tree(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(agencyService.tree(externalAppRequestParam)); @@ -49,7 +44,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 b0b7c1f7a8..248547cc4c 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,11 +1,10 @@ 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.screen.dto.form.*; -import com.epmet.screen.dto.result.*; -import com.epmet.datareport.service.screen.DistributionService; +import com.epmet.datareport.service.evaluationindex.screen.DistributionService; +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; @@ -33,7 +32,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); @@ -46,7 +45,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); @@ -59,7 +58,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); @@ -72,7 +71,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); @@ -85,7 +84,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 325c4606c8..220fb0ca4a 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,13 +1,12 @@ 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.screen.GrassRootsGovernService; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.AgencyFormDTO; -import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +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; @@ -39,7 +38,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); @@ -54,7 +53,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); @@ -69,7 +68,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); @@ -84,7 +83,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); @@ -99,7 +98,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 7c536869e9..66b7555ac8 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,16 +1,15 @@ 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.screen.GrassrootsPartyDevService; -import com.epmet.screen.dto.form.BranchBuildRankFormDTO; -import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; -import com.epmet.screen.dto.form.ParymemberFormDTO; -import com.epmet.screen.dto.result.BranchBuildRankResultDTO; -import com.epmet.screen.dto.result.BranchBuildTrendResultDTO; -import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; -import com.epmet.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -38,7 +37,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); @@ -53,7 +52,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); @@ -68,7 +67,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); @@ -83,7 +82,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 53b69591b4..d670c65b1c 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,18 +1,16 @@ 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.screen.IndexService; -import com.epmet.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.screen.dto.form.YearAverageIndexFormDTO; -import com.epmet.screen.dto.result.MonthBarchartResultDTO; -import com.epmet.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; -import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -40,7 +38,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); @@ -53,7 +51,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); @@ -66,11 +64,11 @@ public class IndexController { * @author zxc * @date 2020/8/19 5:27 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("monthindexanalysis/barchart") - public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam){ + public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); - return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO,externalAppRequestParam)); + return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO)); } /** @@ -79,7 +77,7 @@ public class IndexController { * @author zxc * @date 2020/8/20 10:02 上午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("subagencyindexrank") public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); 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 5478956a32..d3f4242013 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,11 +1,10 @@ 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.screen.PartyMemberLeadService; -import com.epmet.screen.dto.form.*; -import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; +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; @@ -33,7 +32,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); @@ -46,7 +45,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); @@ -59,7 +58,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); @@ -74,7 +73,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); @@ -89,7 +88,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 8c508e5eda..dc80b5178e 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,11 +1,10 @@ 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.screen.ScreenProjectService; -import com.epmet.screen.dto.form.ProjectDetailFormDTO; -import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -31,7 +30,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/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java similarity index 89% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index 87f26f3b01..e752fe40dd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java similarity index 95% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index c97ac8b8e0..17c48ae989 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerDeptDao.java similarity index 94% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index e6ae450514..15ed670395 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java similarity index 85% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 4e57c2f71d..b6196411f8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -15,12 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.AgencyDistributionResultDTO; -import com.epmet.screen.dto.result.BranchResultDTO; -import com.epmet.screen.dto.result.ParymemberDistributionResultDTO; -import com.epmet.screen.dto.result.UserDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -66,5 +63,13 @@ public interface ScreenCustomerGridDao { * @date 2020/8/19 10:30 上午 */ List selectParymemberDistribution(@Param("parentId")String parentId); + + /** + * @Description 查询机关下的网格 + * @param agencyId + * @author zxc + * @date 2020/8/26 5:29 下午 + */ + List selectGridInfo(@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 17d2e7a420..8697ba9adf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.DifficultProjectResultDTO; +import com.epmet.evaluationindex.screen.dto.result.DifficultProjectResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventDataDao.java similarity index 84% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventDataDao.java index 92f1641cce..16e023adff 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventDataDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.ProjectDetailResultDTO; -import com.epmet.screen.dto.result.ProjectResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -47,6 +47,6 @@ public interface ScreenEventDataDao{ * @author zxc * @date 2020/8/19 4:36 下午 */ - ProjectDetailResultDTO selectEventDetail(@Param("projectId")String projectId); + ProjectDetailResultDTO selectEventDetail(@Param("projectId")String projectId,@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventImgDataDao.java similarity index 95% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventImgDataDao.java index 8090ce00c7..f0da56ccd9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventImgDataDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index 3cf167fc5e..e973aa85f3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.GovernCapacityResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java similarity index 76% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 2e18647c39..372dacf9dd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -15,13 +15,12 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.screen.dto.result.MonthBarchartResult; -import com.epmet.screen.dto.result.MonthBarchartResultDTO; -import com.epmet.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult; +import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -42,16 +41,15 @@ public interface ScreenIndexDataMonthlyDao{ * @author zxc * @date 2020/8/19 3:43 下午 */ - MonthPieChartResultDTO selectMonthPieChart(@Param("agencyId")String agencyId); + MonthPieChartResultDTO selectMonthPieChart(@Param("agencyId")String agencyId,@Param("monthId")String monthId); /** * @Description 查询近一年的指数值【不包括本月】 - * @param customerId * @param agencyId * @author zxc * @date 2020/8/20 9:02 上午 */ - List selectMonthBarchart(@Param("customerId")String customerId, @Param("agencyId")String agencyId); + List selectMonthBarchart(@Param("agencyId")String agencyId); /** * @Description 4、下级部门指数排行 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java similarity index 89% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java index 304351b3b7..c63c17fa57 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java index fbee5cd15c..2b9bdba497 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.OrgRankDataResultDTO; +import com.epmet.evaluationindex.screen.dto.result.OrgRankDataResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java similarity index 78% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 0117eec4a7..fa2836e4fb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.BranchBuildOrderByCountResultDTO; -import com.epmet.screen.dto.result.BranchIssueDataResultDTO; -import com.epmet.screen.dto.result.VolunteerServiceResult; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildOrderByCountResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchIssueDataResultDTO; +import com.epmet.evaluationindex.screen.dto.result.VolunteerServiceResult; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -68,4 +68,16 @@ public interface ScreenPartyBranchDataDao { * @date 2020.08.20 09:46 **/ List selectBranchDataByTypeOrder(@Param("agencyId")String agencyId,@Param("category")String category,@Param("monthId")String monthId,@Param("bottomMonthId")String bottomMonthId); + + /** + * @Description 查询组织总数或者总参与人数 + * @param category + * @param type + * @param agencyId + * @param monthId + * @return + * @author wangc + * @date 2020.08.28 17:56 + **/ + Integer selectTotalOrganizationCount(@Param("category") String category,@Param("type") String type, @Param("agencyId") String agencyId,@Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index dfa5c1f6d2..1ca974982f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.ContactMassLineChartResult; +import com.epmet.evaluationindex.screen.dto.result.ContactMassLineChartResult; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java similarity index 88% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index 946ac2a096..2c4358ce15 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.PartyUserPointResultDTO; -import com.epmet.screen.dto.result.UserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 4b477689c3..92177ec52c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.FineExampleResultDTO; +import com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java new file mode 100644 index 0000000000..88c2aa0e77 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.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.screen; + +import com.epmet.evaluationindex.screen.dto.result.PublicPartiRankResultDTO; +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-24 + */ +@Mapper +public interface ScreenPublicPartiTotalDataDao{ + /** + * @Description 查询公众参与各类总数 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 16:00 + **/ + List selectPublicPartiTotal(@Param("agencyId") String agencyId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java similarity index 87% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java index 0edee635d4..962691f625 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO; -import com.epmet.screen.dto.result.UserJoinMonthlyResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserJoinMonthlyResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java similarity index 77% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index a03353e825..653cf3f606 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.PartymemberPercentResultDTO; -import com.epmet.screen.dto.result.PublicPartiRankResultDTO; -import com.epmet.screen.dto.result.TopProfileResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.List; - /** * 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 * @@ -60,12 +57,4 @@ public interface ScreenUserTotalDataDao { **/ int selectAvgIssue(@Param("agencyId")String agencyId); - /** - * @Description 查询用户数据 - * @param agencyId - * @return - * @author wangc - * @date 2020.08.20 16:00 - **/ - List selectUserTotalData(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java similarity index 68% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index d3eee4f133..d633b94ea2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -1,12 +1,9 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; -import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.screen.dto.form.CompartmentFormDTO; -import com.epmet.screen.dto.result.CompartmentResultDTO; -import com.epmet.screen.dto.result.TreeResultDTO; - -import java.util.List; +import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; /** * 组织相关api diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java similarity index 87% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java index 62a0d0d7bf..a73d1ccfcd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java @@ -1,7 +1,7 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.*; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java similarity index 86% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java index 12315295b5..fecde12a9f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java @@ -1,9 +1,9 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.AgencyFormDTO; -import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java similarity index 71% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java index a870d21585..41c8fafc28 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java @@ -1,12 +1,12 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.BranchBuildRankFormDTO; -import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; -import com.epmet.screen.dto.form.ParymemberFormDTO; -import com.epmet.screen.dto.result.BranchBuildRankResultDTO; -import com.epmet.screen.dto.result.BranchBuildTrendResultDTO; -import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; -import com.epmet.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; /** * 基层党建相关各指标查询 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java similarity index 62% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java index 5c0b5e4ade..266898530d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java @@ -1,14 +1,13 @@ -package com.epmet.datareport.service.screen; - -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; -import com.epmet.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.screen.dto.form.YearAverageIndexFormDTO; -import com.epmet.screen.dto.result.MonthBarchartResultDTO; -import com.epmet.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; -import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +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 java.util.List; @@ -42,7 +41,7 @@ public interface IndexService { * @author zxc * @date 2020/8/19 5:27 下午 */ - MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam); + MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO); /** * @Description 4、下级部门指数排行 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PartyMemberLeadService.java similarity index 79% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PartyMemberLeadService.java index 5f781b2622..5e75a3946c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PartyMemberLeadService.java @@ -1,10 +1,10 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; -import com.epmet.screen.dto.form.FineExampleFormDTO; -import com.epmet.screen.dto.form.VolunteerServiceFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; +import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java similarity index 63% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java index 78543bc52f..aea908ff15 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java @@ -1,7 +1,7 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.ProjectDetailFormDTO; -import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; /** * 项目 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 new file mode 100644 index 0000000000..6eef8b2387 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -0,0 +1,139 @@ +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.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.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.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 组织相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:18 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class AgencyServiceImpl implements AgencyService { + + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + + /** + * @Description 1、组织机构树 + * @param + * @author zxc + * @date 2020/8/18 2:04 下午 + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { + // 1. 查询客户根组织ID +// String customerId = externalAppRequestParam.getCustomerId(); + + + // 验签关闭,customerId无法获取,暂时写死 + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + + + TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); + if (null == rootAgency){ + return new TreeResultDTO(); + } + List centerMark = this.getCenterMark(rootAgency.getCenterMarkA()); + rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); + if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)){ + List treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue()); + rootAgency.setChildren(treeResultDTOS); + }else { + List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue())); + rootAgency.setChildren(departmentList); + } + return rootAgency; + } + + /** + * @Description 处理centerMark + * @param centerMark + * @author zxc + * @date 2020/8/26 5:18 下午 + */ + public List getCenterMark(String centerMark){ + if (centerMark.length() == NumConstant.ZERO || centerMark.equals(ScreenConstant.SQUARE_BRACKETS)) { + return new ArrayList<>(); + } + List result = new ArrayList<>(); + String substring = centerMark.substring(NumConstant.TWO, centerMark.length() - NumConstant.TWO); + String[] split = substring.split(ScreenConstant.COMMA); + for (String s : split) { + result.add(Double.valueOf(s)); + } + return result; + } + + /** + * @Description 递归查询填充下级 + * @param subAgencyPids + * @author zxc + * @date 2020/8/18 4:42 下午 + */ + private List getDepartmentList(String subAgencyPids) { + List subAgencyList = screenCustomerAgencyDao.selectSubAgencyList(subAgencyPids); + if (subAgencyList.size() > NumConstant.ZERO) { + subAgencyList.forEach(sub -> { + List centerMark = this.getCenterMark(sub.getCenterMarkA()); + sub.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); + if (sub.getLevel().equals(ScreenConstant.COMMUNITY)){ + List treeResultDTOS = screenCustomerGridDao.selectGridInfo(sub.getValue()); + treeResultDTOS.forEach(tree -> { + List centerMarkTree = this.getCenterMark(tree.getCenterMarkA()); + tree.setCenterMark(centerMarkTree.size() == NumConstant.ZERO ? new ArrayList<>() : centerMarkTree); + }); + sub.setChildren(treeResultDTOS); + }else { + List subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); + sub.setChildren(subAgency); + } + }); + } + return subAgencyList; + } + + /** + * @Description 2、组织区域查询 + * @param compartmentFormDTO + * @author zxc + * @date 2020/8/18 2:33 下午 + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO) { + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(compartmentFormDTO.getAgencyId()); + if (null == agencyAreaInfo){ + return new CompartmentResultDTO(); + } + if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + // 当level为"community"时,查询screen_customer_grid表 + List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + }else { + List agencyDistributionResultDTOS = screenCustomerAgencyDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + } + return agencyAreaInfo; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java similarity index 79% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index 97a627fb23..b65c0fe059 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -1,16 +1,16 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenCustomerAgencyDao; -import com.epmet.datareport.dao.screen.ScreenCustomerGridDao; -import com.epmet.datareport.dao.screen.ScreenEventDataDao; -import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; -import com.epmet.screen.dto.form.*; -import com.epmet.screen.dto.result.*; -import com.epmet.screen.constant.*; -import com.epmet.datareport.service.screen.DistributionService; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.evaluationindex.screen.DistributionService; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,6 +25,7 @@ import java.util.List; * @date 2020/8/18 10:19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class DistributionServiceImpl implements DistributionService { @Autowired @@ -42,7 +43,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/18 10:59 上午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List branch(BranchFormDTO formDTO) { List branchResultDTOS = screenCustomerGridDao.selectBranch(formDTO.getAgencyId()); @@ -55,7 +56,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/18 11:10 上午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public UserResultDTO user(UserFormDTO userFormDTO) { UserResultDTO userResult = new UserResultDTO(); @@ -80,7 +81,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/18 11:20 上午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public ParymemberResultDTO parymember(ParymemberFormDTO parymemberFormDTO) { ParymemberResultDTO parymemberResult = new ParymemberResultDTO(); @@ -105,7 +106,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/19 1:29 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List project(ProjectFormDTO projectFormDTO) { List projectResultDTOS = screenEventDataDao.selectEvent(projectFormDTO.getAgencyId()); @@ -121,7 +122,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/19 1:52 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO) { TopProfileResultDTO topProfileResultDTO = screenUserTotalDataDao.selectTopProfile(topProfileFormDTO.getAgencyId()); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java similarity index 77% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index 8b0db2c65a..d750c1ee03 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -1,20 +1,21 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.*; -import com.epmet.datareport.service.screen.GrassRootsGovernService; +import com.epmet.datareport.dao.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.AgencyFormDTO; -import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import com.github.pagehelper.PageHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.ArrayList; @@ -30,6 +31,7 @@ import java.util.stream.Collectors; * @date 2020/8/18 10:20 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @Autowired @@ -41,9 +43,10 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @Autowired private DateUtils dateUtils; @Autowired - private ScreenUserTotalDataDao screenUserTotalDataDao; - @Autowired private ScreenGovernRankDataDao screenGovernRankDataDao; + @Autowired + private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + /** * @Description 1、热心市民积分排行 * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544 @@ -52,7 +55,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 11:16 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public UserPointRankResultDTO userPointRank(AgencyAndNumFormDTO param) { //默认5 @@ -76,7 +79,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 13:55 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List difficultProject(AgencyNumTypeParamFormDTO param) { if(null == param.getTopNum()){ @@ -97,12 +100,21 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 14:37 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) { - String monthId = dateUtils.getPreviousMonthId(); + String monthId = dateUtils.getCurrentMonthId(); UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + //保证获取公众参与概率数据的最大可能性 + int time = NumConstant.TWELVE; + while(null == latest && time > NumConstant.ONE) + { + time --; + monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + } + if(null == latest) return new PublicPartiProfileResultDTO(); PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest,PublicPartiProfileResultDTO.class); result.setMonthIncr(convertPercentStr(latest.getMonthIncr(),NumConstant.ZERO)); @@ -119,14 +131,20 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 15:32 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List publicPartiRank(AgencyAndNumFormDTO param) { - if(null == param.getTopNum()) param.setTopNum(NumConstant.TWO); - if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + if(null == param.getTopNum()){ + param.setTopNum(NumConstant.TWO); + } + if(NumConstant.ZERO == param.getTopNum()){ + param.setTopNum(NumConstant.MAX); + } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenUserTotalDataDao.selectUserTotalData(param.getAgencyId()); - if(null == result) return new ArrayList<>(); + List result = screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()); + if(null == result) { + return new ArrayList<>(); + } return result; } @@ -138,14 +156,23 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 17:46 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List governCapacityRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE); if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + String monthId = dateUtils.getCurrentMonthId(); List orderList = - screenGovernRankDataDao.selectGovernCapacityRatio(dateUtils.getPreviousMonthId(),param.getAgencyId()); + screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId()); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + orderList = + screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId()); + } if(null == orderList || orderList.isEmpty()) return new ArrayList<>(); List result = new LinkedList<>(); orderList.forEach(o -> { @@ -212,11 +239,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { return result; } - private String convertPercentStr(BigDecimal percent){ - if(null == percent || BigDecimal.ZERO == percent) return "0.00%"; - String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); - return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); - } + private String convertPercentStr(BigDecimal percent,Integer digits){ if(null == percent) percent = BigDecimal.ZERO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java similarity index 71% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index 51a7a49ff6..619eba4625 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -1,27 +1,27 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenCpcBaseDataDao; -import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; -import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCpcBaseDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyBranchDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; +import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; -import com.epmet.screen.dto.form.BranchBuildRankFormDTO; -import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; -import com.epmet.screen.dto.form.ParymemberFormDTO; -import com.epmet.screen.dto.result.*; -import com.epmet.datareport.service.screen.GrassrootsPartyDevService; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import com.github.pagehelper.PageHelper; -import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; -import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -32,6 +32,7 @@ import java.util.stream.Collectors; * @date 2020/8/18 10:21 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService { private static final Logger logger = LoggerFactory.getLogger(GrassrootsPartyDevServiceImpl.class); @@ -42,7 +43,8 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private ScreenCpcBaseDataDao screenCpcBaseDataDao; @Autowired private ScreenPartyBranchDataDao screenPartyBranchDataDao; - private List issueGroup; + @Autowired + private DateUtils dateUtils; /** * @Description 1、党员基本情况-饼状图概况 @@ -52,13 +54,15 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService * @author wangc * @date 2020.08.18 14:58 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); if(null == result){ + result = new PartymemberPercentResultDTO(); logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); + result = new PartymemberPercentResultDTO(); result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); return result; } @@ -79,7 +83,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService * @author wangc * @date 2020.08.18 17:54 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) { return screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); @@ -93,7 +97,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService * @author wangc * @date 2020.08.19 11:02 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public BranchBuildTrendResultDTO branchBuildTrend(BranchBuildTrendFormDTO param) { if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_UNION,param.getCategory())){ @@ -108,7 +112,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService } BranchBuildTrendResultDTO result = new BranchBuildTrendResultDTO(); //生成近十二个月的横坐标数组 - Map monthMap = getX(); + Map monthMap = dateUtils.getXpro(); result.setXAxis(monthMap.values().stream().collect(Collectors.toList())); List dataArray = new LinkedList<>(); @@ -151,7 +155,22 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService result.setSeriesData(dataArray); result.setLegend(null == result.getLegend() ? new ArrayList<>() : result.getLegend()); - + List _ymList = monthMap.keySet().stream().collect(Collectors.toList()); + //总组织次数 + Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,param.getAgencyId(),monthMap.keySet().iterator().next()); + //自旋一次 + totalOrganizationCount = Optional.ofNullable(totalOrganizationCount).orElse( + screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,param.getAgencyId(),_ymList.get(NumConstant.ONE)) + ); + //总参与人数 + Integer totalJoinUserCount = screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,param.getAgencyId(),monthMap.keySet().iterator().next()); + //自旋一次 + totalJoinUserCount = Optional.ofNullable(totalJoinUserCount).orElse( + screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,param.getAgencyId(),_ymList.get(NumConstant.ONE)) + ); + + result.setTotalOrganizationCount(Optional.ofNullable(totalOrganizationCount).orElse(NumConstant.ZERO)); + result.setTotalJoinUserCount(Optional.ofNullable(totalJoinUserCount).orElse(NumConstant.ZERO)); return result; } @@ -163,7 +182,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService * @author wangc * @date 2020.08.19 15:25 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public BranchBuildRankResultDTO branchBuildRank(BranchBuildRankFormDTO param) { if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_UNION,param.getCategory())){ @@ -177,13 +196,23 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_PARTY); } if(StringUtils.isBlank(param.getMonthId())){ - param.setMonthId(getPreviousMonthId()); + param.setMonthId(dateUtils.getCurrentMonthId()); } if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); List orderList = screenPartyBranchDataDao.selectBranchDataByTypeOrder(param.getAgencyId(),param.getCategory(),param.getMonthId(),param.getBottomMonthId()); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ + time --; + param.setMonthId(dateUtils.getPreviousMonthIdByDest(null,param.getMonthId())); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + orderList = + screenPartyBranchDataDao.selectBranchDataByTypeOrder(param.getAgencyId(),param.getCategory(),param.getMonthId(),param.getBottomMonthId()); + } + + BranchBuildRankResultDTO result = new BranchBuildRankResultDTO(); result.setJoinData(new LinkedList<>()); result.setOrganizeData(new LinkedList<>()); @@ -203,59 +232,6 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); } - /** - * @Description 返回当前月以及前十一个月,升序 - * @param - * @return Map key:202001 value:1月 - * @author wangc - * @date 2020.08.19 12:46 - **/ - public Map getX(){ - SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); // 设置为当前时间 - calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 - String currentMonth = format.format(calendar.getTime()); - Integer monthCounter = Integer.parseInt(currentMonth); - Map monthMap = new HashMap<>(); - int i = NumConstant.ONE; - while(i <= NumConstant.TWELVE){ - - if(monthCounter.toString().endsWith("00")){ - monthCounter -= NumConstant.EIGHTY_EIGHT; - } - - String abscissa = monthCounter.toString().substring(monthCounter.toString().length() - NumConstant.TWO); - if(abscissa.startsWith("0")) { - abscissa = abscissa.replace("0","").concat("月"); - }else{ - abscissa = abscissa.concat("月"); - } - monthMap.put(monthCounter.toString(),abscissa); - monthCounter-- ; - i++; - } - - Map result = Maps.newLinkedHashMap(); - monthMap.entrySet().stream().sorted(Map.Entry.comparingByKey()) - .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); - - return result; - } - /** - * @Description 得到上个月的monthId - * @param - * @return - * @author wangc - * @date 2020.08.20 10:19 - **/ - private String getPreviousMonthId(){ - SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); // 设置为当前时间 - calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 - return format.format(calendar.getTime()); - } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java similarity index 55% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index e106a07d45..22f6aa376b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -1,19 +1,21 @@ -package com.epmet.datareport.service.screen.impl; +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.screen.ScreenIndexDataMonthlyDao; -import com.epmet.datareport.dao.screen.ScreenIndexDataYearlyDao; -import com.epmet.datareport.service.screen.IndexService; -import com.epmet.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.screen.dto.form.YearAverageIndexFormDTO; -import com.epmet.screen.dto.result.*; +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.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.time.LocalDate; import java.util.ArrayList; @@ -28,6 +30,7 @@ import java.util.stream.Collectors; * @date 2020/8/18 10:21 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexServiceImpl implements IndexService { @Autowired @@ -36,6 +39,8 @@ public class IndexServiceImpl implements IndexService { private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; @Autowired private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; + @Autowired + private DateUtils dateUtils; /** * @Description 1、年度平均指数 @@ -43,7 +48,7 @@ public class IndexServiceImpl implements IndexService { * @author zxc * @date 2020/8/19 2:53 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO) { YearAverageIndexResultDTO yearAverageIndexResultDTO = screenIndexDataYearlyDao.selectYearAverageIndex(yearAverageIndexFormDTO.getAgencyId()); @@ -59,10 +64,19 @@ public class IndexServiceImpl implements IndexService { * @author zxc * @date 2020/8/19 3:17 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { - MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId()); + + MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),null); + String monthId = dateUtils.getCurrentMonthId(); + int time = NumConstant.TWELVE; + //保证获取月度指数数据的最大可能性 + while(null == monthPieChartResultDTO && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),monthId); + } if (null == monthPieChartResultDTO){ return new MonthPieChartResultDTO(); } @@ -75,10 +89,9 @@ public class IndexServiceImpl implements IndexService { * @author zxc * @date 2020/8/19 5:27 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); + public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO) { MonthBarchartResultDTO result = new MonthBarchartResultDTO(); List serviceAbilityData = new ArrayList<>(); List partyDevAbilityData = new ArrayList<>(); @@ -86,8 +99,8 @@ public class IndexServiceImpl implements IndexService { List totalIndexData = new ArrayList<>(); // 1. x轴 result.setXAxis(partyMemberLeadServiceImpl.getXPro()); - // 2. 查询近一年的指数值【不包括本月】 - List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(customerId, monthBarchartFormDTO.getAgencyId()); + // 2. 查询近一年的指数值【包括本月】 + List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId()); if (monthBarchartResults.size() == NumConstant.ZERO){ for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); @@ -102,12 +115,48 @@ public class IndexServiceImpl implements IndexService { return result; } List collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList()); - collect.forEach(month -> { + //升序 当前月份在队尾 + List _ymList = dateUtils.getXpro().keySet().stream().collect(Collectors.toList()); + //针对集合collect的游标 + int cursor = NumConstant.ZERO; + //针对X轴,数据集合不全则进行数据填充 + a:for(int i = NumConstant.ZERO; i < _ymList.size(); i++){ + //这里的collect必须是有序且升序的 + if(cursor >= collect.size()) break a; + //如果存在过期数据,即从数据库中查询出超出横坐标左边界的月份值 + if(Integer.parseInt(collect.get(cursor).getMonthId()) < Integer.parseInt(_ymList.get(NumConstant.ZERO))) { + //控制当前循环重复进行 + i--; + //忽略过期数据 + cursor++; + continue ; + } + if(!StringUtils.equals(collect.get(cursor).getMonthId(),_ymList.get(i))){ + //SET DEFAULT + serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); + partyDevAbilityData.add(NumConstant.ZERO_DOT_ZERO); + governAbilityData.add(NumConstant.ZERO_DOT_ZERO); + totalIndexData.add(NumConstant.ZERO_DOT_ZERO); + //保持cursor不变 + }else{ + MonthBarchartResult data = collect.get(cursor); + //SET DATA + serviceAbilityData.add(null == data.getServiceAbility() ? NumConstant.ZERO_DOT_ZERO : data.getServiceAbility()); + partyDevAbilityData.add(null == data.getPartyDevAbility() ? NumConstant.ZERO_DOT_ZERO : data.getPartyDevAbility()); + governAbilityData.add(null == data.getGovernAbility() ? NumConstant.ZERO_DOT_ZERO : data.getGovernAbility()); + totalIndexData.add(null == data.getIndexTotal() ? NumConstant.ZERO_DOT_ZERO : data.getIndexTotal()); + //统计日期一致后移动游标 + cursor++; + } + + } + + /*collect.forEach(month -> { serviceAbilityData.add(null == month.getServiceAbility() ? NumConstant.ZERO_DOT_ZERO : month.getServiceAbility()); partyDevAbilityData.add(null == month.getPartyDevAbility() ? NumConstant.ZERO_DOT_ZERO : month.getPartyDevAbility()); governAbilityData.add(null == month.getGovernAbility() ? NumConstant.ZERO_DOT_ZERO : month.getGovernAbility()); totalIndexData.add(null == month.getIndexTotal() ? NumConstant.ZERO_DOT_ZERO : month.getIndexTotal()); - }); + });*/ result.setServiceAbilityData(serviceAbilityData); result.setPartyDevAbilityData(partyDevAbilityData); result.setGovernAbilityData(governAbilityData); @@ -121,14 +170,14 @@ public class IndexServiceImpl implements IndexService { * @author zxc * @date 2020/8/20 10:04 上午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO) { LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); int yearId = now.getYear(); subAgencyIndexRankFormDTO.setYearId(String.valueOf(yearId)); List subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO); - if (subAgencyIndexRankResultDTOS.size() == NumConstant.ZERO){ + if (CollectionUtils.isEmpty(subAgencyIndexRankResultDTOS)){ return new ArrayList<>(); } return subAgencyIndexRankResultDTOS; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java similarity index 63% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index b1cecb92bb..203b5cb456 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -1,31 +1,28 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenOrgRankDataDao; -import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; -import com.epmet.datareport.dao.screen.ScreenPartyLinkMassesDataDao; -import com.epmet.datareport.dao.screen.ScreenPioneerDataDao; -import com.epmet.datareport.dao.screen.ScreenPartyUserRankDataDao; -import com.epmet.datareport.service.screen.PartyMemberLeadService; +import com.epmet.datareport.dao.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; -import com.epmet.screen.dto.form.FineExampleFormDTO; -import com.epmet.screen.dto.form.VolunteerServiceFormDTO; -import com.epmet.screen.dto.result.*; -import com.epmet.screen.constant.*; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; +import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import com.github.pagehelper.PageHelper; +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.*; -import java.util.stream.Collectors; /** * 党建引领相关各指标查询 @@ -34,6 +31,7 @@ import java.util.stream.Collectors; * @date 2020/8/18 10:22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @Autowired @@ -55,7 +53,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author zxc * @date 2020/8/20 1:56 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { FineExampleResultDTO fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); @@ -77,7 +75,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @date 2020/8/20 6:06 下午 */ public String getRatio(Double d){ - BigDecimal bigDecimal = new BigDecimal(d * NumConstant.ONE_HUNDRED); + BigDecimal bigDecimal = new BigDecimal(d); return bigDecimal.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO); } @@ -87,7 +85,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author zxc * @date 2020/8/20 2:35 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) { ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); @@ -109,6 +107,8 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { result.setXAxis(xAxis); result.setGroupData(groupData); result.setGroupMemberData(groupMemberData); + result.setGroupTotal(groupData.stream().mapToInt(Integer :: intValue).sum()); + result.setGroupMemberTotal(groupMemberData.stream().mapToInt(Integer :: intValue).sum()); return result; } @@ -118,7 +118,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author zxc * @date 2020/8/20 3:19 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO) { VolunteerServiceResultDTO result = new VolunteerServiceResultDTO(); @@ -126,6 +126,13 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { List joinData = new ArrayList<>(); List averageJoinUserData = new ArrayList<>(); result.setXAxis(this.getXPro()); + //创建缺省值对象 + VolunteerServiceResult defaultObj = new VolunteerServiceResult(); + defaultObj.setAverageJoinUserData(NumConstant.ZERO); + defaultObj.setJoinData(NumConstant.ZERO); + defaultObj.setOrganizeData(NumConstant.ZERO); + + //倒叙取十二个月的数据,从本月开始,有可能取不到十二条,要对X轴空白的缺口进行填补 List volunteerServiceResults = screenPartyBranchDataDao.selectVolunteerServiceResult(volunteerServiceFormDTO.getAgencyId()); if (volunteerServiceResults.size() == NumConstant.ZERO){ for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { @@ -138,27 +145,48 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { result.setAverageJoinUserData(averageJoinUserData); return result; } - List collect = volunteerServiceResults.stream().sorted(Comparator.comparing(VolunteerServiceResult::getMonthId)).collect(Collectors.toList()); - collect.forEach(volunteer -> { - organizeData.add(volunteer.getOrganizeData()); - joinData.add(volunteer.getJoinData()); - averageJoinUserData.add(volunteer.getAverageJoinUserData()); + + Set yyyyMMList = dateUtils.getXpro().keySet(); + yyyyMMList.forEach(mm -> { + Optional opt = volunteerServiceResults.stream() + .filter(obj -> StringUtils.equals(mm,obj.getMonthId())).findAny(); + VolunteerServiceResult find = opt.isPresent() ? opt.get() : defaultObj; + organizeData.add(find.getOrganizeData()); + joinData.add(find.getJoinData()); + averageJoinUserData.add(find.getAverageJoinUserData()); }); + + result.setOrganizeData(organizeData); result.setJoinData(joinData); result.setAverageJoinUserData(averageJoinUserData); + String bottomMonthId = yyyyMMList.iterator().next(); + //总组织次数 + Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); + //自旋一次 + totalOrganizationCount = Optional.ofNullable(totalOrganizationCount).orElse( + screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,volunteerServiceFormDTO.getAgencyId(),dateUtils.getPreviousMonthIdByDest(null,bottomMonthId)) + ); + //总参与人数 + Integer totalJoinUserCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); + //自旋一次 + totalJoinUserCount = Optional.ofNullable(totalJoinUserCount).orElse( + screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,volunteerServiceFormDTO.getAgencyId(),dateUtils.getPreviousMonthIdByDest(null,bottomMonthId)) + ); + result.setTotalOrganizationCount(null == totalOrganizationCount ? NumConstant.ZERO : totalOrganizationCount); + result.setTotalJoinUserCount(null == totalJoinUserCount ? NumConstant.ZERO : totalJoinUserCount); return result; } /** - * @Description 获取之前的12个月份【不包括当前月】 + * @Description 获取之前的12个月份【包括当前月】 * @author zxc * @date 2020/8/21 10:19 上午 */ public List getXPro(){ List xAxis = new ArrayList<>(); LocalDate today = LocalDate.now(); - for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + for(int i = NumConstant.ELEVEN;i >= NumConstant.ZERO; i--){ LocalDate localDate = today.minusMonths(i); String s = localDate.getMonth().getValue() + ScreenConstant.MONTH; xAxis.add(s); @@ -166,6 +194,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { return xAxis; } + /** * @Description 4、先进排行榜单-先进支部排行 * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321539 @@ -174,7 +203,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author wangc * @date 2020.08.21 11:05 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List advancedBranchRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()){ @@ -183,8 +212,16 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { param.setTopNum(NumConstant.MAX); } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + String monthId = dateUtils.getCurrentMonthId(); List gridData = - screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),dateUtils.getPreviousMonthId()); + screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); + } List result = new LinkedList<>(); if(null == gridData || gridData.isEmpty()) return result; gridData.forEach( data -> { @@ -205,7 +242,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author wangc * @date 2020.08.21 14:22 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List advancedPartymemberRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java similarity index 66% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index dce609636d..2cf288cae9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -1,12 +1,12 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenEventDataDao; -import com.epmet.datareport.dao.screen.ScreenEventImgDataDao; -import com.epmet.datareport.service.screen.ScreenProjectService; -import com.epmet.screen.dto.form.ProjectDetailFormDTO; -import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,6 +19,7 @@ import java.util.List; * @date 2020/8/18 10:23 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectServiceImpl implements ScreenProjectService { @Autowired @@ -32,10 +33,10 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { * @author zxc * @date 2020/8/19 4:36 下午 */ - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override public ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO) { - ProjectDetailResultDTO projectDetailResultDTO = screenEventDataDao.selectEventDetail(projectDetailFormDTO.getProjectId()); + ProjectDetailResultDTO projectDetailResultDTO = screenEventDataDao.selectEventDetail(projectDetailFormDTO.getProjectId(),projectDetailFormDTO.getAgencyId()); if (null == projectDetailResultDTO){ return new ProjectDetailResultDTO(); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java deleted file mode 100644 index 9ca543828c..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.epmet.datareport.service.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.screen.ScreenCustomerAgencyDao; -import com.epmet.datareport.dao.screen.ScreenCustomerGridDao; -import com.epmet.screen.dto.form.CompartmentFormDTO; -import com.epmet.screen.dto.result.AgencyDistributionResultDTO; -import com.epmet.screen.constant.*; -import com.epmet.screen.dto.result.CompartmentResultDTO; -import com.epmet.screen.dto.result.TreeResultDTO; -import com.epmet.datareport.service.screen.AgencyService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 组织相关api - * - * @author yinzuomei@elink-cn.com - * @date 2020/8/18 10:18 - */ -@Service -public class AgencyServiceImpl implements AgencyService { - - @Autowired - private ScreenCustomerAgencyDao screenCustomerAgencyDao; - @Autowired - private ScreenCustomerGridDao screenCustomerGridDao; - - /** - * @Description 1、组织机构树 - * @param - * @author zxc - * @date 2020/8/18 2:04 下午 - */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) - @Override - public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { - // 1. 查询客户根组织ID - String customerId = externalAppRequestParam.getCustomerId(); - TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); - if (null == rootAgency){ - return new TreeResultDTO(); - } - List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) ? "" : rootAgency.getPids() + ",") + rootAgency.getValue()); - rootAgency.setChildren(departmentList); - return rootAgency; - } - - /** - * @Description 递归查询填充下级 - * @param subAgencyPids - * @author zxc - * @date 2020/8/18 4:42 下午 - */ - private List getDepartmentList(String subAgencyPids) { - List subAgencyList = screenCustomerAgencyDao.selectSubAgencyList(subAgencyPids); - if (subAgencyList.size() > NumConstant.ZERO) { - for (TreeResultDTO sub : subAgencyList) { - List subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); - sub.setChildren(subAgency); - } - } - return subAgencyList; - } - - /** - * @Description 2、组织区域查询 - * @param compartmentFormDTO - * @author zxc - * @date 2020/8/18 2:33 下午 - */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) - @Override - public CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO) { - CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(compartmentFormDTO.getAgencyId()); - if (null == agencyAreaInfo){ - return new CompartmentResultDTO(); - } - if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ - // 当level为"community"时,查询screen_customer_grid表 - List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); - agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); - }else { - List agencyDistributionResultDTOS = screenCustomerAgencyDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); - agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); - } - return agencyAreaInfo; - } -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java index 6db1756fdb..b2d99c00f1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java @@ -31,7 +31,7 @@ public class DateUtils { public Map getX(){ Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); // 设置为当前时间 - calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + //calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 String currentMonth = defaultFormat.format(calendar.getTime()); Integer monthCounter = Integer.parseInt(currentMonth); Map monthMap = new HashMap<>(); @@ -64,7 +64,7 @@ public class DateUtils { Map xAxis = new HashMap<>(); LocalDate today = LocalDate.now(); - for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + for(int i = NumConstant.ELEVEN;i >= NumConstant.ZERO; i--){ LocalDate localDate = today.minusMonths(i); String s = localDate.getMonth().getValue() + "月"; xAxis.put(localDate.format(fmt),s); @@ -108,6 +108,19 @@ public class DateUtils { return format.format(c.getTime()); } + /** + * @Description 得到当前月份的monthId + * @param + * @return + * @author wangc + * @date 2020.08.27 13:43 + **/ + public String getCurrentMonthId(){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + return defaultFormat.format(calendar.getTime()); + } + public static void main(String[] args) { DateUtils util = new DateUtils(); Map result = util.getXpro(); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java index 9314d3ba3b..7e3af9f112 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java @@ -21,4 +21,14 @@ public interface ModuleConstant { String PARAM_DIFFICULTY_TYPE_MOST_DEPTS = "mostdepts"; String PARAM_DIFFICULTY_TYPE_MOST_HANDLED = "mosthandled"; + + /** + * 支部建设情况折线图 查询数据类型 组织次数 + * */ + String PARAM_BRANCH_DATA_TYPE_ORGAN = "organize"; + + /** + * 支部建设情况折线图 查询数据类型 参与人数 + * */ + String PARAM_BRANCH_DATA_TYPE_JOIN = "joinuser"; } 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 d4db395aa8..5899ead6dd 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 @@ -104,6 +104,11 @@ dynamic: url: @datasource.druid.statsdisplay.url@ username: @datasource.druid.statsdisplay.username@ password: @datasource.druid.statsdisplay.password@ + evaluationIndex: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.evaluationIndex.url@ + username: @datasource.druid.evaluationIndex.username@ + password: @datasource.druid.evaluationIndex.password@ feign: hystrix: @@ -130,4 +135,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/data-report/data-report-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file 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 08a6a198d1..793be083a1 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 @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} @@ -144,7 +149,7 @@ - + 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 3fc9c990b3..fa89221e37 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 @@ -1,10 +1,10 @@ - + - SELECT SUM( AGE_LEVEL_1 ) + SUM( AGE_LEVEL_2 ) AS under30Count, SUM( AGE_LEVEL_3 ) + SUM( AGE_LEVEL_4 ) AS between31And50Count, @@ -15,8 +15,7 @@ screen_cpc_base_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' - AND ORG_ID = #{agencyId} + AND PARENT_ID = #{agencyId} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index cfdb8da6de..22a62be6d0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -1,14 +1,16 @@ - + - SELECT agency_name AS label, agency_id AS value, - pids AS pids + pids AS pids, + IFNULL(center_mark,'') AS centerMarkA, + level AS level FROM screen_customer_agency WHERE @@ -18,11 +20,13 @@ - SELECT agency_id AS value, agency_name AS label, - pids AS pids + pids AS pids, + IFNULL(center_mark,'') AS centerMarkA, + level AS level FROM screen_customer_agency WHERE @@ -33,7 +37,7 @@ - SELECT agency_id AS agencyId, agency_name AS name, @@ -47,7 +51,7 @@ - SELECT agency_id AS subId, agency_name AS subName, @@ -62,7 +66,7 @@ - SELECT sutd.org_id AS subId, sca.center_mark AS centerMark, @@ -80,7 +84,7 @@ - SELECT sutd.org_id AS subId, sca.center_mark AS centerMark, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml index 58e2171c3d..cf939d024a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml @@ -1,7 +1,7 @@ - + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 988e0b17cd..6cafd96036 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -1,10 +1,10 @@ - + - SELECT grid_id AS subId, grid_name AS subName, @@ -19,7 +19,7 @@ - SELECT grid_id AS gridId, grid_name AS gridName, @@ -28,11 +28,11 @@ screen_customer_grid WHERE del_flag = 0 - AND parent_agency_id = #{agencyId} + AND all_parent_ids LIKE concat('%', #{agencyId}, '%') - SELECT sutd.org_id AS subId, scg.center_mark AS centerMark, @@ -50,7 +50,7 @@ - SELECT sutd.org_id AS subId, scg.center_mark AS centerMark, @@ -66,4 +66,19 @@ AND scg.del_flag = 0 AND sutd.parent_id = #{parentId} + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index ab381cebba..0bb479ed65 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -1,15 +1,15 @@ - + - SELECT diff.EVENT_ID AS projectId, - eve.EVENT_TITLE AS title, + diff.EVENT_CONTENT AS title, diff.EVENT_STATUS_CODE AS STATUS, - diff.EVENT_COST_TIME AS totalHours, + ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours, DATE_FORMAT( eve.EVENT_CREATE_TIME, '%Y-%m-%d %H:%i' ) AS createDateTime, diff.EVENT_SOURCE AS gridName, diff.EVENT_IMG_URL AS imgUrl, @@ -22,8 +22,7 @@ AND eve.DEL_FLAG = '0' WHERE diff.DEL_FLAG = '0' - AND diff.ORG_TYPE = 'agency' - AND diff.ORG_ID = #{agencyId} + AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') ORDER BY CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml index 63cadbbd5e..b877ad611d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -1,12 +1,12 @@ - + - SELECT - event_title AS projectTitle, + IFNULL(event_title,'') AS projectTitle, event_level AS color, event_id AS projectId, org_name AS orgName, @@ -16,11 +16,11 @@ screen_event_data WHERE del_flag = '0' - AND parent_id = #{parentId} + AND all_parent_ids LIKE concat('%', #{parentId}, '%') - SELECT event_content AS projectContent, event_status_desc AS STATUS, @@ -32,5 +32,6 @@ WHERE del_flag = '0' AND event_id = #{projectId} + AND all_parent_ids LIKE concat('%', #{agencyId}, '%') \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml index e5e3e636af..ef20677ece 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml @@ -1,7 +1,7 @@ - + + + - - SELECT month_id AS monthId, service_ablity AS serviceAbility, @@ -31,13 +39,12 @@ WHERE del_flag = '0' AND org_id = #{agencyId} - AND customer_id = #{customerId} ORDER BY MONTH_ID DESC LIMIT 12 - SELECT org_name AS NAME, index_total AS totalIndex, 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 3d9329846d..d224b92d4e 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 @@ -1,10 +1,10 @@ - + - SELECT index_total AS yearAverageIndex, service_ablity AS serviceAbility, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index f83ec244d7..310320029e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT ORG_NAME AS NAME, PARTY_TOTAL AS partyMemberNum, @@ -18,7 +18,7 @@ WHERE DEL_FLAG = '0' AND ORG_TYPE = 'grid' - AND PARENT_ID = #{agencyId} + AND ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') AND MONTH_ID = #{monthId} ORDER BY (PARTY_TOTAL + GROUP_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL + CLOSE_PROJECT_RATIO + SATISFACTION_RATIO) DESC, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml index 8fbf102170..0ee2a6a315 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -1,7 +1,7 @@ - + - SELECT MONTH_ID, MEET_CATEGORY_NAME AS issue, @@ -29,7 +29,6 @@ screen_party_branch_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' AND ORG_ID = #{agencyId} AND TYPE = #{category} AND MONTH_ID = ]]> #{bottomMonthId} @@ -39,7 +38,7 @@ - SELECT ORG_NAME, SUM( ORGANIZE_COUNT ) AS organizeData , @@ -49,7 +48,7 @@ screen_party_branch_data DEL_FLAG = '0' - AND ORG_TYPE = 'agency' + AND PARENT_ID = #{agencyId} AND TYPE = #{category} @@ -70,19 +69,36 @@ - SELECT month_id AS monthId, - organize_count AS organizeData, - join_user_count AS joinData, - average_join_user_count AS averageJoinUserData + SUM(organize_count) AS organizeData, + SUM(join_user_count) AS joinData, + SUM(average_join_user_count) AS averageJoinUserData FROM screen_party_branch_data WHERE del_flag = '0' AND org_id = #{agencyId} + AND type = 'voluntaryservice' + GROUP BY MONTH_ID ORDER BY MONTH_ID DESC LIMIT 12 + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index 5643b1e31b..2bbdece16c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT org_name AS orgName, create_group_total AS groupTotal, 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 66fb4d6a80..8d865b6341 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 @@ -1,10 +1,10 @@ - + - SELECT concat( surname, CASE char_length( NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name, point_total AS point @@ -12,7 +12,7 @@ screen_party_user_rank_data WHERE del_flag = '0' - AND org_id = #{agencyId} + AND all_parent_ids LIKE CONCAT('%',#{agencyId},'%') ORDER BY point_total DESC, user_name @@ -21,7 +21,7 @@ - SELECT USER_ID, concat( surname, CASE char_length( NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name, @@ -30,7 +30,7 @@ screen_party_user_rank_data WHERE DEL_FLAG = '0' - AND ORG_ID = #{agencyId} + AND ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') AND PARTY_FLAG = '1' ORDER BY POINT_TOTAL DESC diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml index 5e509c8329..992c347f9b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT issue_total AS issueTotal, issue_ratio AS issueRatioA, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml new file mode 100644 index 0000000000..1a94210725 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 8f17dc796a..cbbc5fe211 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -1,10 +1,10 @@ - + - SELECT JOIN_TOTAL AS total, AVG_JOIN AS averageJoin, @@ -19,13 +19,13 @@ screen_user_join WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' + AND ORG_ID = #{agencyId} AND MONTH_ID = #{monthId} - /* SELECT MONTH_ID, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index a1700b05a4..57b2959430 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT SUM( PARTY_TOTAL ) AS partyMemberTotal, SUM( USER_TOTAL ) AS platFormTotal @@ -12,12 +12,11 @@ screen_user_total_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' - AND ORG_ID = #{agencyId} + AND PARENT_ID = #{agencyId} - SELECT user_total AS userNum, party_total AS partyMemberNum, @@ -47,7 +46,7 @@ - SELECT ORG_NAME AS NAME, REG_USER_TOTAL AS regNum, @@ -59,7 +58,6 @@ screen_user_total_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' AND PARENT_ID = #{agencyId} ORDER BY (REG_USER_TOTAL + JOIN_USER_TOTAL + TOPIC_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL) DESC, diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java index be529605de..f89ede1ba6 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -11,5 +11,6 @@ public interface DataSourceConstant { String OPER_CRM = "operCrm"; String RESI_GROUP = "resiGroup"; String EPMET_USER = "epmetuser"; + String EVALUATION_INDEX = "evaluationIndex"; } 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 new file mode 100644 index 0000000000..f02185071f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -0,0 +1,69 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/27 15:20 + */ +public interface IndexCalConstant { + + Integer PAGE_SIZE = 10; + + String GRID_ID="GRID_ID"; + + String DEPT_ID="DEPT_ID"; + + String AGENCY_ID="AGENCY_ID"; + + String PARENT_AGENCY_ID = "parentAgencyId"; + + String PARENT_ID = "PARENT_ID"; + + String CUSTOMER_ID="CUSTOMER_ID"; + + String MONTH_ID="MONTH_ID"; + + String USER_ID="USER_ID"; + String YEAR_ID = "YEAR_ID"; + + String COMMUNITY_LEVEL = "community"; + + String STREET_LEVEL = "street"; + + String DISTRICT_LEVEL = "district"; + + String COMMUNITY_RELATE = "shequxiangguan"; + + + + + // 测试插入数据用 + String customerId="b09527201c4409e19d1dbc5e3c3429a1"; + //社区S1-C1 + String SHE_QU_S1_C1="S1-C1"; + //社区S1-C2 + String SHE_QU_S1_C2="S1-C2"; + //网格S1-C1-G1 + String S1_C1_G1="S1-C1-G1"; + //网格S1-C1-G2 + String S1_C1_G2="S1-C1-G2"; + //网格S1-C2-G1 + String S1_C2_G1="S1-C2-G1"; + + String monthId="202008"; + String insertUser="yinzuomei"; + + String INDEX_DETAIL_LIST_NULL = "指标明细查询集合为空"; + String COMMUNITY_PARTY_AVG_NULL = "查询下属所有【社区】的党建能力平均值集合为空"; + String GRID_PARTY_AVG_NULL = "查询下属所有【网格】的党建能力平均值集合为空"; + String DISTRICT_PARTY_AVG_NULL = "查询【区县】的党建能力平均值集合为空"; + String STREET_PUBLISH_ARTICLE_LIST_NULL = "查询【街道】名义发文数量集合为空"; + String DISTRICT_PUBLISH_ARTICLE_LIST_NULL = "查询【区/县】名义发文数量集合为空"; + String COMMUNITY_PUBLISH_ARTICLE_LIST_NULL = "查询【社区】名义发文数量集合为空"; + String INDEX_CODE_NULL = "指标Code未查询出对应字段 【 %s 】"; + String STREET_GOVERN_ABILITY_NULL = "查询【街道】治理能力的六个五级指标集合为空"; + String COMMUNITY_GOVERN_ABILITY_NULL = "查询【社区】治理能力的六个五级指标集合为空"; + String STREET_SERVICE_ABILITY_NULL = "查询街道活动组织次数集合为空"; + String COMMUNITY_SERVICE_ABILITY_NULL = "查询社区活动组织次数集合为空"; +} 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 new file mode 100644 index 0000000000..a9abd3411f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -0,0 +1,135 @@ +/** + * 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.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.math.BigDecimal; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +public class AgencyScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户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; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public AgencyScoreDTO() { + this.isTotal = NumConstant.ZERO_STR; + this.score = new BigDecimal(NumConstant.ZERO); + this.indexCode = ""; + this.dataType = IndexCalConstant.STREET_LEVEL; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java new file mode 100644 index 0000000000..187f69c960 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 指标计算通用入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:49 + */ +@Data +public class CalculateCommonFormDTO implements Serializable { + private static final long serialVersionUID = -5689788391963427717L; + /** + * 月份id: yyyyMM + */ + private String monthId; + + /** + * 客户id + */ + private String customerId; + + public CalculateCommonFormDTO() { + super(); + } + + public CalculateCommonFormDTO(String customerId, String monthId) { + this.monthId=monthId; + this.customerId=customerId; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java new file mode 100644 index 0000000000..16ede875bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.indexcal; + +import com.epmet.dto.ScreenCustomerGridDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 客户下所有网格 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 13:45 + */ +@Data +public class CustomerGridInfoDTO implements Serializable { + private static final long serialVersionUID = -3211409107659568304L; + + /** + * 网格总数 + */ + private Integer total; + + /** + * 网格列表 + */ + private List gridList; +} 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 new file mode 100644 index 0000000000..5051aa3d82 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java @@ -0,0 +1,117 @@ +/** + * 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.indexcal; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +public class DeptScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 治理能力:zhilinengli; + */ + private String indexCode; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java new file mode 100644 index 0000000000..fd383a61dd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 最值通用DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:39 + */ +@Data +public class ExtremeValueCommonDTO implements Serializable { + + private static final long serialVersionUID = -6295067080250068024L; + /** + * 最小值 + */ + private BigDecimal minValue; + + /** + * 最小值 + */ + private BigDecimal maxValue; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java new file mode 100644 index 0000000000..4dbabbf958 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 最值通用DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:39 + */ +@Data +public class ExtremeValueDTO implements Serializable { + + private static final long serialVersionUID = -2227402439857459667L; + + /** + * 最小值 + */ + private BigDecimal minValue1; + private BigDecimal minValue2; + private BigDecimal minValue3; + private BigDecimal minValue4; + private BigDecimal minValue5; + private BigDecimal minValue6; + private BigDecimal minValue7; + private BigDecimal minValue8; + private BigDecimal minValue9; + private BigDecimal minValue10; + + private BigDecimal maxValue1; + private BigDecimal maxValue2; + private BigDecimal maxValue3; + private BigDecimal maxValue4; + private BigDecimal maxValue5; + private BigDecimal maxValue6; + private BigDecimal maxValue7; + private BigDecimal maxValue8; + private BigDecimal maxValue9; + private BigDecimal maxValue10; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java new file mode 100644 index 0000000000..5e3b4096f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 网格相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/31 16:38 + */ +@Data +public class GridScoreDTO implements Serializable { + /** + * 网格Id + */ + private String gridId; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + private List detailList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java new file mode 100644 index 0000000000..e2573fbfd9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 网格相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/31 16:39 + */ +@Data +public class GridScoreDetailDTO implements Serializable { + /** + * 1:总分;0不是 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java new file mode 100644 index 0000000000..3db0986065 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 分页查询网格列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/27 14:37 + */ +@Data +public class PageQueryGridFormDTO implements Serializable { + /** + * 客户id + */ + private String customerId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + + /** + * 每页多少条 + * */ + private Integer pageSize; + + private Integer pageIndex; + + + public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize){ + this.customerId=customerId; + this.monthId=monthId; + this.pageIndex=pageIndex; + this.pageNo=pageNo; + this.pageSize=pageSize; + } + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java new file mode 100644 index 0000000000..f88e035b7b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:32 上午 + */ +@Data +public class SubAgencyScoreAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 6913351504675726385L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java new file mode 100644 index 0000000000..06b06109f1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/2 6:01 下午 + */ +@Data +public class SubCommunityAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 7681907923515081626L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java new file mode 100644 index 0000000000..013d8c02dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/2 5:54 下午 + */ +@Data +public class SubCommunityGovernAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 4591964909777753497L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityPartyAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityPartyAvgResultDTO.java new file mode 100644 index 0000000000..997b9fed0b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityPartyAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/2 4:28 下午 + */ +@Data +public class SubCommunityPartyAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -6439835738195045820L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..80ec8c7100 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 治理能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexGovrnAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal avgShiftProjectRatio; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; + + /** + * 网格办结项目数 统计期内办结的项目数目 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..901ff46b9e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java @@ -0,0 +1,167 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党建能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexPartyAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Idyyyy + */ + private String yearId; + + /** + * 网格群众用户数 + */ + private Integer userCount; + + /** + * 网格党员用户数 + */ + private Integer partyCount; + + /** + * 网格活跃群众用户数 + */ + private Integer activeUserCount; + + /** + * 网格活跃党员用户数 + */ + private Integer activePartyCount; + + /** + * 网格党员人均提出话题数 + */ + private Integer partyAvgTopicCount; + + /** + * 网格群众人均提出话题数 + */ + private Integer userAvgTopicCount; + + /** + * 网格党员人均提出的议题转项目数 + */ + private Integer partyAvgShiftProjectCount; + + /** + * 网格群众人均提出的议题转项目数 + */ + private Integer userAvgShiftProjectCount; + + /** + * 建群党员数(累计值) 去重 + */ + private Integer createGroupPartyCount; + + /** + * 网格发文数 + */ + private Integer publishArticleCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 组织三会一课次数 + */ + private Integer createThreeMeetsCount; + + /** + * 党员参加三会一课人次 + */ + private Integer joinThreeMeetsCount; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..decd896d03 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java @@ -0,0 +1,117 @@ +/** + * 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.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexServiceAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属组织Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 网格活动组织次数 爱心活动 + */ + private Integer activityCount; + + /** + * 网格志愿者占比 + */ + private BigDecimal volunteerRatio; + + /** + * 网格党员志愿者率 + */ + private BigDecimal partyVolunteerRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java index 50cc040c44..b35ca1537a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java @@ -40,11 +40,6 @@ public class DeptGovrnAbilityFormDTO implements Serializable { */ private String yearId; - /** - * allRegion:全区;community:社区;street:街道 - */ - private String dataType; - /** * 区直部门被吹哨次数 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java index ef4efd6a24..021533fe59 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java @@ -73,7 +73,7 @@ public class GridGovrnAbilityFormDTO implements Serializable { /** * 网格议题转项目率 */ - private BigDecimal avgShiftProjectRatio; + private BigDecimal issueToProjectRatio; /** * 网格自治项目数 统计期网格自身内办结的项目数目 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java new file mode 100644 index 0000000000..364b19c34f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 1、党建能力-党员相关指标上报(按照月份) 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/4 16:04 + */ +@Data +public class GridPartyMemberDataDetailFormDTO implements Serializable { + private static final long serialVersionUID = 2923515319015973995L; + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 党员提出的话题数 + */ + private Integer createTopicCount; + + /** + * 党员参与话题数(支持,反对,评论,浏览) + */ + private Integer joinTopicCount; + + /** + * 话题转议题数 + */ + private Integer shiftIssueCount; + + /** + * 议题转项目数 + */ + private Integer shiftProjectCount; + + /** + * 参加三会一课次数 + */ + private Integer joinThreeMeetsCount; + + /** + * 自建群群众人数 + */ + private Integer groupUserCount; + + /** + * 自建群活跃度-话题数 + */ + private Integer groupTopicCount; + + /** + * 议题转项目率 + */ + private BigDecimal topicToIssueRatio; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 党员自建群活跃群众人数(08-24) + */ + private Integer groupActiveUserCount; + + /** + * 用户id + */ + private String userId; +} 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 7993cb2355..5a0a9fb3c8 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 @@ -3,8 +3,11 @@ package com.epmet.dto.indexcollect.form; import lombok.Data; import org.apache.poi.hpsf.Decimal; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; +import java.util.List; /** * 1、党建能力-党员相关指标上报(按照月份) 入参 @@ -17,82 +20,14 @@ public class GridPartyMemberDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * 机关id:网格所属的组织id + * 当为true时后台将删除本月数据 */ - private String agencyId; - - /** - * 网格id - */ - private String gridId; + private Boolean isFirst; /** * yyyyMM */ private String monthId; - /** - * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 - */ - private String quarterId; - - /** - * yyyy - */ - private String yearId; - - /** - * 党员提出的话题数 - */ - private Integer createTopicCount; - - /** - * 党员参与话题数(支持,反对,评论,浏览) - */ - private Integer joinTopicCount; - - /** - * 话题转议题数 - */ - private Integer shiftIssueCount; - - /** - * 议题转项目数 - */ - private Integer shiftProjectCount; - - /** - * 参加三会一课次数 - */ - private Integer joinThreeMeetsCount; - - /** - * 自建群群众人数 - */ - private Integer groupUserCount; - - /** - * 自建群活跃度-话题数 - */ - private Integer groupTopicCount; - - /** - * 议题转项目率 - */ - private BigDecimal topicToIssueRatio; - - /** - * 提出的议题转项目数 - */ - private Integer issueToProjectCount; - - /** - * 用户id - */ - private String userId; - - /** - * 上级组织Id - */ - private String parentId; + private List partyMemberDataList; } 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 7ddb9e785a..c2eadf4dc7 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 @@ -41,7 +41,7 @@ public class OrgGovrnAbilityFormDTO implements Serializable { private String yearId; /** - * allRegion:全区;community:社区;street:街道 + * district:全区;community:社区;street:街道 */ private String dataType; @@ -71,7 +71,13 @@ public class OrgGovrnAbilityFormDTO implements Serializable { private BigDecimal satisfactionRatio; /** - * 超期项目率 + * 社区超期项目率,dataTyp=commnuity有值 */ private BigDecimal overdueProjectRatio; + + + /** + * 街道办结项目的处理效率, data_type=street时有值 + */ + private BigDecimal handleProjectRatio; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java index e5ad40ef3f..cc1401d424 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java @@ -41,7 +41,7 @@ public class OrgPartyAbilityFormDTO implements Serializable { private String yearId; /** - * allRegion:全区;community:社区;street:街道 + * district:全区;community:社区;street:街道 */ private String dataType; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java index 6ef48c6fa4..59050bced2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java @@ -41,7 +41,7 @@ public class OrgServiceAbilityFormDTO implements Serializable { private String yearId; /** - * allRegion:全区;community:社区;street:街道 + * district:全区;community:社区;street:街道 */ private String dataType; 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 new file mode 100644 index 0000000000..8ad2ec6658 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -0,0 +1,132 @@ +/** + * 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.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 社区相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Data +public class FactIndexCommunityScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户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; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan + */ + private String indexCode; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public FactIndexCommunityScoreDTO() { + this.customerId = ""; + this.agencyId = ""; + this.parentAgencyId = ""; + this.yearId = ""; + this.quarterId = ""; + this.monthId = ""; + this.isTotal = "0"; + this.score = new BigDecimal(0); + this.indexCode = ""; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java new file mode 100644 index 0000000000..d5be2db6e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java @@ -0,0 +1,122 @@ +/** + * 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.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-28 + */ +@Data +public class FactIndexGridScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 年维度Id: yyyy + */ + private String yearId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关(前三者之和):wanggexiangguan + */ + private String indexCode; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java new file mode 100644 index 0000000000..efe372f027 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.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.dto.screen; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class IndexGroupDetailDTO { + + private static final long serialVersionUID = 1L; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 阈值 如果是百分比 则为除以100以后的值 + */ + private BigDecimal threshold; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java new file mode 100644 index 0000000000..ee7863d40b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java @@ -0,0 +1,116 @@ +/** + * 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-08-26 + */ +@Data +public class ScreenCustomerGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党支部(=网格)的位置 + */ + private String partyMark; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java index 49e30cdb21..af11109fa3 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java @@ -3,6 +3,7 @@ package com.epmet.dto.screen.form; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * desc:初始化客户指标权重参数实体类 @@ -12,9 +13,9 @@ import java.io.Serializable; public class IndexCalculateForm implements Serializable { private static final long serialVersionUID = 3280392511156378209L; /** - * desc:客户id + * desc:客户ids */ - private String customerId; + private List customerIds; /** * desc:月份id diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java new file mode 100644 index 0000000000..ec3b17f615 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/31 2:12 下午 + */ +@Data +public class CommunityActivityCountResultDTO implements Serializable { + + private static final long serialVersionUID = -6623426101220283941L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 发文数 + */ + public Integer activityCount; + + public CommunityActivityCountResultDTO() { + this.agencyId = ""; + this.parentId = ""; + this.monthId = ""; + this.quarterId = ""; + this.yearId = ""; + this.activityCount = 0; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java new file mode 100644 index 0000000000..84ab47503d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 1:21 下午 + */ +@Data +public class CommunityGovernAbilityCalculateResultDTO implements Serializable { + + private static final long serialVersionUID = 3766218681545581100L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private Double score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java new file mode 100644 index 0000000000..92b80e3ecf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 11:20 上午 + */ +@Data +public class CommunityGovernAbilityResultDTO implements Serializable { + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 社区被吹哨次数 + */ + private Integer transferedCount; + + /** + * 社区办结项目数 + */ + private Integer closedProjectCount; + + /** + * 社区项目响应度 + */ + private Double respProjectRatio; + + /** + * 社区项目超期率 + */ + private Double overDueProjectRatio; + + /** + * 社区办结项目率 + */ + private Double closedProjectRatio; + + /** + * 社区办结项目满意度 + */ + private Double satisfactionRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java new file mode 100644 index 0000000000..148d6abd80 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:43 上午 + */ +@Data +public class CommunityPublishArticleCountCalculateResultDTO implements Serializable { + + private static final long serialVersionUID = 3527690541253204132L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private Double score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java new file mode 100644 index 0000000000..cf29133001 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:37 上午 + */ +@Data +public class CommunityPublishArticleCountResultDTO implements Serializable { + + private static final long serialVersionUID = -8260746179353253237L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 发文数 + */ + public Integer publishArticleCount; + + public CommunityPublishArticleCountResultDTO() { + this.agencyId = ""; + this.parentId = ""; + this.monthId = ""; + this.quarterId = ""; + this.yearId = ""; + this.publishArticleCount = 0; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java new file mode 100644 index 0000000000..0d6cea89c8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java @@ -0,0 +1,28 @@ +package com.epmet.dto.screen.result; + +import com.epmet.dto.screen.IndexGroupDetailDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * desc:计算指标时 获取要计算的组的指标 + * + * @author liujianjun + */ +@Data +public class IndexGroupDetailResult implements Serializable { + private static final long serialVersionUID = 3937041236261115759L; + + /** + * 是否有下一组 + */ + private Boolean hasNextGroup; + + /** + * desc:指标详情列表 如果hasNextGroup是true则返回的是明细,否则返回的是上级的分组的指标明细 + * 例如:网格的三大能力上次已经返回完毕,下一次调用时返回的是网格相关的三大能力的 指标明细 + */ + private List indexGroupDetailList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java new file mode 100644 index 0000000000..aa9f471405 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/30 8:11 下午 + */ +@Data +public class MaxAndMinBigDecimalResultDTO implements Serializable { + + private static final long serialVersionUID = 76227645470470839L; + + private BigDecimal min; + + private BigDecimal max; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java new file mode 100644 index 0000000000..32b429f188 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/28 9:51 上午 + */ +@Data +public class MaxAndMinDoubleResultDTO implements Serializable { + + private static final long serialVersionUID = -3927045097012156582L; + + /** + * 最小值 + */ + private Double min; + + /** + * 最大值 + */ + private Double max; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java new file mode 100644 index 0000000000..d807e42344 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/28 9:49 上午 + */ +@Data +public class MaxAndMinIntegerResultDTO implements Serializable { + + private static final long serialVersionUID = 5845694081181431599L; + + /** + * 最小值 + */ + private Integer min; + + /** + * 最大值 + */ + private Integer max; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java new file mode 100644 index 0000000000..460eb12640 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/28 3:15 下午 + */ +@Data +public class SubGridAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 1592381327492545907L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java new file mode 100644 index 0000000000..64f3cc7319 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/31 9:11 上午 + */ +@Data +public class SubGridGovernAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -1354963771895272899L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java new file mode 100644 index 0000000000..ba6329aef1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/31 1:53 下午 + */ +@Data +public class SubGridServiceAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -405197363477213644L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java index 38094a105a..75eb13a0fa 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java @@ -48,4 +48,9 @@ public class CustomerGridFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java new file mode 100644 index 0000000000..ab77a2363c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java @@ -0,0 +1,105 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/4 15:43 + */ +@Data +public class DifficultyDataDetailFormDTO implements Serializable { + private static final long serialVersionUID = 4893795146396420078L; + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 事件原Id + */ + private String eventId; + + /** + * 事件图片 URL + */ + private String eventImgUrl; + + /** + * 事件来源 eg: XXX街道-xx社区-网格 + */ + private String eventSource; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件耗时单位:分钟 + */ + private Integer eventCostTime; + + /** + * 事件设计部门数 + */ + private Integer eventReOrg; + + /** + * 事件类别编码 + */ + private String eventCategoryCode; + + /** + * 事件状态编码 + */ + private String eventStatusCode; + + /** + * 事件类别名称 + */ + private String eventCategoryName; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 最近一次操作说明 eg: 转项目,结案,流转 + */ + private String latestOperateDesc; + + /** + * 事件被处理次数(08-21新增) + */ + private Integer eventHandledCount; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} 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 7d136c4b27..a0de181acb 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 @@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * 3、难点赌点 入参 @@ -11,92 +12,15 @@ import java.io.Serializable; */ @Data public class DifficultyDataFormDTO implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * 组织类别 agency:组织;部门:department;网格:grid - */ - private String orgType; - - /** - * 组织Id 可以为网格,机关id - */ - private String orgId; - - /** - * 上级组织Id - */ - private String parentId; - - /** - * 组织名称 - */ - private String orgName; - - /** - * 事件原Id - */ - private String eventId; - - /** - * 事件图片 URL - */ - private String eventImgUrl; - - /** - * 事件来源 eg: XXX街道-xx社区-网格 - */ - private String eventSource; - /** - * 事件内容 + * 当为true时后台将删除本月数据 */ - private String eventContent; + private Boolean isFirst; /** - * 事件耗时单位:分钟 + * 难点堵点数据 */ - private Integer eventCostTime; + private List diffcultyDataList; - /** - * 事件设计部门数 - */ - private Integer eventReOrg; - - /** - * 事件类别编码 - */ - private String eventCategoryCode; - - /** - * 事件状态编码 - */ - private String eventStatusCode; - - /** - * 事件类别名称 - */ - private String eventCategoryName; - - /** - * 事件状态描述 - */ - private String eventStatusDesc; - - /** - * 最近一次操作说明 eg: 转项目,结案,流转 - */ - private String latestOperateDesc; - - /** - * 事件被处理次数(08-21新增) - */ - private Integer eventHandledCount; - - - /** - * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) - */ - private String dataEndTime; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java index 21e8ee718e..6c2cbe43a5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java @@ -121,4 +121,9 @@ public class EventDataFormDTO implements Serializable { * 数据更新至: yyyy|yyyMM|yyyyMMdd 8.21增加字段 */ private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java index 8b0a753839..5e962e47bb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java @@ -79,4 +79,9 @@ public class OrgRankDataFormDTO implements Serializable { * 满意率,最大值100,保留小数点后四位 */ private BigDecimal satisfactionRatio; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java index 29b35aa147..5d9f5da32b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java @@ -73,4 +73,9 @@ public class PartyUserRankDataFormDTO implements Serializable { * 名 */ private String name; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java new file mode 100644 index 0000000000..df902a06a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java @@ -0,0 +1,67 @@ +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 PublicPartiTotalDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id,如果是网格,传入网格所属的组织id + */ + private String parentId; + + /** + * 组织名称(可以是网格名称,也可以是组织名称) + */ + private String orgName; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 注册人数 + */ + private Integer regUserTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 参与人数 + */ + private Integer joinUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java index 14f4df673d..3111d5136d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java @@ -68,14 +68,4 @@ public class UserTotalDataFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; - - /** - * 注册人数(08-21新增) - */ - private Integer regUserTotal; - - /** - * 参与人数(08-21新增) - */ - private Integer joinUserTotal; } 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 a34bca869d..36afabff51 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 @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.45 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.48 ports: - "8108:8108" network_mode: host # 使用现有网络 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 029e37c343..b62847d615 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.48 ports: - "8108:8108" network_mode: host # 使用现有网络 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 2e5a7af0e8..075a43a0af 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 @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.47 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 70a64c3864..d930651a68 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.45 + 0.3.48 data-statistical com.epmet @@ -93,6 +93,11 @@ easyexcel 2.2.6 + + io.github.wnjustdoit + pinyin4j + 2.6.0 + @@ -122,12 +127,107 @@ dev + + 8108 + dev + + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + + + + epmet_gov_voice_user + EpmEt-db-UsEr + + + + + epmet_oper_crm_user + EpmEt-db-UsEr + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + + + + epmet_user_user + EpmEt-db-UsEr + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + 5 + 8 + 10 + 30 + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8108 - dev + local @@ -184,13 +284,19 @@ epmet_data_stats_display_user EpmEt-db-UsEr + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 192.168.1.130 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -270,6 +376,18 @@ epmet elink@833066 + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -352,6 +470,18 @@ epmet_user_user EpmEt-db-UsEr + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com @@ -381,4 +511,4 @@ - \ No newline at end of file + 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 21b5ea51b7..eee1f3bca7 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,5 +1,7 @@ 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; @@ -15,6 +17,6 @@ public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); - //HttpClientManager.getInstance().sendAlarmMsg("DataStatsApplication started!"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java new file mode 100644 index 0000000000..7c88be956c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 组织类别/机关级别 常量 + * + * @author sun + * @since 1.0.0 + */ +public interface OrgTypeConstant { + + /** + * 部门 + */ + String DEPARTMENT = "department"; + + /** + * 网格 + */ + String GRID = "grid"; + + /** + * 组织 + */ + String AGENCY = "agency"; + + /** + * 乡(镇、街道)级 + */ + String STREET = "street"; + + /** + * 区县级 + */ + String DISTRICT = "district"; + + /** + * 社区级 + */ + String COMMUNITY = "community"; + +} 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 6ed40fc377..bf2e750a65 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -1,10 +1,25 @@ package com.epmet.controller; +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.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -13,6 +28,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; import java.util.concurrent.ExecutionException; @@ -23,7 +39,6 @@ import java.util.concurrent.Future; @RestController @Slf4j public class DemoController { - @Autowired private StatsDemoService demoService; @@ -32,6 +47,16 @@ public class DemoController { @Autowired private DimAgencyService dimAgencyService; + @Autowired + private IndexCalculateCommunityService indexCalculateCommunityService; + @Autowired + private GridCorreLationService gridCorreLationService; + @Autowired + private IndexCalculateStreetService indexCalculateStreetService; + @Autowired + private DeptScoreService deptScoreService; + @Autowired + private IndexCalculateDistrictService indexCalculateDistrictService; @GetMapping("testAlarm") public void testAlarm() { @@ -108,4 +133,354 @@ public class DemoController { List list = dimAgencyService.getAgencyListByCustomerId("ba7c0b5b21e882b263ee8456e2cfb63e"); return new Result().ok(list); } + + @PostMapping("zxc2") + public Result getZxc2(){ + indexCalculateCommunityService.calCommunityAll("b09527201c4409e19d1dbc5e3c3429a1","202008"); + return new Result(); + } + + @PostMapping("testcalculategridcorrelation") + public Result testcalculateGridCorreLation(){ + CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); + gridCorreLationService.calculateGridCorreLation(formDTO); + return new Result(); + } + + @Autowired + private GridScoreDao gridScoreDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; +// private static Integer testcal=100; + + @PostMapping("testcal") + public Result testCal(){ + CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); +// //查询总记录数 +// List gridScoreDTOList=gridScoreDao.selectList(formDTO); +// return new Result>().ok(gridScoreDTOList); + gridCorreLationService.calculateGridCorreLation(formDTO); +// deptScoreService.calculateDeptCorreLation(formDTO); + return new Result(); + } + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @PostMapping("insertgridinfo") + public Result insertScreenCustomerGrid(){ + ScreenCustomerGridEntity entity1=new ScreenCustomerGridEntity(); + entity1.setCustomerId(IndexCalConstant.customerId); + entity1.setGridId(IndexCalConstant.S1_C1_G1); + entity1.setGridName("网格S1-C1-G1"); + entity1.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity1.setAllParentIds("S1,C1"); + entity1.setCreatedBy(IndexCalConstant.insertUser); + entity1.setUpdatedBy(IndexCalConstant.insertUser); + entity1.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity1); + + ScreenCustomerGridEntity entity2=new ScreenCustomerGridEntity(); + entity2.setCustomerId(IndexCalConstant.customerId); + entity2.setGridId(IndexCalConstant.S1_C1_G2); + entity2.setGridName("网格S1-C1-G2"); + entity2.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity2.setAllParentIds("S1,C1"); + entity2.setCreatedBy(IndexCalConstant.insertUser); + entity2.setUpdatedBy(IndexCalConstant.insertUser); + entity2.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity2); + + ScreenCustomerGridEntity entity3=new ScreenCustomerGridEntity(); + entity3.setCustomerId(IndexCalConstant.customerId); + entity3.setGridId(IndexCalConstant.S1_C2_G1); + entity3.setGridName("网格S1-C2-G1"); + entity3.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity3.setAllParentIds("S1,C2"); + entity3.setCreatedBy(IndexCalConstant.insertUser); + entity3.setUpdatedBy(IndexCalConstant.insertUser); + entity3.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity3); + + return new Result(); + } + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @PostMapping("inserttestdata") + public Result test(){ + //网格相关-党建能力 + FactIndexPartyAblityGridMonthlyEntity entity1=this.getPartyAblityGridMonthlyEntity1(); + factIndexPartyAblityGridMonthlyDao.insert(entity1); + FactIndexPartyAblityGridMonthlyEntity entity2=this.getPartyAblityGridMonthlyEntity2(); + factIndexPartyAblityGridMonthlyDao.insert(entity2); + FactIndexPartyAblityGridMonthlyEntity entity3=this.getPartyAblityGridMonthlyEntity3(); + factIndexPartyAblityGridMonthlyDao.insert(entity3); + + //网格相关-治理能力 + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity1=this.getGovrnAblityGridMonthlyEntity1(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity1); + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity2=this.getGovrnAblityGridMonthlyEntity2(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity2); + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity3=this.getGovrnAblityGridMonthlyEntity3(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity3); + + //网格相关-服务能力 + FactIndexServiceAblityGridMonthlyEntity fuwuEntity1=this.getServiceAblityGridMonthlyEntity1(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity1); + FactIndexServiceAblityGridMonthlyEntity fuwuEntity2=this.getServiceAblityGridMonthlyEntity2(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity2); + FactIndexServiceAblityGridMonthlyEntity fuwuEntity3=this.getServiceAblityGridMonthlyEntity3(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity3); + + return new Result(); + } + + //网格相关-党建能力-网格1 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity1() { + FactIndexPartyAblityGridMonthlyEntity entity1=new FactIndexPartyAblityGridMonthlyEntity(); + entity1.setCustomerId(IndexCalConstant.customerId); + entity1.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity1.setGridId(IndexCalConstant.S1_C1_G1); + entity1.setMonthId(IndexCalConstant.monthId); + entity1.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity1.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity1.setUserCount(10); // 网格群众用户数 + entity1.setPartyCount(50); // 网格党员用户数 + entity1.setActiveUserCount(100); // 网格活跃群众用户数 + entity1.setActivePartyCount(80); //网格活跃党员用户数 + entity1.setPartyAvgTopicCount(30); //网格党员人均提出话题数 + entity1.setUserAvgTopicCount(10); //网格群众人均提出话题数 + entity1.setPartyAvgShiftProjectCount(50); //网格党员人均提出的议题转项目数 + entity1.setUserAvgShiftProjectCount(50); //网格群众人均提出的议题转项目数 + entity1.setCreateGroupPartyCount(35); //建群党员数(累计值) 去重 + entity1.setPublishArticleCount(50); //网格发文数 + entity1.setIssueToProjectRatio(new BigDecimal("50")); //网格议题转项目率 + entity1.setCreateThreeMeetsCount(10); //组织三会一课次数 + entity1.setJoinThreeMeetsCount(30); //党员参加三会一课人次 + + entity1.setCreatedBy(IndexCalConstant.insertUser); + entity1.setUpdatedBy(IndexCalConstant.insertUser); + return entity1; + } + + //网格相关-党建能力-网格2 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity2() { + FactIndexPartyAblityGridMonthlyEntity entity2=new FactIndexPartyAblityGridMonthlyEntity(); + entity2.setCustomerId(IndexCalConstant.customerId); + entity2.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity2.setGridId(IndexCalConstant.S1_C1_G2); + entity2.setMonthId(IndexCalConstant.monthId); + entity2.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity2.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity2.setUserCount(20); // 网格群众用户数 + entity2.setPartyCount(30); // 网格党员用户数 + entity2.setActiveUserCount(20); // 网格活跃群众用户数 + entity2.setActivePartyCount(20); //网格活跃党员用户数 + entity2.setPartyAvgTopicCount(10); //网格党员人均提出话题数 + entity2.setUserAvgTopicCount(50); //网格群众人均提出话题数 + entity2.setPartyAvgShiftProjectCount(35); //网格党员人均提出的议题转项目数 + entity2.setUserAvgShiftProjectCount(55); //网格群众人均提出的议题转项目数 + entity2.setCreateGroupPartyCount(30); //建群党员数(累计值) 去重 + entity2.setPublishArticleCount(30); //网格发文数 + entity2.setIssueToProjectRatio(new BigDecimal("30")); //网格议题转项目率 + entity2.setCreateThreeMeetsCount(35); //组织三会一课次数 + entity2.setJoinThreeMeetsCount(20); //党员参加三会一课人次 + + entity2.setCreatedBy(IndexCalConstant.insertUser); + entity2.setUpdatedBy(IndexCalConstant.insertUser); + return entity2; + } + //网格相关-党建能力-网格3 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity3() { + FactIndexPartyAblityGridMonthlyEntity entity3=new FactIndexPartyAblityGridMonthlyEntity(); + entity3.setCustomerId(IndexCalConstant.customerId); + entity3.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity3.setGridId(IndexCalConstant.S1_C2_G1); + entity3.setMonthId(IndexCalConstant.monthId); + entity3.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity3.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity3.setUserCount(60); // 网格群众用户数 + entity3.setPartyCount(80); // 网格党员用户数 + entity3.setActiveUserCount(70); // 网格活跃群众用户数 + entity3.setActivePartyCount(70); //网格活跃党员用户数 + entity3.setPartyAvgTopicCount(40); //网格党员人均提出话题数 + entity3.setUserAvgTopicCount(20); //网格群众人均提出话题数 + entity3.setPartyAvgShiftProjectCount(30); //网格党员人均提出的议题转项目数 + entity3.setUserAvgShiftProjectCount(30); //网格群众人均提出的议题转项目数 + entity3.setCreateGroupPartyCount(20); //建群党员数(累计值) 去重 + entity3.setPublishArticleCount(80); //网格发文数 + entity3.setIssueToProjectRatio(new BigDecimal("80")); //网格议题转项目率 + entity3.setCreateThreeMeetsCount(100); //组织三会一课次数 + entity3.setJoinThreeMeetsCount(100); //党员参加三会一课人次 + + entity3.setCreatedBy(IndexCalConstant.insertUser); + entity3.setUpdatedBy(IndexCalConstant.insertUser); + return entity3; + } + //网格相关-治理能力-网格1 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity1() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(100); //网格总议题数 + entity.setAvgIssueCount(100); //网格人均议题数目 + entity.setIssueToProjectRatio(new BigDecimal("20")); //网格议题转项目率 + entity.setProjectTotal(20);// 网格总项目数 + entity.setSelfSolveProjectCount(10); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(100);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("100"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("100"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-治理能力-网格2 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity2() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G2); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(70); //网格总议题数 + entity.setAvgIssueCount(10); //网格人均议题数目 + entity.setIssueToProjectRatio(new BigDecimal("20")); //网格议题转项目率 + entity.setProjectTotal(40);// 网格总项目数 + entity.setSelfSolveProjectCount(15); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(20);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("10"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("70"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + + return entity; + } + //网格相关-治理能力-网格3 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity3() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity.setGridId(IndexCalConstant.S1_C2_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(80); //网格总议题数 + entity.setAvgIssueCount(70); //网格人均议题数目 + entity.setIssueToProjectRatio(new BigDecimal("100")); //网格议题转项目率 + entity.setProjectTotal(100);// 网格总项目数 + entity.setSelfSolveProjectCount(20); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(20);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("70"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("10"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + + return entity; + } + + //网格相关-服务能力-网格1 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity1() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(80);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("70"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("60"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-服务能力-网格2 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity2() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G2); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(40);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("30"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("80"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-服务能力-网格3 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity3() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity.setGridId(IndexCalConstant.S1_C2_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(20);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("80"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("20"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + @PostMapping("streetZxc") + public void getStreet(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + indexCalculateStreetService.calStreetAll(customerId,monthId); + } + + @PostMapping("districtZxc") + public void getDistrict(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + indexCalculateDistrictService.calDistrictAll(customerId,monthId); + } + @PostMapping("gridZxc") + public void getGrid(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + CalculateCommonFormDTO c = new CalculateCommonFormDTO(); + c.setCustomerId(customerId); + c.setMonthId(monthId); + gridCorreLationService.calculateGridCorreLation(c); + } + @PostMapping("deptZxc") + public void getDept(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + CalculateCommonFormDTO c = new CalculateCommonFormDTO(); + c.setCustomerId(customerId); + c.setMonthId(monthId); + deptScoreService.calculateDeptCorreLation(c); + } } 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 7c12fec411..138ab5cbb7 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,10 @@ import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcollect.form.*; -import com.epmet.service.indexcollect.FactIndexCollectService; +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.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -37,8 +35,8 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridpartymemberdata") - public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - factIndexCollectService.insertGridPartyMemberData(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyMemberDataFormDTO formDTO) { + factIndexCollectService.insertGridPartyMemberData(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 cba12740c5..978181b3a4 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,16 +1,21 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; -import com.epmet.service.screen.IndexCalculateService; +import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; +import com.epmet.util.DimIdGenerator; +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 java.util.Date; + /** * 指标计算controller * @@ -24,23 +29,41 @@ public class IndexCalculateController { @Autowired private IndexCalculateService indexCalculateService; + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; + /** - * 1、党建能力-党员相关指标计算(按照月份) + * 按照客户计算所有指标(按照月份) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @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); + } + return new Result().error("指标计算失败"); + } + + /** + * desc:计算党员指标分数 + * + * @return + */ @PostMapping("cpc") - public Result cpcIndexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexCalculateForm formDTO) { - indexCalculateService.cpcIndexCalculate(formDTO); - return new Result(); + public Result cpc(@RequestBody CalculateCommonFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getMonthId())) { + //默认 当前月份-1 + formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); + } + return new Result().ok(cpcIndexCalculateService.cpcIndexCalculate(formDTO)); } - /* *//** + /* *//** * 2、党建能力-网格相关指标上报(按照月份) * * @param externalAppRequestParam diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java index c26189717e..03deff604d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java @@ -8,10 +8,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.model.IndexExcelDataListener; import com.epmet.model.IndexModel; -import com.epmet.service.screen.IndexDictService; -import com.epmet.service.screen.IndexGroupDetailTemplateService; -import com.epmet.service.screen.IndexGroupService; -import com.epmet.service.screen.IndexGroupTemplateService; +import com.epmet.service.evaluationindex.screen.IndexDictService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; +import com.epmet.service.evaluationindex.screen.IndexGroupService; +import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; 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/ScreenCollController.java index 080ba5384b..d83f8df3c5 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/ScreenCollController.java @@ -4,7 +4,7 @@ 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.screen.ScreenCollService; +import com.epmet.service.evaluationindex.screen.ScreenCollService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -133,7 +133,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("difficultydata") - public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -283,4 +283,21 @@ public class ScreenCollController { screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } + + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * + * @param formDTO + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:44 2020-08-25 + **/ + @ExternalAppRequestAuth + @PostMapping("publicpartitotaldata") + public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.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 new file mode 100644 index 0000000000..5cbcfb20e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +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 AgencyScoreDao extends BaseDao { + + /** + * @Description 【街道】中间表插入 + * @param lists + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertStreetRecord(@Param("lists") List lists); + + /** + * @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); + + /** + * @Description 查询【fact_index_agency_score】相关信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType); + + /** + * @Description 区下级街道得分平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + + + /** + * 根据入参查询 区/街道相关分数表 记录 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + 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 + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListAgencyId(@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/indexcal/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java new file mode 100644 index 0000000000..9c3d339ae8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.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.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +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 CpcScoreDao 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("indexCode") String indexCode); + + List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId); + + 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 new file mode 100644 index 0000000000..4be461b59a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.indexcal.DeptScoreDTO; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +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 DeptScoreDao extends BaseDao { + + /** + * 根据入参查询 区直部门分值表 记录 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + 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 + * @param monthId + * @return java.lang.String + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListDeptId(@Param("customerId")String customerId, @Param("monthId")String monthId); + + + /** + * @Description 所有直属部门治理能力平均值 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/4 10:53 上午 + */ + List selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + + /** + * @return int + * @param customerId + * @param monthId + * @param deptId + * @author yinzuomei + * @description + * @Date 2020/9/7 14:30 + **/ + int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, @Param("monthId")String monthId,@Param("deptId") String deptId); +} 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 new file mode 100644 index 0000000000..2e4a10cde2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java @@ -0,0 +1,69 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.entity.evaluationindex.indexcal.GridScoreEntity; +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 GridScoreDao extends BaseDao { + /** + * @param customerId + * @param monthId + * @param indexCode + * @param isTotal 1:总分;0不是 + * @return int + * @author yinzuomei + * @description + * @Date 2020/8/31 14:00 + **/ + int deleteByCusAndMonthId(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("indexCode") String indexCode, + @Param("isTotal") String isTotal); + + /** + * @return int + * @param gridScoreEntityList + * @author yinzuomei + * @description + * @Date 2020/8/31 14:01 + **/ + int insertBatches(List gridScoreEntityList); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description + * @Date 2020/8/31 16:42 + **/ + List selectList(CalculateCommonFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java similarity index 55% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index f56638a3f6..5a9350a63e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.indexcoll; /** +package com.epmet.dao.evaluationindex.indexcoll; /** * Copyright 2018 人人开源 https://www.renren.io *

* This program is free software: you can redistribute it and/or modify @@ -17,12 +17,15 @@ package com.epmet.dao.indexcoll; /** import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; -import com.epmet.entity.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 治理能力-部门相关数据 @@ -63,4 +66,47 @@ public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @return java.lang.Integer + * @param calculateCommonFormDTO + * @author yinzuomei + * @description 查询(fact_index_govrn_ablity_dept_monthly治理能力-区直部门相关数据 )当前月共上传了多少条记录 + * @Date 2020/9/3 9:31 + **/ + Integer selectCount(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @return java.util.Map + * @param calculateCommonFormDTO + * @author yinzuomei + * @description 计算最大最小值 + * @Date 2020/9/3 9:36 + **/ + Map selectExtremeValue(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @return java.util.List> + * @param customerId 客户id + * @param monthId yyyyMM + * @param offset + * @param pageSize + * @author yinzuomei + * @description + * @Date 2020/9/3 11:00 + **/ + List> selectListByMonthId(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("offset") Integer offset, + @Param("pageSize") Integer pageSize); + + /** + * @return com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity + * @param customerId + * @param monthId + * @author yinzuomei + * @description 只有一条数据时用 + * @Date 2020/9/3 16:45 + **/ + FactIndexGovrnAblityDeptMonthlyEntity selectOneRecord(@Param("customerId") String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java similarity index 60% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index e591ba928d..55d0e5730b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -15,15 +15,18 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; -import com.epmet.entity.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 治理能力-网格相关事实表 @@ -64,4 +67,41 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:58 + **/ + List> selectListGovrnAblityGrid(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询治理能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 13:10 + **/ + Map selectGovrnAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return int + * @param formDTO + * @author yinzuomei + * @description 查询(治理能力-网格相关事实表)当前月共上传了多少条记录 + * @Date 2020/8/31 14:31 + **/ + int selectCount(CalculateCommonFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 场景:客户这个月只上传了一个网格的事实记录 + * @Date 2020/9/2 14:46 + **/ + String selectTheOneGrid(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java similarity index 77% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index 9013d4f9cf..2b7277f7d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -15,15 +15,16 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.OrgGovrnAbilityFormDTO; -import com.epmet.entity.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 治理能力-街道及社区相关数据 @@ -61,4 +62,13 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、【街道办结项目的处理效率,level为street时存在】、办结项目率、办结项目满意度】 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + List> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java similarity index 62% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 387a369af1..ffdc533581 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -15,15 +15,17 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +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.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 党建能力-党员相关的事实表 @@ -36,35 +38,29 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list, - @Param("customerId")String customerId); + int batchInsertFactIndexPartyAblityCpcMonthly(@Param("list") List list, + @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); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java similarity index 60% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index b5cb8d2c5e..aeaf65e6b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -15,15 +15,18 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; -import com.epmet.entity.indexcoll.FactIndexPartyAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 党建能力-网格相关事实表 @@ -64,4 +67,41 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/26 15:57 + **/ + List> selectListPartyAblityGrid(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询党建能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:51 + **/ + Map selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.lang.Integer + * @param formDTO + * @author yinzuomei + * @description 查询(党建能力-网格相关事实表) 这个月共上传记录数 + * @Date 2020/9/2 14:28 + **/ + Integer selectCount(CalculateCommonFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 场景:客户这个月只上传了一个网格的事实记录 + * @Date 2020/9/2 14:45 + **/ + String selectTheOneGrid(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java similarity index 72% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index 73a73a1c50..44d3a19638 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -15,15 +15,17 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.OrgPartyAbilityFormDTO; -import com.epmet.entity.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import com.epmet.dto.screen.result.CommunityPublishArticleCountResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 党建能力-街道及社区相关事实表 @@ -62,4 +64,22 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 查询社区下的发文数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 10:49 上午 + */ + List selectPublishArticleCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 查询社区下的发文数 Map + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 10:49 上午 + */ + List> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java similarity index 61% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java index 9eb7051762..ca2489ba6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -15,15 +15,18 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO; -import com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 服务能力-网格相关事实表 @@ -63,4 +66,41 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:59 + **/ + List> selectListServiceAblityGrid(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 13:15 + **/ + Map selectServiceAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return int + * @param formDTO + * @author yinzuomei + * @description 查询(服务能力-网格相关事实表)共上传记录数 + * @Date 2020/9/2 14:28 + **/ + int selectCount(CalculateCommonFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 场景:客户这个月只上传了一个网格的事实记录 + * @Date 2020/9/2 14:46 + **/ + String selectTheOneGrid(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java similarity index 73% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index 31c268cd75..b17ad01eea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -15,15 +15,17 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.OrgServiceAbilityFormDTO; -import com.epmet.entity.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; +import com.epmet.dto.screen.result.CommunityActivityCountResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 服务能力-组织(街道|社区|全区)相关事实表 @@ -62,4 +64,23 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 社区活动组织次数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 2:15 下午 + */ + List selectActivityCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 社区活动组织次数 + * @param customerId + * @param monthId + * @param level + * @author zxc + * @date 2020/9/2 2:09 下午 + */ + List> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java new file mode 100644 index 0000000000..40fd49e6ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +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 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 FactIndexCommunityScoreDao extends BaseDao { + + /** + * @Description 【社区】中间表插入 + * @param lists + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertCommunityPartyRecord(@Param("lists") List lists); + + /** + * @Description 删除旧记录 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/1 9:03 上午 + */ + void deleteOldRecord(@Param("customerId") String customerId,@Param("monthId")String monthId,@Param("indexCode")String indexCode); + + /** + * @Description 查询社区相关信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectCommunityInfo(@Param("customerId") String customerId,@Param("monthId")String monthId); + + /** + * 根据入参查询 查询社区相关信息 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListCommunityScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + /** + * @Description 街道下级所有社区得分平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List 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 + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListCommunityId(@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/FactIndexGridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java new file mode 100644 index 0000000000..77c3f85366 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.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/IndexCodeFieldReDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexCodeFieldReDao.java new file mode 100644 index 0000000000..4289caf4db --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexCodeFieldReDao.java @@ -0,0 +1,13 @@ +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.IndexCodeFieldReEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface IndexCodeFieldReDao extends BaseDao { + List getAllData(); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexDictDao.java similarity index 90% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexDictDao.java index 7aa2ab9733..780fabd1d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexDictDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.IndexDictEntity; +import com.epmet.entity.evaluationindex.screen.IndexDictEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDao.java similarity index 90% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDao.java index 5458720940..26cb71f2ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.IndexGroupEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java similarity index 75% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java index 1a7dd4a0a8..17e7a7eb82 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java @@ -15,11 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户指标详情 @@ -29,5 +32,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IndexGroupDetailDao extends BaseDao { - + + List getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailTemplateDao.java similarity index 89% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailTemplateDao.java index 29f074c13f..eb0c0b260a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailTemplateDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupTemplateDao.java similarity index 90% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupTemplateDao.java index c1e14b531c..0e1b5a2a06 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupTemplateDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.IndexGroupTemplateEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index 12271b8e3c..8cd75faff7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.CpcBaseDataFormDTO; -import com.epmet.entity.screen.ScreenCpcBaseDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java similarity index 66% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index d7851cd754..4912171860 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -15,12 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; -import com.epmet.dto.screencoll.form.CustomerGridFormDTO; -import com.epmet.entity.screen.ScreenCustomerAgencyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -56,4 +55,24 @@ public interface ScreenCustomerAgencyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * 返回当前客户下,未匹配到的组织信息 + * @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); + + /** + * 根据客户id,查询区/街道 组织名称、id + * + * @param customerId 客户id + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListAgencyInfo(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java similarity index 58% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index 53f37049a3..53a5fcf042 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.CustomerDeptFormDTO; -import com.epmet.entity.screen.ScreenCustomerDeptEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -56,4 +56,35 @@ public interface ScreenCustomerDeptDao extends BaseDao * @Date 10:52 2020-08-18 **/ void batchInsertCustomerDept(@Param("list") List list, @Param("customerId")String customerId); + + /** + * @param customerId + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity + * @author yinzuomei + * @description 查询部门所属组织id + * @Date 2020/9/3 16:32 + **/ + ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId); + + /** + * 返回当前客户下,未匹配到的区直部门信息 + * + * @param customerId + * @param deptIds + * @return java.util.List + * @Author zhangyong + * @Date 10:45 2020-09-04 + **/ + List selectListMismatchDeptInfo(@Param("customerId") String customerId, + @Param("deptIds") String[] deptIds); + + /** + * 根据客户id 查询部门 信息 + * @param customerId 客户id + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListDeptInfo(@Param("customerId")String customerId); } 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 new file mode 100644 index 0000000000..005f69289b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.screencoll.form.CustomerGridFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 网格(党支部)信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenCustomerGridDao extends BaseDao { + /** + *15、网格信息上传 + * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param gridIds 网格Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCustomerGrid(@Param("customerId") String customerId, + @Param("gridIds") String[] gridIds); + + /** + * 15、网格信息上传 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCustomerGrid(@Param("list") List list, @Param("customerId")String customerId); + + /** + * @return java.lang.Integer + * @param customerId + * @author yinzuomei + * @description 查询客户下网格总数 + * @Date 2020/8/26 15:33 + **/ + Integer selectCountByCustomerId(@Param("customerId") String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询客户下网格信息 + * @Date 2020/8/26 15:33 + **/ + List selectListByCustomerId(@Param("customerId")String customerId); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:42 + **/ + List pageListByCustomerId(PageQueryGridFormDTO formDTO); + + /** + * @param customerId 客户id + * @param gridId 网格id + * @return java.lang.String + * @author yinzuomei + * @description 查询网格所属的组织id + * @Date 2020/8/31 12:35 + **/ + ScreenCustomerGridDTO selectParentAgencyId(@Param("customerId") String customerId, @Param("gridId") String gridId); + + /** + * 返回当前客户下,未匹配到的网格信息 + * + * @param customerId + * @param gridIds + * @return java.util.List + * @Author zhangyong + * @Date 10:45 2020-09-04 + **/ + List selectListMismatchGridInfo(@Param("customerId") String customerId, + @Param("gridIds") String[] gridIds); + + /** + * 根据客户id 查询网格(党支部)详细信息 + * @param customerId + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListGridInfo(@Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java similarity index 83% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 1a9b991bac..412ab70225 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -15,11 +15,12 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.DifficultyDataDetailFormDTO; import com.epmet.dto.screencoll.form.DifficultyDataFormDTO; -import com.epmet.entity.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -38,14 +39,10 @@ public interface ScreenDifficultyDataDao extends BaseDao list, @Param("customerId")String customerId); + void batchInsertDifficultyData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java index ec80809c55..14c0153f62 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.EventDataFormDTO; -import com.epmet.entity.screen.ScreenEventDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenEventDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java similarity index 91% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java index 42ca86859e..835b1f112d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.ScreenEventImgDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index ea3d67aa68..3dca5cc281 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.GovernRankDataFormDTO; -import com.epmet.entity.screen.ScreenGovernRankDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java similarity index 76% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index e97406febf..4ebfc825e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; -import com.epmet.entity.screen.ScreenIndexDataMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenIndexDataMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -60,4 +60,16 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * 获取今年的各月份的平均值 + * @param customerId + * @param yearId + * @param month 做除法运算 + * @return java.util.List + * @Author zhangyong + * @Date 15:51 2020-09-04 + **/ + List selectListIndexDataMonthlyByYear(@Param("customerId") String customerId, + @Param("yearId") String yearId, @Param("month") String month); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java index 4ca64f6944..bb2a5eeb6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; -import com.epmet.entity.screen.ScreenIndexDataYearlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenIndexDataYearlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java index 4eabfd508a..00b4599fe4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.OrgRankDataFormDTO; -import com.epmet.entity.screen.ScreenOrgRankDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 3cae4a160d..3f2de14703 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO; -import com.epmet.entity.screen.ScreenPartyBranchDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java similarity index 93% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 276b08e356..931c05c6bf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO; -import com.epmet.entity.screen.ScreenPartyLinkMassesDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index 9e43669618..e1f527f47d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.PartyUserRankDataFormDTO; -import com.epmet.entity.screen.ScreenPartyUserRankDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 202fc4aa59..b50d74b1a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.PioneerDataFormDTO; -import com.epmet.entity.screen.ScreenPioneerDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; 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 new file mode 100644 index 0000000000..5bc9ea4130 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PublicPartiTotalDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; +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-24 + */ +@Mapper +public interface ScreenPublicPartiTotalDataDao extends BaseDao { + + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-25 + **/ + void deletePublicPartiTotalData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 18、公众参与各类总数 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-25 + **/ + void batchInsertPublicPartiTotalData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java similarity index 95% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java index 69422c07c4..a620008b22 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.ScreenUserJoinEntity; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index e0712dee50..5595259af6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.dao.screen; +package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.UserTotalDataFormDTO; -import com.epmet.entity.screen.ScreenUserTotalDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java deleted file mode 100644 index c9fa856582..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java +++ /dev/null @@ -1,58 +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.dao.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.screencoll.form.CustomerGridFormDTO; -import com.epmet.entity.screen.ScreenCustomerGridEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 网格(党支部)信息 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-18 - */ -@Mapper -public interface ScreenCustomerGridDao extends BaseDao { - /** - *15、网格信息上传 - * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 - * - * @param customerId - * @param gridIds 网格Id集合 - * @Author zhangyong - * @Date 10:52 2020-08-18 - **/ - void deleteCustomerGrid(@Param("customerId") String customerId, - @Param("gridIds") String[] gridIds); - - /** - * 15、网格信息上传 - * 2) 在批量新增 - * - * @param list - * @param customerId - * @Author zhangyong - * @Date 10:52 2020-08-18 - **/ - void batchInsertCustomerGrid(@Param("list") List list, @Param("customerId")String customerId); -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencyScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencyScoreEntity.java new file mode 100644 index 0000000000..879018ac99 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencyScoreEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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_score") +public class AgencyScoreEntity 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; + +} 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 new file mode 100644 index 0000000000..0b21c5de92 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java @@ -0,0 +1,85 @@ +/** + * 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_score") +public class CpcScoreEntity 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; + + /** + * 是否是总分 1是0不是 + */ + private String isTotal; +} 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 new file mode 100644 index 0000000000..29857fdc2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java @@ -0,0 +1,85 @@ +/** + * 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_score") +public class DeptScoreEntity 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; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 治理能力:zhilinengli; + */ + private String indexCode; + +} 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 new file mode 100644 index 0000000000..781dca54bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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_score") +public class GridScoreEntity 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; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java index 24827756fa..47501f13f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.indexcoll; +package com.epmet.entity.evaluationindex.indexcoll; 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; /** * 治理能力-部门相关数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java similarity index 95% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java index c1c6553ef5..7b0c61a9fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.indexcoll; +package com.epmet.entity.evaluationindex.indexcoll; 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; /** * 治理能力-网格相关事实表 @@ -82,7 +80,7 @@ public class FactIndexGovrnAblityGridMonthlyEntity extends BaseEpmetEntity { /** * 网格议题转项目率 */ - private BigDecimal avgShiftProjectRatio; + private BigDecimal issueToProjectRatio; /** * 网格总项目数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java similarity index 87% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java index 94eec97d6f..e23472c6a4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.indexcoll; +package com.epmet.entity.evaluationindex.indexcoll; 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; /** * 治理能力-街道及社区相关数据 @@ -70,7 +68,7 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { private String yearId; /** - * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 + * 数据类型 district:全区;street:街道;community:社区;grid:网格 */ private String dataType; @@ -100,8 +98,12 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { private BigDecimal satisfactionRatio; /** - * 超期项目率 + * 社区超期项目率,dataTyp=commnuity有值 */ private BigDecimal overdueProjectRatio; + /** + * 街道办结项目的处理效率, data_type=street时有值 + */ + private BigDecimal handleProjectRatio; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java similarity index 64% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java index e6ec77f0fa..550a5ce8a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java @@ -15,22 +15,20 @@ * along with this program. If not, see . */ -package com.epmet.entity.indexcoll; +package com.epmet.entity.evaluationindex.indexcoll; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; -import java.util.Date; /** - * 党建能力-党员相关的事实表 + * 党建能力-党员相关的事实表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-20 + * @since v1.0.0 2020-08-24 */ @Data @EqualsAndHashCode(callSuper=false) @@ -39,89 +37,89 @@ public class FactIndexPartyAblityCpcMonthlyEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; - /** - * 客户Id - */ + /** + * 客户Id + */ private String customerId; - /** - * 机关Id - */ + /** + * 机关Id + */ private String agencyId; - /** - * 上级组织Id - */ + /** + * agency_id的上级组织Id + */ private String parentId; - /** - * 网格Id - */ + /** + * 网格Id + */ private String gridId; - /** - * 用户Id: - */ + /** + * 用户Id: + */ private String userId; - /** - * 月维度Id: yyyMM - */ + /** + * 月维度Id: yyyMM + */ private String monthId; - /** - * 季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 - */ + /** + * 季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ private String quarterId; - /** - * 年Id : yyyy - */ + /** + * 年Id : yyyy + */ private String yearId; - /** - * 党员提出的话题数 - */ + /** + * 党员提出的话题数 + */ private Integer createTopicCount; - /** - * 党员参与话题数(支持,反对,评论,浏览) - */ + /** + * 党员参与话题数(支持,反对,评论,浏览) + */ private Integer joinTopicCount; - /** - * 话题转议题数 - */ + /** + * 党员提出的话题转议题数 + */ private Integer shiftIssueCount; - /** - * 议题转项目数 - */ + /** + * 党员提出的议题转项目数 + */ private Integer shiftProjectCount; - /** - * 参加三会一课次数 - */ + /** + * 参加三会一课次数 + */ private Integer joinThreeMeetsCount; - /** - * 自建群群众人数 - */ + /** + * 党员自建群群众人数 + */ private Integer groupUserCount; - /** - * 自建群活跃度-话题数 - */ + /** + * 党员自建群活跃群众人数(08-24) + */ + private Integer groupActiveUserCount; + + /** + * 党员自建群活跃度——话题数 + */ private Integer groupTopicCount; - /** - * 议题转项目率 - */ + /** + * 自建群活跃度——议题转项目率 + */ private BigDecimal topicToIssueRatio; - /** - * 提出的议题转项目数 - */ - private Integer issueToProjectCount; - } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java index 208106e87a..b38d4c4d7a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.indexcoll; +package com.epmet.entity.evaluationindex.indexcoll; 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; /** * 党建能力-网格相关事实表 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java similarity index 92% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java index 1bf023f055..80bcce0819 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.indexcoll; +package com.epmet.entity.evaluationindex.indexcoll; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 党建能力-街道及社区相关事实表 * @@ -74,7 +71,7 @@ public class FactIndexPartyAblityOrgMonthlyEntity extends BaseEpmetEntity { private Integer publishArticleCount; /** - * 数据类型 allRegion:全区;community:社区;street:街道 + * 数据类型 district:全区;community:社区;street:街道 */ private String dataType; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java similarity index 96% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java index d4c6aa6ab6..fedcaf1637 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.indexcoll; +package com.epmet.entity.evaluationindex.indexcoll; 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; /** * 服务能力-网格相关事实表 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java similarity index 92% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java index 8abeb1c172..a93c7fbae4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.indexcoll; +package com.epmet.entity.evaluationindex.indexcoll; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 服务能力-组织(街道|社区|全区)相关事实表 * @@ -74,7 +71,7 @@ public class FactIndexServiceAblityOrgMonthlyEntity extends BaseEpmetEntity { private Integer activityCount; /** - * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 + * 数据类型 district:全区;street:街道;community:社区;grid:网格 */ private String dataType; 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/FactIndexCommunityFiveScoreEntity.java new file mode 100644 index 0000000000..40a112d6d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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; + +/** + * 社区相关-党建能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_five_score") +public class FactIndexCommunityFiveScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 发文数量:publish_article + */ + private String type; + +} 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/screen/FactIndexCommunityScoreEntity.java new file mode 100644 index 0000000000..d99cd7b506 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 社区相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_score") +public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 社区上一级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan + */ + private String indexCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexGridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexGridScoreEntity.java new file mode 100644 index 0000000000..05ab819f20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexGridScoreEntity.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_grid_score") +public class FactIndexGridScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 总指数分值 + */ + private BigDecimal totalScore; + + /** + * 党建能力分值 + */ + private BigDecimal partyAblityScore; + + /** + * 治理能力分值 + */ + private BigDecimal govrnAblityScore; + + /** + * 服务能力分值 + */ + private BigDecimal serviceAblityScore; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexCodeFieldReEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexCodeFieldReEntity.java new file mode 100644 index 0000000000..042508eae6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexCodeFieldReEntity.java @@ -0,0 +1,21 @@ +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; + +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_code_field_re") +public class IndexCodeFieldReEntity extends BaseEpmetEntity { + /** + * 指标code + */ + private String indexCode; + + /** + * 字段名 + */ + private String fieldId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java similarity index 90% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java index 2ea5745dba..e0932daeef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -50,4 +50,8 @@ public class IndexDictEntity extends BaseEpmetEntity { */ private String level; + /** + * 正相关:positive;负相关:negative + */ + private String correlation; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java similarity index 80% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java index c0088d5383..8a1b94fb3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -52,6 +52,11 @@ public class IndexGroupDetailEntity extends BaseEpmetEntity { */ private String indexId; + /** + * 指标code + */ + private String indexCode; + /** * 权重(同一组权重总和=1) */ @@ -62,4 +67,19 @@ public class IndexGroupDetailEntity extends BaseEpmetEntity { */ private String status; + /** + * 阈值 如果是百分比 则为除以100以后的值 + */ + private BigDecimal threshold; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java similarity index 85% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java index 569cda48d9..0d06fe6955 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -47,6 +47,11 @@ public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity { */ private String indexId; + /** + * 指标code + */ + private String indexCode; + /** * 权重(同一组权重总和=1) */ @@ -62,4 +67,14 @@ public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity { */ private BigDecimal threshold; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java similarity index 93% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java index 24df1ef18a..dfe57f7d8d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -45,6 +45,11 @@ public class IndexGroupEntity extends BaseEpmetEntity { */ private String indexId; + /** + * 指标code + */ + private String indexCode; + /** * 是否启用:启用:enable 禁用:disabled */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java similarity index 93% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java index 3348ebdeda..e22f7e6f2f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -40,6 +40,11 @@ public class IndexGroupTemplateEntity extends BaseEpmetEntity { */ private String indexId; + /** + * 指标code + */ + private String indexCode; + /** * 是否启用:启用:enable 禁用:disabled */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCpcBaseDataEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCpcBaseDataEntity.java index e649e5e89f..fa70f90897 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCpcBaseDataEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 基层党建-党员基本情况 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java index 96b2e23dfe..e06907ca84 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java @@ -14,16 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 组织机构信息 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java similarity index 96% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java index f020e44cd8..6fdb38f4b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 部门信息 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java similarity index 92% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java index 99b6c99553..19fdd132be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 网格(党支部)信息 * @@ -78,4 +75,8 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity { */ private String dataEndTime; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java index 845bbb7db0..35f4ca3ee4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 基层治理-难点堵点(耗时最长|设计部门最多|处理次数) * @@ -127,4 +124,8 @@ public class ScreenDifficultyDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventDataEntity.java similarity index 95% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventDataEntity.java index e666f852b0..ea8b52cd3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventDataEntity.java @@ -15,10 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; @@ -144,4 +143,8 @@ public class ScreenEventDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java similarity index 96% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java index fb0e81290b..8609b4f1b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 中央区-事件数据图片数据 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataEntity.java index d280785a6c..f60c612d9e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; /** * 基层治理-治理能力排行数据(按月统计) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java index fbeb83ba9a..e8d16e858d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; /** * 指数-指数数据(每月数值) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataYearlyEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataYearlyEntity.java index 259947010d..3c6b62b0e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataYearlyEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; /** * 指数-指数数据(按年统计) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenOrgRankDataEntity.java similarity index 93% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenOrgRankDataEntity.java index a732eda4b9..1c1a893327 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenOrgRankDataEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; /** * 党建引领-组织先进排行榜 @@ -109,4 +107,8 @@ public class ScreenOrgRankDataEntity extends BaseEpmetEntity { */ private BigDecimal satisfactionRatio; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyBranchDataEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyBranchDataEntity.java index cb870d2de7..34ecdac955 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyBranchDataEntity.java @@ -14,16 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyLinkMassesDataEntity.java similarity index 96% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyLinkMassesDataEntity.java index c663fc770b..0a8d768127 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyLinkMassesDataEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 党建引领-党员联系群众数据 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java similarity index 93% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java index 702e184439..4d70bf29ff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java @@ -15,16 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; - /** * 党建引领|基层治理-市民(党员)积分排行榜 * @@ -98,4 +95,8 @@ public class ScreenPartyUserRankDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java index b53561b229..a51b8b6449 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; /** * 党建引领-先锋模范数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java new file mode 100644 index 0000000000..3f38146cc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_public_parti_total_data") +public class ScreenPublicPartiTotalDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;网格:grid;部门:department; + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id,如果是网格,传入网格所属组织id + */ + private String parentId; + + /** + * 组织名称,也可能是网格名称 + */ + private String orgName; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 注册人数 + */ + private Integer regUserTotal; + + /** + * 参与人数 + */ + private Integer joinUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java index 8a2009d9ca..75668a1215 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java @@ -15,16 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +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; /** * 基层治理-公众参与 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java similarity index 86% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java index a58f257cc6..c41ef72cc3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java @@ -15,18 +15,15 @@ * along with this program. If not, see . */ -package com.epmet.entity.screen; +package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** - * 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * 中央区-各类(用户|党员|党群|话题|议题|项目)总数 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-21 @@ -98,14 +95,4 @@ public class ScreenUserTotalDataEntity extends BaseEpmetEntity { */ private Integer projectTotal; - /** - * 注册人数(08-21新增) - */ - private Integer regUserTotal; - - /** - * 参与人数(08-21新增) - */ - private Integer joinUserTotal; - } 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 new file mode 100644 index 0000000000..a49d1a1e13 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -0,0 +1,69 @@ +package com.epmet.eum; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + +/** + * 需要计算指标code枚举类 + * + * @author jianjun liu + * @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_JIAN_NENG_LI("dangjiannengli", "党建能力", 2), + ZHI_LI_NENG_LI("zhilinengli", "治理能力", 2), + FU_WU_NENG_LI("fuwunengli", "服务能力", 2), + + 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), + ; + + private String code; + private String name; + private Integer level; + + + IndexCodeEnum(String code, String name, Integer level) { + this.code = code; + this.name = name; + this.level = level; + } + + public static IndexCodeEnum getEnum(String code) { + IndexCodeEnum[] values = IndexCodeEnum.values(); + for (IndexCodeEnum 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-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 76f0897890..3fec1a9132 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 @@ -3,13 +3,16 @@ package com.epmet.model; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.UniqueIdGenerator; -import com.epmet.entity.screen.IndexDictEntity; -import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; -import com.epmet.entity.screen.IndexGroupTemplateEntity; -import com.epmet.service.screen.IndexDictService; -import com.epmet.service.screen.IndexGroupDetailTemplateService; -import com.epmet.service.screen.IndexGroupTemplateService; +import com.epmet.entity.evaluationindex.screen.IndexDictEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; +import com.epmet.service.evaluationindex.screen.IndexDictService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; +import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; +import com.epmet.support.normalizing.Correlation; +import com.epmet.util.Pinyin4jUtil; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -83,6 +86,23 @@ public class IndexExcelDataListener extends AnalysisEventListener { data.setWeight(preWheight); } LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + if (StringUtils.isNotBlank(data.getThreshold())) { + String threshold = data.getThreshold(); + if ("无".equals(data.getThreshold())) { + 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(); + } + data.setThreshold(threshold); + } + if (StringUtils.isNotBlank(data.getCorrelation())) { + if (Correlation.NEGATIVE.getDesc().equals(data.getCorrelation())) { + data.setCorrelation(Correlation.NEGATIVE.getCode()); + } else { + data.setCorrelation(Correlation.POSITIVE.getCode()); + } + } IndexDictEntity entity = new IndexDictEntity(); IndexDictEntity entity2 = new IndexDictEntity(); @@ -110,78 +130,114 @@ public class IndexExcelDataListener extends AnalysisEventListener { List collect = indexModelList.stream().sorted(Comparator.comparing(IndexModel::getLevel1Index)).collect(Collectors.toList()); collect.forEach(index -> { if (index.getLevel1Index().equals("党员相关")) { + IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); - String level1GroupId = UniqueIdGenerator.generate(); IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); if (group1 == null) { group1 = new IndexGroupTemplateEntity(); group1.setIndexId(indexDictEntity.getId()); group1.setParentIndexGroupId("0"); - group1.setId(level1GroupId); + group1.setId(UniqueIdGenerator.generate()); + group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), true, 4)); indexGroupMap.put(index.getLevel1Index(), group1); } - + StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); String level4Index = index.getLevel4Index(); indexDictEntity = indexDicMap.get(level4Index); - String level2GroupId = UniqueIdGenerator.generate(); - IndexGroupTemplateEntity group2 = indexGroupMap.get(level4Index); + String level4IndexDetailKey = index.getLevel1Index() + index.getLevel2Index() + level4Index; + IndexGroupTemplateEntity group2 = indexGroupMap.get(level4IndexDetailKey); IndexGroupDetailTemplateEntity templateEntity = null; if (group2 == null) { group2 = new IndexGroupTemplateEntity(); group2.setIndexId(indexDictEntity.getId()); - group2.setParentIndexGroupId(level1GroupId); - group2.setId(level2GroupId); - indexGroupMap.put(level4Index, group2); + group2.setParentIndexGroupId(group1.getId()); + group2.setId(UniqueIdGenerator.generate()); + group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + indexGroupMap.put(level4IndexDetailKey, group2); //构建 分组明细 - templateEntity = indexGroupDetailMap.get(level4Index); + templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + level4Index); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2); + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group1.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); + indexGroupDetailMap.put(index.getLevel1Index() + level4Index, templateEntity); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); - templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); + String level5IndexDetailKey = index.getLevel1Index() + index.getLevel2Index() + index.getLevel5Index(); + allIndexCodeSb.append(StrConstant.COLON); + allIndexCodeSb.append(group2.getIndexCode()); + templateEntity = indexGroupDetailMap.get(level5IndexDetailKey); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5); + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); + indexGroupDetailMap.put(level5IndexDetailKey, templateEntity); } } else { //todo 测试完去掉 //if ("街道相关".equals(index.getLevel1Index())) { IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); - String level1GroupId = UniqueIdGenerator.generate(); IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); if (group1 == null) { group1 = new IndexGroupTemplateEntity(); group1.setIndexId(indexDictEntity.getId()); group1.setParentIndexGroupId("0"); - group1.setId(level1GroupId); + group1.setId(UniqueIdGenerator.generate()); + group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); indexGroupMap.put(index.getLevel1Index(), group1); } - + StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); String level2Index = index.getLevel2Index(); indexDictEntity = indexDicMap.get(level2Index); - String level2GroupId = UniqueIdGenerator.generate(); - - IndexGroupTemplateEntity group2 = indexGroupMap.get(level2Index); + String level2IndexGroupKey = index.getLevel1Index() + level2Index; + IndexGroupTemplateEntity group2 = indexGroupMap.get(level2IndexGroupKey); IndexGroupDetailTemplateEntity templateEntity = null; if (group2 == null) { group2 = new IndexGroupTemplateEntity(); group2.setIndexId(indexDictEntity.getId()); - group2.setParentIndexGroupId(level1GroupId); - group2.setId(level2GroupId); - indexGroupMap.put(level2Index, group2); + group2.setParentIndexGroupId(group1.getId()); + group2.setId(UniqueIdGenerator.generate()); + group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + + indexGroupMap.put(level2IndexGroupKey, group2); //构建 分组明细 - templateEntity = indexGroupDetailMap.get(level2Index); + templateEntity = indexGroupDetailMap.get(level2IndexGroupKey); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2); + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); + indexGroupDetailMap.put(level2IndexGroupKey, templateEntity); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); - - templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); + allIndexCodeSb.append(StrConstant.COLON); + allIndexCodeSb.append(group2.getIndexCode()); + String level5IndexGroupKey = index.getLevel1Index() + index.getLevel2Index() + index.getLevel5Index(); + templateEntity = indexGroupDetailMap.get(level5IndexGroupKey); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5); + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); + indexGroupDetailMap.put(level5IndexGroupKey, templateEntity); } } //} @@ -190,55 +246,53 @@ public class IndexExcelDataListener extends AnalysisEventListener { LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values())); } - private void buildIndexGroupDetail(IndexDictEntity indexDictEntity, IndexModel index, String groupId, Integer level) { - IndexGroupDetailTemplateEntity templateEntity; - templateEntity = new IndexGroupDetailTemplateEntity(); - templateEntity.setIndexGroupId(groupId); - templateEntity.setIndexId(indexDictEntity.getId()); - + private void buildIndexGroupDetail(IndexGroupDetailTemplateEntity templateEntity, IndexDictEntity indexDictEntity, IndexModel index, Integer level) { if (level == 5) { + templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(index.getLevel5Index(), false, 4)); String level5WeightStr = index.getLevel5Weight().replace("%", ""); templateEntity.setWeight(new BigDecimal(level5WeightStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); - indexGroupDetailMap.put(index.getLevel5Index(), templateEntity); } else { - indexGroupDetailMap.put(indexDictEntity.getIndexName(), templateEntity); + templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); } - templateEntity.setId(UniqueIdGenerator.generate()); - if (StringUtils.isNotBlank(index.getThreshold())) { - String thresholdStr = index.getThreshold().replace("%", ""); - templateEntity.setThreshold(new BigDecimal(thresholdStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); - } + templateEntity.setThreshold(new BigDecimal(index.getThreshold())); + templateEntity.setCorrelation(index.getCorrelation()); } private void buildIndexDicEntity(IndexModel data, IndexDictEntity entity, IndexDictEntity entity2, IndexDictEntity entity3, IndexDictEntity entity4, IndexDictEntity entity5) { + if (!indexDicMap.containsKey(data.getLevel1Index())) { entity.setId(UniqueIdGenerator.generate()); entity.setIndexName(data.getLevel1Index()); + entity.setCorrelation(data.getCorrelation()); entity.setLevel("1"); indexDicMap.put(data.getLevel1Index(), entity); } if (!indexDicMap.containsKey(data.getLevel2Index())) { entity2.setId(UniqueIdGenerator.generate()); entity2.setIndexName(data.getLevel2Index()); + entity2.setCorrelation(data.getCorrelation()); entity2.setLevel("2"); indexDicMap.put(data.getLevel2Index(), entity2); } if (!indexDicMap.containsKey(data.getLevel3Index())) { entity3.setId(UniqueIdGenerator.generate()); entity3.setIndexName(data.getLevel3Index()); + entity3.setCorrelation(data.getCorrelation()); entity3.setLevel("3"); indexDicMap.put(data.getLevel3Index(), entity3); } if (!indexDicMap.containsKey(data.getLevel4Index())) { entity4.setId(UniqueIdGenerator.generate()); entity4.setIndexName(data.getLevel4Index()); + entity4.setCorrelation(data.getCorrelation()); entity4.setLevel("4"); indexDicMap.put(data.getLevel4Index(), entity4); } if (!indexDicMap.containsKey(data.getLevel5Index())) { entity5.setId(UniqueIdGenerator.generate()); entity5.setIndexName(data.getLevel5Index()); + entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); indexDicMap.put(data.getLevel5Index(), entity5); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java index f264a2c39e..77a0fd3138 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -21,6 +21,12 @@ public class IndexModel { private String weight; @ExcelProperty(value = "五级权重") private String level5Weight; + //没有阈值:无,有就是百分数 @ExcelProperty(value = "阈值") private String threshold; + /** + * 正相关:positive;负相关:negative + */ + @ExcelProperty(value = "相关性") + private String correlation; } 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/IndexCodeFieldReRedis.java new file mode 100644 index 0000000000..8a99d62890 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.Map; +import java.util.concurrent.TimeUnit; + +@Slf4j +@Component +public class IndexCodeFieldReRedis { + @Autowired + private RedisTemplate redisTemplate; + + + /** + * @Description 获取指标code和字段Id的关系 + */ + public Map getIndexCodeFiledReMap() { + HashOperations hashOperations = redisTemplate.opsForHash(); + Map values = hashOperations.entries(RedisKeys.getIndexCodeFieldReKey()); + return values; + } + + /** + * @Description 存入指标code和字段Id的关系 + */ + public void setIndexCodeFiledReMap(Map records) { + HashOperations hashOperations = redisTemplate.opsForHash(); + hashOperations.putAll(RedisKeys.getIndexCodeFieldReKey(), records); + redisTemplate.expire(RedisKeys.getIndexCodeFieldReKey(), 1, TimeUnit.DAYS); + } + + /** + * desc:删除指标字段关系缓存 + * @return + */ + public Boolean deleteIndexCodeFromRedis() { + return redisTemplate.delete(RedisKeys.getIndexCodeFieldReKey()); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/AgencyScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/AgencyScoreService.java new file mode 100644 index 0000000000..0805622937 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/AgencyScoreService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; + +import java.util.List; +import java.util.Map; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +public interface AgencyScoreService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AgencyScoreDTO + * @author generator + * @date 2020-09-02 + */ + AgencyScoreDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-02 + */ + void save(AgencyScoreDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-02 + */ + void update(AgencyScoreDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java new file mode 100644 index 0000000000..3cd66eccf5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcal; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + +/** + * 党员指标计算service + * + * @author liujianjun@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface CpcIndexCalculateService { + /** + * desc:计算党员相关指标 + * @param formDTO + * @return + */ + Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/DeptScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/DeptScoreService.java new file mode 100644 index 0000000000..afb6bc40bc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/DeptScoreService.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.service.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +public interface DeptScoreService extends BaseService { + /** + * @return java.lang.Boolean + * @param formDTO + * @author yinzuomei + * @description 区直部门,分值计算 + * @Date 2020/8/26 10:51 + **/ + Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO); +} \ 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 new file mode 100644 index 0000000000..a93697ce12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java @@ -0,0 +1,56 @@ +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.IndexInputVO; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 网格相关指标计算 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:34 + */ +public interface GridCorreLationService { + + /** + * @return java.lang.Boolean + * @param formDTO + * @author yinzuomei + * @description 网格相关,分值计算 + * @Date 2020/8/26 10:51 + **/ + Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO); + + /** + * @return java.util.List> + * @param formDTO + * @author yinzuomei + * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/27 14:48 + **/ + List> queryListPartyAblityGrid(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:48 + **/ + List pageGridList(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.HashMap + * @param indexMap + * @author yinzuomei + * @description 通用计算方法 + * @Date 2020/9/3 16:07 + **/ + HashMap calculate(Map> indexMap); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java new file mode 100644 index 0000000000..09d344dd47 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java @@ -0,0 +1,17 @@ +package com.epmet.service.evaluationindex.indexcal; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:33 上午 + */ +public interface IndexCalculateCommunityService { + + /** + * @Description 计算社区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 4:12 下午 + */ + Boolean calCommunityAll(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java new file mode 100644 index 0000000000..0e8ce09ccf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcal; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:03 上午 + */ +public interface IndexCalculateDistrictService { + + /** + * @Description 计算全区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + Boolean calDistrictAll(String customerId, String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java similarity index 55% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java index a43dcc2907..a1ab0ad1bf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java @@ -1,4 +1,4 @@ -package com.epmet.service.screen; +package com.epmet.service.evaluationindex.indexcal; import com.epmet.dto.screen.form.IndexCalculateForm; @@ -10,8 +10,9 @@ import com.epmet.dto.screen.form.IndexCalculateForm; */ public interface IndexCalculateService { /** - * desc:计算党员相关指标 + * desc:按照客户计算所有指标(按照月份) * @param formDTO + * @return */ - void cpcIndexCalculate(IndexCalculateForm formDTO); + Boolean indexCalculate(IndexCalculateForm formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java new file mode 100644 index 0000000000..c27b6db508 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcal; + +/** + * @Author zxc + * @DateTime 2020/9/2 3:11 下午 + */ +public interface IndexCalculateStreetService { + + /** + * @Description 计算街道相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + Boolean calStreetAll(String customerId, String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCodeFieldReService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCodeFieldReService.java new file mode 100644 index 0000000000..d2804d1dec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCodeFieldReService.java @@ -0,0 +1,24 @@ +package com.epmet.service.evaluationindex.indexcal; + +import java.util.Map; + +/** + * 党员指标计算service + * + * @author liujianjun@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface IndexCodeFieldReService { + /** + * desc:获取指标code对应的字段值 + * @return + */ + Map getIndexCodeFieldReMap(); + + /** + * desc:根据指标code获取 对应的字段 + * @param indexCode + * @return + */ + String getFieldNameByIndexCode(String indexCode); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/AgencyScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/AgencyScoreServiceImpl.java new file mode 100644 index 0000000000..17f56e6895 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/AgencyScoreServiceImpl.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import com.epmet.service.evaluationindex.indexcal.AgencyScoreService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class AgencyScoreServiceImpl extends BaseServiceImpl implements AgencyScoreService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AgencyScoreDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AgencyScoreDTO.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 AgencyScoreDTO get(String id) { + AgencyScoreEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AgencyScoreDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AgencyScoreDTO dto) { + AgencyScoreEntity entity = ConvertUtils.sourceToTarget(dto, AgencyScoreEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AgencyScoreDTO dto) { + AgencyScoreEntity entity = ConvertUtils.sourceToTarget(dto, AgencyScoreEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/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 new file mode 100644 index 0000000000..52cb4e3fc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -0,0 +1,348 @@ +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.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.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; +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.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +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.SampleValue; +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.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private IndexGroupDetailService getDetailListByParentCode; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private CpcScoreDao cpcScoreDao; + + @Override + public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { + calculatePartScore(formDTO); + calculateTotalScore(formDTO); + return true; + } + + /** + * desc: 计算总分 + * + * @param formDTO + */ + private void calculateTotalScore(CalculateCommonFormDTO formDTO) { + //获取指标权重 + List parentIndexDetails = getDetailListByParentCode.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("客户【党员相关】指标权重信息不存在"); + } + Map cpcScoreTotalMap = new HashMap<>(); + Map indexWeightMap = parentIndexDetails.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o)); + + //获取数据 + 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)); + } + }); + deleteAndInsertBatch(formDTO, cpcScoreTotalMap.values().stream().collect(Collectors.toList()), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + } + + /** + * @param formDTO + * @param indexCode + * @param stringObjectMap + * @return void + * @author yinzuomei + * @description 只有一条事实记录时,分值默认赋50 + * @Date 2020/9/2 14:35 + **/ + private CpcScoreEntity handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode, Map stringObjectMap) { + FactIndexPartyAblityCpcMonthlyEntity factCpc = JSON.parseObject(JSON.toJSONString(stringObjectMap), FactIndexPartyAblityCpcMonthlyEntity.class); + // 保存中间表 + CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); + cpcScoreEntity.setCustomerId(factCpc.getCustomerId()); + cpcScoreEntity.setAgencyId(factCpc.getAgencyId()); + cpcScoreEntity.setGridId(factCpc.getGridId()); + cpcScoreEntity.setYearId(factCpc.getYearId()); + cpcScoreEntity.setMonthId(factCpc.getMonthId()); + cpcScoreEntity.setUserId(factCpc.getUserId()); + cpcScoreEntity.setScore(new BigDecimal(NumConstant.FIFTY_STR)); + cpcScoreEntity.setIndexCode(indexCode); + cpcScoreEntity.setIsTotal(NumConstant.ZERO_STR); + return cpcScoreEntity; + } + + /** + * desc:根据客户id和月份Id 指标code 非必填 删除数据 + * + * @param formDTO + * @param indexCode 指标code 非必填 + * @param values + */ + private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection values, String indexCode) { + cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + cpcScoreDao.insertBatch(values); + } + + private void calculatePartScore(CalculateCommonFormDTO formDTO) { + //计算最大最小值 + Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.error("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); + throw new RenException("指标原始数据记录不存在"); + } + //指标集合 + Map> groupIndexDetailsMap = getIndexDetailMap(formDTO); + if (groupIndexDetailsMap == null) { + log.error("calculatePartScore"); + return; + } + + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_THOUSAND; + //分页查询 要计算的原始数据 + List> list = null; + 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); + } + } + } + pageNo++; + } while (!CollectionUtils.isEmpty(list) && list.size() == pageSize); + } + + /** + * desc:计算并保存中间结果 + * + * @param formDTO + * @param indexDetailList + * @param finalList + * @param minAndMaxMap + * @param parentIndexCode remark:1.遍历指标和原始数据;2.构建指标归一算法计算器,计算分值;3.将分值保存到中间表 + */ + private void calculateScore(CalculateCommonFormDTO formDTO, List indexDetailList, List> finalList, Map minAndMaxMap, String parentIndexCode) { + Map> indexMap = buildIndexInputVO(indexDetailList, minAndMaxMap); + Map scoreEntityMap = new HashMap<>(); + //遍历指标 进行计算 + for (Map.Entry> entry : indexMap.entrySet()) { + String indexCode = entry.getKey(); + IndexInputVO value = entry.getValue(); + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); + if (StringUtils.isBlank(fieldName)) { + log.error("calculateScore indexCode:{} get fieldName return blank", indexCode); + continue; + } + + for (Map cpcCount : finalList) { + //对应的数值 + String userId = String.valueOf(cpcCount.get(IndexCalConstant.USER_ID)); + BigDecimal sampleValue = new BigDecimal(String.valueOf(cpcCount.get(fieldName))); + + CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); + cpcScoreEntity.setYearId(String.valueOf(cpcCount.get(IndexCalConstant.YEAR_ID))); + cpcScoreEntity.setCustomerId(formDTO.getCustomerId()); + cpcScoreEntity.setAgencyId(String.valueOf(cpcCount.get(IndexCalConstant.AGENCY_ID))); + cpcScoreEntity.setGridId(String.valueOf(cpcCount.get(IndexCalConstant.GRID_ID))); + cpcScoreEntity.setUserId(userId); + cpcScoreEntity.setIsTotal(NumConstant.ZERO_STR); + cpcScoreEntity.setMonthId(formDTO.getMonthId()); + cpcScoreEntity.setScore(new BigDecimal(0)); + cpcScoreEntity.setIndexCode(parentIndexCode); + + scoreEntityMap.put(userId, cpcScoreEntity); + + //构造样本值对象 + SampleValue currentUserIndexValue = new SampleValue(userId, sampleValue); + value.getIndexValueVOs().add(currentUserIndexValue); + } + } + log.info("计算的参数:{}", JSON.toJSONString(indexMap)); + HashMap result = calculateScore(indexMap); + log.info("计算的结果:{}", result); + + //处理结果 + if (CollectionUtils.isEmpty(result)) { + log.error("calculateScore calculateScore return empty"); + return; + } + saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); + } + + /** + * desc:保存分值 到中间表 + * + * @param formDTO + * @param indexDetails + * @param parentIndexCode + * @param result + */ + @Transactional(rollbackFor = Exception.class) + public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { + + List list = new ArrayList<>(); + result.forEach((userId, score) -> { + CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); + cpcScoreEntity.setScore(score); + list.add(cpcScoreEntity); + }); + this.deleteAndInsertBatch(formDTO, list, parentIndexCode); + } + + + /** + * desc:构建分值计算器 + * + * @param indexList 指标集合 + * @param minAndMaxMap 最大值最小值集合 + * @return java.util.Map + * @author yinzuomei + * @description + * @Date 2020/8/30 15:56 + **/ + private Map> buildIndexInputVO(List indexList, Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (IndexGroupDetailEntity index : indexList) { + BigDecimal minValue = null; + BigDecimal maxValue = null; + + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + if (StringUtils.isBlank(fieldName)) { + continue; + } + //最小值key + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + //最大值key + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + 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 = index.getThreshold(); + } + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); + map.put(index.getIndexCode(), indexInputVO); + } + return map; + } + + /** + * desc:调用计算器计算每个人的分数值 + * + * @param indexMap + * @return + */ + private HashMap calculateScore(Map> indexMap) { + //构造入参 + List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + } + + + /** + * desc:构建党员相关4级指标明细map + * + * @param formDTO + * @return + */ + private Map> getIndexDetailMap(CalculateCommonFormDTO formDTO) { + //获取指标权重信息 -参与议事 + List canyuyishiIndexDetails = getDetailListByParentCode.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()); + 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()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return null; + } + + Map> groupIndexDetailsMap = new HashMap<>(); + groupIndexDetailsMap.put(IndexCodeEnum.CAN_YU_YI_SHI.getCode(), canyuyishiIndexDetails); + groupIndexDetailsMap.put(IndexCodeEnum.DANG_WU_HUO_DONG.getCode(), dangwuhongdongIndexDetails); + groupIndexDetailsMap.put(IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode(), lianxiqunzhongIndexDetails); + return groupIndexDetailsMap; + } +} 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 new file mode 100644 index 0000000000..959f3caa64 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -0,0 +1,262 @@ +/** + * 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.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.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.DeptScoreService; +import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +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.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; +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.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Slf4j +@Service +public class DeptScoreServiceImpl extends BaseServiceImpl implements DeptScoreService { + @Autowired + private IndexGroupDetailService getDetailListByParentCode; + @Autowired + private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private GridCorreLationService gridCorreLationService; + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + @Autowired + private DeptScoreDao deptScoreDao; + + /** + * @param formDTO + * @return java.lang.Boolean + * @author yinzuomei + * @description 区直部门,分值计算 + * @Date 2020/8/26 10:51 + **/ + @Override + public Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO) { + //获取指标权重 + List indexGroupDetailEntityList = getDetailListByParentCode.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.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; + } + + //2、计算最大最小值 + Map minAndMaxMap = factIndexGovrnAblityDeptMonthlyDao.selectExtremeValue(formDTO); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.warn("calculateDeptCorreLation getExtremeValue customerId:{} fact_index_govrn_ablity_dept_monthly have not any fact record", formDTO.getCustomerId()); + throw new RenException("【区直部门:治理能力】指标原始数据记录不存在"); + } + //3、构造入参 指标集合 + Map> indexMap = buildDeptCorrelationIndexInputVO(indexGroupDetailEntityList, minAndMaxMap); + //4、分批计算 + int pageNo = NumConstant.ONE; + int pageSize = IndexCalConstant.PAGE_SIZE; + //分页查询 要计算的原始数据 + List> list = null; + do { + list = factIndexGovrnAblityDeptMonthlyDao.selectListByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + if (!CollectionUtils.isEmpty(list)) { + //遍历指标分组 计算分数 + List> crrentFactRecordList = list; + calculateScore(formDTO,indexMap,crrentFactRecordList); + } + } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); + return true; + } + + /** + * @return void + * @param formDTO + * @param indexMap + * @author yinzuomei + * @description 计算分值并保存结果 + * @Date 2020/9/3 11:14 + **/ + private void calculateScore(CalculateCommonFormDTO formDTO, Map> indexMap,List> recordList) { + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, indexInputVO) -> { + if (StringUtils.isNotBlank(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); + + } + }); + + }); + HashMap resultMap = gridCorreLationService.calculate(indexMap); + //保存中间表记录 + this.saveDeptScoreEntity(formDTO,resultMap); + } + + /** + * @return void + * @param formDTO + * @param resultMap + * @author yinzuomei + * @description fact_index_dept_score + * @Date 2020/9/3 16:11 + **/ + @Transactional(rollbackFor = Exception.class) + public void saveDeptScoreEntity(CalculateCommonFormDTO formDTO, HashMap resultMap) { + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + resultMap.forEach((deptId, governAblityScore) -> { + DeptScoreEntity deptScoreEntity = new DeptScoreEntity(); + deptScoreEntity.setCustomerId(formDTO.getCustomerId()); + deptScoreEntity.setDeptId(deptId); + deptScoreEntity.setIsTotal(NumConstant.ZERO_STR); + deptScoreEntity.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + ScreenCustomerDeptEntity deptEntity = screenCustomerDeptDao.selectParentAgencyId(formDTO.getCustomerId(), deptId); + if (null != deptEntity) { + if(StringUtils.isNotBlank(deptEntity.getParentAgencyId())){ + deptScoreEntity.setAgencyId(deptEntity.getParentAgencyId()); + } + } + deptScoreEntity.setQuarterId(quarterId); + deptScoreEntity.setYearId(yearId); + deptScoreEntity.setMonthId(formDTO.getMonthId()); + deptScoreEntity.setScore(governAblityScore); + deptScoreDao.deleteByDeptIdAndMonthId(formDTO.getCustomerId(),formDTO.getMonthId(),deptId); + deptScoreDao.insert(deptScoreEntity); + }); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description + * @Date 2020/9/3 9:35 + **/ + private void handleOneGridScene(CalculateCommonFormDTO formDTO) { + FactIndexGovrnAblityDeptMonthlyEntity entity = factIndexGovrnAblityDeptMonthlyDao.selectOneRecord(formDTO.getCustomerId(), formDTO.getMonthId()); + HashMap resultMap = new HashMap<>(); + resultMap.put(entity.getDeptId(), new BigDecimal(NumConstant.FIFTY_STR)); + this.saveDeptScoreEntity(formDTO, resultMap); + } + + /** + * @param indexList + * @param minAndMaxMap + * @return java.util.Map> + * @author yinzuomei + * @description + * @Date 2020/9/3 9:31 + **/ + private Map> buildDeptCorrelationIndexInputVO(List indexList, + Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (IndexGroupDetailEntity index : indexList) { + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + if (StringUtils.isBlank(fieldName)) { + log.error("index_code:{} not find field_name", index.getIndexCode()); + continue; + } + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + BigDecimal minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + BigDecimal maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + //有阈值,且最大值>阈值,则最大值赋值为阈值 + if (new BigDecimal(NumConstant.ONE_NEG_STR).compareTo(index.getThreshold()) != NumConstant.ZERO + && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) { + maxValue = index.getThreshold(); + } + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + List> sampleValueList = new ArrayList<>(); + IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + sampleValueList, + index.getThreshold(), +// new BigDecimal("-1"), //FOR TEST + index.getWeight(), + scoreCalculator); + map.put(index.getIndexCode(), indexInputVO1); + } + return map; + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..abbe326a81 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -0,0 +1,751 @@ +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.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.CpcScoreDao; +import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.indexcal.*; +import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +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 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.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 网格相关service + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:35 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class GridCorreLationServiceImpl implements GridCorreLationService { + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private CpcScoreDao cpcScoreDao; + @Autowired + private GridScoreDao gridScoreDao; + + + /** + * @param formDTO + * @return java.lang.Boolean + * @author yinzuomei + * @description 网格相关,分值计算 + * @Date 2020/8/26 10:51 + **/ + @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); + //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); + //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); + //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; + } + + /** + * @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) { + //查询总记录数 + 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); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,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()); + return; + } + //指标集合 + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListPartyAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + log.info("index_code :{}",key); + if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { + //组织内党员的联系群众能力考评分(平均值) +// log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); + //网格内党员的联系群众能力考评分(平均值) + String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); + BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); + value.getIndexValueVOs().add(contactMassesAblityValue); + }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } + }); + }); + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); + } + // 保存中间表 + saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), NumConstant.ZERO_STR); + } + + /** + * @param formDTO + * @param indexCode + * @return void + * @author yinzuomei + * @description 只有一条事实记录时,分值默认赋50 + * @Date 2020/9/2 14:35 + **/ + private void handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode) { + List> resultMapList = new ArrayList<>(); + HashMap resultMap = new HashMap<>(); + String gridId =null; + if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexPartyAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } else if (IndexCodeEnum.ZHI_LI_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexGovrnAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } else if (IndexCodeEnum.FU_WU_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexServiceAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } + resultMap.put(gridId, new BigDecimal(NumConstant.FIFTY_STR)); + resultMapList.add(resultMap); + // 保存中间表 + saveGridCorreLationResult(formDTO, resultMapList, indexCode, NumConstant.ZERO_STR); + } + + /** + * @param calculateCommonFormDTO + * @return java.util.Map + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 + * @Date 2020/8/31 9:51 + **/ + private Map getContactMassesAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { + Map map = new HashMap<>(); + List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); + if (!CollectionUtils.isEmpty(list)) { + BigDecimal minValue = Collections.min(list); + BigDecimal maxValue = Collections.max(list); + map.put(StrConstant.MIN, minValue); + map.put(StrConstant.MAX, maxValue); + return map; + } + map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + //FOR TEST + /*map.put(StrConstant.MIN, new BigDecimal("24.35")); + map.put(StrConstant.MAX, new BigDecimal("46.13"));*/ + return map; + } + + /** + * @param calculateCommonFormDTO + * @param gridId 网格id + * @return java.math.BigDecimal + * @author yinzuomei + * @description 获取网格(组织)内党员的联系群众能力考评分(平均值) + * @Date 2020/8/31 9:50 + **/ + private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { + BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + if (null == result) { + return new BigDecimal(NumConstant.ZERO_STR); + } + //FOR TEST + /*BigDecimal result=null; + if(IndexCalConstant.S1_C1_G1.equals(gridId)){ + result= new BigDecimal("24.43"); + }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ + result=new BigDecimal("46.13"); + }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ + result=new BigDecimal("24.35"); + }*/ + return result; + } + + /** + * @param formDTO + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 组织内党员的参与议事能力考评分(平均值) + * @Date 2020/8/31 15:51 + **/ + private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { + BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + if (null == result) { + return new BigDecimal(NumConstant.ZERO_STR); + } + //FOR TEST + /*BigDecimal result=null; + if(IndexCalConstant.S1_C1_G1.equals(gridId)){ + result= new BigDecimal("29.40"); + }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ + result=new BigDecimal("18.30"); + }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ + result=new BigDecimal("9.15"); + }*/ + return result; + } + + /** + * @param calculateCommonFormDTO + * @return java.util.Map + * @author yinzuomei + * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 + * @Date 2020/8/31 14:41 + **/ + private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { + Map map = new HashMap<>(); + List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); + if (!CollectionUtils.isEmpty(list)) { + BigDecimal minValue = Collections.min(list); + BigDecimal maxValue = Collections.max(list); + map.put(StrConstant.MIN, minValue); + map.put(StrConstant.MAX, maxValue); + return map; + } + map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + // FOR TEST + /*map.put(StrConstant.MIN, new BigDecimal("9.15")); + map.put(StrConstant.MAX, new BigDecimal("29.4"));*/ + return map; + } + + /** + * @param formDTO 客户id 月份id: yyyyMM + * @param resultMapList + * @param indexCode 指标编码: 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + * @param isTotal 1:总分;0不是 + * @return void + * @author yinzuomei + * @description 保存网格相关三大能力值 + * @Date 2020/8/30 22:50 + **/ + private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO, + 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); + GridScoreEntity gridScoreEntity = new GridScoreEntity(); + gridScoreEntity.setCustomerId(formDTO.getCustomerId()); + gridScoreEntity.setGridId(gridId); + gridScoreEntity.setIsTotal(isTotal); + gridScoreEntity.setIndexCode(indexCode); + ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId); + if (null != screenCustomerGridDTO) { + if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){ + gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); + } + if(StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())){ + gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); + } + } + gridScoreEntity.setQuarterId(quarterId); + gridScoreEntity.setYearId(yearId); + gridScoreEntity.setMonthId(formDTO.getMonthId()); + gridScoreEntity.setScore(partyAblityScore); + gridScoreEntityList.add(gridScoreEntity); + }); + } + if (!CollectionUtils.isEmpty(gridScoreEntityList)) { + gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, isTotal); + gridScoreDao.insertBatches(gridScoreEntityList); + } + } + + /** + * @param indexMap + * @return java.util.List + * @author yinzuomei + * @description 调用计算器计算每个指标下,各个网格的总分 + * @Date 2020/8/30 21:40 + **/ + @Override + 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)); + + HashMap resultMap = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + log.info("计算的结果{}", resultMap); + return resultMap; + } + + /** + * @param indexMap + * @return java.util.List + * @author yinzuomei + * @description map遍历,转为List + * @Date 2020/8/30 18:34 + **/ + private List getIndexInputVOList(Map> indexMap) { + List list = new ArrayList<>(); + //遍历所有的指标 + indexMap.forEach((key, indexInputVO) -> { + list.add(indexInputVO); + }); + return list; + } + + + /** + * @param indexList 指标集合 + * @param minAndMaxMap 最大值最小值集合 + * @return java.util.Map + * @author yinzuomei + * @description 构造网格相关 指标计算参数 + * @Date 2020/8/30 15:56 + **/ + private Map> buildGridCorrelationIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (IndexGroupDetailEntity index : indexList) { + BigDecimal minValue = null; + BigDecimal maxValue = null; + if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { + //组织内党员的联系群众能力考评分(平均值) 获取最大值,最小值 +// log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); + Map contactMassesAblityMap = this.getContactMassesAblityMap(formDTO); + minValue = contactMassesAblityMap.get(StrConstant.MIN); + maxValue = contactMassesAblityMap.get(StrConstant.MAX); + } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())) { +// log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); + Map joinIssueAblityMap = this.getJoinIssueAblityMap(formDTO); + minValue = joinIssueAblityMap.get(StrConstant.MIN); + maxValue = joinIssueAblityMap.get(StrConstant.MAX); + } else { + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + if (StringUtils.isBlank(fieldName)) { + log.error("index_code:{} not find field_name",index.getIndexCode()); + continue; + } +// log.info("index_code2:{} ,field_name:{}",index.getIndexCode(),fieldName); + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + } + //有阈值,且最大值>阈值,则最大值赋值为阈值 + if (new BigDecimal(NumConstant.ONE_NEG_STR).compareTo(index.getThreshold()) != NumConstant.ZERO + && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) { + maxValue = index.getThreshold(); + } + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + List> sampleValueList = new ArrayList<>(); + IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + sampleValueList, + index.getThreshold(), +// new BigDecimal("-1"),//FOR TEST + index.getWeight(), + scoreCalculator); + map.put(index.getIndexCode(), indexInputVO1); + } + return map; + } + + /** + * @param formDTO + * @param indexList + * @return void + * @author yinzuomei + * @description 计算网格相关-治理能力 + * @Date 2020/8/26 16:47 + **/ + private void calculateGridZhiLi(CalculateCommonFormDTO formDTO, List indexList) { + //查询总记录数 + 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); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,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()); + return; + } + //指标集合 + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListGovrnAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { +// log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); + String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); + BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); + value.getIndexValueVOs().add(contactMassesAblityValue); + }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } + }); + }); + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); + } + // 保存中间表 + 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) { + //查询总记录数 + 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); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,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()); + return; + } + //指标集合 + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListServiceAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + 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"); + } + }); + }); + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); + } + // 保存中间表 + 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) { + //查询总记录数 + 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("客户一级指标分值记录不存在"); + } + 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.setScore(BigDecimal.ZERO); + if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { + log.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); + continue; + } + for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) { + BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); + gridScoreEntity.setScore(gridScoreEntity.getScore().add(indexScore)); + } + gridScoreEntityList.add(gridScoreEntity); + } + if (!CollectionUtils.isEmpty(gridScoreEntityList)) { + gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, NumConstant.ONE_STR); + gridScoreDao.insertBatches(gridScoreEntityList); + } + } + + /** + * @param customerId + * @return com.epmet.dto.indexcal.CustomerGridInfoDTO + * @author yinzuomei + * @description 查询客户下网格信息 + * @Date 2020/8/26 15:37 + **/ + public CustomerGridInfoDTO queryCustomerGridInfo(String customerId) { + CustomerGridInfoDTO customerGridInfoDTO = new CustomerGridInfoDTO(); + customerGridInfoDTO.setTotal(screenCustomerGridDao.selectCountByCustomerId(customerId)); + customerGridInfoDTO.setGridList(screenCustomerGridDao.selectListByCustomerId(customerId)); + return customerGridInfoDTO; + } + + /** + * @param formDTO + * @return + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:42 + **/ + @Override + public List pageGridList(PageQueryGridFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageIndex(pageIndex); + return screenCustomerGridDao.pageListByCustomerId(formDTO); + } + + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/26 15:52 + **/ + @Override + public List> queryListPartyAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexPartyAblityGridMonthlyDao.selectListPartyAblityGrid(formDTO); + } + + /*网格群众用户数 + 网格党员用户数 + 网格活跃群众用户数 + 网格活跃党员用户数 + 网格党员人均提出话题数 + 网格群众人均提出话题数 + 网格党员人均提出的议题转项目数 + 网格群众人均提出的议题转项目数 + 建群党员数 + 组织内党员的联系群众能力考评分(平均值) + 网格的发文数量 + 网格议题转项目率 + 组织“三会一课”次数 + 党员参加“三会一课”人次*/ + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 查询党建能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:47 + **/ + public Map queryPartyAblityGridMinAndMax(String customerId, String monthId) { + return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId, monthId); + } + + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:55 + **/ + public List> queryListGovrnAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexGovrnAblityGridMonthlyDao.selectListGovrnAblityGrid(formDTO); + } + + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 查询治理能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:48 + **/ + public Map queryGovrnAblityGridMinAndMax(String customerId, String monthId) { + return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(customerId, monthId); + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的服务能力相关五级指标 + * @Date 2020/8/26 15:55 + **/ + public List> queryListServiceAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexServiceAblityGridMonthlyDao.selectListServiceAblityGrid(formDTO); + } + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:50 + **/ + public Map queryServiceAblityGridMinAndMax(String customerId, String monthId) { + return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(customerId, monthId); + } + + +} 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 new file mode 100644 index 0000000000..f25e27deb6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -0,0 +1,456 @@ +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.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +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.screen.FactIndexCommunityScoreDTO; +import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.dto.screen.result.SubGridAvgResultDTO; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +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.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:34 上午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommunityService { + + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + @Autowired + private FactIndexGridScoreDao factIndexGridScoreDao; + + /** + * @param customerId + * @Description 社区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean communityPartyCalculate(String customerId, String monthId) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + 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) { + 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 index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 社区名义发文数量 + 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); + return; + }else if (publishArticleCountList.size() > NumConstant.ONE) { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach( publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + 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); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 社区治理能力 + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean communityGovernAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + 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) { + 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()); + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + 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) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + 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())); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + 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); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 社区服务能力 + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean communityServiceAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + 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) { + 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()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + 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) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); + communityActivityList.forEach(communityActivity -> { + 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()); + 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); + indexInputVOS.add(index1VO); + }); + } + } + }); + 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); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 社区相关计算 + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + public Boolean communityRelate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfo(customerId, monthId); + detailListByParentCode.forEach(detail -> { + factIndexCommunityScoreEntities.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = factIndexCommunityScoreEntities.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); + 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 ......"); + } + return true; + } + + /** + * @param list + * @Description BigDecimal类型获取最大数和最小数 + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @param customerId + * @param monthId + * @param indexCode + * @param subAllGridList + * @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); + } + } + + /** + * @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<>(); + scoreCountOfSampleId.forEach((k, v) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); + result.add(score); + }); + 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 new file mode 100644 index 0000000000..9baa63df36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -0,0 +1,405 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.druid.util.StringUtils; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateDistrictService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +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.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:03 上午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrictService { + + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private AgencyScoreDao agencyScoreDao; + @Autowired + private DeptScoreDao deptScoreDao; + + /** + * @Description 计算全区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + @Override + public Boolean calDistrictAll(String customerId, String monthId) { + Boolean aBoolean = districtPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate district-party-ability failure ......"); + } + Boolean bBoolean = districtGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate district-govern-ability failure ......"); + } + Boolean cBoolean = districtServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate district-service-ability failure ......"); + } + Boolean dBoolean = districtRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate district-all insert failure ......"); + } + return true; + } + + /** + * @param customerId + * @Description 全区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean districtPartyCalculate(String customerId, String monthId) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexDetailList)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + 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) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); + subPartyAvgList.forEach( party -> { + List index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + pid.put(c.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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 区名义发文数量 + 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())); + 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) { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach( publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), 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); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 全区治理能力 + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean districtGovernAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + 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) { + 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()); + 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); + 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) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(deptScoreAvgList, 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()); + 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); + indexInputVOS.add(index1VO); + }); + } + }else{ + // TODO 治理能力暂无自身级别 + } + }); + 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); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 全区服务能力 + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean districtServiceAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + 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) { + 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()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + // todo 暂时没有自身级别 + } + }); + 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); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 区相关计算 + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + public Boolean districtRelate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfo(customerId, monthId, IndexCalConstant.DISTRICT_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + 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); + return true; + } + + /** + * @param list + * @Description BigDecimal类型获取最大数和最小数 + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @param customerId + * @param monthId + * @param indexCode + * @param subAllDistrict + * @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); + } + } + + /** + * @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<>(); + scoreCountOfSampleId.forEach((k, v) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); + result.add(score); + }); + 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 new file mode 100644 index 0000000000..9385c1f121 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -0,0 +1,130 @@ +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.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.DataSourceConstant; +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.service.evaluationindex.indexcal.*; +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.Date; +import java.util.List; + +/** + * @author liujianjun + * 指标计算service + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateServiceImpl implements IndexCalculateService { + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private GridCorreLationService gridCorreLationService; + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; + @Autowired + private IndexCodeFieldReRedis indexCodeFieldReRedis; + @Autowired + private IndexCalculateCommunityService indexCalculateCommunityService; + @Autowired + private IndexCalculateStreetService indexCalculateStreetService; + @Autowired + private IndexCalculateDistrictService indexCalculateDistrictService; + @Autowired + private DeptScoreService deptScoreService; + + @Override + public Boolean indexCalculate(IndexCalculateForm formDTO) { + try { + if (StringUtils.isBlank(formDTO.getMonthId())) { + //默认 当前月份-1 + formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); + } + //按照客户分组 + if (CollectionUtils.isEmpty(formDTO.getCustomerIds())) { + Result> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); + if (!externalCustomerIdsResult.success()) { + log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); + return false; + } + formDTO.setCustomerIds(externalCustomerIdsResult.getData()); + } + Boolean flag = false; + for (String customerId : formDTO.getCustomerIds()) { + CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); + //计算党员相关的 + try { + CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); + flag = cpcIndexCalculateService.cpcIndexCalculate(param); + log.info("indexCalculate cpcIndexCalculate return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate cpcIndexCalculate exception", e); + break; + } + + //计算网格 + try { + flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); + log.info("indexCalculate calculateGridCorreLation return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calculateGridCorreLation exception", e); + break; + } + //计算社区 + try { + indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + + //计算街道 + try { + indexCalculateStreetService.calStreetAll(customerId,formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + + //计算区直属 + try { + deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + + //计算全区 + try { + indexCalculateDistrictService.calDistrictAll(customerId,formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + } + return flag; + } catch (Exception e) { + log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); + } finally { + //清除缓存 + indexCodeFieldReRedis.deleteIndexCodeFromRedis(); + } + 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 new file mode 100644 index 0000000000..e18de69bb2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -0,0 +1,448 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.druid.util.StringUtils; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +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.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; +import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateStreetService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +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.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/2 3:11 下午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetService { + + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private FactIndexCommunityScoreDao communityScoreDao; + @Autowired + private AgencyScoreDao agencyScoreDao; + + /** + * @Description 计算街道相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + @Override + public Boolean calStreetAll(String customerId, String monthId) { + Boolean aBoolean = streetPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate street-party-ability failure ......"); + } + Boolean bBoolean = streetGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate street-govern-ability failure ......"); + } + Boolean cBoolean = streetServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate street-service-ability failure ......"); + } + Boolean dBoolean = streetRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate street-all insert failure ......"); + } + return true; + } + + /** + * @param customerId + * @Description 社区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean streetPartyCalculate(String customerId, String monthId) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + 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) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexEnd = NumConstant.TEN; + List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); + partition.forEach(publish -> { + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 街道名义发文数量 + 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); + return; + }else if (mapList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); + List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), 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); + return true; + } + + /** + * @Description 街道治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean streetGovernAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + 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) { + 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()); + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + 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) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + 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()); + 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); + 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); + return true; + } + + /** + * @Description 街道服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean streetServiceAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + 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) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subCommServiceAvg, 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()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + 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) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); + communityActivityList.forEach(communityActivity -> { + 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()); + 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); + 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); + return true; + } + + /** + * @Description 街道相关计算 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/3 9:21 上午 + */ + public Boolean streetRelate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfo(customerId, monthId, IndexCalConstant.STREET_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + score.setDataType(IndexCalConstant.STREET_LEVEL); + 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); + return true; + } + + /** + * @param list + * @Description BigDecimal类型获取最大数和最小数 + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @param customerId + * @param monthId + * @param indexCode + * @param subAllCommunityList + * @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); + } + } + + /** + * @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<>(); + scoreCountOfSampleId.forEach((k, v) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); + result.add(score); + }); + 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 new file mode 100644 index 0000000000..3e89bee003 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -0,0 +1,56 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +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.service.evaluationindex.indexcal.IndexCodeFieldReService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { + @Autowired + private IndexCodeFieldReDao indexCodeFieldReDao; + + @Autowired + private IndexCodeFieldReRedis indexCodeFieldReRedis; + + @Override + public Map getIndexCodeFieldReMap() { + Map indexCodeFiledReMap = indexCodeFieldReRedis.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); + } + return indexCodeFiledReMap; + } + + @Override + public String getFieldNameByIndexCode(String indexCode) { + Map indexCodeFieldReMap = this.getIndexCodeFieldReMap(); + if (CollectionUtils.isEmpty(indexCodeFieldReMap)) { + return null; + } + String fieldName = indexCodeFieldReMap.get(indexCode); + if (StringUtils.isEmpty(fieldName)){ + log.error("indexCode:{} 在index_code_re表中不存在记录",indexCode); + } + return fieldName; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java similarity index 87% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java index c9d876996b..e88e5d55a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java @@ -1,4 +1,4 @@ -package com.epmet.service.indexcollect; +package com.epmet.service.evaluationindex.indexcoll; import com.epmet.dto.indexcollect.form.*; @@ -22,7 +22,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridPartyMemberData(List formDTO, String customerId); + void insertGridPartyMemberData(GridPartyMemberDataFormDTO formDTO, String customerId); /** * 2、党建能力-网格相关指标上报(按照月份) @@ -107,4 +107,14 @@ public interface FactIndexCollectService { * @Date 10:52 2020-08-20 **/ void insertDeptGovrnAbility(List formDTO, String customerId); + + /** + * 将网格、社区、区直部门、区/街道分支记录表中的数据,抽取到 指数-指数数据(每月数值) 指数-指数数据(按年统计) + * @param monthId 2020-8 + * @param customerId + * @return void + * @Author zhangyong + * @Date 10:29 2020-09-03 + **/ + void insertScreenIndexDataMonthlyAndYearly(String monthId, 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 new file mode 100644 index 0000000000..2d6a2c48ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -0,0 +1,910 @@ +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.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.*; +import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.DeptScoreDTO; +import com.epmet.dto.indexcollect.form.*; +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; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Auther: zhangyong + * @Date: 2020-08-20 10:05 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexCollectServiceImpl implements FactIndexCollectService { + private static final Logger log = LoggerFactory.getLogger(FactIndexCollectServiceImpl.class); + + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; + @Autowired + private FactIndexGridScoreDao factIndexGridScoreDao; + @Autowired + private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + @Autowired + private DeptScoreDao deptScoreDao; + @Autowired + private AgencyScoreDao agencyScoreDaol; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridPartyMemberData(GridPartyMemberDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + //删除这个客户这个月的数据 + int deleteNum; + do { + deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getPartyMemberDataList())) { + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getPartyMemberDataList(), 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); + } + } + + @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); + } + } + + @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); + } + } + + @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); + } + } + + @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); + } + } + + @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); + } + } + + @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); + } + } + + @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.startHandleIndexGridScore(monthId, customerId); + // 开始处理 社区相关分值表 + this.startHandleIndexCommunityScore(monthId, customerId); + // 开始处理 区直部门分值表 + this.startHandleIndexDeptScore(monthId, customerId); + // 开始处理 区/街道相关分数表 + this.startHandleIndexAgencyScore(monthId, customerId); + + // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly + this.insertIndexDataYear(monthId, customerId); + } + + /** + * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,在插入网格相关分值表。 一对四 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexGridScore(String monthId, String customerId){ + // 查询网格相关分值记录 表已经存在的网格id + List indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); + if (indexGridIds.size() > NumConstant.ZERO){ + // 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询。 + String[] gridIds = new String[indexGridIds.size()]; + for (int i = NumConstant.ZERO; i < indexGridIds.size(); i++){ + gridIds[i] = indexGridIds.get(i); + } + // 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 + List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); + // 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 + if (mismatchGridList.size() > NumConstant.ZERO){ + this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); + } + } else { + // 将所有的网格按照 4种类型,各赋一遍默认值 + List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); + this.insertIndexGridScoreDefaultValue(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 insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 + Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); + // 查询网格的 上级组织id 和 组织名称 + List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); + 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++){ + if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())){ + // 是总分 + if (IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode().equals(gridScore.getValue().get(i).getIndexCode())){ + // 总指数 = 网格相关 + monthlyFormDTO.setIndexTotal(gridScore.getValue().get(i).getScore()); + } + } else { + // 赋实际值 党建能力、治理能力、服务能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(gridScore.getValue().get(i).getIndexCode(), + gridScore.getValue().get(i).getScore(), + monthlyFormDTO); + } + } + // 匹配网格的 上级组织id 和 组织名称 + String parentAgencyId = ""; + String gridName = ""; + for (ScreenCustomerGridDTO gridDTO : parentGridList){ + if (gridScore.getKey().equals(gridDTO.getGridId())){ + parentAgencyId = gridDTO.getParentAgencyId(); + gridName = gridDTO.getGridName(); + } + } + if ("".equals(parentAgencyId)){ + throw new RuntimeException("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey()); + } + // 补充表中其他字段 + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScore.getKey(), + parentAgencyId, gridName, monthlyFormDTO); + 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 + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexCommunityScore(String monthId, String customerId){ + // 查询社区相关分值记录id + List indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); + if (indexCommunityIds.size() > NumConstant.ZERO){ + // 根据社区相关分值表 中查询到的社区id,去 组织机构信息 进行不匹配查询。 + String[] communityIds = new String[indexCommunityIds.size()]; + 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); + } + } else { + // 将所有的社区按照 4种类型,各赋一遍默认值 + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + this.insertIndexCommunityScoreDefaultValue(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 insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + // 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据 + Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + // 根据客户id,查询区/街道 组织名称、id + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); + 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++){ + if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())){ + // 是总分 + if (IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode().equals(communityScore.getValue().get(i).getIndexCode())){ + // 总指数 = 社区相关 + monthlyFormDTO.setIndexTotal(communityScore.getValue().get(i).getScore()); + } + } else { + // 赋值 党建能力、治理能力、服务能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(communityScore.getValue().get(i).getIndexCode(), + communityScore.getValue().get(i).getScore(), + monthlyFormDTO); + } + } + + // 当前组织 的上级组织id + String parentAgencyId = communityScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); + // 获取 组织名称 + String agencyName = ""; + for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) { + if (communityScore.getKey().equals(agencyScoreDTO.getAgencyId())) { + agencyName = agencyScoreDTO.getAgencyName(); + } + } + if ("".equals(agencyName)){ + throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); + } + // 补充表中其他字段 + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScore.getKey(), + parentAgencyId, agencyName, monthlyFormDTO); + // 补充表中其他字段 + 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 + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexDeptScore(String monthId, String customerId){ + // 查询社 区直部门分值表 + List indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); + if (indexDeptIds.size() > NumConstant.ZERO){ + String[] depeIds = new String[indexDeptIds.size()]; + 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); + } + } else { + List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); + this.insertIndexDeptScoreDefaultValueFor(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 insertIndexDataMonthlyByDeptScore(String monthId, String customerId, List deptScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + // 根据部门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()); + // 赋值 治理能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), + deptScore.getValue().get(i).getScore(), + monthlyFormDTO); + } + // 查询网格的 上级组织id 和 组织名称 + String parentAgencyId = ""; + String deptName = ""; + for (ScreenCustomerDeptEntity deptEntity : parentDeptList) { + if (deptScore.getKey().equals(deptEntity.getDeptId())) { + parentAgencyId = deptEntity.getParentAgencyId(); + deptName = deptEntity.getDeptName(); + } + } + if ("".equals(parentAgencyId)){ + throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); + } + // 补充表中其他字段 + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScore.getKey(), + parentAgencyId, deptName, monthlyFormDTO); + 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 + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexAgencyScore(String monthId, String customerId){ + 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); + } + } else { + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + // 开始处理实际分数 + // fact_index_agency_score 区/街道相关分数表 agency + List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); + this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS); + } + + /** + * 将区/街道相关分数表 数据 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param agencyScoreDTOS 区/街道相关分数表 当前客户所属月份数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 + Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); + 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++){ + if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())){ + // 是总分 总指数 = IS_TOTAL = 1 + monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore()); + } else { + // 赋值 党建能力、治理能力、服务能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(), + agencyScore.getValue().get(i).getScore(), + monthlyFormDTO); + } + } + // 当前组织 的上级组织id + String parentAgencyId = agencyScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); + // 查询 组织名称 + String agencyName = ""; + for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) { + if (agencyScore.getKey().equals(agencyScoreDTO.getAgencyId())) { + agencyName = agencyScoreDTO.getAgencyName(); + } + } + if ("".equals(agencyName)){ + throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); + } + // 补充表中其他字段 + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, agencyScore.getKey(), + parentAgencyId, agencyName, monthlyFormDTO); + monthlyFormDTOList.add(monthlyFormDTO); + } + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + } + + /** + * 指数-指数数据(每月数值) 表 字段补全,待新增 + * @param monthId 202008 + * @param orgType 组织类别 agency:组织;部门:department;网格:grid + * @param orgId 组织Id 可以为网格,机关id + * @param parentId 上级组织id + * @param orgName 组织名称 + * @param monthlyFormDTO 待新增的DTO + * @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO + * @Author zhangyong + * @Date 15:29 2020-09-03 + **/ + private IndexDataMonthlyFormDTO supplementIndexDataMonthlyTable(String monthId, String orgType, String orgId, String parentId, + String orgName, IndexDataMonthlyFormDTO monthlyFormDTO){ + monthlyFormDTO.setYearId(getYearStr(monthId)); + monthlyFormDTO.setMonthId(monthId); + monthlyFormDTO.setOrgType(orgType); + monthlyFormDTO.setOrgId(orgId); + // 根据网格id,查询其上级组织id、组织名称 + monthlyFormDTO.setParentId(parentId); + monthlyFormDTO.setOrgName(orgName); + return monthlyFormDTO; + } + + /** + * 赋实际值 党建能力、治理能力、服务能力 + * @param IndexCode 组织类别 + * @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){ + // 赋实际值 + if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(IndexCode)){ + // 党建能力 + monthlyFormDTO.setPartyDevAblity(Score); + } else if (IndexCodeEnum.ZHI_LI_NENG_LI.getCode().equals(IndexCode)){ + // 治理能力 + monthlyFormDTO.setGovernAblity(Score); + } else if (IndexCodeEnum.FU_WU_NENG_LI.getCode().equals(IndexCode)){ + // 服务能力 + monthlyFormDTO.setServiceAblity(Score); + } + return monthlyFormDTO; + } + + /** + * 设置 指数-指数数据(月、年) 表 + * 总指数、党建能力指数、治理能力、服务能力 默认值 0 + * @param monthlyFormDTO + * @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO + * @Author zhangyong + * @Date 11:01 2020-09-04 + **/ + private IndexDataMonthlyFormDTO setIndexDefaultValueFor(IndexDataMonthlyFormDTO monthlyFormDTO){ + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + monthlyFormDTO.setIndexTotal(zero); + monthlyFormDTO.setPartyDevAblity(zero); + monthlyFormDTO.setGovernAblity(zero); + monthlyFormDTO.setServiceAblity(zero); + 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 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @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(); + } + if (monthlyFormList.size() > NumConstant.ZERO){ + screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId), orgIds); + List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); + screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); + } + } + + /** + * 将月份id,拆分成 年份 + * + * @param monthId 202008 + * @return java.lang.String + * @Author zhangyong + * @Date 13:39 2020-09-04 + **/ + private String getYearStr(String monthId){ + return monthId.substring(NumConstant.ZERO, NumConstant.FOUR); + } + + + /** + * 将月份id,拆分成 月份 + * + * @param monthId 202008 + * @return java.lang.String + * @Author zhangyong + * @Date 13:39 2020-09-04 + **/ + private String getMonthStr(String monthId){ + return monthId.substring(NumConstant.FOUR, NumConstant.SIX); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexDictService.java similarity index 90% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexDictService.java index 9e3b4f83ed..8a259c5255 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexDictService.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.service.screen; +package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.entity.screen.IndexDictEntity; +import com.epmet.entity.evaluationindex.screen.IndexDictEntity; import java.util.Collection; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java similarity index 72% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java index ea03e298a1..f202beca1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java @@ -15,10 +15,12 @@ * along with this program. If not, see . */ -package com.epmet.service.screen; +package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; + +import java.util.List; /** * 客户指标详情 @@ -27,5 +29,10 @@ import com.epmet.entity.screen.IndexGroupDetailEntity; * @since v1.0.0 2020-08-19 */ public interface IndexGroupDetailService extends BaseService { - + /** + * desc:根据all_parent_index_code 获取指标明细 + * @param customerId + * @param indexCode + */ + List getDetailListByParentCode(String customerId,String... indexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailTemplateService.java similarity index 89% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailTemplateService.java index 3b0c48f7f9..d82fa93de8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailTemplateService.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.service.screen; +package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import java.util.Collection; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupService.java similarity index 89% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupService.java index 88c66b3da6..56b53dbed2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupService.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.service.screen; +package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.entity.screen.IndexGroupEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupEntity; /** * 客户指标分组 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupTemplateService.java similarity index 89% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupTemplateService.java index 1f23716176..fd72ef8279 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupTemplateService.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.service.screen; +package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.entity.screen.IndexGroupTemplateEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; import java.util.Collection; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java similarity index 91% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java index e81e4497c3..1e6dca0080 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java @@ -1,4 +1,4 @@ -package com.epmet.service.screen; +package com.epmet.service.evaluationindex.screen; import com.epmet.dto.screencoll.form.*; @@ -100,7 +100,7 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertDifficultyData(List formDTO, String customerId); + void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId); /** * 2、党员基本情况 @@ -218,4 +218,17 @@ public interface ScreenCollService { * @Date 10:52 2020-08-18 **/ void insertPioneerData(List formDTO, String customerId); + + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * @param formDTO + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:44 2020-08-25 + **/ + void insertPublicPartiTotalData(List formDTO, String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java similarity index 75% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java index 16e4815226..759270bf09 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java @@ -15,12 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.service.screen.impl; +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.dao.screen.IndexDictDao; -import com.epmet.entity.screen.IndexDictEntity; -import com.epmet.service.screen.IndexDictService; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexDictDao; +import com.epmet.entity.evaluationindex.screen.IndexDictEntity; +import com.epmet.service.evaluationindex.screen.IndexDictService; import org.springframework.stereotype.Service; import java.util.Collection; @@ -32,6 +34,7 @@ import java.util.Collection; * @since v1.0.0 2020-08-19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexDictServiceImpl extends BaseServiceImpl implements IndexDictService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java similarity index 50% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java index db9fe1f411..7a8935bd02 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java @@ -15,14 +15,20 @@ * along with this program. If not, see . */ -package com.epmet.service.screen.impl; +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.dao.screen.IndexGroupDetailDao; -import com.epmet.entity.screen.IndexGroupDetailEntity; -import com.epmet.service.screen.IndexGroupDetailService; +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.service.evaluationindex.screen.IndexGroupDetailService; import org.springframework.stereotype.Service; +import java.util.List; + /** * 客户指标详情 * @@ -30,7 +36,19 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-08-19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService { + @Override + public List getDetailListByParentCode(String customerId,String... indexCode) { + if (indexCode == null || indexCode.length == 0){ + throw new RenException("参数错误"); + } + StringBuilder sb = new StringBuilder(); + for (String code:indexCode){ + sb.append(code).append(StrConstant.COLON); + } + return baseDao.getDetailListByParentCode(customerId,sb.deleteCharAt(sb.length()-1).toString()); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java similarity index 74% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java index 081f94ef3c..dd0d811cfd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java @@ -15,12 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.service.screen.impl; +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.dao.screen.IndexGroupDetailTemplateDao; -import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; -import com.epmet.service.screen.IndexGroupDetailTemplateService; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailTemplateDao; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; import org.springframework.stereotype.Service; import java.util.Collection; @@ -32,6 +34,7 @@ import java.util.Collection; * @since v1.0.0 2020-08-19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupDetailTemplateServiceImpl extends BaseServiceImpl implements IndexGroupDetailTemplateService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java new file mode 100644 index 0000000000..e455120eef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java @@ -0,0 +1,143 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.UniqueIdGenerator; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexGroupDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailTemplateDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupTemplateDao; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; +import com.epmet.service.evaluationindex.screen.IndexGroupService; +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.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexGroupServiceImpl extends BaseServiceImpl implements IndexGroupService { +@Autowired +private IndexGroupTemplateDao indexGroupTemplateDao; + @Autowired + private IndexGroupDetailTemplateDao indexGroupDetailTemplateDao; + + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + + @Transactional(rollbackFor = Exception.class) + @Override + public Boolean initCustomerIndexGroup(String customerId) { + List groupTempList = indexGroupTemplateDao.selectAll(); + List groupDetailTempList = indexGroupDetailTemplateDao.selectAll(); + if (CollectionUtils.isEmpty(groupTempList) || CollectionUtils.isEmpty(groupDetailTempList)){ + throw new RenException("没有需要初始化的数据"); + } + Map groupMap = groupTempList.stream().collect(Collectors.toMap(IndexGroupTemplateEntity::getId, o -> o)); + Map groupEntityMap = new HashMap<>(); + Map groupNewIdMap = new HashMap<>(); + + List insertGroupList = new ArrayList<>(); + groupMap.forEach((oldGroupTempId,o)->{ + IndexGroupEntity newGroupEntity = ConvertUtils.sourceToTarget(o, IndexGroupEntity.class); + String newGroupId = UniqueIdGenerator.generate(); + newGroupEntity.setId(newGroupId); + newGroupEntity.setCustomerId(customerId); + String oldPid = newGroupEntity.getParentIndexGroupId(); + String newPid = groupNewIdMap.get(oldPid); + /*if (StringUtils.isBlank(newPid)){ + newPid = UniqueIdGenerator.generate(); + groupNewIdMap.put(oldPid,newPid); + }*/ + //newGroupEntity.setParentIndexGroupId(newPid); + groupNewIdMap.put(oldGroupTempId,newGroupId); + //groupEntityMap.put(newGroupId,newGroupEntity); + insertGroupList.add(newGroupEntity); + }); + insertGroupList.forEach(o-> { + String parentIndexGroupId = groupNewIdMap.get(o.getParentIndexGroupId()); + if (StringUtils.isBlank(parentIndexGroupId)){ + parentIndexGroupId = "0"; + } + o.setParentIndexGroupId(parentIndexGroupId); + }); + groupDetailTempList.forEach(groupDetailTemp->{ + String oldIndexGroupId = groupDetailTemp.getIndexGroupId(); + System.out.println(oldIndexGroupId); + + + IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupDetailTemp, IndexGroupDetailEntity.class); + entity.setId(UniqueIdGenerator.generate()); + String newGroupId = groupNewIdMap.get(oldIndexGroupId); + if (StringUtils.isBlank(newGroupId)){ + log.error("新旧id映射关系有误"); + return; + } + entity.setIndexGroupId(newGroupId); + entity.setCustomerId(customerId); + indexGroupDetailDao.insert(entity); + }); + this.insertBatch(insertGroupList,10); + + + /* List groupEntityList = groupTempList.stream().map(groupTemp -> { + IndexGroupEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupEntity.class); + entity.setId(UniqueIdGenerator.generate()); + entity.setCustomerId(customerId); + return entity; + }).collect(Collectors.toList()); + + groupEntityList.forEach(group->{ + + }); + + List groupTempEntityList = groupDetailTempList.stream().map(groupTemp -> { + IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupDetailEntity.class); + entity.setId(UniqueIdGenerator.generate()); + entity.setCustomerId(customerId); + return entity; + }).collect(Collectors.toList()); + groupTempEntityList.forEach(o->{ + indexGroupDetailDao.insert(o); + });*/ + return true; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java similarity index 75% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java index 058cf911eb..868e422b02 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java @@ -15,12 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.service.screen.impl; +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.dao.screen.IndexGroupTemplateDao; -import com.epmet.entity.screen.IndexGroupTemplateEntity; -import com.epmet.service.screen.IndexGroupTemplateService; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexGroupTemplateDao; +import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; +import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; import org.springframework.stereotype.Service; import java.util.Collection; @@ -32,6 +34,7 @@ import java.util.Collection; * @since v1.0.0 2020-08-19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupTemplateServiceImpl extends BaseServiceImpl implements IndexGroupTemplateService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java similarity index 85% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java index b5e65fd193..6018622deb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java @@ -15,22 +15,22 @@ * along with this program. If not, see . */ -package com.epmet.service.screen.impl; +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.commons.tools.utils.Result; import com.epmet.constant.CompareConstant; import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.screen.*; +import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.screencoll.form.*; -import com.epmet.entity.screen.ScreenEventImgDataEntity; -import com.epmet.entity.screen.ScreenUserJoinEntity; -import com.epmet.service.screen.ScreenCollService; +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; @@ -44,6 +44,7 @@ import java.util.List; * @since v1.0.0 2020-05-11 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenCollServiceImpl implements ScreenCollService { @Autowired @@ -80,8 +81,10 @@ public class ScreenCollServiceImpl implements ScreenCollService { private ScreenPioneerDataDao screenPioneerDataDao; @Autowired private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPartyUserRankData(List formDTO,String customerId) { @@ -96,7 +99,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPartyLinkMassesData(List formDTO, String customerId) { @@ -111,7 +114,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPartyBranchData(List formDTO, String customerId) { @@ -129,7 +132,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgRankData(List formDTO, String customerId) { @@ -147,7 +150,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGovernRankData(List formDTO, String customerId) { @@ -165,7 +168,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertEventData(List formDTO, String customerId) { @@ -193,20 +196,20 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertDifficultyData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenDifficultyDataDao.deleteDifficultyData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); - } - - screenDifficultyDataDao.batchInsertDifficultyData(formDTO, customerId); + 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.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertCpcbaseData(List formDTO, String customerId) { @@ -221,7 +224,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertIndexDataMonthly(List formDTO, String customerId) { @@ -239,7 +242,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertIndexDataYearly(List formDTO, String customerId) { @@ -256,7 +259,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertCustomerDept(List formDTO, String customerId) { @@ -271,7 +274,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertCustomerGrid(List formDTO, String customerId) { @@ -286,7 +289,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertCustomerAgency(List formDTO, String customerId) { @@ -301,7 +304,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertUserTotalData(List formDTO, String customerId) { @@ -316,7 +319,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertUserJoin(List formDTO, String customerId) { @@ -332,9 +335,10 @@ public class ScreenCollServiceImpl implements ScreenCollService { String[] lastMonth = this.lastMonthDate(); // 获取上个月的基本数据 + String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, lastMonth[NumConstant.ZERO], - lastMonth[NumConstant.ONE], + moneth, orgIds); // 定义本月待添加数据的集合 @@ -407,6 +411,9 @@ public class ScreenCollServiceImpl implements ScreenCollService { * @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; @@ -431,7 +438,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPioneerData(List formDTO, String customerId) { @@ -445,4 +452,19 @@ public class ScreenCollServiceImpl implements ScreenCollService { 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/indexcollect/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java deleted file mode 100644 index cd767ff580..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.epmet.service.indexcollect.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.indexcoll.*; -import com.epmet.dto.indexcollect.form.*; -import com.epmet.service.indexcollect.FactIndexCollectService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * @Auther: zhangyong - * @Date: 2020-08-20 10:05 - */ -@Service -public class FactIndexCollectServiceImpl implements FactIndexCollectService { - - @Autowired - private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; - @Autowired - private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; - @Autowired - private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; - @Autowired - private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; - @Autowired - private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; - @Autowired - private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; - @Autowired - private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; - @Autowired - private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; - - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertGridPartyMemberData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getUserId(), - formDTO.get(i).getYearId(), formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.STATS, 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); - } - } - - @DataSource(value = DataSourceConstant.STATS, 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); - } - } - - @DataSource(value = DataSourceConstant.STATS, 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); - } - } - - @DataSource(value = DataSourceConstant.STATS, 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); - } - } - - @DataSource(value = DataSourceConstant.STATS, 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); - } - } - - @DataSource(value = DataSourceConstant.STATS, 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); - } - } - - @DataSource(value = DataSourceConstant.STATS, 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); - } - } -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java deleted file mode 100644 index 7aff662edf..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.epmet.service.screen.impl; - -import com.epmet.dto.screen.form.IndexCalculateForm; -import com.epmet.service.screen.IndexCalculateService; -import org.springframework.stereotype.Service; - -/** - * @author liujianjun - */ -@Service -public class IndexCalculateServiceImpl implements IndexCalculateService { - @Override - public void cpcIndexCalculate(IndexCalculateForm formDTO) { - - } -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java deleted file mode 100644 index 65fc39f131..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java +++ /dev/null @@ -1,84 +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.screen.impl; - -import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.UniqueIdGenerator; -import com.epmet.dao.screen.IndexGroupDao; -import com.epmet.dao.screen.IndexGroupDetailDao; -import com.epmet.dao.screen.IndexGroupDetailTemplateDao; -import com.epmet.dao.screen.IndexGroupTemplateDao; -import com.epmet.entity.screen.IndexGroupDetailEntity; -import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; -import com.epmet.entity.screen.IndexGroupEntity; -import com.epmet.entity.screen.IndexGroupTemplateEntity; -import com.epmet.service.screen.IndexGroupService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * 客户指标分组 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-19 - */ -@Service -public class IndexGroupServiceImpl extends BaseServiceImpl implements IndexGroupService { -@Autowired -private IndexGroupTemplateDao indexGroupTemplateDao; - @Autowired - private IndexGroupDetailTemplateDao indexGroupDetailTemplateDao; - - @Autowired - private IndexGroupDetailDao indexGroupDetailDao; - - @Transactional(rollbackFor = Exception.class) - @Override - public Boolean initCustomerIndexGroup(String customerId) { - List groupTempList = indexGroupTemplateDao.selectAll(); - List groupDetailTempList = indexGroupDetailTemplateDao.selectAll(); - if (CollectionUtils.isEmpty(groupTempList) || CollectionUtils.isEmpty(groupDetailTempList)){ - throw new RenException("没有需要初始化的数据"); - } - List groupEntityList = groupTempList.stream().map(groupTemp -> { - IndexGroupEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupEntity.class); - entity.setId(UniqueIdGenerator.generate()); - entity.setCustomerId(customerId); - return entity; - }).collect(Collectors.toList()); - this.insertBatch(groupEntityList,10); - - List groupTempEntityList = groupDetailTempList.stream().map(groupTemp -> { - IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupDetailEntity.class); - entity.setId(UniqueIdGenerator.generate()); - entity.setCustomerId(customerId); - return entity; - }).collect(Collectors.toList()); - groupTempEntityList.forEach(o->{ - indexGroupDetailDao.insert(o); - }); - return true; - } -} \ No newline at end of file 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 10d4ba7a44..d24fec3ee8 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 @@ -21,11 +21,11 @@ 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.commons.tools.constant.FieldConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DimAgencyConstant; import com.epmet.constant.RobotConstant; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java new file mode 100644 index 0000000000..4f884c3e34 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java @@ -0,0 +1,98 @@ +package com.epmet.support.normalizing; + +import com.alibaba.fastjson.JSON; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; + +/** + * BigDecimal的分值计算 + * 每一种数据类型的计算都要继承ScoreCalculator并且实现其抽象方法,实现数据类型的转换 + */ +public class BigDecimalScoreCalculator extends ScoreCalculator { + + /* *//** + * 初始化基于原数组的整数分值计算 + * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ + * @param sourceArray 源数据完整数组 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + *//* + public BigDecimalScoreCalculator(BigDecimal[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray.clone(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + *//** + * 初始化基于原数组的整数分值计算 + * @param sourceList 源数据完整列表 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + *//* + public BigDecimalScoreCalculator(List sourceList, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceList.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + }*/ + + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public BigDecimalScoreCalculator(BigDecimal minSourceValue, BigDecimal maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValue; + this.maxValue = maxSourceValue; + this.correlation = correlation; + prepare4BoundaryValue(); + System.out.println("归一区间最小值:"+minScore+";归一区间最大值:"+maxScore+";样本最小值:"+minSourceValue+";样本最大值:"+maxSourceValue); + } + + @Override + public BigDecimal getMaxFromSourceArray() { + if (this.sourceArrary == null){ + return null; + } + BigDecimal[] intSourceArrary = (BigDecimal[]) this.sourceArrary; + return intSourceArrary[intSourceArrary.length - 1]; + } + + @Override + public BigDecimal getMinFromSourceArray() { + if (this.sourceArrary == null){ + return null; + } + BigDecimal[] intSourceArrary = (BigDecimal[]) this.sourceArrary; + return intSourceArrary[0]; + } + + @Override + public BigDecimal convertValue2BigDecimal(Object sourceValue) { + return (BigDecimal) sourceValue; + } + + public static void main(String[] args) { + BigDecimal minScore = new BigDecimal(0); + BigDecimal maxScore = new BigDecimal(100); + ScoreCalculator sc = new BigDecimalScoreCalculator(new BigDecimal("0.1"),new BigDecimal("1"), minScore, maxScore, Correlation.POSITIVE); + List ts = Arrays.asList(new BigDecimal("0.1"),new BigDecimal("1")); + List normalize = sc.normalize(ts); + System.out.println(JSON.toJSONString(normalize)); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java index f7a31b1436..acacce6f1a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java @@ -14,4 +14,33 @@ public enum Correlation { this.code = code; this.desc = desc; } + + public static Correlation getCorrelation(String code){ + if (code == null) { + return Correlation.POSITIVE; + } + Correlation[] values = Correlation.values(); + for (Correlation correlation : values) { + if (code.equals(correlation.getCode())) { + return correlation; + } + } + return Correlation.POSITIVE; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java index 87f34db1f9..d919b2470f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java @@ -1,6 +1,7 @@ package com.epmet.support.normalizing; import java.math.BigDecimal; +import java.util.List; /** * Double的分值计算 @@ -17,11 +18,40 @@ public class DoubleScoreCalculator extends ScoreCalculator { * @param correlation 相关性 */ public DoubleScoreCalculator(Double[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { - this.sourceArrary = sourceArray; + this.sourceArrary = sourceArray.clone(); this.minScore = minScore; this.maxScore = maxScore; this.correlation = correlation; - this.prepare(); + this.prepare4SourceArray(); + } + + public DoubleScoreCalculator(List sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare4SourceArray(); + } + + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public DoubleScoreCalculator(Double minSourceValue, Double maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + BigDecimal minSourceValueBD = new BigDecimal(minSourceValue); + BigDecimal maxSourceValueBD = new BigDecimal(maxSourceValue); + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValueBD; + this.maxValue = maxSourceValueBD; + this.correlation = correlation; + prepare4BoundaryValue(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java index 333cd0a4a2..2114eee59e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java @@ -1,6 +1,7 @@ package com.epmet.support.normalizing; import java.math.BigDecimal; +import java.util.List; /** * Integer的分值计算 @@ -9,21 +10,57 @@ import java.math.BigDecimal; public class IntegerScoreCalculator extends ScoreCalculator { /** - * 初始化整数分值计算 + * 初始化基于原数组的整数分值计算 * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ - * @param sourceArray 数据所在的数组 + * @param sourceArray 源数据完整数组 * @param minScore 分值区间的左边界 * @param maxScore 分值区间的右边界 * @param correlation 相关性 */ public IntegerScoreCalculator(Integer[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { - this.sourceArrary = sourceArray; + this.sourceArrary = sourceArray.clone(); this.minScore = minScore; this.maxScore = maxScore; this.correlation = correlation; - this.prepare(); + prepare4SourceArray(); System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + /** + * 初始化基于原数组的整数分值计算 + * @param sourceList 源数据完整列表 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public IntegerScoreCalculator(List sourceList, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceList.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public IntegerScoreCalculator(Integer minSourceValue, Integer maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + BigDecimal minSourceValueBD = new BigDecimal(minSourceValue); + BigDecimal maxSourceValueBD = new BigDecimal(maxSourceValue); + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValueBD; + this.maxValue = maxSourceValueBD; + this.correlation = correlation; + prepare4BoundaryValue(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index 2fb3fab926..07407d5032 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -1,30 +1,52 @@ package com.epmet.support.normalizing; +import lombok.Data; + import java.math.BigDecimal; import java.math.MathContext; import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; /** * 所有数据类型计算器的父类,实现算法骨架,数据类型转换方法则由子类实现 + * ☆☆☆ 如果需要保持传入的数组元素顺序不变,请在实现类的构造方法中将传入数组进行克隆 ☆☆☆ * @param 数据类型泛型 */ +@Data public abstract class ScoreCalculator { + /** + * 源数据的数组 + */ protected T[] sourceArrary; + /** + * 最大最小分 + */ protected BigDecimal minScore; protected BigDecimal maxScore; + /** + * 相关性 + */ protected Correlation correlation; - private BigDecimal maxValue; - private BigDecimal minValue; + /** + * 系数 + */ private BigDecimal coefficient; /** - * 计算准备 + * 最大最小值 + */ + protected BigDecimal maxValue; + protected BigDecimal minValue; + + /** + * 计算准备(基于sourceArray方式的) */ - protected void prepare() { + public void prepare4SourceArray() { // 校验数组 if (!validSourceArray(sourceArrary)) { throw new RuntimeException("入参数组错误:请设置非空数组"); @@ -33,12 +55,19 @@ public abstract class ScoreCalculator { maxValue = getMaxFromSourceArray(); minValue = getMinFromSourceArray(); //计算系数 - System.out.println("最小值:"+minScore+";最大值:"+maxScore); - coefficient = getCoefficient(minValue, maxValue); + coefficient = calcuteCoefficient(minValue, maxValue); + //System.out.println("最小分值:"+minScore+";最大分值:"+maxScore+";系数:"+coefficient); + } + + /** + * 计算准备(基于边界值的) + */ + public void prepare4BoundaryValue() { + coefficient = calcuteCoefficient(minValue, maxValue); } /** - * 归一算法 + * 单值归一算法 * @return */ public BigDecimal normalize(T sourceValue) { @@ -47,14 +76,10 @@ public abstract class ScoreCalculator { throw new RuntimeException("入参数组错误:请设置sourceValue"); } - if (!Arrays.asList(sourceArrary).contains(sourceValue)) { - throw new RuntimeException("请确认要计算的数组在数组中存在"); - } - if (correlation == Correlation.POSITIVE) { // 正相关 BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); - BigDecimal score = minScore.add(x, MathContext.DECIMAL32); + BigDecimal score = minScore.add(x); return score; } else if (correlation == Correlation.NEGATIVE) { // 负相关 @@ -66,6 +91,69 @@ public abstract class ScoreCalculator { } } + /** + * 单值归一算法,带权重 + * @param sourceValue + * @param weight + * @return + */ + public BigDecimal normalize(T sourceValue, BigDecimal weight) { + return normalize(sourceValue).multiply(weight); + } + + /** + * 批量归一算法 + * @param sourceValues + * @return + */ + public BigDecimal[] normalize(T[] sourceValues) { + + BigDecimal[] scores = new BigDecimal[sourceValues.length]; + + for (int i=0;i normalize(List sourceValues) { + return sourceValues.stream().map(s -> normalize(s)).collect(Collectors.toList()); + } + + /** + * 批量归一算法,带权重 + * @param sourceValues + * @param weight + * @return + */ + public BigDecimal[] normalize(T[] sourceValues, BigDecimal weight) { + + BigDecimal[] scores = new BigDecimal[sourceValues.length]; + + for (int i=0;i normalize(List sourceValues, BigDecimal weight) { + return sourceValues.stream().map(s -> normalize(s).multiply(weight)).collect(Collectors.toList()); + } + /** * 校验数组 * @param sourceArray @@ -83,12 +171,11 @@ public abstract class ScoreCalculator { * 计算系数 * @return */ - protected BigDecimal getCoefficient(BigDecimal min, BigDecimal max) { + protected BigDecimal calcuteCoefficient(BigDecimal min, BigDecimal max) { BigDecimal fenmu = max.subtract(min); - if (fenmu.toString().equals("0"))return new BigDecimal(0); + if (fenmu.compareTo(BigDecimal.ZERO)==0)return new BigDecimal(0); BigDecimal fenzi = maxScore.subtract(minScore); BigDecimal divide = fenzi.divide(fenmu, MathContext.DECIMAL32); - System.out.println("分子:"+fenzi+"分母:"+fenmu+"系数:"+divide.toString()); return divide; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java new file mode 100644 index 0000000000..1eecc8cf36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java @@ -0,0 +1,13 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; + +/** + * 分值常量 + */ +public class ScoreConstants { + + public static final BigDecimal MIN_SCORE = new BigDecimal(0); + public static final BigDecimal MAX_SCORE = new BigDecimal(100); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java new file mode 100644 index 0000000000..1ede9a4aae --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -0,0 +1,86 @@ +package com.epmet.support.normalizing.batch; + +import com.epmet.support.normalizing.ScoreCalculator; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; + +public class BatchScoreCalculator { + + /** + * 执行计算,每个指标中每个样本的得分明细 + * @return 每一条都是一个指标的,所有样本对应的,得分值 + */ + public List getScoreDetailOfIndexId(List indexInputVOS) { + + return indexInputVOS.stream().map(i -> { + // 每个指标循环一次 + String indexId = i.getIndexId(); + List indexValueVOs = i.getIndexValueVOs(); + BigDecimal weight = i.getWeight(); + ScoreCalculator scoreCalculator = i.getScoreCalculator(); + BigDecimal threshold = i.getThreshold(); + + // 循环同一个指标内的多个样本值的SampleValue列表 + List scores4OneIndex = indexValueVOs.stream().map(vo -> { + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP);; + return new SampleScore(vo.getSampleId(), score); + }).collect(Collectors.toList()); + + return new IndexOutputVO(indexId, scores4OneIndex); + }).collect(Collectors.toList()); + } + + /** + * 执行计算,以样本的所有指标总得分 + * @param indexInputVOS + * @return + */ + public HashMap getScoreCountOfSampleId(List indexInputVOS) { + + // 每个样本的总得分 + 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); + } else { + score.setScale(6, RoundingMode.HALF_UP); + scoreCountOfSamples.put(sampleId, score); + } + } + } + + return scoreCountOfSamples; + } + + /** + * 获取最终样本值 + * @param realValue + * @param threshold + * @return + */ + public BigDecimal getFinalSampleValue(Object realValue, BigDecimal threshold) { + BigDecimal bdRealValue = new BigDecimal(realValue.toString()); + if (threshold.compareTo(new BigDecimal(-1)) == 0) { + // -1表示不使用阈值 + return bdRealValue; + } + return (bdRealValue.compareTo(threshold) < 0) || (bdRealValue.equals(threshold)) + ? bdRealValue + : threshold ; + } +} 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 new file mode 100644 index 0000000000..57c6fbc396 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java @@ -0,0 +1,38 @@ +package com.epmet.support.normalizing.batch; + +import com.epmet.support.normalizing.ScoreCalculator; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +@AllArgsConstructor +public class IndexInputVO implements Serializable { + + private static final long serialVersionUID = -4855313801481921595L; + /** + * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code + * 非必填 + */ + private String indexId; + + /** + * 指标的样本值 + */ + private List> indexValueVOs; + + /** + * 样本阈值 + */ + private BigDecimal threshold; + + /** + * 权重 + */ + private BigDecimal weight; + + private ScoreCalculator scoreCalculator; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java new file mode 100644 index 0000000000..fdf0a3dea9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java @@ -0,0 +1,23 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@AllArgsConstructor +public class IndexOutputVO { + + /** + * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code + * 非必填 + */ + private String indexId; + + /** + * 指标的样本值 + */ + private List indexScoreVOs; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java new file mode 100644 index 0000000000..bd677fc861 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java @@ -0,0 +1,19 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 样本得分对象 + */ +@Data +@AllArgsConstructor +public class SampleScore { + + private String sampleId; + + private BigDecimal sampleScore; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java new file mode 100644 index 0000000000..5a42508e64 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java @@ -0,0 +1,20 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +/** + * 样本值对象 + */ +@Data +@AllArgsConstructor +public class SampleValue implements Serializable { + + private static final long serialVersionUID = 8661385412757324539L; + private String sampleId; + + private T sampleValue; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java new file mode 100644 index 0000000000..8d392a2c21 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java @@ -0,0 +1,203 @@ +package com.epmet.util; + +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + + +/** + * @author liujianjun + */ +public class Pinyin4jUtil { + private static Map duoyinMap; + static { + duoyinMap = new HashMap<>(); + duoyinMap.put('区',new String[]{"qu"}); + duoyinMap.put('系',new String[]{"xi"}); + duoyinMap.put('率',new String[]{"lv"}); + duoyinMap.put('员',new String[]{"yuan"}); + duoyinMap.put('提',new String[]{"ti"}); + duoyinMap.put('被',new String[]{"bei"}); + duoyinMap.put('期',new String[]{"qi"}); + duoyinMap.put('参',new String[]{"can"}); + duoyinMap.put('均',new String[]{"jun"}); + duoyinMap.put('会', new String[]{"hui"}); + duoyinMap.put('属', new String[]{"shu"}); + } + + /** + * getFirstSpellPinYin:(多音字的时候获取第一个).
+ * + * @param src 传入的拼音字符串,以逗号隔开 + * @param isFullSpell 是否全拼,true:全拼,false:第一个汉字全拼(其它汉字取首字母) + * @return 第一个拼音 + */ + public static String getFirstSpellPinYin(String src, boolean isFullSpell) { + String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1)); + System.out.println(targetStr); + String[] split = targetStr.split(","); + if (split.length > 1) { + targetStr = split[0]; + } + return targetStr; + } + + /** + * getFirstSpellPinYin:(多音字的时候获取第一个).
+ * + * @param src 传入的拼音字符串,以逗号隔开 + * @param isFullSpell 是否全拼,true:全拼,false:第一个汉字全拼(其它汉字取首字母) + * @return 第一个拼音 + */ + public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) { + String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont)); + System.out.println(targetStr); + String[] split = targetStr.split(","); + if (split.length > 1) { + targetStr = split[0]; + } + return targetStr; + } + + /** + * makeStringByStringSet:(拼音字符串集合转换字符串(逗号分隔)).
+ * + * @param stringSet 拼音集合 + * @return 带逗号字符串 + */ + public static String makeStringByStringSet(Set stringSet) { + StringBuilder str = new StringBuilder(); + int i = 0; + if (stringSet.size() > 0) { + for (String s : stringSet) { + if (i == stringSet.size() - 1) { + str.append(s); + } else { + str.append(s + ","); + } + i++; + } + } + return str.toString().toLowerCase(); + } + + /** + * getPinyin:(获取汉字拼音).
+ * + * @param src 汉字 + * @param isFullSpell 是否全拼,如果为true:全拼,false:首字全拼 + * @param preFont isFullSpell =true时,前几个字全拼 + * @return + */ + public static Set getPinyin(String src, boolean isFullSpell, int preFont) { + if (src != null && !src.trim().equalsIgnoreCase("")) { + char[] srcChar; + srcChar = src.toCharArray(); + // 汉语拼音格式输出类 + HanyuPinyinOutputFormat hanYuPinOutputFormat = new HanyuPinyinOutputFormat(); + + // 输出设置,大小写,音标方式等 + hanYuPinOutputFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); + hanYuPinOutputFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + hanYuPinOutputFormat.setVCharType(HanyuPinyinVCharType.WITH_V); + + String[][] temp = new String[src.length()][]; + for (int i = 0; i < srcChar.length; i++) { + char c = srcChar[i]; + if (String.valueOf(c).matches("[\\u4E00-\\u9FA5]+")) {//中文 + try { + String[] py = duoyinMap.get(c); + if (py != null){ + temp[i] = py; + }else{ + temp[i] = PinyinHelper.toHanyuPinyinStringArray(srcChar[i], hanYuPinOutputFormat); + } + + if (!isFullSpell) { + if (i < preFont) { + temp[i] = temp[i]; + } else { + String[] tTemps = new String[temp[i].length]; + for (int j = 0; j < temp[i].length; j++) { + char t = temp[i][j].charAt(0); + tTemps[j] = Character.toString(t); + } + temp[i] = tTemps; + } + } + } catch (BadHanyuPinyinOutputFormatCombination e) { + e.printStackTrace(); + } + } else if (((int) c >= 65 && (int) c <= 90) + || ((int) c >= 97 && (int) c <= 122)) {//英文 + temp[i] = new String[]{String.valueOf(srcChar[i])}; + } else { + temp[i] = new String[]{""}; + } + } + String[] pingyinArray = exchange(temp); + Set pinyinSet = new HashSet(); + for (int i = 0; i < pingyinArray.length; i++) { + pinyinSet.add(pingyinArray[i]); + } + return pinyinSet; + } + return null; + } + + /** + * 递归 + * + * @param strJaggedArray + * @return + */ + public static String[] exchange(String[][] strJaggedArray) { + String[][] temp = doExchange(strJaggedArray); + return temp[0]; + } + + /** + * 递归 + * + * @param strJaggedArray + * @return + */ + private static String[][] doExchange(String[][] strJaggedArray) { + int len = strJaggedArray.length; + if (len >= 2) { + int len1 = strJaggedArray[0].length; + int len2 = strJaggedArray[1].length; + int newlen = len1 * len2; + String[] temp = new String[newlen]; + int Index = 0; + for (int i = 0; i < len1; i++) { + for (int j = 0; j < len2; j++) { + temp[Index] = strJaggedArray[0][i] + strJaggedArray[1][j]; + Index++; + } + } + String[][] newArray = new String[len - 1][]; + for (int i = 2; i < len; i++) { + newArray[i - 1] = strJaggedArray[i]; + } + newArray[0] = temp; + return doExchange(newArray); + } else { + return strJaggedArray; + } + } + + public static void main(String[] args) { + System.out.println(getFirstSpellPinYin("区直部门",false)); + System.out.println(getSpellPinYin("党员提出话题数",false,4)); + System.out.println(getSpellPinYin("社区超期项目数",false,4)); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 7ece13bb19..c2b2f726f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -165,6 +165,11 @@ dynamic: url: @datasource.druid.statsdisplay.url@ username: @datasource.druid.statsdisplay.username@ password: @datasource.druid.statsdisplay.password@ + evaluationIndex: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.evaluationIndex.url@ + username: @datasource.druid.evaluationIndex.username@ + password: @datasource.druid.evaluationIndex.password@ thread: # 线程池配置 @@ -177,4 +182,4 @@ thread: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql new file mode 100644 index 0000000000..4374c4cd09 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql @@ -0,0 +1,514 @@ +/* + Navicat Premium Data Transfer + + Source Server : 测试 + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306 + Source Schema : epmet_evaluation_index + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 02/09/2020 17:57:39 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for screen_cpc_base_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_cpc_base_data`; +CREATE TABLE `screen_cpc_base_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `REGISTER_USER_COUNT` int(11) DEFAULT '0' COMMENT '注册用户数', + `RESI_TOTAL` int(11) DEFAULT '0' COMMENT '群众用户数', + `PARTY_MEMBER_COUNT` int(11) DEFAULT '0' COMMENT '注册党员数', + `AGE_LEVEL_1` int(11) DEFAULT '0' COMMENT '小于20岁的党员总人数', + `AGE_LEVEL_2` int(11) DEFAULT '0' COMMENT '20-30岁的党员总人数', + `AGE_LEVEL_3` int(11) DEFAULT '0' COMMENT '31-40岁的党员总人数', + `AGE_LEVEL_4` int(11) DEFAULT '0' COMMENT '41-50岁的党员总人数', + `AGE_LEVEL_5` int(11) DEFAULT '0' COMMENT '51-60岁的党员总人数', + `AGE_LEVEL_6` int(11) DEFAULT '0' COMMENT '60+岁的党员总人数', + `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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层党建-党员基本情况'; + +-- ---------------------------- +-- Table structure for screen_customer_agency +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_agency`; +CREATE TABLE `screen_customer_agency` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', + `AGENCY_NAME` varchar(255) NOT NULL COMMENT '组织名称', + `PID` varchar(64) NOT NULL COMMENT '父级id ,顶级,此列为0', + `PIDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用逗号(英文)分开', + `ALL_PARENT_NAMES` varchar(512) DEFAULT NULL COMMENT '所有组织名称以-链接', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `PARTY_MARK` varchar(255) DEFAULT NULL COMMENT '党工委或者党委的位置,目前此阶段为预留字段', + `LEVEL` varchar(32) NOT NULL COMMENT '机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `AREA_CODE` varchar(30) DEFAULT NULL COMMENT '行政地区编码', + `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 '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织机构信息'; + +-- ---------------------------- +-- Table structure for screen_customer_dept +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_dept`; +CREATE TABLE `screen_customer_dept` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DEPT_ID` varchar(64) NOT NULL COMMENT '部门id', + `DEPT_NAME` varchar(255) NOT NULL COMMENT '部门名称', + `PARENT_AGENCY_ID` varchar(64) NOT NULL COMMENT '部门所属组织id', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `DEPT_MARK` varchar(255) DEFAULT NULL COMMENT '部门所在位置(目前预留此字段)', + `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 '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门信息'; + +-- ---------------------------- +-- Table structure for screen_customer_grid +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_grid`; +CREATE TABLE `screen_customer_grid` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', + `GRID_NAME` varchar(255) NOT NULL COMMENT '组织名称', + `PARENT_AGENCY_ID` varchar(64) NOT NULL COMMENT '网格所属组织id', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `PARTY_MARK` varchar(255) DEFAULT NULL COMMENT '党支部(=网格)的位置', + `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 '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格(党支部)信息'; + +-- ---------------------------- +-- Table structure for screen_difficulty_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_difficulty_data`; +CREATE TABLE `screen_difficulty_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `EVENT_ID` varchar(64) NOT NULL COMMENT '事件原Id', + `EVENT_IMG_URL` varchar(512) DEFAULT NULL COMMENT '事件图片', + `EVENT_SOURCE` varchar(64) DEFAULT NULL COMMENT '事件来源 XX街道-社区-网格', + `EVENT_CONTENT` varchar(512) DEFAULT NULL COMMENT '事件内容', + `EVENT_COST_TIME` int(11) DEFAULT '0' COMMENT '事件耗时 单位:分钟', + `EVENT_RE_ORG` int(11) DEFAULT '0' COMMENT '事件涉及部门数', + `EVENT_HANDLED_COUNT` int(11) NOT NULL COMMENT '事件被处理次数(08-21新增)', + `EVENT_CATEGORY_CODE` varchar(32) DEFAULT NULL COMMENT '事件类别编码', + `EVENT_CATEGORY_NAME` varchar(128) DEFAULT NULL COMMENT '事件类别名称', + `EVENT_STATUS_CODE` varchar(32) DEFAULT NULL COMMENT '事件状态key', + `EVENT_STATUS_DESC` varchar(64) DEFAULT NULL COMMENT '事件状态描述', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' 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 '更新时间', + `LATEST_OPERATE_DESC` varchar(64) NOT NULL COMMENT '最近一次操作说明', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-难点堵点(耗时最长|设计部门最多|处理次数)'; + +-- ---------------------------- +-- Table structure for screen_event_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_event_data`; +CREATE TABLE `screen_event_data` ( + `ID` varchar(256) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `EVENT_ID` varchar(64) NOT NULL COMMENT '原始事件Id', + `EVENT_TITLE` varchar(256) DEFAULT '0' COMMENT '事件名称', + `EVENT_CREATE_TIME` datetime DEFAULT NULL COMMENT '事件时间', + `LINK_MOBILE` varchar(32) DEFAULT NULL COMMENT '联系人 联系人', + `EVENT_CONTENT` varchar(1024) DEFAULT '0' COMMENT '事件描述', + `EVENT_IMG_URL` varchar(512) DEFAULT NULL COMMENT '事件图片', + `EVENT_LEVEL` varchar(32) DEFAULT '0' COMMENT '事件待处理级别 red:红;yellow:黄;绿色:green', + `EVENT_ADDRESS` varchar(512) DEFAULT NULL COMMENT '事件地址', + `LONGITUDE` decimal(32,8) DEFAULT '0.00000000' COMMENT '事件所在经度', + `LATITUDE` decimal(32,8) DEFAULT '0.00000000' COMMENT '事件所在维度', + `LAST_PROCESS_DEPT` varchar(128) DEFAULT '0' COMMENT '最后处理组织', + `LAST_PROCESS_DATE` datetime DEFAULT '0000-00-00 00:00:00' 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 '更新时间', + `EVENT_STATUS_CODE` varchar(32) DEFAULT NULL COMMENT '事件状态key', + `EVENT_STATUS_DESC` varchar(64) DEFAULT NULL COMMENT '事件状态描述', + `LATEST_OPERATE_DESC` varchar(64) DEFAULT NULL COMMENT '最近一次操作说明', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyMM|yyyyMMdd', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='中央区-事件数据'; + +-- ---------------------------- +-- Table structure for screen_event_img_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_event_img_data`; +CREATE TABLE `screen_event_img_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `EVENT_ID` varchar(64) NOT NULL COMMENT '原始事件Id', + `EVENT_IMG_URL` varchar(512) NOT NULL COMMENT '图片图片地址', + `SORT` 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(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 screen_govern_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_govern_rank_data`; +CREATE TABLE `screen_govern_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称', + `RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率', + `RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率', + `GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率', + `SATISFACTION_RATIO` decimal(10,6) DEFAULT 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-治理能力排行数据(按月统计)'; + +-- ---------------------------- +-- Table structure for screen_index_data_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `screen_index_data_monthly`; +CREATE TABLE `screen_index_data_monthly` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_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', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `INDEX_TOTAL` decimal(10,6) DEFAULT NULL COMMENT '总指数', + `PARTY_DEV_ABLITY` decimal(10,6) DEFAULT NULL COMMENT '党建能力指数', + `SERVICE_ABLITY` decimal(10,6) DEFAULT NULL COMMENT '服务能力指数', + `GOVERN_ABLITY` decimal(10,6) DEFAULT 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指数-指数数据(每月数值)'; + +-- ---------------------------- +-- Table structure for screen_index_data_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `screen_index_data_yearly`; +CREATE TABLE `screen_index_data_yearly` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id: yyyy', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `INDEX_TOTAL` decimal(10,6) NOT NULL COMMENT '总指数', + `PARTY_DEV_ABLITY` decimal(10,6) NOT NULL COMMENT '党建能力指数', + `SERVICE_ABLITY` decimal(10,6) NOT NULL COMMENT '服务能力指数', + `GOVERN_ABLITY` 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指数-指数数据(按年统计)'; + +-- ---------------------------- +-- Table structure for screen_org_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_org_rank_data`; +CREATE TABLE `screen_org_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `PARTY_TOTAL` int(11) DEFAULT '0' COMMENT '党员总数', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '小组(支部建设)总数', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '项目总数', + `CLOSE_PROJECT_RATIO` decimal(10,6) DEFAULT NULL COMMENT '结案率', + `SATISFACTION_RATIO` decimal(10,6) DEFAULT 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 '更新时间', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-组织先进排行榜'; + +-- ---------------------------- +-- Table structure for screen_party_branch_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_branch_data`; +CREATE TABLE `screen_party_branch_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `TYPE` varchar(32) NOT NULL DEFAULT 'party' COMMENT '数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `MEET_CATEGORY_ID` varchar(32) DEFAULT '0' COMMENT '会议分类Id', + `MEET_CATEGORY_NAME` varchar(64) DEFAULT '0' COMMENT '会议分类名称(三会党课、主题党日.....等等)', + `ORGANIZE_COUNT` int(11) DEFAULT '0' COMMENT '组织次数', + `JOIN_USER_COUNT` int(11) DEFAULT '0' COMMENT '参加人数', + `AVERAGE_JOIN_USER_COUNT` int(11) DEFAULT NULL COMMENT '平均参加人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) DEFAULT 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 screen_party_link_masses_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_link_masses_data`; +CREATE TABLE `screen_party_link_masses_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `CREATE_GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '党员建群总数', + `GROUP_USER_TOTAL` int(11) DEFAULT '0' COMMENT '群成员总数', + `DEL_FLAG` char(1) NOT NULL 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 '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-党员联系群众数据'; + +-- ---------------------------- +-- Table structure for screen_party_user_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_user_rank_data`; +CREATE TABLE `screen_party_user_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `GRID_ID` varchar(64) NOT NULL COMMENT '用户所属网格id', + `GRID_NAME` varchar(128) NOT NULL COMMENT '用户所属网格名称', + `ORG_ID` varchar(64) NOT NULL COMMENT '网格所属的组织id', + `ORG_NAME` varchar(255) NOT NULL COMMENT '网格所属的组织名称', + `PARTY_FLAG` tinyint(1) NOT NULL COMMENT '是否是党员标志:1是。0不是党员', + `USER_ID` varchar(64) NOT NULL COMMENT '用户Id', + `SURNAME` varchar(32) DEFAULT NULL COMMENT '姓', + `NAME` varchar(32) DEFAULT NULL COMMENT '名', + `USER_NAME` varchar(32) NOT NULL COMMENT '姓名', + `POINT_TOTAL` int(11) DEFAULT '0' 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 '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领|基层治理-市民(党员)积分排行榜'; + +-- ---------------------------- +-- Table structure for screen_pioneer_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_pioneer_data`; +CREATE TABLE `screen_pioneer_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '党员参与议事', + `ISSUE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员参与议事占比', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '党员发布话题', + `TOPIC_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员发布话题占比', + `PUBLISH_ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '党员发布议题', + `PUBLISH_ISSUE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员发布议题占比', + `SHIFT_PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '议题转项目数', + `SHIFT_PROJECT_RATIO` decimal(10,6) DEFAULT NULL COMMENT '议题转项目占比', + `RESOLVED_PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '解决项目总数', + `RESOLVED_PROJECT_RATIO` decimal(10,6) DEFAULT 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 '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-先锋模范数据'; + +-- ---------------------------- +-- Table structure for screen_public_parti_total_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_public_parti_total_data`; +CREATE TABLE `screen_public_parti_total_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;网格:grid;部门:department;', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id,如果是网格,传入网格所属组织id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称,也可能是网格名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `TOPIC_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '项目总数', + `REG_USER_TOTAL` int(11) NOT NULL COMMENT '注册人数', + `JOIN_USER_TOTAL` int(11) NOT NULL COMMENT '参与人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' 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 screen_user_join +-- ---------------------------- +DROP TABLE IF EXISTS `screen_user_join`; +CREATE TABLE `screen_user_join` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `YEAR_ID` varchar(32) NOT NULL COMMENT '数据更新至 年Id: yyyy', + `MONTH_ID` varchar(32) NOT NULL COMMENT '数据更新至 :月份Id :yyyyMM', + `JOIN_TOTAL` int(11) DEFAULT '0' COMMENT '总的参与次数', + `JOIN_TOTAL_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '总的参与次数较上月增长率(采集的时候后台自己计算)', + `JOIN_TOTAL_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `AVG_ISSUE` int(11) DEFAULT '0' COMMENT '人均议题', + `AVG_ISSUE_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '人均议题较上月增长率(采集的时候后台自己计算)', + `AVG_ISSUE_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `AVG_JOIN` int(11) DEFAULT '0' COMMENT '平均参与度', + `AGVG_JOIN_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '平均参与度较上月增长率(采集的时候后台自己计算)', + `AGVG_JOIN_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-公众参与'; + +-- ---------------------------- +-- Table structure for screen_user_total_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_user_total_data`; +CREATE TABLE `screen_user_total_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;网格:grid;部门:department;', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称,也可能是网格名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `USER_TOTAL` int(11) DEFAULT '0' COMMENT '用户总数', + `PARTY_TOTAL` int(11) DEFAULT '0' COMMENT '注册党总数', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '小组(党群)总数', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '项目总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' 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='中央区-各类(用户|党员|党群|话题|议题|项目)总数'; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql index 9f1554015e..541d0d7307 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql @@ -1 +1,2 @@ -ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等'; \ No newline at end of file +/*ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等';*/ +select 1; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml new file mode 100644 index 0000000000..211e573c3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -0,0 +1,165 @@ + + + + + + + + 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 + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.dataType}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_agency_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + AND index_code = #{indexCode} + AND data_type = #{dataType} + + + + + + + + + + + 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() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml new file mode 100644 index 0000000000..3c6fb2ea55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -0,0 +1,142 @@ + + + + + + + delete from fact_index_cpc_score + where + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + + and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO `fact_index_cpc_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `YEAR_ID`, + `MONTH_ID`, + `USER_ID`, + `IS_TOTAL`, + `SCORE`, + `INDEX_CODE`, + `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.isTotal}, + #{item.score}, + #{item.indexCode}, + 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 new file mode 100644 index 0000000000..077c6a7430 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + insert into fact_index_dept_score + ( + ID, + CUSTOMER_ID, + DEPT_ID, + AGENCY_ID, + 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.deptId}, + #{item.agencyId}, + #{item.quarterId}, + #{item.yearId}, + + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + 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/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml new file mode 100644 index 0000000000..e45dcb04ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + fact_index_grid_score + WHERE + CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND INDEX_CODE = #{indexCode} + and IS_TOTAL=#{isTotal} + + + + 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), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 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/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml new file mode 100644 index 0000000000..67165f1bf7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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} + + + + insert into fact_index_govrn_ablity_dept_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + DEPT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + HANDLE_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.deptId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.transferedCount}, + #{item.closedProjectCount}, + #{item.respProjectRatio}, + #{item.handleProjectRatio}, + #{item.closedProjectRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..870e2596ec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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} + + + + insert into fact_index_govrn_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_TOTAL, + AVG_ISSUE_COUNT, + ISSUE_TO_PROJECT_RATIO, + PROJECT_TOTAL, + SELF_SOLVE_PROJECT_COUNT, + RESOLVE_PROJECT_COUNT, + TRANSFER_RIGHT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.issueTotal}, + #{item.avgIssueCount}, + #{item.issueToProjectRatio}, + #{item.projectTotal}, + #{item.selfSolveProjectCount}, + #{item.resolveProjectCount}, + #{item.transferRightRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml similarity index 74% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 36e4d07b3a..a703174aee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -1,9 +1,9 @@ - + - + @@ -18,6 +18,7 @@ + @@ -53,6 +54,7 @@ CLOSED_PROJECT_RATIO, SATISFACTION_RATIO, OVERDUE_PROJECT_RATIO, + HANDLE_PROJECT_RATIO, DEL_FLAG, REVISION, CREATED_BY, @@ -76,6 +78,7 @@ #{item.closedProjectRatio}, #{item.satisfactionRatio}, #{item.overdueProjectRatio}, + #{item.handleProjectRatio}, 0, 0, 'APP_USER', @@ -85,4 +88,28 @@ ) + + + 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 new file mode 100644 index 0000000000..8336f33e9a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -0,0 +1,127 @@ + + + + + + + delete from fact_index_party_ablity_cpc_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + limit 1000 + + + + insert into fact_index_party_ablity_cpc_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + CREATE_TOPIC_COUNT, + JOIN_TOPIC_COUNT, + SHIFT_ISSUE_COUNT, + SHIFT_PROJECT_COUNT, + JOIN_THREE_MEETS_COUNT, + GROUP_USER_COUNT, + GROUP_TOPIC_COUNT, + TOPIC_TO_ISSUE_RATIO, + GROUP_ACTIVE_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + USER_ID + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.createTopicCount}, + #{item.joinTopicCount}, + #{item.shiftIssueCount}, + #{item.shiftProjectCount}, + #{item.joinThreeMeetsCount}, + #{item.groupUserCount}, + #{item.groupTopicCount}, + #{item.topicToIssueRatio}, + #{item.groupActiveUserCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.userId} + ) + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..2d8b199022 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_party_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + + + + insert into fact_index_party_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + USER_COUNT, + PARTY_COUNT, + ACTIVE_USER_COUNT, + ACTIVE_PARTY_COUNT, + PARTY_AVG_TOPIC_COUNT, + USER_AVG_TOPIC_COUNT, + PARTY_AVG_SHIFT_PROJECT_COUNT, + USER_AVG_SHIFT_PROJECT_COUNT, + CREATE_GROUP_PARTY_COUNT, + PUBLISH_ARTICLE_COUNT, + ISSUE_TO_PROJECT_RATIO, + CREATE_THREE_MEETS_COUNT, + JOIN_THREE_MEETS_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.userCount}, + #{item.partyCount}, + #{item.activeUserCount}, + #{item.activePartyCount}, + #{item.partyAvgTopicCount}, + #{item.userAvgTopicCount}, + #{item.partyAvgShiftProjectCount}, + #{item.userAvgShiftProjectCount}, + #{item.createGroupPartyCount}, + #{item.publishArticleCount}, + #{item.issueToProjectRatio}, + #{item.createThreeMeetsCount}, + #{item.joinThreeMeetsCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml similarity index 64% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index 758a686052..df7e750147 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -1,9 +1,9 @@ - + - + @@ -71,4 +71,42 @@ + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..467bba7667 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_service_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + + + + insert into fact_index_service_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ACTIVITY_COUNT, + VOLUNTEER_RATIO, + PARTY_VOLUNTEER_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.activityCount}, + #{item.volunteerRatio}, + #{item.partyVolunteerRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml similarity index 64% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index c475e2aca1..03bc8a2b10 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -1,9 +1,9 @@ - + - + @@ -70,4 +70,42 @@ ) + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml new file mode 100644 index 0000000000..7978db5eee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml @@ -0,0 +1,160 @@ + + + + + + + + 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 + + ( + REPLACE(UUID(),'-',''), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_community_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + AND index_code = #{indexCode} + + + + + + + + + + + + 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() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml new file mode 100644 index 0000000000..010ac06798 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + 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/IndexCodeFieIdReDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexCodeFieIdReDao.xml new file mode 100644 index 0000000000..5fbd64673a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexCodeFieIdReDao.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexDictDao.xml similarity index 73% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexDictDao.xml index a91513e1d5..146fddddb2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexDictDao.xml @@ -1,7 +1,7 @@ - + delete from index_dict diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml similarity index 75% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml index 4597456ae7..668ba89e2d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml @@ -1,7 +1,7 @@ - + + + + + + + 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 new file mode 100644 index 0000000000..c85dc0af60 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -0,0 +1,139 @@ + + + + + + + delete from screen_customer_grid + where CUSTOMER_ID = #{customerId} + AND GRID_ID IN + + #{item} + + + + + insert into screen_customer_grid + ( + ID, + CUSTOMER_ID, + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + AREA_MARKS, + CENTER_MARK, + PARTY_MARK, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME, + ALL_PARENT_IDS + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.areaMarks}, + #{item.centerMark}, + #{item.partyMark}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime}, + #{item.allParentIds} + ) + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml similarity index 88% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml index e26c43115c..051f14cbcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -1,11 +1,11 @@ - + delete from screen_difficulty_data - where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + where CUSTOMER_ID = #{customerId} @@ -35,7 +35,8 @@ UPDATED_BY, UPDATED_TIME, LATEST_OPERATE_DESC, - DATA_END_TIME + DATA_END_TIME, + ALL_PARENT_IDS ) values ( @@ -63,7 +64,8 @@ 'APP_USER', now(), #{item.latestOperateDesc}, - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.allParentIds} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml similarity index 91% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml index be95b118df..fa22c8ad79 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_event_data @@ -38,7 +38,8 @@ EVENT_STATUS_CODE, EVENT_STATUS_DESC, LATEST_OPERATE_DESC, - DATA_END_TIME + DATA_END_TIME, + ALL_PARENT_IDS ) values ( @@ -69,7 +70,8 @@ #{item.eventStatusCode}, #{item.eventStatusDesc}, #{item.latestOperateDesc}, - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.allParentIds} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml similarity index 79% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml index eaef413fd8..9623ede0b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_event_img_data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml similarity index 95% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml index 9a6e6c3c44..9a8da4e40e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_govern_rank_data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml similarity index 66% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml index 721c4e0af3..4c8369dd0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml @@ -1,7 +1,7 @@ - + delete from screen_index_data_monthly @@ -59,4 +59,23 @@ + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml index 8747e1219a..75eb13d280 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml @@ -1,7 +1,7 @@ - + delete from screen_index_data_yearly diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml similarity index 90% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml index 4ebe5e2c28..64c79965e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_org_rank_data @@ -35,7 +35,8 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + ALL_PARENT_IDS ) values ( @@ -59,7 +60,8 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.allParentIds} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml similarity index 95% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml index afeaca9651..12bc3a4755 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_party_branch_data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index d317d97ee9..c9e4e65e5f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_party_link_masses_data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml similarity index 88% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml index 070e952878..fe88da6d76 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_party_user_rank_data @@ -29,7 +29,8 @@ CREATED_TIME, UPDATED_BY, UPDATED_TIME, - DATA_END_TIME + DATA_END_TIME, + ALL_PARENT_IDS ) values ( @@ -51,7 +52,8 @@ now(), 'APP_USER', now(), - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.allParentIds} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml similarity index 96% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index 8142176bee..ceff6812fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_pioneer_data 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 new file mode 100644 index 0000000000..69701d3f17 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_public_parti_total_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_public_parti_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + REG_USER_TOTAL, + JOIN_USER_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + #{item.regUserTotal}, + + #{item.joinUserTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml index 9751293f5f..678b2b960c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml @@ -1,9 +1,9 @@ - + - select CUSTOMER_ID customerId, YEAR_ID yearId, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml similarity index 89% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index a3f29dd5a6..032739c71c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -1,7 +1,7 @@ - + delete from screen_user_total_data @@ -28,8 +28,6 @@ TOPIC_TOTAL, ISSUE_TOTAL, PROJECT_TOTAL, - REG_USER_TOTAL, - JOIN_USER_TOTAL, DEL_FLAG, REVISION, CREATED_BY, @@ -52,8 +50,6 @@ #{item.topicTotal}, #{item.issueTotal}, #{item.projectTotal}, - #{item.regUserTotal}, - #{item.joinUserTotal}, 0, 0, 'APP_USER', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml deleted file mode 100644 index 107b94abc1..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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} - - - - insert into fact_index_govrn_ablity_dept_monthly - ( - ID, - CUSTOMER_ID, - AGENCY_ID, - DEPT_ID, - MONTH_ID, - QUARTER_ID, - YEAR_ID, - TRANSFERED_COUNT, - CLOSED_PROJECT_COUNT, - RESP_PROJECT_RATIO, - HANDLE_PROJECT_RATIO, - CLOSED_PROJECT_RATIO, - SATISFACTION_RATIO, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.deptId}, - #{item.monthId}, - #{item.quarterId}, - #{item.yearId}, - #{item.transferedCount}, - #{item.closedProjectCount}, - #{item.respProjectRatio}, - #{item.handleProjectRatio}, - #{item.closedProjectRatio}, - #{item.satisfactionRatio}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml deleted file mode 100644 index ed0f65cc79..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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} - - - - insert into fact_index_govrn_ablity_grid_monthly - ( - ID, - CUSTOMER_ID, - AGENCY_ID, - GRID_ID, - MONTH_ID, - QUARTER_ID, - YEAR_ID, - ISSUE_TOTAL, - AVG_ISSUE_COUNT, - AVG_SHIFT_PROJECT_RATIO, - PROJECT_TOTAL, - SELF_SOLVE_PROJECT_COUNT, - RESOLVE_PROJECT_COUNT, - TRANSFER_RIGHT_RATIO, - SATISFACTION_RATIO, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.gridId}, - #{item.monthId}, - #{item.quarterId}, - #{item.yearId}, - #{item.issueTotal}, - #{item.avgIssueCount}, - #{item.avgShiftProjectRatio}, - #{item.projectTotal}, - #{item.selfSolveProjectCount}, - #{item.resolveProjectCount}, - #{item.transferRightRatio}, - #{item.satisfactionRatio}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml deleted file mode 100644 index 836adcdb03..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - delete from fact_index_party_ablity_cpc_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} - AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} - - - - insert into fact_index_party_ablity_cpc_monthly - ( - ID, - CUSTOMER_ID, - AGENCY_ID, - PARENT_ID, - GRID_ID, - USER_ID, - MONTH_ID, - QUARTER_ID, - YEAR_ID, - CREATE_TOPIC_COUNT, - JOIN__TOPIC_COUNT, - SHIFT_ISSUE_COUNT, - SHIFT_PROJECT_COUNT, - JOIN_THREE_MEETS_COUNT, - GROUP_USER_COUNT, - GROUP_TOPIC_COUNT, - TOPIC_TO_ISSUE_RATIO, - ISSUE_TO_PROJECT_COUNT, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.parentId}, - #{item.gridId}, - #{item.userId}, - #{item.monthId}, - #{item.quarterId}, - #{item.yearId}, - #{item.createTopicCount}, - #{item.joinTopicCount}, - #{item.shiftIssueCount}, - #{item.shiftProjectCount}, - #{item.joinThreeMeetsCount}, - #{item.groupUserCount}, - #{item.groupTopicCount}, - #{item.topicToIssueRatio}, - #{item.issueToProjectCount}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml deleted file mode 100644 index e51a7d4f7f..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - delete from fact_index_party_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - - - - insert into fact_index_party_ablity_grid_monthly - ( - ID, - CUSTOMER_ID, - AGENCY_ID, - GRID_ID, - MONTH_ID, - QUARTER_ID, - YEAR_ID, - USER_COUNT, - PARTY_COUNT, - ACTIVE_USER_COUNT, - ACTIVE_PARTY_COUNT, - PARTY_AVG_TOPIC_COUNT, - USER_AVG_TOPIC_COUNT, - PARTY_AVG_SHIFT_PROJECT_COUNT, - USER_AVG_SHIFT_PROJECT_COUNT, - CREATE_GROUP_PARTY_COUNT, - PUBLISH_ARTICLE_COUNT, - ISSUE_TO_PROJECT_RATIO, - CREATE_THREE_MEETS_COUNT, - JOIN_THREE_MEETS_COUNT, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.gridId}, - #{item.monthId}, - #{item.quarterId}, - #{item.yearId}, - #{item.userCount}, - #{item.partyCount}, - #{item.activeUserCount}, - #{item.activePartyCount}, - #{item.partyAvgTopicCount}, - #{item.userAvgTopicCount}, - #{item.partyAvgShiftProjectCount}, - #{item.userAvgShiftProjectCount}, - #{item.createGroupPartyCount}, - #{item.publishArticleCount}, - #{item.issueToProjectRatio}, - #{item.createThreeMeetsCount}, - #{item.joinThreeMeetsCount}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml deleted file mode 100644 index bc4348ea56..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - delete from fact_index_service_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - - - - insert into fact_index_service_ablity_grid_monthly - ( - ID, - CUSTOMER_ID, - AGENCY_ID, - GRID_ID, - MONTH_ID, - QUARTER_ID, - YEAR_ID, - ACTIVITY_COUNT, - VOLUNTEER_RATIO, - PARTY_VOLUNTEER_RATIO, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.gridId}, - #{item.monthId}, - #{item.quarterId}, - #{item.yearId}, - #{item.activityCount}, - #{item.volunteerRatio}, - #{item.partyVolunteerRatio}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml deleted file mode 100644 index b7854f3338..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml deleted file mode 100644 index a3fedbf4d5..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - delete from screen_customer_dept - where CUSTOMER_ID = #{customerId} - AND DEPT_ID IN - - #{item} - - - - - insert into screen_customer_dept - ( - ID, - CUSTOMER_ID, - DEPT_ID, - DEPT_NAME, - PARENT_AGENCY_ID, - AREA_MARKS, - CENTER_MARK, - DEPT_MARK, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME, - DATA_END_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.deptId}, - #{item.deptName}, - #{item.parentAgencyId}, - #{item.areaMarks}, - #{item.centerMark}, - #{item.deptMark}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now(), - #{item.dataEndTime} - ) - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml deleted file mode 100644 index 5381e9ddd2..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - delete from screen_customer_grid - where CUSTOMER_ID = #{customerId} - AND GRID_ID IN - - #{item} - - - - - insert into screen_customer_grid - ( - ID, - CUSTOMER_ID, - GRID_ID, - GRID_NAME, - PARENT_AGENCY_ID, - AREA_MARKS, - CENTER_MARK, - PARTY_MARK, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME, - DATA_END_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.gridId}, - #{item.gridName}, - #{item.parentAgencyId}, - #{item.areaMarks}, - #{item.centerMark}, - #{item.partyMark}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now(), - #{item.dataEndTime} - ) - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java index d218327ad1..6e0e7823ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java @@ -3,7 +3,7 @@ package com.epmet.stats.test.model; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.fastjson.JSON; -import com.epmet.dao.screen.ScreenCustomerAgencyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 new file mode 100644 index 0000000000..d573765b6b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java @@ -0,0 +1,249 @@ +package com.epmet.stats.test.normalizing; + +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 org.junit.Test; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +public class DemoScoreCal { + + public static void main(String[] args) { + //demoInteger(); + //demoIntegerPartical(); + //demoDouble(); + } + + /** + * 整数类型,完整源数据列表的归一算法 + */ + @Test + public void demoInteger() { + Integer[] iArray = {4, 8, 1, 3, 2}; + + ScoreCalculator sc = new IntegerScoreCalculator(iArray, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + BigDecimal[] scores = sc.normalize(iArray); + Arrays.stream(scores).forEach(s -> System.out.println(s)); + } + + /** + * 整数类型,基于边界值的部分列表的的归一算法 + */ + @Test + public void demoIntegerPartical() { + Integer[] iArray = {4, 1, 8}; + + ScoreCalculator sc = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + BigDecimal[] scores = sc.normalize(iArray);// 此处也可以直接使用list参数的重载方法,计算阶段没有任何区别,区别在于new IntegerScoreCalculator()阶段 + Arrays.stream(scores).forEach(s -> System.out.println(s)); + } + + /** + * double类型归一算法 + */ + public static void demoDouble() { + Double[] iArray = {1.9, 8.9, 1.0, 3.0, 2.0}; + BigDecimal minScore = new BigDecimal(5); + BigDecimal maxScore = new BigDecimal(10); + + ScoreCalculator sc = new DoubleScoreCalculator(iArray, minScore, maxScore, Correlation.POSITIVE); + BigDecimal normalize = sc.normalize(3.0); + System.out.println(normalize); + + /** + * 同一组数据内,只有被计算值变了的话,不需要重新new对象,直接重复调用即可 + */ + BigDecimal normalize2 = sc.normalize(2.0); + System.out.println(normalize2); + } + + /** + * 批量计算demo + */ + @Test + public void testBatchCalculate() throws InterruptedException { + //{4,8,1,3,2} + + // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + ScoreCalculator sc2 = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + + 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", index1SampleValues, new BigDecimal(10), new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", index2SampleValues, new BigDecimal(10), new BigDecimal(1), sc2); + + List indexInputVOS = Arrays.asList(index1VO, index2VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + + System.err.println("--------------------------------"); + result.stream().forEach(r -> System.out.println(r)); + Thread.sleep(10); + System.err.println("--------------------------------"); + } + + @Test + public void testBigDecimalBatchCalculate() throws InterruptedException { + //{4,8,1,3,2} + + // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + + List index1SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(4)), new SampleValue<>("id2", new BigDecimal(1)), new SampleValue<>("id3", new BigDecimal(8))); + 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); + + List indexInputVOS = Arrays.asList(index1VO, index2VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + + System.err.println("--------------------------------"); + result.stream().forEach(r -> System.out.println(r)); + Thread.sleep(10); + System.err.println("--------------------------------"); + } + + @Test + public void testBigDecimalBatchCalculateGroupBySampleId() throws InterruptedException { + //{4,8,1,3,2} + + //分值计算器 每个指标需要单独的分值计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(50), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(20), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc3 = new BigDecimalScoreCalculator(new BigDecimal(20), new BigDecimal(40), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc4 = new BigDecimalScoreCalculator(new BigDecimal(10), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + + //每个指标的数值 比如 a指标里有5条数据 + List index1SampleValues = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(100)), + new SampleValue<>("id2", new BigDecimal(50)), + new SampleValue<>("id3", new BigDecimal(60)), + new SampleValue<>("id4", new BigDecimal(80)), + new SampleValue<>("id5", new BigDecimal(80)) + ); + + List index1SampleValues2 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(100)), + new SampleValue<>("id2", new BigDecimal(80)), + new SampleValue<>("id3", new BigDecimal(80)), + new SampleValue<>("id4", new BigDecimal(20)), + new SampleValue<>("id5", new BigDecimal(20)) + ); + + List index1SampleValues3 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(40)), + new SampleValue<>("id2", new BigDecimal(20)), + new SampleValue<>("id3", new BigDecimal(40)), + new SampleValue<>("id4", new BigDecimal(30)), + new SampleValue<>("id5", new BigDecimal(20)) + ); + + List index1SampleValues4 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(20)), + new SampleValue<>("id2", new BigDecimal(100)), + new SampleValue<>("id3", new BigDecimal(10)), + new SampleValue<>("id4", new BigDecimal(50)), + new SampleValue<>("id5", new BigDecimal(20)) + ); + + + // 每个指标的信息,包括样本列表,权重,指标标记 + 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); + + + List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + + System.err.println("----------------1----------------"); + result.forEach((key, value) -> { + System.out.println(key.concat("的得分为:").concat(value.toString())); + }); + System.err.println("-----------------2---------------"); + } + + + @Test + public void testCpc() throws InterruptedException { + //{4,8,1,3,2} + + //分值计算器 每个指标需要单独的分值计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(10), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(20), new BigDecimal(80), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc3 = new BigDecimalScoreCalculator(new BigDecimal(10), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc4 = new BigDecimalScoreCalculator(new BigDecimal(0.1), new BigDecimal(0.6), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + + //每个指标的数值 比如 a指标里有5条数据 + List index1SampleValues = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(80)), + new SampleValue<>("id2", new BigDecimal(10)), + new SampleValue<>("id3", new BigDecimal(100)), + new SampleValue<>("id4", new BigDecimal(50)), + new SampleValue<>("id5", new BigDecimal(40)) + ); + + List index1SampleValues2 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(20)), + new SampleValue<>("id2", new BigDecimal(50)), + new SampleValue<>("id3", new BigDecimal(40)), + new SampleValue<>("id4", new BigDecimal(35)), + new SampleValue<>("id5", new BigDecimal(80)) + ); + + List index1SampleValues3 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(100)), + new SampleValue<>("id2", new BigDecimal(70)), + new SampleValue<>("id3", new BigDecimal(50)), + new SampleValue<>("id4", new BigDecimal(55)), + new SampleValue<>("id5", new BigDecimal(10)) + ); + + List index1SampleValues4 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(1)), + new SampleValue<>("id2", new BigDecimal(0.1)), + new SampleValue<>("id3", new BigDecimal(1)), + new SampleValue<>("id4", new BigDecimal(0.3)), + new SampleValue<>("id5", new BigDecimal(1)) + ); + + + // 每个指标的信息,包括样本列表,权重,指标标记 + 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); + + + List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + + System.err.println("----------------1----------------"); + result.forEach((key, value) -> { + System.out.println(key.concat("的得分为:").concat(value.toString())); + }); + System.err.println("-----------------2---------------"); + } + + +} diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml index 5a4cf59cab..06d167aab2 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml @@ -158,12 +158,41 @@ dev + + 8086 + dev + + + + + + epmet_activiti_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8086 - dev + local diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index d23de0c0e2..caa9bd6301 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -39,4 +39,11 @@ public interface EpmetCommonServiceOpenFeignClient { */ @PostMapping("/commonservice/externalapp/auth") Result externalAppAuth(@RequestBody ExternalAppAuthFormDTO formDTO); + + /** + * 获取外部应用客户Id + * @return + */ + @PostMapping("/commonservice/externalapp/getcustomerids") + Result> getExternalCustomerIds(); } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java index 555e502062..f21808fc8c 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -29,4 +29,9 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer public Result externalAppAuth(ExternalAppAuthFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "externalAppAuth", formDTO); } + + @Override + public Result> getExternalCustomerIds() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getExternalCustomerIds", null); + } } 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 e7736f4f6b..a81498d9a8 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -98,9 +98,6 @@ dev - - true - 8103 dev @@ -135,6 +132,45 @@ 52d9d9b0e7d0eb5b8b81c205b579e07c + + local + + true + + + 8103 + local + + + + + + + + epmet_common_service_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + + test + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8113 - dev + local @@ -191,7 +220,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 5b963aa293..202bc6a9d7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -110,12 +110,50 @@ dev + + 8111 + dev + + + + + + epmet_heart_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8111 - dev + local @@ -129,7 +167,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index 3b0c5fcbf5..eddc655426 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -107,12 +107,44 @@ dev + + 8084 + dev + + + + + + epmet_job_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8084 - dev + local @@ -126,7 +158,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index deea95460a..1322ad2243 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -124,12 +124,41 @@ dev + + 8085 + dev + + + + + + epmet_message_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8085 - dev + local @@ -143,7 +172,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index 8fc5bc1d67..b73264233b 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -120,12 +120,41 @@ dev + + 8083 + dev + + + + + + epmet_oss_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8083 - dev + local @@ -139,7 +168,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index c67cf5c997..f0add3faf1 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -115,12 +115,44 @@ dev + + 8112 + dev + + + + + + epmet_point_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8112 - dev + local @@ -134,7 +166,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java index 910ded04de..afcedffee0 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java @@ -58,6 +58,11 @@ public class CodeAuditResultDTO implements Serializable { */ private String result; + /** + * 是否加急 + */ + private Boolean isSpeed; + /** * 原因 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java index 9c2f1c506f..a16d0c8d6c 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java @@ -25,6 +25,11 @@ public class SubmitAuditFormDTO implements Serializable { */ private Boolean isSpeed; + /** + * isSpeed=true时,是否是审核失败后的反馈提审 + */ + private Boolean isRepeat; + /** * 小程序版本说明和功能解释 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java index b1b367c457..74b1bb54d4 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java @@ -71,6 +71,10 @@ public class CodeVersionInfoResultDTO implements Serializable { * */ private String status; + /** + * + */ + private Boolean isSpeed; } @Data diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index d4706c5733..d9ab7469c0 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.134 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.141 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index 1028ad0be9..7d3cbbf9c4 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.138 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.141 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml index e368b27eda..9b72f3c260 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.131 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.132 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index 6eadb9e5f2..f85185fb9b 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.138 + 0.0.141 com.epmet @@ -183,12 +183,41 @@ dev + + 8110 + dev + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8110 - dev + local @@ -202,9 +231,9 @@ 6379 123456 - true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java index 164b8a97bb..488fa876a0 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java @@ -58,6 +58,11 @@ public class CodeAuditResultEntity extends BaseEpmetEntity { */ private String result; + /** + * 是否加急 + */ + private Boolean isSpeed; + /** * 原因 */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index 611c1a05b4..09f5f5a276 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -183,6 +183,7 @@ public class CodeServiceImpl implements CodeService { //审核版本 CodeCustomerDTO audit = codeCustomerService.getAuditInfo(formDTO.getCustomerId(), formDTO.getClientType()); if(null != audit) { + CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(audit.getId()); CodeVersionInfoResultDTO.AuditBean auditBean = new CodeVersionInfoResultDTO.AuditBean(); auditBean.setCodeId(audit.getId()); auditBean.setVersion(audit.getUserVersion()); @@ -191,7 +192,6 @@ public class CodeServiceImpl implements CodeService { //获取小程序调用令牌 AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); //获取审核结果信息 - CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(audit.getId()); //调用微信API获取最新审核状态 WxMaCodeAuditStatusReq request = new WxMaCodeAuditStatusReq(); request.setAuditId(auditResult.getAuditId()); @@ -222,6 +222,7 @@ public class CodeServiceImpl implements CodeService { } } auditBean.setStatus(audit.getStatus()); + auditBean.setIsSpeed(auditResult.getIsSpeed()); auditBean.setCommitTime(DateUtils.format(audit.getCommitTime(), DateUtils.DATE_TIME_PATTERN)); auditBean.setAuditTime(DateUtils.format(audit.getAuditTime(), DateUtils.DATE_TIME_PATTERN)); resultDTO.setAudit(auditBean); @@ -283,6 +284,7 @@ public class CodeServiceImpl implements CodeService { codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxResult.getErrorMsg()); throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); } + boolean speedSuccess = false; if(formDTO.getIsSpeed()) { //调用微信API 加急审核 WxMaSpeedUpAuditReq speedRequest = new WxMaSpeedUpAuditReq(); @@ -291,8 +293,9 @@ public class CodeServiceImpl implements CodeService { if (!wxSpeedResult.success()) { saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType(), codeCustomerDTO.getId(), codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxSpeedResult.getErrorMsg()); - throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg()); + log.error(wxSpeedResult.getErrorMsg()); } + speedSuccess = wxSpeedResult.success(); } //获取审核结果信息 CodeAuditResultDTO codeAuditResultDTO = codeAuditResultService.getAuditResultByCodeId(formDTO.getCodeId()); @@ -302,18 +305,24 @@ public class CodeServiceImpl implements CodeService { codeAuditResultDTO.setCustomerId(codeCustomerDTO.getCustomerId()); codeAuditResultDTO.setCodeId(codeCustomerDTO.getId()); codeAuditResultDTO.setAuditId(wxResult.getData()); + codeAuditResultDTO.setIsSpeed(speedSuccess); codeAuditResultDTO.setResult(CodeConstant.AUDITING); codeAuditResultService.save(codeAuditResultDTO); } else { - codeAuditResultDTO.setFeedbackInfo(formDTO.getFeedbackInfo()); - codeAuditResultDTO.setFeedbackStuff(formDTO.getFeedbackStuff()); codeAuditResultService.update(codeAuditResultDTO); codeAuditResultService.deleteById(codeAuditResultDTO.getId()); codeAuditResultDTO = new CodeAuditResultDTO(); + codeAuditResultDTO.setFeedbackInfo(formDTO.getFeedbackInfo()); + codeAuditResultDTO.setFeedbackStuff(formDTO.getFeedbackStuff()); codeAuditResultDTO.setCustomerId(codeCustomerDTO.getCustomerId()); codeAuditResultDTO.setCodeId(codeCustomerDTO.getId()); codeAuditResultDTO.setAuditId(wxResult.getData()); codeAuditResultDTO.setResult(CodeConstant.AUDITING); + if (formDTO.getIsRepeat()) { + codeAuditResultDTO.setIsSpeed(true); + } else { + codeAuditResultDTO.setIsSpeed(speedSuccess); + } codeAuditResultService.save(codeAuditResultDTO); } //更新代码表状态 @@ -656,6 +665,8 @@ public class CodeServiceImpl implements CodeService { codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxSpeedResult.getErrorMsg()); throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg()); } + codeAuditResultDTO.setIsSpeed(true); + codeAuditResultService.update(codeAuditResultDTO); } @Override diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index 08f17ae49a..c0d11dca5b 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -44,7 +44,7 @@ public interface WxMaCodeConstant { * 下面注释url为按钮形式 */ String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s"; -// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s#wechat_redirect"; +// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s&auth_type=3#wechat_redirect"; /** * 创建开放平台帐号并绑定公众号/小程序 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql new file mode 100644 index 0000000000..9e7d638917 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql @@ -0,0 +1 @@ +ALTER TABLE code_audit_result ADD COLUMN IS_SPEED tinyint NULL DEFAULT 0 COMMENT '是否加急' AFTER RESULT; \ No newline at end of file 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 0f0fd6fe31..6f7c7fe6d8 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 @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.38 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.40 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index 948dca9446..9c0b30d5c1 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.39 + 0.3.40 gov-access com.epmet @@ -101,12 +101,42 @@ dev + + 8099 + dev + + + + + + epmet_gov_access_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + + local true 8099 - dev + local @@ -120,7 +150,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index c5bf66fd08..494a417395 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -93,12 +93,35 @@ dev + + 8097 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8097 - dev + local 0 @@ -106,7 +129,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index a90b43312d..93d9f0334c 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -119,12 +119,46 @@ dev + + 8101 + dev + + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8101 - dev + local @@ -138,7 +172,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 073cf96190..54f3b8e225 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -119,12 +119,33 @@ dev + + 8098 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8098 - dev + local 0 @@ -132,7 +153,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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 952b5c665f..4d59daef61 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 @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.87 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.88 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index f7e38a8870..94f959ad2b 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -125,12 +125,41 @@ dev + + 8092 + dev + + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8092 - dev + local @@ -144,7 +173,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 9cae28ab76..c51ef0b513 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -194,6 +194,9 @@ public class StaffServiceImpl implements StaffService { @Override @Transactional(rollbackFor = Exception.class) public void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO) { + if (tokenDto.getUserId().equals(fromDTO.getStaffId())) { + throw new RenException(EpmetErrorCode.CAN_NOT_SELF.getCode()); + } //1.获取工作人员与机关关系 CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId()); String oldAgency = staffAgencyDTO.getAgencyId(); 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 0c08e7e115..e7aae13868 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 @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.40 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.43 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 163ea7921d..2c45f4a53f 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -119,12 +119,42 @@ dev + + 8102 + dev + + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8102 - dev + local @@ -138,7 +168,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 17268c4fe4..1c80814b41 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -106,12 +106,42 @@ dev + + 8105 + dev + + + + + + epmet_gov_voice_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8105 - dev + local @@ -125,7 +155,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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 ea567d95a0..1c81fdec99 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 @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.17 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.18 ports: - "8093:8093" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index e5c20ef1be..f78794d104 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-server/pom.xml @@ -94,12 +94,41 @@ dev + + 8093 + dev + + + + + + epmet_oper_access_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8093 - dev + local @@ -113,7 +142,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index b675bc8c4a..8535f16485 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -115,12 +115,41 @@ dev + + 8090 + dev + + + + + + epmet_oper_crm_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8090 - dev + local @@ -134,7 +163,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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 fc836e6a15..91e39f33c5 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 @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.42 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.47 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index b42ea55d37..ff5abc3d03 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.43 + 0.3.47 com.epmet oper-customize @@ -92,12 +92,41 @@ dev + + 8089 + dev + + + + + + epmet_oper_customize_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8089 - dev + local @@ -111,7 +140,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index c07b96ad77..9cf3e5ec43 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -122,12 +122,42 @@ dev + + 8095 + dev + + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8095 - dev + local @@ -141,7 +171,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index 4aefd4cbe1..04ba4c1d3e 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -115,12 +115,41 @@ dev + + 8091 + dev + + + + + + epmet_resi_guide_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8091 - dev + local @@ -134,7 +163,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-hall/resi-hall-server/pom.xml b/epmet-module/resi-hall/resi-hall-server/pom.xml index a81bf919dc..a44a834c35 100644 --- a/epmet-module/resi-hall/resi-hall-server/pom.xml +++ b/epmet-module/resi-hall/resi-hall-server/pom.xml @@ -79,12 +79,35 @@ dev + + 8100 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8100 - dev + local 0 @@ -92,7 +115,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index f6eebaaad7..d43f84aaa6 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -99,12 +99,33 @@ dev + + 8104 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8104 - dev + local 0 @@ -112,7 +133,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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 a2a9ae18df..3c154c7eec 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 @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.38 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.40 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 35d2c0edda..1cf70149cc 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.38 + 0.3.40 com.epmet resi-mine @@ -124,19 +124,39 @@ dev + + 8094 + dev + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8094 - dev + local 0 192.168.1.130 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 7ee6d3c54e..d35830cc69 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -121,12 +121,41 @@ dev + + 8096 + dev + + + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8096 - dev + local @@ -140,7 +169,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-voice/resi-voice-server/pom.xml b/epmet-module/resi-voice/resi-voice-server/pom.xml index 5c087281de..9985f3c6a5 100644 --- a/epmet-module/resi-voice/resi-voice-server/pom.xml +++ b/epmet-module/resi-voice/resi-voice-server/pom.xml @@ -85,12 +85,33 @@ dev + + 8106 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8106 - dev + local 0 @@ -98,7 +119,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml index 46532a144e..c77bafe339 100644 --- a/epmet-openapi/epmet-openapi-scan/pom.xml +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -86,6 +86,28 @@ dev + + 8107 + dev + + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true @@ -100,7 +122,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -111,9 +133,6 @@ test - 8107 test 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 7f1bcc84c1..e1af81c0ce 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.121 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.124 ports: - "8087:8087" network_mode: host # 不会创建新的网络 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 0f080c990f..183968322f 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.122 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.124 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index b7c301d01b..b6872595d0 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.122 + 0.3.124 com.epmet epmet-user @@ -130,12 +130,41 @@ dev + + 8087 + dev + + + + + + epmet_user_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8087 - dev + local @@ -149,7 +178,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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 94aaebe1a6..48fd117891 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 @@ -228,7 +228,6 @@ LEFT JOIN user_wechat uw ON uw.user_id = cs.user_id AND uw.del_flag = 0 WHERE cs.del_flag = 0 - AND cs.active_flag = 'active' AND cs.enable_flag = 'enable' AND