Browse Source

Merge branch 'dev_screen_data' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_screen_data

 Conflicts:
	epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
master
wxz 5 years ago
parent
commit
b4254b09f9
  1. 13
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  2. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java
  3. 2
      epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml
  4. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java
  5. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java
  6. 13
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java
  7. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java
  8. 19
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java
  9. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcCategorySummaryFormDTO.java
  10. 2
      epmet-module/data-statistical/data-statistical-server/pom.xml
  11. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  12. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java
  13. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java
  14. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java
  15. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java
  16. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencyScoreEntity.java
  17. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java
  18. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java
  19. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java
  20. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java
  21. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java
  22. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunityScoreEntity.java
  23. 70
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java
  24. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java
  25. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java
  26. 75
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java
  27. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java
  28. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcProjectCategoryGridDailyEntity.java
  29. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCalRedis.java
  30. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java
  31. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  32. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  33. 66
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  34. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  35. 164
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
  36. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  37. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java
  38. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java
  39. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java
  40. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java
  41. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java
  42. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java
  43. 53
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  44. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml
  45. 49
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
  46. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml
  47. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml
  48. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml
  49. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml
  50. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml
  51. 7
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml
  52. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml
  53. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml
  54. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml
  55. 2
      epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java
  56. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml

13
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
*/

6
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;
}
/**

2
epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml

@ -139,7 +139,7 @@
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<springProfile name="dev,test,local">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.datareport.dao.group" level="DEBUG"/>

9
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;

6
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;
}
/**
* 权重同一组权重总和=1 9.12新增
*/
private BigDecimal weight;
}

13
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 = "";

4
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;
}

19
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);
}

4
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;

2
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -226,7 +226,7 @@
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<server.port>8109</server.port>
<server.port>8108</server.port>
<spring.profiles.active>local</spring.profiles.active>
<!-- 数据库配置-->

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -168,9 +168,9 @@ public class DemoController {
// List<GridScoreDTO> gridScoreDTOList=gridScoreDao.selectList(formDTO);
// return new Result<List<GridScoreDTO>>().ok(gridScoreDTOList);
cpcIndexCalculateService.cpcIndexCalculate(formDTO);
// cpcIndexCalculateService.cpcIndexCalculate(formDTO);
gridCorreLationService.calculateGridCorreLation(formDTO);
deptScoreService.calculateDeptCorreLation(formDTO);
// deptScoreService.calculateDeptCorreLation(formDTO);
return new Result();
}
@DataSource(DataSourceConstant.EVALUATION_INDEX)

11
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<AgencyScoreEntity> {
**/
List<AgencyScoreDTO> 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<AgencyScoreEntity> list, @Param("customerId")String customerId);
/**
* 根据入参查询 /街道相关分数表id
* @param customerId

13
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<FactIndexCommunityScoreEntity
*/
List<SubCommunityAvgResultDTO> 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<FactIndexCommunityScoreEntity> list, @Param("customerId")String customerId);
/**
* 根据入参查询 查询社区id
* @param customerId

5
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<FactIndexCommunityScoreEntity> {
public interface CommunitySubScoreDao extends BaseDao<FactIndexCommunitySubScoreEntity> {
/**
* @param lists

2
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<IndexGroupDetailEntity> {
List<IndexGroupDetailEntity> getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode);
List<IndexGroupDetailEntity> getAllIndexWeightList(String customerId);
}

4
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;
}

4
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;
}

5
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;
}

5
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;
}

4
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;
}

4
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;
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java → 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 <http://www.gnu.org/licenses/>.
*/
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;
}

70
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: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
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;
}

4
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;
}

4
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;
}

75
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java

@ -1,75 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

17
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;
}

4
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;

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java → 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<String, BigDecimal> getIndexCodeWeightMap(String customerId) {
HashOperations hashOperations = redisTemplate.opsForHash();
Map<String, BigDecimal> values = hashOperations.entries(RedisKeys.getIndexCodeWeightKey(customerId));
return values;
}
/**
* @Description 存入指标权重
*/
public void setIndexCodeWeightMap(String customerId, Map<String, BigDecimal> 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));
}
}

14
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<IndexGroupDetailEntity> parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode());
List<IndexGroupDetailEntity> 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<String, List<IndexGroupDetailEntity>> getIndexDetailMap(CalculateCommonFormDTO formDTO) {
//获取指标权重信息 -参与议事
List<IndexGroupDetailEntity> canyuyishiIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode());
List<IndexGroupDetailEntity> 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<IndexGroupDetailEntity> dangwuhongdongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode());
List<IndexGroupDetailEntity> 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<IndexGroupDetailEntity> lianxiqunzhongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode());
List<IndexGroupDetailEntity> 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;

