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 41302f5e32..25cfa3e0b2 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 @@ -82,5 +82,8 @@ public interface StrConstant { String MAX="MAX"; + //青岛体悟实训客户 String SPECIAL_CUSTOMER = "150282ed25c14ff0785e7e06283b6283"; + //平音客户 + String PY_CUSTOMER = "6f203e30de1a65aab7e69c058826cd80"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java index e75abb9f63..9cd0d8cf49 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/IndexScoreFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; -import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -31,6 +30,8 @@ public class IndexScoreFormDTO implements Serializable { */ //@NotBlank(message = "月份Id不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class}) private String monthId; + + private String customerId; public interface AddUserInternalGroup {} } 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 cb851647af..55543e1e70 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 @@ -134,7 +134,8 @@ public class IndexController { * @author sun */ @PostMapping("month/indexscore") - public Result indexScore(@RequestBody IndexScoreFormDTO formDTO) { + public Result indexScore(@RequestHeader("CustomerId") String customerId,@RequestBody IndexScoreFormDTO formDTO) { + formDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(formDTO, IndexScoreFormDTO.AddUserInternalGroup.class); return new Result().ok(indexService.indexScore(formDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java index c4bf48603a..7e7e2864dd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java @@ -199,6 +199,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { for(UserSubAgencyResultDTO m:dimList){ logger.info("机关名:"+m.getName()+",总数="+m.getTotal()); } + //2021.5.25 平音客户热心居民改网格员 sun start + if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { + dimList.forEach(d->{ + if("热心居民".equals(d.getType())){ + d.setType("网格员"); + } + }); + } + //2021.5.25 平音客户热心居民改网格员 sun end return dimList; } @@ -323,6 +332,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { for(UserSubGridResultDTO m:dimList){ logger.info("网格名:"+m.getName()+",总数="+m.getTotal()); } + //2021.5.25 平音客户热心居民改网格员 sun start + if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { + dimList.forEach(d->{ + if("热心居民".equals(d.getType())){ + d.setType("网格员"); + } + }); + } + //2021.5.25 平音客户热心居民改网格员 sun end return dimList; } @@ -488,6 +506,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { party.setValue(userIncrTrendResDTO.getPartymemberIncr()); resultList.add(party); } + //2021.5.25 平音客户热心居民改网格员 sun start + if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { + resultList.forEach(d->{ + if("热心居民".equals(d.getType())){ + d.setType("网格员"); + } + }); + } + //2021.5.25 平音客户热心居民改网格员 sun end return resultList; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 265e0ddca8..1dcde880e4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -87,6 +87,9 @@ del_flag = '0' AND parent_id = #{agencyId} AND month_id = #{monthId,jdbcType=VARCHAR} + + AND CUSTOMER_ID = #{customerId} + AND ORG_TYPE = #{orgType,jdbcType=VARCHAR} @@ -189,6 +192,9 @@ WHERE del_flag = '0' AND org_id = #{orgId} + + AND customer_id = #{customerId} + AND org_type = #{orgType} 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 7cf197a054..301954275f 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 @@ -35,6 +35,9 @@ del_flag = '0' AND parent_id = #{agencyId} AND year_id = YEAR(CURDATE()) + + AND CUSTOMER_ID = #{customerId} + AND ORG_TYPE = #{orgType,jdbcType=VARCHAR} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index d52c6891c5..2c7c1ac52d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -219,6 +219,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { List> list = null; groupIndexDetailsMap.keySet().forEach(indexCode -> deleteOldData(formDTO, indexCode)); do { + //以党员userId为单位 获取数量 list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(),(pageNo - 1) * pageSize, pageSize, formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); if (!CollectionUtils.isEmpty(list)) { @@ -304,7 +305,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } log.info("计算的参数:{}", JSON.toJSONString(indexMap)); HashMap result = calculateScore(indexMap); - log.info("计算的结果:{}", result); + log.info("计算的结果:{}", JSON.toJSONString(result)); //处理结果 if (CollectionUtils.isEmpty(result)) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql index 3f1cff2e94..367af0a9b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql @@ -1 +1 @@ -ALTER TABLE `fact_origin_topic_main_daily` ADD `SHIFT_ISSUE` tinyint(1) NOT NULL COMMENT '是否转为议题,0:false,1:true'; \ No newline at end of file +ALTER TABLE `fact_origin_topic_main_daily` ADD `SHIFT_ISSUE` tinyint(1) NOT NULL default '0' COMMENT '是否转为议题,0:false,1:true' AFTER `CREATE_TOPIC_USER_IS_PARTY`; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 9610514dcf..2f588f52ff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -120,15 +120,15 @@ cpc.QUARTER_ID, cpc.YEAR_ID, cpc.USER_ID, - cpc.CREATE_TOPIC_COUNT, - cpc.JOIN_TOPIC_COUNT, - cpc.SHIFT_ISSUE_COUNT, - cpc.SHIFT_PROJECT_COUNT, - cpc.JOIN_THREE_MEETS_COUNT, - cpc.GROUP_USER_COUNT, - cpc.GROUP_TOPIC_COUNT, - cpc.TOPIC_TO_ISSUE_RATIO, - cpc.GROUP_ACTIVE_USER_COUNT + SUM(cpc.CREATE_TOPIC_COUNT) CREATE_TOPIC_COUNT, + SUM(cpc.JOIN_TOPIC_COUNT) JOIN_TOPIC_COUNT, + SUM(cpc.SHIFT_ISSUE_COUNT) SHIFT_ISSUE_COUNT, + SUM(cpc.SHIFT_PROJECT_COUNT) SHIFT_PROJECT_COUNT, + SUM(cpc.JOIN_THREE_MEETS_COUNT) JOIN_THREE_MEETS_COUNT, + SUM(cpc.GROUP_USER_COUNT) GROUP_USER_COUNT, + SUM(cpc.GROUP_TOPIC_COUNT) GROUP_TOPIC_COUNT, + SUM(cpc.TOPIC_TO_ISSUE_RATIO) TOPIC_TO_ISSUE_RATIO, + SUM(cpc.GROUP_ACTIVE_USER_COUNT) GROUP_ACTIVE_USER_COUNT FROM fact_index_party_ablity_cpc_monthly cpc inner join screen_customer_grid scg @@ -148,6 +148,7 @@ and scg.CUSTOMER_ID=#{customerId,jdbcType=VARCHAR} + GROUP BY cpc.USER_ID LIMIT #{offset},#{pageSize}