Browse Source

社区相关

master
zxc 5 years ago
parent
commit
1485154ea3
  1. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java
  2. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java
  3. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java
  4. 43
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java
  5. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java

@ -18,6 +18,8 @@
package com.epmet.dto.screen;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;
/**
@ -47,29 +49,29 @@ public class FactIndexCommunityGovrnFiveScoreDTO implements Serializable {
private String monthId;
/**
* 季度ID
* 指标ID
*/
private String quarterId;
private String indexId;
/**
* 年度ID
* 总指数分值
*/
private String yearId;
private BigDecimal totalScore;
/**
* 指标ID
* 党建能力分值
*/
private String indexId;
private BigDecimal partyAbilityScore;
/**
* 分数
* 治理能力分值
*/
private Double score;
private BigDecimal govrnAbilityScore;
/**
* 社区被吹哨次数transfered社区办结项目数closed_project社区项目响应度resp_project_ratio社区超期项目率overdue_project_ratio社区办结项目率closed_project_ratio社区办结项目满意度satisfaction_ratio
* 服务能力分值
*/
private String type;
private BigDecimal serviceAbilityScore;
/**
* 删除状态0正常1删除
@ -94,11 +96,11 @@ public class FactIndexCommunityGovrnFiveScoreDTO implements Serializable {
public FactIndexCommunityGovrnFiveScoreDTO() {
this.agencyId = "";
this.monthId = "";
this.quarterId = "";
this.yearId = "";
this.indexId = "";
this.score = 0.00;
this.type = "";
this.totalScore = new BigDecimal(0);
this.partyAbilityScore = new BigDecimal(0);
this.govrnAbilityScore = new BigDecimal(0);
this.serviceAbilityScore = new BigDecimal(0);
this.delFlag = 0;
this.revision = 0;
this.createdBy = "APP_USER";

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java

@ -54,14 +54,24 @@ public class FactIndexCommunityPartyFiveScoreDTO implements Serializable {
private String indexId;
/**
* 分数
* 总指数分值
*/
private BigDecimal score;
private BigDecimal totalScore;
/**
* 发文数量publish_article
* 党建能力分值
*/
private String type;
private BigDecimal partyAbilityScore;
/**
* 治理能力分值
*/
private BigDecimal govrnAbilityScore;
/**
* 服务能力分值
*/
private BigDecimal serviceAbilityScore;
/**
* 删除状态0正常1删除
@ -87,8 +97,10 @@ public class FactIndexCommunityPartyFiveScoreDTO implements Serializable {
this.agencyId = "";
this.monthId = "";
this.indexId = "";
this.score = BigDecimal.valueOf(0);
this.type = "";
this.totalScore = new BigDecimal(0);
this.partyAbilityScore = new BigDecimal(0);
this.govrnAbilityScore = new BigDecimal(0);
this.serviceAbilityScore = new BigDecimal(0);
this.delFlag = 0;
this.revision = 0;
this.createdBy = "APP_USER";

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java

@ -50,29 +50,29 @@ public class FactIndexCommunityServiceFiveScoreDTO implements Serializable {
private String monthId;
/**
* 季度ID
* 指标ID
*/
private String quarterId;
private String indexId;
/**
* 年度ID
* 总指数分值
*/
private String yearId;
private BigDecimal totalScore;
/**
* 指标ID
* 党建能力分值
*/
private String indexId;
private BigDecimal partyAbilityScore;
/**
* 分数
* 治理能力分值
*/
private BigDecimal score;
private BigDecimal govrnAbilityScore;
/**
* 社区活动组织次数activity
* 服务能力分值
*/
private String type;
private BigDecimal serviceAbilityScore;
/**
* 删除状态0正常1删除

43
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java

@ -72,27 +72,31 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
@Override
public void communityPublishArticleCountCalculate(String customerId, String monthId) {
customerId = "b09527201c4409e19d1dbc5e3c3429a1";
// 党建能力
// 根据all_parent_index_code 获取指标明细
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
List<FactIndexCommunityPartyFiveScoreDTO> subAllGridList = new ArrayList<>();
List<FactIndexCommunityPartyFiveScoreDTO> communityPublishArticle = new ArrayList<>();
// todo 下属所有网格的党建能力平均值
//下属所有网格的党建能力平均值
String finalCustomerId = customerId;
detailListByParentCode.forEach(indexGroup -> {
if (indexGroup.getIndexCode().equals("xiazhusuoyouwgddjnlpjz")){
List<SubGridPartyAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(finalCustomerId, monthId);
subGridPartyAvgScore.forEach(subGridParty -> {
BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight());
subGridParty.setScore(multiply);
FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO();
BeanUtils.copyProperties(subGridParty,dto);
dto.setType("sub_all_grid_party_avg");
dto.setIndexId(indexGroup.getIndexId());
subAllGridList.add(dto);
});
factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList);
if (subGridPartyAvgScore.size() != NumConstant.ZERO){
subGridPartyAvgScore.forEach(subGridParty -> {
BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight());
subGridParty.setScore(multiply);
FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO();
BeanUtils.copyProperties(subGridParty,dto);
dto.setIndexId(indexGroup.getIndexId());
dto.setTotalScore(dto.getPartyAbilityScore());
subAllGridList.add(dto);
});
factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList);
}
}
});
@ -103,8 +107,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
//TODO 计算之后的分数
FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO();
BeanUtils.copyProperties(detailListByParentCode.get(NumConstant.ZERO), dto);
dto.setScore(BigDecimal.valueOf(50.00));
dto.setType("publish_article_count");
dto.setPartyAbilityScore(BigDecimal.valueOf(50.00));
dto.setIndexId(detailListByParentCode.get(NumConstant.ZERO).getIndexId());
communityPublishArticle.add(dto);
factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle);
@ -120,14 +123,26 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
collect.forEach(c -> {
SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount());
ll.add(s);
FactIndexCommunityPartyFiveScoreDTO publishArticle = new FactIndexCommunityPartyFiveScoreDTO();
BeanUtils.copyProperties(c,publishArticle);
communityPublishArticle.add(publishArticle);
});
IndexInputVO<Integer> index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll, indexGroup.getWeight(), sc1);
List<IndexInputVO> indexInputVOS = Arrays.asList(index1VO);
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
List<IndexOutputVO> result = batchScoreCalculator.exec(indexInputVOS);
result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> {
communityPublishArticle.forEach(publish -> {
if (publish.getAgencyId().equals(agency.getSampleId())){
publish.setIndexId(indexGroup.getIndexId());
publish.setPartyAbilityScore(agency.getSampleScore());
publish.setTotalScore(agency.getSampleScore());
}
});
});
indexStart++;
} while (collect.size() == 10);
factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle);
}
}
});

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml

@ -5,7 +5,7 @@
<!-- 党建能力【社区】中间表插入 -->
<insert id="insertCommunityPartyRecord">
INSERT INTO fact_index_community_party_five_score ( ID, AGENCY_ID, MONTH_ID, INDEX_ID, SCORE, TYPE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
INSERT INTO fact_index_community_party_five_score ( ID, AGENCY_ID, MONTH_ID, INDEX_ID, TOTAL_SCORE, PARTY_ABILITY_SCORE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
<foreach collection="lists" item="item" separator=",">
(
@ -13,8 +13,8 @@
#{item.agencyId},
#{item.monthId},
#{item.indexId},
#{item.score},
#{item.type},
#{item.totalScore},
#{item.partyAbilityScore},
#{item.delFlag},
#{item.revision},
#{item.createdBy},

Loading…
Cancel
Save