15
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<DeptScoreDao, DeptScoreEntity> implements DeptScoreService {
@Autowired
private IndexGroupDetailService getDetailListByParentCode;
private IndexGroupDetailService indexGroupDetailService;
@Autowired
private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao;
@Autowired
@ -117,7 +117,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
**/
private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) {
//获取区直部门的治理能力下,五级指标权重
List<IndexGroupDetailEntity> indexGroupDetailEntityList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(),
List<IndexGroupDetailEntity> 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<DeptScoreDao, DeptScor
**/
private void calculateDeptTotalScore(CalculateCommonFormDTO formDTO) {
//计算区直部门总分
List<IndexGroupDetailEntity> indexList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(),
List<IndexGroupDetailEntity> 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<DeptScoreDao, DeptScor
deptScoreEntity.setIndexCode(IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
deptScoreEntity.setScore(BigDecimal.ZERO);
deptScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
deptScoreEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG));
for (DeptScoreDetailDTO deptScoreDetailDTO : deptScore.getDetailList()) {
BigDecimal indexScore = deptScoreDetailDTO.getScore().multiply(indexMap.get(deptScoreDetailDTO.getIndexCode()).getWeight());
deptScoreEntity.setScore(deptScoreEntity.getScore().add(indexScore));
@ -310,13 +311,17 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
//区直部门治理能力的 上一级是 quzhibumen
////新增ALL_PARENT_INDEX_CODE 所有指标code拼接的字符串 冒号隔开
deptScoreEntity.setAllParentIndexCode(IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
String allPath = deptScoreEntity.getAllParentIndexCode().concat(StrConstant.COLON).concat(deptScoreEntity.getIndexCode());
BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(formDTO.getCustomerId(), allPath);
deptScoreEntity.setWeight(weight);
deptScoreEntityList.add(deptScoreEntity);
for(IndexScoreVo detail:calculateResult.getDetails()){
DeptSubScoreEntity deptSubScore= ConvertUtils.sourceToTarget(deptScoreEntity, DeptSubScoreEntity.class);
for (IndexScoreVo detail : calculateResult.getDetails()) {
DeptSubScoreEntity deptSubScore = ConvertUtils.sourceToTarget(deptScoreEntity, DeptSubScoreEntity.class);
//重新赋值
deptSubScore.setIndexCode(detail.getIndexCode());
deptSubScore.setAllParentIndexCode(detail.getAllParentIndexCode());
deptSubScore.setScore(detail.getScore());
deptSubScore.setWeight(detail.getWeight());
deptSubScoreEntityList.add(deptSubScore);
}
});

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -356,7 +356,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){
gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId());
}
if(StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())){
if (StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())) {
gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds());
}
}
@ -366,13 +366,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
gridScoreEntity.setScore(calculateResult.getTotalScore());
//新增ALL_PARENT_INDEX_CODE 所有指标code拼接的字符串 冒号隔开
gridScoreEntity.setAllParentIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(formDTO.getCustomerId(), gridScoreEntity.getAllParentIndexCode().concat(StrConstant.COLON).concat(gridScoreEntity.getIndexCode()));
gridScoreEntity.setWeight(weight);
gridScoreEntityList.add(gridScoreEntity);
for(IndexScoreVo detail:calculateResult.getDetails()){
GridSubScoreEntity gridSubScoreEntity= ConvertUtils.sourceToTarget(gridScoreEntity, GridSubScoreEntity.class);
for (IndexScoreVo detail : calculateResult.getDetails()) {
GridSubScoreEntity gridSubScoreEntity = ConvertUtils.sourceToTarget(gridScoreEntity, GridSubScoreEntity.class);
//重新赋值
gridSubScoreEntity.setIndexCode(detail.getIndexCode());
gridSubScoreEntity.setAllParentIndexCode(detail.getAllParentIndexCode());
gridSubScoreEntity.setScore(detail.getScore());
gridSubScoreEntity.setWeight(detail.getWeight());
gridSubScoreList.add(gridSubScoreEntity);
}
});
@ -667,6 +670,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
gridScoreEntity.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
gridScoreEntity.setScore(BigDecimal.ZERO);
gridScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
gridScoreEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG));
log.warn("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失");
for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) {
BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight());

