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 ce57594ad2..ea8f100f6c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -295,21 +295,32 @@ public class RedisKeys { * @return */ public static String getExternalAppSecretKey(String appId) { - return String.format(rootPrefix+"externalapp:secret:%s",appId); + return String.format(rootPrefix + "externalapp:secret:%s", appId); } /** * 计算指标时获取指标code和fields关系缓存Key + * * @return */ public static String getIndexCodeFieldReKey() { return rootPrefix.concat("stats:indexcal:indexcode:field"); } + /** + * 计算指标时获取指标权重缓存Key + * + * @return + */ + public static String getIndexCodeWeightKey(String customerId) { + return rootPrefix.concat("stats:indexcal:indexcode:weight").concat(customerId); + } + /** * 客户统计的计算标记。 * 0:未在计算 * 1:正在计算 + * * @param customerId * @return */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index 619eba4625..73ebfc5c14 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -86,7 +86,11 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) { - return screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + PartymemberAgeDistributionResultDTO ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + if(null == ageInfo){ + ageInfo = new PartymemberAgeDistributionResultDTO(); + } + return ageInfo; } /** diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index 793be083a1..1be215aa54 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java index dabf459123..605f755064 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -120,12 +120,17 @@ public class AgencyScoreDTO implements Serializable { /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; + + /** + * 权重 + */ + private BigDecimal weight; public AgencyScoreDTO() { this.isTotal = NumConstant.ZERO_STR; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java index f61ab58957..8c0ee008be 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java @@ -120,4 +120,8 @@ public class DeptScoreDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file + /** + * 权重(同一组权重总和=1) 9.12新增 + */ + private BigDecimal weight; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java index 026b92084b..2888cc7706 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -17,11 +17,11 @@ package com.epmet.dto.screen; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 社区相关分数表 @@ -112,12 +112,17 @@ public class FactIndexCommunityScoreDTO implements Serializable { /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; + + /** + * 权重 + */ + private BigDecimal weight; public FactIndexCommunityScoreDTO() { this.customerId = ""; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java index d5be2db6e9..ed068f9a75 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java @@ -119,4 +119,8 @@ public class FactIndexGridScoreDTO implements Serializable { */ private Date updatedTime; + /** + * 权重(同一组权重总和=1) 9.12新增 + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java index c27f75db87..4adf142a12 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -64,4 +65,22 @@ public class IndexDataMonthlyFormDTO implements Serializable { * 治理能力指数 */ private BigDecimal governAblity; + +// PARTY_DEV_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 +// SERVICE_ABLITY_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 +// GOVERN_ABLITY_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 + /** + * 党建能力指数权重 + */ + private BigDecimal partyDevWeight = new BigDecimal(NumConstant.ZERO); + + /** + * 服务能力指数 权重 + */ + private BigDecimal serviceAblityWeight = new BigDecimal(NumConstant.ZERO); + + /** + * 治理能力分数,权重 + */ + private BigDecimal governAblityWeight = new BigDecimal(NumConstant.ZERO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcCategorySummaryFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcCategorySummaryFormDTO.java index 495e3ac7f7..045e515fe1 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcCategorySummaryFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcCategorySummaryFormDTO.java @@ -36,12 +36,12 @@ public class KcCategorySummaryFormDTO implements Serializable { private String allParentIds; /** - * 类别id + * 一级类别id */ private String categoryId; /** - * 分类名称 + * 一级分类名称 */ private String categoryName; diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index b907c6525e..d930651a68 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -226,7 +226,7 @@ true - 8109 + 8108 local 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 59ed8ba771..360571a1e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -168,9 +168,9 @@ public class DemoController { // List gridScoreDTOList=gridScoreDao.selectList(formDTO); // return new Result>().ok(gridScoreDTOList); - cpcIndexCalculateService.cpcIndexCalculate(formDTO); +// cpcIndexCalculateService.cpcIndexCalculate(formDTO); gridCorreLationService.calculateGridCorreLation(formDTO); - deptScoreService.calculateDeptCorreLation(formDTO); +// deptScoreService.calculateDeptCorreLation(formDTO); return new Result(); } @DataSource(DataSourceConstant.EVALUATION_INDEX) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index fa9ae610f4..3046923a98 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -82,17 +82,6 @@ public interface AgencyScoreDao extends BaseDao { **/ List selectListAgencyScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - /** - * 批量插入区/街道相关分数表 - * - * @param list - * @param customerId - * @return void - * @Author zhangyong - * @Date 11:11 2020-09-04 - **/ - void batchInsertAgencyScoreData(@Param("list") List list, @Param("customerId")String customerId); - /** * 根据入参查询 区/街道相关分数表id * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 4df07097d9..95d0f60e84 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -20,7 +20,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; -import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunityScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -79,17 +79,6 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); - /** - * 批量插入 社区相关分数表 - * - * @param list - * @param customerId - * @return void - * @Author zhangyong - * @Date 11:11 2020-09-04 - **/ - void batchInsertCommunityScoreData(@Param("list") List list, @Param("customerId")String customerId); - /** * 根据入参查询 查询社区id * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java index 7107d29e8c..a8d5971cc7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java @@ -18,9 +18,8 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; -import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySubScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,7 +32,7 @@ import java.util.List; * @since v1.0.0 2020-08-31 */ @Mapper -public interface CommunitySubScoreDao extends BaseDao { +public interface CommunitySubScoreDao extends BaseDao { /** * @param lists diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java index 17e7a7eb82..d67b86e887 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java @@ -34,4 +34,6 @@ import java.util.List; public interface IndexGroupDetailDao extends BaseDao { List getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode); + + List getAllIndexWeightList(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencyScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencyScoreEntity.java index 879018ac99..21847b47d9 100644 --- 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 @@ -87,4 +87,8 @@ public class AgencyScoreEntity extends BaseEpmetEntity { */ private String dataType; + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java index 2f1d277b46..d5ca30dc0e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java @@ -87,4 +87,8 @@ public class AgencySubScoreEntity extends BaseEpmetEntity { */ private String dataType; + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java index 30eb9fb66a..ee1a68f8eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java @@ -87,4 +87,9 @@ public class CpcScoreEntity extends BaseEpmetEntity { * 是否是总分 1是0不是 */ private String isTotal; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java index 2183f77502..f1c79068a5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java @@ -87,4 +87,9 @@ public class CpcSubScoreEntity extends BaseEpmetEntity { * 是否是总分 1是0不是 */ private String isTotal; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java index 7a5dcce754..41a5f19188 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java @@ -87,4 +87,8 @@ public class DeptScoreEntity extends BaseEpmetEntity { */ private String allParentIndexCode; + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java index db12edfeec..191ffb0157 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java @@ -82,4 +82,8 @@ public class DeptSubScoreEntity extends BaseEpmetEntity { */ private String allParentIndexCode; + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunityScoreEntity.java similarity index 93% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunityScoreEntity.java index 5fee9d7cb3..1a2dbe1dfd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunityScoreEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.evaluationindex.screen; +package com.epmet.entity.evaluationindex.indexcal; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -87,4 +87,9 @@ public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { */ private String allParentIndexCode; + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java new file mode 100644 index 0000000000..d8938d9018 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java @@ -0,0 +1,70 @@ +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 社区相关分数表-明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_sub_score") +public class FactIndexCommunitySubScoreEntity extends BaseEpmetEntity { + private static final long serialVersionUID = -7046354032669198828L; + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 社区上一级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java index 2fc442c0be..6831a84e5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java @@ -92,4 +92,8 @@ public class GridScoreEntity extends BaseEpmetEntity { */ private String allParentIndexCode; + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java index 01f40a5ddd..3404fda77d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java @@ -92,4 +92,8 @@ public class GridSubScoreEntity extends BaseEpmetEntity { */ private String allParentIndexCode; + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java deleted file mode 100644 index 40a112d6d8..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java +++ /dev/null @@ -1,75 +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.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/ScreenIndexDataMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java index e8d16e858d..0a2fdd7455 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java @@ -92,4 +92,21 @@ public class ScreenIndexDataMonthlyEntity extends BaseEpmetEntity { */ private BigDecimal governAblity; +// PARTY_DEV_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 +// SERVICE_ABLITY_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 +// GOVERN_ABLITY_WEIGHT decimal 5 4 0 0 0 0 0 0 0 0 0 0 0 + /** + * 党建能力指数权重 + */ + private BigDecimal partyDevWeight; + + /** + * 服务能力指数 权重 + */ + private BigDecimal serviceAblityWeight; + + /** + * 治理能力分数,权重 + */ + private BigDecimal governAblityWeight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectCategoryGridDailyEntity.java index 3307b3dcfa..ba35584411 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectCategoryGridDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectCategoryGridDailyEntity.java @@ -69,12 +69,12 @@ public class ScreenKcProjectCategoryGridDailyEntity extends BaseEpmetEntity { private String allParentIds; /** - * 类别id + * 一级类别id */ private String categoryId; /** - * 分类名称 + * 一级分类名称 */ private String categoryName; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCalRedis.java similarity index 67% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCalRedis.java index 8a99d62890..8e1c769d14 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCalRedis.java @@ -24,12 +24,13 @@ import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; +import java.math.BigDecimal; import java.util.Map; import java.util.concurrent.TimeUnit; @Slf4j @Component -public class IndexCodeFieldReRedis { +public class IndexCalRedis { @Autowired private RedisTemplate redisTemplate; @@ -54,9 +55,37 @@ public class IndexCodeFieldReRedis { /** * desc:删除指标字段关系缓存 + * * @return */ public Boolean deleteIndexCodeFromRedis() { return redisTemplate.delete(RedisKeys.getIndexCodeFieldReKey()); } + + /** + * @Description 获取指标权重 + */ + public Map getIndexCodeWeightMap(String customerId) { + HashOperations hashOperations = redisTemplate.opsForHash(); + Map values = hashOperations.entries(RedisKeys.getIndexCodeWeightKey(customerId)); + return values; + } + + /** + * @Description 存入指标权重 + */ + public void setIndexCodeWeightMap(String customerId, Map records) { + HashOperations hashOperations = redisTemplate.opsForHash(); + hashOperations.putAll(RedisKeys.getIndexCodeWeightKey(customerId), records); + redisTemplate.expire(RedisKeys.getIndexCodeFieldReKey(), 1, TimeUnit.DAYS); + } + + /** + * desc:删除指标权重缓存 + * + * @return + */ + public Boolean deleteIndexCodeWeightFromRedis(String customerId) { + return redisTemplate.delete(RedisKeys.getIndexCodeWeightKey(customerId)); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 7c2f3dc367..0de8be20fc 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 @@ -50,7 +50,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @Autowired - private IndexGroupDetailService getDetailListByParentCode; + private IndexGroupDetailService indexGroupDetailService; @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired @@ -72,7 +72,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { */ private void calculateTotalScore(CalculateCommonFormDTO formDTO) { //获取指标权重 - List parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + List parentIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); if (CollectionUtils.isEmpty(parentIndexDetails)) { log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【党员相关】指标权重信息不存在"); @@ -113,6 +113,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); totalEntity.setScore(new BigDecimal(NumConstant.ZERO)); totalEntity.setAllParentIndexCode(NumConstant.ZERO_STR); + totalEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG)); if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) { preLastCpcScoreTotalMap.put(part.getUserId(), part); @@ -265,6 +266,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { cpcScoreEntity.setScore(new BigDecimal(NumConstant.ZERO)); cpcScoreEntity.setIndexCode(parentIndexCode); cpcScoreEntity.setAllParentIndexCode(value.getAllParentIndexCode()); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(formDTO.getCustomerId(), value.getAllParentIndexCode()); + cpcScoreEntity.setWeight(weight); scoreEntityMap.put(userId, cpcScoreEntity); //构造样本值对象 @@ -311,6 +314,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { child.setIndexCode(o.getIndexCode()); child.setAllParentIndexCode(o.getAllParentIndexCode()); child.setScore(o.getScore()); + child.setWeight(o.getWeight()); subList.add(child); }); @@ -403,17 +407,17 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { */ private Map> getIndexDetailMap(CalculateCommonFormDTO formDTO) { //获取指标权重信息 -参与议事 - List canyuyishiIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); + List canyuyishiIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); return null; } - List dangwuhongdongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); + List dangwuhongdongIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); return null; } - List lianxiqunzhongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); + List lianxiqunzhongIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); return null; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index b133615512..9355c6f79e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -78,7 +78,7 @@ import java.util.stream.Collectors; @Service public class DeptScoreServiceImpl extends BaseServiceImpl implements DeptScoreService { @Autowired - private IndexGroupDetailService getDetailListByParentCode; + private IndexGroupDetailService indexGroupDetailService; @Autowired private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; @Autowired @@ -117,7 +117,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl indexGroupDetailEntityList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), + List indexGroupDetailEntityList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.QU_ZHI_BU_MEN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(indexGroupDetailEntityList)) { @@ -167,7 +167,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl indexList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); if (CollectionUtils.isEmpty(indexList)) { log.error("calculateDeptTotalScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); @@ -189,6 +189,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); - return; } else { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); @@ -111,7 +138,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); - return; } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -165,7 +191,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.error("社区下级治理能力平均分集合为空"); - return; }else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); @@ -186,7 +211,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(communityGovernAbility)){ log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); - return; }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -240,7 +264,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridServiceAvg)) { log.error("查询社区下级所有网格服务能力得分平均值集合为空"); - //todo return; } else { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); @@ -260,7 +283,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); - return; }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -322,6 +344,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); score.setParentAgencyId(community.getParentAgencyId()); @@ -334,33 +357,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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类型获取最大数和最小数 @@ -441,6 +437,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIndexCode(indexCode); score.setScore(v.getTotalScore()); score.setAllParentIndexCode(allParentIndexCode); + String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath); + score.setWeight(weight); pid.forEach((agency, parentAgency) -> { if (k.equals(agency)) { score.setParentAgencyId(parentAgency); @@ -458,6 +457,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni s.setIndexCode(fiveDetail.getIndexCode()); s.setScore(fiveDetail.getScore()); s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode()); + s.setWeight(fiveDetail.getWeight()); pid.forEach((agency, parentAgency) -> { if (k.equals(agency)) { s.setParentAgencyId(parentAgency); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index d11a1e7df2..3143fdf4e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.druid.util.StringUtils; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; @@ -115,7 +116,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); @@ -136,7 +136,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.error(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); - return; } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -190,7 +189,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(districtGovernAvgList)) { log.error("查询所有街道治理能力平均值集合为空"); - return; } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); @@ -210,7 +208,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(deptScoreAvgList)) { log.error("查询所有直属部门治理能力平均值集合为空"); - //return; } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); @@ -260,7 +257,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(subStreetAvgList)) { log.error("查询区下属街道服务能力汇总平均值集合为空"); - return; } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); @@ -321,6 +317,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setDataType(IndexCalConstant.DISTRICT_LEVEL); score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); score.setParentAgencyId(community.getParentAgencyId()); @@ -415,13 +412,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setScore(v.getTotalScore()); score.setAllParentIndexCode(allParentIndexCode); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath); + score.setWeight(weight); pid.forEach((agency, parentAgency) -> { //todo 确认 if (k != null && k.equals(agency)) { score.setParentAgencyId(parentAgency); } }); - if (!CollectionUtils.isEmpty(v.getDetails())){ + if (!CollectionUtils.isEmpty(v.getDetails())) { v.getDetails().forEach(streetScore -> { AgencyScoreDTO s = new AgencyScoreDTO(); s.setCustomerId(customerId); @@ -434,6 +434,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict s.setScore(streetScore.getScore()); s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); s.setDataType(IndexCalConstant.DISTRICT_LEVEL); + s.setWeight(streetScore.getWeight()); pid.forEach((agency, parentAgency) -> { //todo 确认 if (k != null && k.equals(agency)) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index 48b8b46e31..c4fef95f7b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -8,7 +8,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; -import com.epmet.redis.IndexCodeFieldReRedis; +import com.epmet.redis.IndexCalRedis; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.util.DimIdGenerator; @@ -36,7 +36,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { @Autowired private CpcIndexCalculateService cpcIndexCalculateService; @Autowired - private IndexCodeFieldReRedis indexCodeFieldReRedis; + private IndexCalRedis indexCalRedis; @Autowired private IndexCalculateCommunityService indexCalculateCommunityService; @Autowired @@ -70,90 +70,106 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } Boolean flag = false; for (String customerId : customerIds) { - CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); - long start = System.currentTimeMillis(); + CalculateCommonFormDTO param = new CalculateCommonFormDTO(); + param.setCustomerId(customerId); + param.setMonthId(formDTO.getMonthId()); + flag = calulateCustomerIndexScore(param); + } + return flag; + } catch (Exception e) { + log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); + } finally { + //清除缓存 + indexCalRedis.deleteIndexCodeFromRedis(); + } + return false; + } + + private Boolean calulateCustomerIndexScore(CalculateCommonFormDTO formDTO) { + try { + String customerId = formDTO.getCustomerId(); + Boolean flag; + long start = System.currentTimeMillis(); + try { + //计算党员相关的 try { - //计算党员相关的 - try { - CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); - flag = cpcIndexCalculateService.cpcIndexCalculate(param); - log.info("客户Id:{}【党员相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); - } catch (Exception e) { - log.error("indexCalculate cpcIndexCalculate exception", e); - throw new RenException("indexCalculate cpcIndexCalculate exception", e); - } - //测试用 - //计算网格 - start = System.currentTimeMillis(); - try { - flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); - log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); - } catch (Exception e) { - log.error("indexCalculate calculateGridCorreLation exception", e); - throw new RenException("indexCalculate calculateGridCorreLation exception", e); - } - //计算社区 - start = System.currentTimeMillis(); - try { - flag = indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); - log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); - } catch (Exception e) { - log.error("indexCalculate calCommunityAll exception", e); - throw new RenException("indexCalculate calAll exception", e); - } + flag = cpcIndexCalculateService.cpcIndexCalculate(formDTO); + log.info("客户Id:{}【党员相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); + } catch (Exception e) { + log.error("indexCalculate cpcIndexCalculate exception", e); + throw new RenException("indexCalculate cpcIndexCalculate exception", e); + } + //测试用 + + //计算网格 + start = System.currentTimeMillis(); + try { + flag = gridCorreLationService.calculateGridCorreLation(formDTO); + log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); + } catch (Exception e) { + log.error("indexCalculate calculateGridCorreLation exception", e); + throw new RenException("indexCalculate calculateGridCorreLation exception", e); + } + //计算社区 + start = System.currentTimeMillis(); + try { + flag = indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); + log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); + } catch (Exception e) { + log.error("indexCalculate calCommunityAll exception", e); + throw new RenException("indexCalculate calAll exception", e); + } - //计算街道 - start = System.currentTimeMillis(); - try { - flag = indexCalculateStreetService.calStreetAll(customerId, formDTO.getMonthId()); - log.info("客户Id:{}【街道相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); - } catch (Exception e) { - log.error("indexCalculate calStreetAll exception", e); - throw new RenException("indexCalculate calStreetAll exception", e); - } + //计算街道 + start = System.currentTimeMillis(); + try { + flag = indexCalculateStreetService.calStreetAll(customerId, formDTO.getMonthId()); + log.info("客户Id:{}【街道相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); + } catch (Exception e) { + log.error("indexCalculate calStreetAll exception", e); + throw new RenException("indexCalculate calStreetAll exception", e); + } - //计算区直属 - start = System.currentTimeMillis(); - try { - flag = deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO); - log.info("客户Id:{}【区直部门】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); - } catch (Exception e) { - log.error("indexCalculate calculateDeptCorreLation exception", e); - throw new RenException("indexCalculate calculateDeptCorreLation exception", e); - } + //计算区直属 + start = System.currentTimeMillis(); + try { + flag = deptScoreService.calculateDeptCorreLation(formDTO); + log.info("客户Id:{}【区直部门】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); + } catch (Exception e) { + log.error("indexCalculate calculateDeptCorreLation exception", e); + throw new RenException("indexCalculate calculateDeptCorreLation exception", e); + } - //计算全区 - start = System.currentTimeMillis(); - try { - indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); - log.info("客户Id:{}【全区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); - } catch (Exception e) { - log.error("indexCalculate calDistrictAll exception", e); - throw new RenException("indexCalculate calDistrictAll exception", e); - } - } catch (RenException e) { - flag = false; + //计算全区 + start = System.currentTimeMillis(); + try { + indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); + log.info("客户Id:{}【全区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); + } catch (Exception e) { + log.error("indexCalculate calDistrictAll exception", e); + throw new RenException("indexCalculate calDistrictAll exception", e); } + } catch (RenException e) { + flag = false; + } - //计算完毕后 将结果插入大屏相关数据表 - if (flag) { - start = System.currentTimeMillis(); - try { - factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId()); - log.info("客户Id:{}分数插入到大屏显示库完毕,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000); - } catch (Exception e) { - log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e); - flag = false; - } + //计算完毕后 将结果插入大屏相关数据表 + if (flag) { + start = System.currentTimeMillis(); + try { + factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId()); + log.info("客户Id:{}分数插入到大屏显示库完毕,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000); + } catch (Exception e) { + log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e); + flag = false; } } return flag; } catch (Exception e) { - log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); + log.error("calulateCustomerIndexScore exception", e); } finally { - //清除缓存 - indexCodeFieldReRedis.deleteIndexCodeFromRedis(); + indexCalRedis.deleteIndexCodeWeightFromRedis(formDTO.getCustomerId()); } return false; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 1eb6a60a5b..dfec8da308 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.druid.util.StringUtils; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; @@ -118,7 +119,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); - //todo return; } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; @@ -140,7 +140,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(mapList)) { log.error(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); - return; } String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldName)) { @@ -193,7 +192,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.error("查询街道下属所有社区治理能力汇总为空"); - //todo return; }else if (subGridGovernAvg.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); @@ -214,7 +212,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(communityGovernAbility)){ log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); - return; }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -268,7 +265,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.error("查询街道下属社区服务能力得分平均值为空"); - //todo return; } else if (subCommServiceAvg.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE); @@ -288,7 +284,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); - return; }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -351,6 +346,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); score.setDataType(IndexCalConstant.STREET_LEVEL); score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); value.forEach(street -> { score.setScore(score.getScore().add(street.getScore())); score.setParentAgencyId(street.getParentAgencyId()); @@ -445,12 +441,15 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setScore(v.getTotalScore()); score.setAllParentIndexCode(allParentIndexCode); score.setDataType(IndexCalConstant.STREET_LEVEL); + String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode); + BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath); + score.setWeight(weight); pid.forEach((agency, parentAgency) -> { if (k.equals(agency)) { score.setParentAgencyId(parentAgency); } }); - if (!CollectionUtils.isEmpty(v.getDetails())){ + if (!CollectionUtils.isEmpty(v.getDetails())) { v.getDetails().forEach(streetScore -> { AgencyScoreDTO s = new AgencyScoreDTO(); s.setCustomerId(customerId); @@ -463,6 +462,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ s.setScore(streetScore.getScore()); s.setDataType(IndexCalConstant.STREET_LEVEL); s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); + s.setWeight(streetScore.getWeight()); pid.forEach((agency, parentAgency) -> { if (k.equals(agency)) { s.setParentAgencyId(parentAgency); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java index 3e89bee003..009dc1dc42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -4,7 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexCodeFieldReDao; import com.epmet.entity.evaluationindex.screen.IndexCodeFieldReEntity; -import com.epmet.redis.IndexCodeFieldReRedis; +import com.epmet.redis.IndexCalRedis; import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -25,18 +25,18 @@ public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { private IndexCodeFieldReDao indexCodeFieldReDao; @Autowired - private IndexCodeFieldReRedis indexCodeFieldReRedis; + private IndexCalRedis indexCalRedis; @Override public Map getIndexCodeFieldReMap() { - Map indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap(); + Map indexCodeFiledReMap = indexCalRedis.getIndexCodeFiledReMap(); if (CollectionUtils.isEmpty(indexCodeFiledReMap)) { List allData = indexCodeFieldReDao.getAllData(); if (CollectionUtils.isEmpty(allData)){ return new HashMap<>(); } indexCodeFiledReMap = allData.stream().collect(Collectors.toMap(IndexCodeFieldReEntity::getIndexCode, o -> o.getFieldId())); - indexCodeFieldReRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); + indexCalRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); } return indexCodeFiledReMap; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 1a879bd3a8..ade95f1c5d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -276,6 +276,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyDTO.setPartyDevAblity(zero); monthlyDTO.setServiceAblity(zero); monthlyDTO.setGovernAblity(zero); + // 9.12 增加权重 + monthlyDTO.setPartyDevWeight(zero); + monthlyDTO.setServiceAblityWeight(zero); + monthlyDTO.setGovernAblityWeight(zero); // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScoreDTOS.get(i).getGridId(), gridScoreDTOS.get(i).getParentAgencyId(), gridScoreDTOS.get(i).getGridName(), monthlyDTO); @@ -315,6 +319,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } else { // 赋实际值 党建能力、治理能力、服务能力 monthlyFormDTO = this.setValueAbilityMonthlyFor(gridScore.getValue().get(i).getIndexCode(), + gridScore.getValue().get(i).getWeight(), gridScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -397,6 +402,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyDTO.setPartyDevAblity(zero); monthlyDTO.setServiceAblity(zero); monthlyDTO.setGovernAblity(zero); + // 9.12 增加权重 + monthlyDTO.setPartyDevWeight(zero); + monthlyDTO.setServiceAblityWeight(zero); + monthlyDTO.setGovernAblityWeight(zero); // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScoreDTOS.get(i).getAgencyId(), communityScoreDTOS.get(i).getPid(), communityScoreDTOS.get(i).getAgencyName(), monthlyDTO); @@ -435,6 +444,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } else { // 赋值 党建能力、治理能力、服务能力 monthlyFormDTO = this.setValueAbilityMonthlyFor(communityScore.getValue().get(i).getIndexCode(), + communityScore.getValue().get(i).getWeight(), communityScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -517,6 +527,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyDTO.setPartyDevAblity(zero); monthlyDTO.setServiceAblity(zero); monthlyDTO.setGovernAblity(zero); + // 9.12 增加权重 + monthlyDTO.setPartyDevWeight(zero); + monthlyDTO.setServiceAblityWeight(zero); + monthlyDTO.setGovernAblityWeight(zero); // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScoreDTOS.get(i).getDeptId(), deptScoreDTOS.get(i).getParentAgencyId(), deptScoreDTOS.get(i).getDeptName(), monthlyDTO); @@ -547,8 +561,12 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { for ( int i = 0; i < deptScore.getValue().size(); i++){ // 区直街道的总分 就是 治理能力 monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore()); + // 多余的权重,赋0 + monthlyFormDTO.setPartyDevWeight(new BigDecimal(NumConstant.ZERO)); + monthlyFormDTO.setServiceAblityWeight(new BigDecimal(NumConstant.ZERO)); // 赋值 治理能力 monthlyFormDTO = this.setValueAbilityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), + deptScore.getValue().get(i).getWeight(), deptScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -633,6 +651,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } else { // 赋值 党建能力、治理能力、服务能力 monthlyFormDTO = this.setValueAbilityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(), + agencyScore.getValue().get(i).getWeight(), agencyScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -686,23 +705,28 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { /** * 赋实际值 党建能力、治理能力、服务能力 * @param IndexCode 组织类别 + * @param weight 权重(同一组权重总和=1) * @param Score 分数 * @param monthlyFormDTO 待保存的数据 * @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO * @Author zhangyong * @Date 09:26 2020-09-04 **/ - private IndexDataMonthlyFormDTO setValueAbilityMonthlyFor(String IndexCode, BigDecimal Score, IndexDataMonthlyFormDTO monthlyFormDTO){ + private IndexDataMonthlyFormDTO setValueAbilityMonthlyFor(String IndexCode, BigDecimal weight, BigDecimal Score, IndexDataMonthlyFormDTO monthlyFormDTO){ // 赋实际值 if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(IndexCode)){ // 党建能力 monthlyFormDTO.setPartyDevAblity(Score); + // 9.12 增加权重 + monthlyFormDTO.setPartyDevWeight(weight); } else if (IndexCodeEnum.ZHI_LI_NENG_LI.getCode().equals(IndexCode)){ // 治理能力 monthlyFormDTO.setGovernAblity(Score); + monthlyFormDTO.setGovernAblityWeight(weight); } else if (IndexCodeEnum.FU_WU_NENG_LI.getCode().equals(IndexCode)){ // 服务能力 monthlyFormDTO.setServiceAblity(Score); + monthlyFormDTO.setServiceAblityWeight(weight); } return monthlyFormDTO; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java index f202beca1b..eb77f2cf63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java @@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import java.math.BigDecimal; import java.util.List; /** @@ -31,8 +32,18 @@ import java.util.List; public interface IndexGroupDetailService extends BaseService { /** * desc:根据all_parent_index_code 获取指标明细 + * * @param customerId * @param indexCode */ - List getDetailListByParentCode(String customerId,String... indexCode); + List getDetailListByParentCode(String customerId, String... indexCode); + + /** + * desc:根据all_parent_index_code 获取指标权重 + * 如果获取不到 返回-1 表明数据有误 + * + * @param customerId + * @param allPathIndexCode + */ + BigDecimal getWeightByAllPathIndexCode(String customerId, String allPathIndexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java index 7a8935bd02..26fb5b8cc2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java @@ -19,15 +19,23 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.redis.IndexCalRedis; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 客户指标详情 @@ -35,20 +43,40 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-19 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService { - + @Autowired + private IndexCalRedis indexCalRedis; @Override - public List getDetailListByParentCode(String customerId,String... indexCode) { - if (indexCode == null || indexCode.length == 0){ + public List getDetailListByParentCode(String customerId, String... indexCode) { + if (indexCode == null || indexCode.length == 0) { throw new RenException("参数错误"); } StringBuilder sb = new StringBuilder(); - for (String code:indexCode){ + for (String code : indexCode) { sb.append(code).append(StrConstant.COLON); } - return baseDao.getDetailListByParentCode(customerId,sb.deleteCharAt(sb.length()-1).toString()); + return baseDao.getDetailListByParentCode(customerId, sb.deleteCharAt(sb.length() - 1).toString()); } + + @Override + public BigDecimal getWeightByAllPathIndexCode(String customerId, String allPathIndexCode) { + Map indexCodeFiledReMap = indexCalRedis.getIndexCodeWeightMap(customerId); + if (CollectionUtils.isEmpty(indexCodeFiledReMap)) { + List allData = baseDao.getAllIndexWeightList(customerId); + if (CollectionUtils.isEmpty(allData)) { + log.warn("getAllIndexWeightList return empty"); + return null; + } + indexCodeFiledReMap = allData.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o.getWeight())); + indexCalRedis.setIndexCodeWeightMap(customerId, indexCodeFiledReMap); + } + BigDecimal weight = indexCodeFiledReMap.get(allPathIndexCode); + + return weight == null ? new BigDecimal(NumConstant.ONE_NEG) : weight; + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java index 1ca86d8faf..b0ee8fa0ad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -37,7 +37,7 @@ public class BatchScoreCalculator { } /** - * 执行计算,以样本的所有指标总得分及明细分数值 + * 执行计算,以样本的所有指标总得分(原始值)及明细分数(归一后的值 不乘以权重)值 * * @param indexInputVOS * @return @@ -56,7 +56,9 @@ public class BatchScoreCalculator { //遍历该指标下的每个数据 for (SampleValue vo : indexValueVOs) { String sampleId = vo.getSampleId(); - BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP); + //归一后的值 + BigDecimal normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold); + BigDecimal score = scoreCalculator.normalize(normalizeValue, weight).setScale(6, RoundingMode.HALF_UP); CalculateResult result = scoreCountOfSamples.get(sampleId); if (result == null) { @@ -67,7 +69,7 @@ public class BatchScoreCalculator { result.setDetails(new ArrayList<>()); scoreCountOfSamples.put(sampleId, result); } - IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), score); + IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), normalizeValue, idx.getWeight()); result.getDetails().add(sampleScore); result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java index 3b108999a1..dd971eadc3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -26,6 +26,10 @@ public class IndexScoreVo implements Serializable { * 分值 */ private BigDecimal score; + /** + * 该指标的权重 + */ + private BigDecimal weight; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index a0c7f2cdae..65922677e5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -5,7 +5,8 @@ - INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, + WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( @@ -21,6 +22,7 @@ #{item.score}, #{item.indexCode}, #{item.allParentIndexCode}, + #{item.weight}, #{item.delFlag}, #{item.revision}, #{item.createdBy}, @@ -53,7 +55,8 @@ MONTH_ID monthId, IS_TOTAL isTotal, SCORE score, - INDEX_CODE indexCode + INDEX_CODE indexCode, + WEIGHT weight FROM fact_index_agency_score WHERE @@ -107,52 +110,6 @@ GROUP BY fics.parent_agency_id - - insert into fact_index_agency_score - ( - ID, - CUSTOMER_ID, - - AGENCY_ID, - PARENT_AGENCY_ID, - YEAR_ID, - QUARTER_ID, - MONTH_ID, - DATA_TYPE, - IS_TOTAL, - SCORE, - INDEX_CODE, - - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.parentAgencyId}, - - #{item.yearId}, - #{item.quarterId}, - #{item.monthId}, - #{item.dataType}, - #{item.isTotal}, - #{item.score}, - #{item.indexCode}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - - insert into fact_index_community_score - ( - ID, - CUSTOMER_ID, - AGENCY_ID, - PARENT_AGENCY_ID, - YEAR_ID, - QUARTER_ID, - MONTH_ID, - IS_TOTAL, - SCORE, - INDEX_CODE, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.agencyId}, - #{item.parentAgencyId}, - #{item.yearId}, - #{item.quarterId}, - - #{item.monthId}, - #{item.isTotal}, - #{item.score}, - #{item.indexCode}, - 0, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - \ No newline at end of file + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml index 7111976b9d..536f834564 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml @@ -17,6 +17,7 @@ `SCORE`, `INDEX_CODE`, ALL_PARENT_INDEX_CODE, + WEIGHT, `DEL_FLAG`, `REVISION`, `CREATED_BY`, @@ -38,6 +39,7 @@ #{item.score}, #{item.indexCode}, #{item.allParentIndexCode}, + #{item.weight}, 0, 0, 'APP_USER', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml index c2ab3e07c6..76bec7b257 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml @@ -12,4 +12,10 @@ CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0' and ALL_PARENT_INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml index 417ac18c3f..b699ec7d6b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml @@ -24,6 +24,9 @@ PARTY_DEV_ABLITY, SERVICE_ABLITY, GOVERN_ABLITY, + PARTY_DEV_WEIGHT, + SERVICE_ABLITY_WEIGHT, + GOVERN_ABLITY_WEIGHT, DEL_FLAG, REVISION, CREATED_BY, @@ -46,6 +49,9 @@ #{item.partyDevAblity}, #{item.serviceAblity}, #{item.governAblity}, + #{item.partyDevWeight}, + #{item.serviceAblityWeight}, + #{item.governAblityWeight}, 0, 0, 'APP_USER', diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java index 57969c12e0..15e029b3e6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java @@ -1,5 +1,6 @@ package com.epmet.stats.test.normalizing; +import com.alibaba.fastjson.JSON; import com.epmet.support.normalizing.*; import com.epmet.support.normalizing.batch.*; import org.junit.Test; @@ -233,6 +234,7 @@ public class DemoScoreCal { List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + System.out.println("param:" + JSON.toJSONString(indexInputVOS)); HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); HashMap result2 = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index a9da37f9d9..c8bd19b151 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -82,8 +82,10 @@ gsr.del_flag = 0 AND sr.del_flag = 0 AND - - sr.staff_id = #{userId} - + ( + + sr.staff_id = #{userId} + + ) \ No newline at end of file