66
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.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;
@ -68,6 +69,33 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
@Autowired
private CommunitySubScoreDao communitySubScoreDao;
/**
* @param customerId
* @param monthId
* @Description 计算社区相关总分
* @author zxc
* @date 2020/9/1 4:12 下午
*/
public Boolean calCommunityAll(String customerId, String monthId) {
Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力
if (!aBoolean.equals(true)) {
throw new RenException("calculate community-party-ability failure ......");
}
Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力
if (!bBoolean.equals(true)) {
throw new RenException("calculate community-govern-ability failure ......");
}
Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力
if (!cBoolean.equals(true)) {
throw new RenException("calculate community-service-ability failure ......");
}
Boolean dBoolean = communityRelate(customerId, monthId);
if (!dBoolean.equals(true)) {
throw new RenException("calculate community-all insert failure ......");
}
return true;
}
/**
* @param customerId
* @Description 社区名义发文数量计算党建能力
@ -90,7 +118,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<SubGridAvgResultDTO> 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<List<SubGridAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE);
@ -111,7 +138,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<Map<String, Object>> 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<SubGridAvgResultDTO> 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<List<SubGridAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE);
@ -186,7 +211,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<Map<String, Object>> 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<SubGridAvgResultDTO> 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<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE);
@ -260,7 +283,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<Map<String, Object>> 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);

13
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<SubAgencyScoreAvgResultDTO> 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<List<SubAgencyScoreAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE);
@ -136,7 +136,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<Map<String, Object>> 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<SubAgencyScoreAvgResultDTO> 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<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE);
@ -210,7 +208,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> 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<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE);
@ -260,7 +257,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> 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<List<SubAgencyScoreAvgResultDTO>> 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)) {

164
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;
}

14
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<SubCommunityAvgResultDTO> 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<Map<String, Object>> 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<SubCommunityAvgResultDTO> 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<List<SubCommunityAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE);
@ -214,7 +212,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<Map<String, Object>> 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<SubCommunityAvgResultDTO> 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<List<SubCommunityAvgResultDTO>> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE);
@ -288,7 +284,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<Map<String, Object>> 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);

8
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<String, String> getIndexCodeFieldReMap() {
Map<String, String> indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap();
Map<String, String> indexCodeFiledReMap = indexCalRedis.getIndexCodeFiledReMap();
if (CollectionUtils.isEmpty(indexCodeFiledReMap)) {
List<IndexCodeFieldReEntity> 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;
}

26
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;
}

13
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<IndexGroupDetailEntity> {
/**
* desc根据all_parent_index_code 获取指标明细
*
* @param customerId
* @param indexCode
*/
List<IndexGroupDetailEntity> getDetailListByParentCode(String customerId,String... indexCode);
List<IndexGroupDetailEntity> getDetailListByParentCode(String customerId, String... indexCode);
/**
* desc根据all_parent_index_code 获取指标权重
* 如果获取不到 返回-1 表明数据有误
*
* @param customerId
* @param allPathIndexCode
*/
BigDecimal getWeightByAllPathIndexCode(String customerId, String allPathIndexCode);
}

38
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<IndexGroupDetailDao, IndexGroupDetailEntity> implements IndexGroupDetailService {
@Autowired
private IndexCalRedis indexCalRedis;
@Override
public List<IndexGroupDetailEntity> getDetailListByParentCode(String customerId,String... indexCode) {
if (indexCode == null || indexCode.length == 0){
public List<IndexGroupDetailEntity> 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<String, BigDecimal> indexCodeFiledReMap = indexCalRedis.getIndexCodeWeightMap(customerId);
if (CollectionUtils.isEmpty(indexCodeFiledReMap)) {
List<IndexGroupDetailEntity> 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;
}
}

8
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));
}

4
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;
}

53
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml

@ -5,7 +5,8 @@
<!-- 【街道】中间表插入 -->
<insert id="insertStreetRecord">
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
<foreach collection="lists" item="item" separator=",">
(
@ -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
</select>
<insert id="batchInsertAgencyScoreData" parameterType="map">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(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()
)
</foreach>
</insert>
<select id="selectListAgencyId" resultType="String">
SELECT

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml

@ -5,7 +5,8 @@
<!-- 【街道】中间表插入 -->
<insert id="insertStreetRecord">
INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE,
WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
<foreach collection="lists" item="item" separator=",">
(
@ -20,6 +21,7 @@
#{item.score},
#{item.indexCode},
#{item.allParentIndexCode},
#{item.weight},
#{item.delFlag},
#{item.revision},
#{item.createdBy},

49
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml

@ -5,7 +5,8 @@
<!-- 党建能力【社区】中间表插入 -->
<insert id="insertCommunityPartyRecord">
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,ALL_PARENT_INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
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,ALL_PARENT_INDEX_CODE,
WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
<foreach collection="lists" item="item" separator=",">
(
@ -20,6 +21,7 @@
#{item.score},
#{item.indexCode},
#{item.allParentIndexCode},
#{item.weight},
#{item.delFlag},
#{item.revision},
#{item.createdBy},
@ -96,7 +98,8 @@
MONTH_ID monthId,
IS_TOTAL isTotal,
SCORE score,
INDEX_CODE indexCode
INDEX_CODE indexCode,
WEIGHT weight
FROM
fact_index_community_score
WHERE
@ -106,48 +109,6 @@
ORDER BY AGENCY_ID
</select>
<insert id="batchInsertCommunityScoreData" parameterType="map">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(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()
)
</foreach>
</insert>
<select id="selectListCommunityId" resultType="String">
SELECT

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml

@ -5,7 +5,8 @@
<!-- 党建能力【社区】中间表插入 -->
<insert id="insertCommunityPartyRecord">
INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE,
WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
<foreach collection="lists" item="item" separator=",">
(
@ -19,6 +20,7 @@
#{item.score},
#{item.indexCode},
#{item.allParentIndexCode},
#{item.weight},
#{item.delFlag},
#{item.revision},
#{item.createdBy},

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml

@ -116,6 +116,7 @@
`SCORE`,
`INDEX_CODE`,
`ALL_PARENT_INDEX_CODE`,
WEIGHT,
`DEL_FLAG`,
`REVISION`,
`CREATED_BY`,
@ -137,6 +138,7 @@
#{item.score},
#{item.indexCode},
#{item.allParentIndexCode},
#{item.weight},
0,
0,
'APP_USER',

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml

@ -113,6 +113,7 @@
`SCORE`,
`INDEX_CODE`,
`ALL_PARENT_INDEX_CODE`,
WEIGHT,
`DEL_FLAG`,
`REVISION`,
`CREATED_BY`,
@ -133,6 +134,7 @@
#{item.score},
#{item.indexCode},
#{item.allParentIndexCode},
#{item.weight},
0,
0,
'APP_USER',

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml

@ -11,7 +11,8 @@
MONTH_ID monthId,
IS_TOTAL isTotal,
SCORE score,
INDEX_CODE indexCode
INDEX_CODE indexCode,
WEIGHT weight
FROM
fact_index_dept_score
WHERE
@ -83,6 +84,7 @@
SCORE,
INDEX_CODE,
ALL_PARENT_INDEX_CODE,
WEIGHT,
DEL_FLAG,
REVISION,
CREATED_BY,
@ -103,6 +105,7 @@
#{item.score},
#{item.indexCode},
#{item.allParentIndexCode},
#{item.weight},
0,
0,
'APP_USER',

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml

@ -16,6 +16,7 @@
SCORE,
INDEX_CODE,
ALL_PARENT_INDEX_CODE,
WEIGHT,
DEL_FLAG,
REVISION,
CREATED_BY,
@ -35,6 +36,7 @@
#{item.score},
#{item.indexCode},
#{item.allParentIndexCode},
#{item.weight},
0,
0,
'APP_USER',

7
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml

@ -52,6 +52,7 @@
`SCORE`,
`INDEX_CODE`,
ALL_PARENT_INDEX_CODE,
WEIGHT,
`DEL_FLAG`,
`REVISION`,
`CREATED_BY`,
@ -74,6 +75,7 @@
#{item.score},
#{item.indexCode},
#{item.allParentIndexCode},
#{item.weight},
0,
0,
'APP_USER',
@ -152,7 +154,8 @@
MONTH_ID monthId,
IS_TOTAL isTotal,
SCORE score,
INDEX_CODE indexCode
INDEX_CODE indexCode,
WEIGHT weight
FROM
fact_index_grid_score
WHERE
@ -175,4 +178,4 @@
ORDER BY GRID_ID
</select>
</mapper>
</mapper>

2
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',

6
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}
</select>
<select id="getAllIndexWeightList" resultType="com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity">
select ID, concat(ALL_PARENT_INDEX_CODE,':',INDEX_CODE) INDEX_CODE, WEIGHT, THRESHOLD FROM index_group_detail
WHERE
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0'
</select>
</mapper>

6
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',

2
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<IndexInputVO> indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO);
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
System.out.println("param:" + JSON.toJSONString(indexInputVOS));
HashMap<String, BigDecimal> result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
HashMap<String, CalculateResult> result2 = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);

8
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
<foreach collection="userIds" item="userId" separator="OR">
sr.staff_id = #{userId}
</foreach>
(
<foreach collection="userIds" item="userId" separator="OR">
sr.staff_id = #{userId}
</foreach>
)
</select>
</mapper>
Loading…
Cancel
Save