Browse Source

Merge branch 'dev_third_data' into dev_temp

dev_shibei_match
sunyuchao 4 years ago
parent
commit
d7333b2c24
  1. 2
      epmet-cloud-generator/src/main/resources/application.yml
  2. 38
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java
  3. 41
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java
  4. 37
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java
  5. 29
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java
  6. 49
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java
  7. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  8. 34
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  9. 435
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  10. 39
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  11. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java
  12. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java
  13. 135
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java
  14. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java
  15. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java
  16. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java
  17. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  18. 63
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  19. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql
  20. 49
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql
  21. 7
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml
  22. 10
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml
  23. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml

2
epmet-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.1.130:3306/epmet_third?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epmet_dba
password: EpmEt-dbA-UsEr
#oracle配置

38
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java

@ -0,0 +1,38 @@
package com.epmet.dataaggre.dto.datastats.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 治理实况-当前组织治理指数-接口入参
* @Auth sun
*/
@Data
public class AgencyGovrnFormDTO implements Serializable {
private static final long serialVersionUID = -3381286960911634231L;
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = AgencyGovrnFormDTO.Agency.class)
private String agencyId;
/**
* 日维度Id
*/
private String dateId;
/**
* 排序类型字段
* 问题解决总数:problem
* 党群自治占比:party
* 网格自治占比:grid
* 社区解决占比:community
* 区直部门解决占比:dept
* 街道解决占比:street
*/
private String type;
public interface Agency extends CustomerClientShowGroup {}
}

41
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java

@ -0,0 +1,41 @@
package com.epmet.dataaggre.dto.datastats.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 治理实况-当前网格治理指数-接口入参
* @Auth sun
*/
@Data
public class GridGovrnFormDTO implements Serializable {
private static final long serialVersionUID = -3381286960911634231L;
/**
* 组织Id
*/
@NotBlank(message = "机关Id不能为空",groups = GridGovrnFormDTO.Agency.class)
private String agencyId;
/**
* 网格Id
*/
@NotBlank(message = "网格Id不能为空",groups = GridGovrnFormDTO.Grid.class)
private String gridId;
/**
* 日维度Id
*/
private String dateId;
/**
* 排序类型字段
* 问题解决总数:problem
* 党群自治占比:party
* 网格自治占比:grid
*/
private String type;
public interface Agency extends CustomerClientShowGroup {}
public interface Grid extends CustomerClientShowGroup {}
}

37
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java

@ -0,0 +1,37 @@
package com.epmet.dataaggre.dto.datastats.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 治理实况-当前组织治理指数-接口返参
* @Auth sun
*/
@Data
public class AgencyGovrnResultDTO implements Serializable {
private static final long serialVersionUID = 466974582608407121L;
@JsonIgnore
BigDecimal bi = new BigDecimal(0);
//组织Id
private String agencyId;
//组织名称
private String agencyName = "";
//agency_id所属的机关级别(社区级:community,乡(镇、街道)级:street, 区县级: district, 市级: city, 省级:province)
private String level = "";
//问题解决总数
private Integer problemResolvedCount = 0;
//党群自治占比
private BigDecimal groupSelfGovernRatio = bi;
//网格自治占比
private BigDecimal gridSelfGovernRatio = bi;
//社区解决占比
private BigDecimal communityResolvedRatio = bi;
//区直部门解决占比
private BigDecimal districtDeptResolvedRatio = bi;
//街道解决占比
private BigDecimal streetResolvedRatio = bi;
}

29
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java

@ -0,0 +1,29 @@
package com.epmet.dataaggre.dto.datastats.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 治理实况-当前网格治理指数-接口返参
* @Auth sun
*/
@Data
public class GridGovrnResultDTO implements Serializable {
private static final long serialVersionUID = 466974582608407121L;
@JsonIgnore
BigDecimal bi = new BigDecimal(0);
//网格Id
private String gridId;
//网格名称
private String gridName = "";
//问题解决总数
private Integer problemResolvedCount = 0;
//党群自治占比
private BigDecimal groupSelfGovernRatio = bi;
//网格自治占比
private BigDecimal gridSelfGovernRatio = bi;
}

49
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java

@ -2,10 +2,7 @@ package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import org.springframework.beans.factory.annotation.Autowired;
@ -159,4 +156,48 @@ public class DataStatsController {
return new Result<List<SubGridProjectResultDTO>>().ok(dataStatsService.subGridProject(formDTO));
}
/**
* @Param formDTO
* @Description 治理实况-当前组织治理指数
* @author sun
*/
@PostMapping("agencygovrn")
public Result<AgencyGovrnResultDTO> agencyGovrn(@RequestBody AgencyGovrnFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AgencyGovrnFormDTO.Agency.class);
return new Result<AgencyGovrnResultDTO>().ok(dataStatsService.agencyGovrn(formDTO));
}
/**
* @Param formDTO
* @Description 治理实况-组织直属下级治理指数列表
* @author sun
*/
@PostMapping("subagencygovrnlist")
public Result<List<AgencyGovrnResultDTO>> subAgencyGovrnList(@RequestBody AgencyGovrnFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AgencyGovrnFormDTO.Agency.class);
return new Result<List<AgencyGovrnResultDTO>>().ok(dataStatsService.subAgencyGovrnList(formDTO));
}
/**
* @Param formDTO
* @Description 治理实况-当前网格治理指数
* @author sun
*/
@PostMapping("gridgovrn")
public Result<GridGovrnResultDTO> gridGovrn(@RequestBody GridGovrnFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridGovrnFormDTO.Grid.class);
return new Result<GridGovrnResultDTO>().ok(dataStatsService.gridGovrn(formDTO));
}
/**
* @Param formDTO
* @Description 治理实况-组织直属网格治理指数列表
* @author sun
*/
@PostMapping("subgridgovrnlist")
public Result<List<GridGovrnResultDTO>> subGridGovrnList(@RequestBody GridGovrnFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridGovrnFormDTO.Agency.class);
return new Result<List<GridGovrnResultDTO>>().ok(dataStatsService.subGridGovrnList(formDTO));
}
}

14
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java

@ -228,4 +228,18 @@ public interface DataStatsDao {
@Param("actCategoryDictDTOList") List<ActCategoryDictDTO> actCategoryDictDTOList);
DimAgencyEntity getAgencyInfo(@Param("agencyId") String agencyId);
/**
* @Param formDTO
* @Description 根据组织Id查询事件治理指数
* @author sun
*/
List<AgencyGovrnResultDTO> getAgencyGovern(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Param formDTO
* @Description 根据网格Id查询事件治理指数
* @author sun
*/
List<GridGovrnResultDTO> getGridGovern(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId);
}

34
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java

@ -1,11 +1,7 @@
package com.epmet.dataaggre.service.datastats;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.PartyMemberVanguardFormDTO;
import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
@ -128,4 +124,32 @@ public interface DataStatsService {
List<FactGroupActDailyDTO> querySubAnalysisByCode(String customerId, String pid, String dateId, String categoryCode);
List<GroupActRankDetailDTO> selectGroupActRankDetail(String customerId, String dateId, String orgId, List<ActCategoryDictDTO> actCategoryDictDTOList);
/**
* @Param formDTO
* @Description 治理实况-当前组织治理指数
* @author sun
*/
AgencyGovrnResultDTO agencyGovrn(AgencyGovrnFormDTO formDTO);
/**
* @Param formDTO
* @Description 治理实况-组织直属下级治理指数列表
* @author sun
*/
List<AgencyGovrnResultDTO> subAgencyGovrnList(AgencyGovrnFormDTO formDTO);
/**
* @Param formDTO
* @Description 治理实况-当前网格治理指数
* @author sun
*/
GridGovrnResultDTO gridGovrn(GridGovrnFormDTO formDTO);
/**
* @Param formDTO
* @Description 治理实况-组织直属网格治理指数列表
* @author sun
*/
List<GridGovrnResultDTO> subGridGovrnList(GridGovrnFormDTO formDTO);
}

435
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -7,11 +7,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.constant.OrgConstant;
import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.PartyMemberVanguardFormDTO;
import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
@ -267,18 +263,24 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
//2.查询直属下级组织注册用户日统计数据,默认按用户总数降序
resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId());
List<SubAgencyUserResultDTO> list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId());
//3.封装数据
resultList.forEach(re -> {
re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal())));
re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal())));
subAgencyList.forEach(sub -> {
if (re.getAgencyId().equals(sub.getId())) {
re.setAgencyName(sub.getAgencyName());
for (DimAgencyEntity sub : subAgencyList) {
SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO();
dto.setAgencyId(sub.getId());
dto.setAgencyName(sub.getAgencyName());
for (SubAgencyUserResultDTO u : list) {
if (sub.getId().equals(u.getAgencyId())) {
dto.setUserTotal(u.getUserTotal());
dto.setPartyMemberTotal(u.getPartyMemberTotal());
dto.setResiTotal(u.getResiTotal());
}
});
});
}
dto.setPartyMemberRatio(dto.getPartyMemberTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPartyMemberTotal() / (float) dto.getUserTotal())));
dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal())));
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<SubAgencyUserResultDTO>() {
@ -330,18 +332,24 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
//2.查询网格层级注册用户日统计数据,默认按用户总数降序
resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId());
List<SubGridUserResultDTO> list = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId());
//3.封装数据
resultList.forEach(re -> {
re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal())));
re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal())));
gridList.forEach(sub -> {
if (re.getGridId().equals(sub.getId())) {
re.setGridName(sub.getGridName());
for (DimGridEntity gr : gridList) {
SubGridUserResultDTO dto = new SubGridUserResultDTO();
dto.setGridId(gr.getId());
dto.setGridName(gr.getGridName());
for (SubGridUserResultDTO re : list) {
if (gr.getId().equals(re.getGridId())) {
dto.setUserTotal(re.getUserTotal());
dto.setPartyMemberTotal(re.getPartyMemberTotal());
dto.setResiTotal(re.getResiTotal());
}
});
});
}
dto.setPartyMemberRatio(dto.getPartyMemberTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPartyMemberTotal() / (float) dto.getUserTotal())));
dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal())));
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<SubGridUserResultDTO>() {
@ -391,18 +399,24 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
//2.查询直属下级组织小组日统计数据,默认按群组总数降序
resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId());
List<SubAgencyGroupResultDTO> list = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId());
//3.封装数据
resultList.forEach(re -> {
re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal())));
re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal())));
subAgencyList.forEach(sub -> {
if (re.getAgencyId().equals(sub.getId())) {
re.setAgencyName(sub.getAgencyName());
for (DimAgencyEntity sub : subAgencyList) {
SubAgencyGroupResultDTO dto = new SubAgencyGroupResultDTO();
dto.setAgencyId(sub.getId());
dto.setAgencyName(sub.getAgencyName());
for (SubAgencyGroupResultDTO u : list) {
if (sub.getId().equals(u.getAgencyId())) {
dto.setGroupTotal(u.getGroupTotal());
dto.setOrdinaryTotal(u.getOrdinaryTotal());
dto.setBranchTotal(u.getBranchTotal());
}
});
});
}
dto.setOrdinaryRatio(dto.getOrdinaryTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getOrdinaryTotal() / (float) dto.getGroupTotal())));
dto.setBranchRatio(dto.getBranchTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getBranchTotal() / (float) dto.getGroupTotal())));
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<SubAgencyGroupResultDTO>() {
@ -451,18 +465,24 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
//2.查询网格层级小组日统计数据,默认按群组总数降序
resultList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId());
List<SubGridGroupResultDTO> list = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId());
//3.封装数据并返回
resultList.forEach(re -> {
re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal())));
re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal())));
gridList.forEach(sub -> {
if (re.getGridId().equals(sub.getId())) {
re.setGridName(sub.getGridName());
for (DimGridEntity gr : gridList) {
SubGridGroupResultDTO dto = new SubGridGroupResultDTO();
dto.setGridId(gr.getId());
dto.setGridName(gr.getGridName());
for (SubGridGroupResultDTO re : list) {
if (gr.getId().equals(re.getGridId())) {
dto.setGroupTotal(re.getGroupTotal());
dto.setOrdinaryTotal(re.getOrdinaryTotal());
dto.setBranchTotal(re.getBranchTotal());
}
});
});
}
dto.setOrdinaryRatio(dto.getOrdinaryTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getOrdinaryTotal() / (float) dto.getGroupTotal())));
dto.setBranchRatio(dto.getBranchTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getBranchTotal() / (float) dto.getGroupTotal())));
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<SubGridGroupResultDTO>() {
@ -518,15 +538,14 @@ public class DataStatsServiceImpl implements DataStatsService {
List<SubAgencyFormDTO.Topic> topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId());
//查询直属下级组织热议中话题-机关日统计数据
List<SubAgencyFormDTO.Topic> hotdiscuss = dataStatsDao.getSubAgencyTopicHotDiscuss(agencyIds, formDTO.getDateId());
agencyIds.forEach(agencyId -> {
subAgencyList.forEach(sub -> {
SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO();
AtomicInteger topicTotal = new AtomicInteger(0);
AtomicInteger closedTotal = new AtomicInteger(0);
AtomicInteger shiftIssueTotal = new AtomicInteger(0);
AtomicInteger hotdiscussTotal = new AtomicInteger(0);
AtomicReference<String> agencyName = new AtomicReference<>("");
topic.forEach(t -> {
if (t.getAgencyId().equals(agencyId)) {
if (t.getAgencyId().equals(sub.getId())) {
topicTotal.addAndGet(t.getTopicCount());
if (t.getTopicStatus().equals("closed")) {
closedTotal.set(t.getTopicCount());
@ -534,23 +553,18 @@ public class DataStatsServiceImpl implements DataStatsService {
}
});
topicShiftIssue.forEach(t -> {
if (t.getAgencyId().equals(agencyId)) {
if (t.getAgencyId().equals(sub.getId())) {
shiftIssueTotal.addAndGet(t.getShiftedIssueTotal());
}
});
hotdiscuss.forEach(t -> {
if (t.getAgencyId().equals(agencyId)) {
if (t.getAgencyId().equals(sub.getId())) {
hotdiscussTotal.addAndGet(t.getTopicCount());
}
});
subAgencyList.forEach(sub -> {
if (agencyId.equals(sub.getId())) {
agencyName.set(sub.getAgencyName());
}
});
resultDTO.setAgencyId(agencyId);
resultDTO.setAgencyName(agencyName.get());
resultDTO.setAgencyId(sub.getId());
resultDTO.setAgencyName(sub.getAgencyName());
resultDTO.setTopicTotal(topicTotal.get());
resultDTO.setDiscussingTotal(hotdiscussTotal.get());
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
@ -618,15 +632,14 @@ public class DataStatsServiceImpl implements DataStatsService {
List<SubGridFormDTO.Topic> topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId());
//查询网格层级热议中话题-日统计数据
List<SubGridFormDTO.Topic> hotdiscuss = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId());
gridIds.forEach(gridId -> {
gridList.forEach(gr -> {
SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO();
AtomicInteger topicTotal = new AtomicInteger(0);
AtomicInteger closedTotal = new AtomicInteger(0);
AtomicInteger shiftIssueTotal = new AtomicInteger(0);
AtomicInteger hotdiscussTotal = new AtomicInteger(0);
AtomicReference<String> gridName = new AtomicReference<>("");
topic.forEach(t -> {
if (t.getGridId().equals(gridId)) {
if (t.getGridId().equals(gr.getId())) {
topicTotal.addAndGet(t.getTopicCount());
if (t.getTopicStatus().equals("closed")) {
closedTotal.set(t.getTopicCount());
@ -634,23 +647,18 @@ public class DataStatsServiceImpl implements DataStatsService {
}
});
topicShiftIssue.forEach(t -> {
if (t.getGridId().equals(gridId)) {
if (t.getGridId().equals(gr.getId())) {
shiftIssueTotal.addAndGet(t.getShiftedIssueTotal());
}
});
hotdiscuss.forEach(t -> {
if (t.getGridId().equals(gridId)) {
if (t.getGridId().equals(gr.getId())) {
hotdiscussTotal.addAndGet(t.getTopicCount());
}
});
gridList.forEach(sub -> {
if (gridId.equals(sub.getId())) {
gridName.set(sub.getGridName());
}
});
resultDTO.setGridId(gridId);
resultDTO.setGridName(gridName.get());
resultDTO.setGridId(gr.getId());
resultDTO.setGridName(gr.getGridName());
resultDTO.setTopicTotal(topicTotal.get());
resultDTO.setDiscussingTotal(hotdiscussTotal.get());
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
@ -711,19 +719,26 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
//2.查询直属下级组织议题日统计数据,默认按议题总数降序
resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId());
List<SubAgencyIssueResultDTO> list = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId());
//3.封装数据
resultList.forEach(re -> {
re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal())));
re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal())));
re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal())));
subAgencyList.forEach(sub -> {
if (re.getAgencyId().equals(sub.getId())) {
re.setAgencyName(sub.getAgencyName());
for (DimAgencyEntity sub : subAgencyList) {
SubAgencyIssueResultDTO dto = new SubAgencyIssueResultDTO();
dto.setAgencyId(sub.getId());
dto.setAgencyName(sub.getAgencyName());
for (SubAgencyIssueResultDTO u : list) {
if (sub.getId().equals(u.getAgencyId())) {
dto.setIssueTotal(u.getIssueTotal());
dto.setVotingTotal(u.getVotingTotal());
dto.setClosedIssueTotal(u.getClosedIssueTotal());
dto.setShiftProjectTotal(u.getShiftProjectTotal());
}
});
});
}
dto.setVotingRatio(dto.getVotingTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getVotingTotal() / (float) dto.getIssueTotal())));
dto.setClosedIssueRatio(dto.getClosedIssueTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedIssueTotal() / (float) dto.getIssueTotal())));
dto.setShiftProjectRatio(dto.getShiftProjectTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getShiftProjectTotal() / (float) dto.getIssueTotal())));
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<SubAgencyIssueResultDTO>() {
@ -774,19 +789,26 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
//2.查询网格层级议题日统计数据,默认按议题总数降序
resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId());
List<SubGridIssueResultDTO> list = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId());
//3.封装数据
resultList.forEach(re -> {
re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal())));
re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal())));
re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal())));
gridList.forEach(sub -> {
if (re.getGridId().equals(sub.getId())) {
re.setGridName(sub.getGridName());
for (DimGridEntity gr : gridList) {
SubGridIssueResultDTO dto = new SubGridIssueResultDTO();
dto.setGridId(gr.getId());
dto.setGridName(gr.getGridName());
for (SubGridIssueResultDTO re : list) {
if (gr.getId().equals(re.getGridId())) {
dto.setIssueTotal(re.getIssueTotal());
dto.setVotingTotal(re.getVotingTotal());
dto.setClosedIssueTotal(re.getClosedIssueTotal());
dto.setShiftProjectTotal(re.getShiftProjectTotal());
}
});
});
}
dto.setVotingRatio(dto.getVotingTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getVotingTotal() / (float) dto.getIssueTotal())));
dto.setClosedIssueRatio(dto.getClosedIssueTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedIssueTotal() / (float) dto.getIssueTotal())));
dto.setShiftProjectRatio(dto.getShiftProjectTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getShiftProjectTotal() / (float) dto.getIssueTotal())));
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<SubGridIssueResultDTO>() {
@ -837,18 +859,24 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
//2.查询直属下级组织项目日统计数据,默认按项目总数降序
resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId());
List<SubAgencyProjectResultDTO> list = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId());
//3.封装数据
resultList.forEach(re -> {
re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal())));
re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal())));
subAgencyList.forEach(sub -> {
if (re.getAgencyId().equals(sub.getId())) {
re.setAgencyName(sub.getAgencyName());
for (DimAgencyEntity sub : subAgencyList) {
SubAgencyProjectResultDTO dto = new SubAgencyProjectResultDTO();
dto.setAgencyId(sub.getId());
dto.setAgencyName(sub.getAgencyName());
for (SubAgencyProjectResultDTO u : list) {
if (sub.getId().equals(u.getAgencyId())) {
dto.setProjectTotal(u.getProjectTotal());
dto.setPendingTotal(u.getPendingTotal());
dto.setClosedProjectTotal(u.getClosedProjectTotal());
}
});
});
}
dto.setPendingRatio(dto.getPendingTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPendingTotal() / (float) dto.getProjectTotal())));
dto.setClosedProjectRatio(dto.getClosedProjectTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedProjectTotal() / (float) dto.getProjectTotal())));
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<SubAgencyProjectResultDTO>() {
@ -897,18 +925,24 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
//2.查询网格层级项目日统计数据,默认按项目总数降序
resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId());
List<SubGridProjectResultDTO> list = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId());
//3.封装数据
resultList.forEach(re -> {
re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal())));
re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal())));
gridList.forEach(sub -> {
if (re.getGridId().equals(sub.getId())) {
re.setGridName(sub.getGridName());
for (DimGridEntity gr : gridList) {
SubGridProjectResultDTO dto = new SubGridProjectResultDTO();
dto.setGridId(gr.getId());
dto.setGridName(gr.getGridName());
for (SubGridProjectResultDTO re : list) {
if (gr.getId().equals(re.getGridId())) {
dto.setProjectTotal(re.getProjectTotal());
dto.setPendingTotal(re.getPendingTotal());
dto.setClosedProjectTotal(re.getClosedProjectTotal());
}
});
});
}
dto.setPendingRatio(dto.getPendingTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPendingTotal() / (float) dto.getProjectTotal())));
dto.setClosedProjectRatio(dto.getClosedProjectTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedProjectTotal() / (float) dto.getProjectTotal())));
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<SubGridProjectResultDTO>() {
@ -1014,4 +1048,199 @@ public class DataStatsServiceImpl implements DataStatsService {
return new ArrayList<>();
}
/**
* @Param formDTO
* @Description 治理实况-当前组织治理指数
* @author sun
*/
@Override
public AgencyGovrnResultDTO agencyGovrn(AgencyGovrnFormDTO formDTO) {
AgencyGovrnResultDTO resultDTO = new AgencyGovrnResultDTO();
resultDTO.setAgencyId(formDTO.getAgencyId());
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
//1.按日期查询当前组织事件治理指数
List<String> agencyIds = new ArrayList<>();
agencyIds.add(formDTO.getAgencyId());
List<AgencyGovrnResultDTO> list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId());
if (list.size() > NumConstant.ZERO) {
resultDTO = list.get(NumConstant.ZERO);
}
return resultDTO;
}
/**
* @Param formDTO
* @Description 治理实况-组织直属下级治理指数列表
* @author sun
*/
@Override
public List<AgencyGovrnResultDTO> subAgencyGovrnList(AgencyGovrnFormDTO formDTO) {
List<AgencyGovrnResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
//排序类型,默认按问题解决总数降序
if (StringUtils.isBlank(formDTO.getDateId())) {
formDTO.setType("problem");
}
//1.查询当前组织的直属下级组织信息【机关维度】
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
//2.按日期查询所有下级组织的事件治理指数
List<AgencyGovrnResultDTO> list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId());
//3.封装数据
for (DimAgencyEntity sub : subAgencyList) {
AgencyGovrnResultDTO dto = new AgencyGovrnResultDTO();
dto.setAgencyId(sub.getId());
dto.setAgencyName(sub.getAgencyName());
dto.setLevel(sub.getLevel());
for (AgencyGovrnResultDTO re : list) {
if (sub.getId().equals(re.getAgencyId())) {
dto.setProblemResolvedCount(re.getProblemResolvedCount());
dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio());
dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio());
dto.setCommunityResolvedRatio(re.getCommunityResolvedRatio());
dto.setStreetResolvedRatio(re.getStreetResolvedRatio());
dto.setDistrictDeptResolvedRatio(re.getDistrictDeptResolvedRatio());
}
}
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<AgencyGovrnResultDTO>() {
@Override
public int compare(AgencyGovrnResultDTO o1, AgencyGovrnResultDTO o2) {
if ("party".equals(formDTO.getType())) {
return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio());
} else if ("grid".equals(formDTO.getType())) {
return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio());
} else if ("community".equals(formDTO.getType())) {
return o2.getCommunityResolvedRatio().compareTo(o1.getCommunityResolvedRatio());
} else if ("department".equals(formDTO.getType())) {
return o2.getDistrictDeptResolvedRatio().compareTo(o1.getDistrictDeptResolvedRatio());
} else if ("street".equals(formDTO.getType())) {
return o2.getStreetResolvedRatio().compareTo(o1.getStreetResolvedRatio());
} else {
return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount());
}
}
});
return resultList;
}
/**
* @Param formDTO
* @Description 治理实况-当前网格治理指数
* @author sun
*/
@Override
public GridGovrnResultDTO gridGovrn(GridGovrnFormDTO formDTO) {
GridGovrnResultDTO resultDTO = new GridGovrnResultDTO();
resultDTO.setGridId(formDTO.getGridId());
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
//1.按日期查询网格事件治理指数
List<String> gridIds = new ArrayList<>();
gridIds.add(formDTO.getGridId());
List<GridGovrnResultDTO> list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId());
if (list.size() > NumConstant.ZERO) {
resultDTO = list.get(NumConstant.ZERO);
}
return resultDTO;
}
/**
* @Param formDTO
* @Description 治理实况-组织直属网格治理指数列表
* @author sun
*/
@Override
public List<GridGovrnResultDTO> subGridGovrnList(GridGovrnFormDTO formDTO) {
List<GridGovrnResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
//排序类型,默认按问题解决总数降序
if (StringUtils.isBlank(formDTO.getDateId())) {
formDTO.setType("problem");
}
//1.查询组织直属网格列表【网格维度】
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
//2.按日期查找组织直属网格事件治理指数列表
List<GridGovrnResultDTO> list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId());
//3.封装数据
for (DimGridEntity gr : gridList) {
GridGovrnResultDTO dto = new GridGovrnResultDTO();
dto.setGridId(gr.getId());
dto.setGridName(gr.getGridName());
for (GridGovrnResultDTO re : list) {
if (gr.getId().equals(re.getGridId())) {
dto.setProblemResolvedCount(re.getProblemResolvedCount());
dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio());
dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio());
}
}
resultList.add(dto);
}
//4.按要求排序并返回
Collections.sort(resultList, new Comparator<GridGovrnResultDTO>() {
@Override
public int compare(GridGovrnResultDTO o1, GridGovrnResultDTO o2) {
if ("party".equals(formDTO.getType())) {
return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio());
} else if ("grid".equals(formDTO.getType())) {
return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio());
} else {
return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount());
}
}
});
return resultList;
}
}

39
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -612,4 +612,43 @@
WHERE
ID = #{agencyId}
</select>
<select id="getAgencyGovern" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyGovrnResultDTO">
SELECT
agency_id AS agencyId,
`level` AS level,
problem_resolved_count AS problemResolvedCount,
ROUND(group_self_govern_ratio, 3) AS groupSelfGovernRatio,
ROUND(grid_self_govern_ratio, 3) AS gridSelfGovernRatio,
ROUND(community_closed_ratio, 3) AS communityResolvedRatio,
ROUND(street_closed_ratio, 3) AS streetResolvedRatio,
ROUND(district_dept_closed_ratio, 3) AS districtDeptResolvedRatio
FROM
fact_agency_govern_daily
WHERE
del_flag = '0'
AND date_id = #{dateId}
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
ORDER BY problem_resolved_count DESC
</select>
<select id="getGridGovern" resultType="com.epmet.dataaggre.dto.datastats.result.GridGovrnResultDTO">
SELECT
grid_id AS gridId,
problem_resolved_count AS problemResolvedCount,
ROUND(group_self_govern_ratio, 3) AS groupSelfGovernRatio,
ROUND(grid_self_govern_ratio, 3) AS gridSelfGovernRatio
FROM
fact_grid_govern_daily
WHERE
del_flag = '0'
AND date_id = #{dateId}
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index="">
grid_id = #{gridId}
</foreach>
ORDER BY problem_resolved_count DESC
</select>
</mapper>

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java

@ -0,0 +1,33 @@
/**
* 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.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格的治理指数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-24
*/
@Mapper
public interface FactGridGovernDailyDao extends BaseDao<FactGridGovernDailyEntity> {
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.CpcScoreResultDTO;
import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity;
import com.epmet.model.AvgOperationResultVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -46,9 +47,9 @@ public interface CpcScoreDao extends BaseDao<CpcScoreEntity> {
* @description 获取网格内党员的联系群众能力考评分平均值
* @Date 2020/8/31 10:56
**/
BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("gridId") String gridId);
AvgOperationResultVO selectGridContactMassesAvgValue(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("gridId") String gridId);
/**
* @param formDTO
@ -77,7 +78,7 @@ public interface CpcScoreDao extends BaseDao<CpcScoreEntity> {
* @description 组织内党员的参与议事能力考评分平均值
* @Date 2020/8/31 15:51
**/
BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId);
AvgOperationResultVO selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId);
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("deleteSize") Integer deleteSize, @Param("isTotal") String isTotal);

135
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java

@ -0,0 +1,135 @@
/**
* 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.extract;
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 2021-05-24
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_grid_govern_daily")
public class FactGridGovernDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 网格所属的组织id
*/
private String pid;
/**
* 网格所有上级id
*/
private String pids;
/**
* 界面展示问题解决总数=1+2+3+4+5+6+7+8
*/
private Integer problemResolvedCount;
/**
* 界面展示党群自治占比=9+10/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
*/
private BigDecimal groupSelfGovernRatio;
/**
* 界面展示网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT此列存储的是小数
*/
private BigDecimal gridSelfGovernRatio;
/**
* 1当前网格内话题关闭已解决数
*/
private Integer topicResolvedCount;
/**
* 2当前网格内话题关闭无需解决数
*/
private Integer topicUnResolvedCount;
/**
* 3当前网格内议题关闭已解决数
*/
private Integer issueResolvedCount;
/**
* 4当前网格内议题关闭无需解决数
*/
private Integer issueUnResolvedCount;
/**
* 5当前网格内来源于议题的项目结案已解决数
*/
private Integer issueProjectResolvedCount;
/**
* 6当前网格内来源于议题的项目结案无需解决数
*/
private Integer issueProjectUnResolvedCount;
/**
* 7当前网格内项目立项结案已解决数默认为0
*/
private Integer approvalProjectResolvedCount;
/**
* 8当前网格内项目立项结案无需解决数默认为0
*/
private Integer approvalProjectUnResolvedCount;
/**
* 9当前网格内未出小组即未转议题的话题关闭已解决数
*/
private Integer inGroupTopicResolvedCount;
/**
* 10当前网格内未出小组即未转议题的话题关闭无需解决数
*/
private Integer inGroupTopicUnResolvedCount;
/**
* 未出当前网格的结案项目数
*/
private Integer gridSelfGovernProjectTotal;
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java

@ -101,4 +101,9 @@ public class GridSubScoreEntity extends BaseEpmetEntity {
* 权重同一组权重总和=1
*/
private BigDecimal weight;
/**
* 样本总量
*/
private Integer sampleCount;
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java

@ -0,0 +1,21 @@
package com.epmet.model;
import lombok.Data;
import java.math.BigDecimal;
/**
* 平均值运算结果vo
*/
@Data
public class AvgOperationResultVO {
/**
* 样本量
*/
private Integer sampleCount;
/**
* 平均值
*/
private BigDecimal avgValue;
}

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java

@ -0,0 +1,32 @@
/**
* 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.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
/**
* 网格的治理指数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-24
*/
public interface FactGridGovernDailyService extends BaseService<FactGridGovernDailyEntity> {
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java

@ -0,0 +1,35 @@
/**
* 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.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import org.springframework.stereotype.Service;
/**
* 网格的治理指数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-24
*/
@Service
public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGovernDailyDao, FactGridGovernDailyEntity> implements FactGridGovernDailyService {
}

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

@ -26,6 +26,7 @@ import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
import com.epmet.eum.IndexCodeEnum;
import com.epmet.model.AvgOperationResultVO;
import com.epmet.service.evaluationindex.indexcal.GridCorreLationService;
import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService;
import com.epmet.service.evaluationindex.screen.IndexGroupDetailService;
@ -185,6 +186,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
**/
@Transactional(rollbackFor = Exception.class)
public void calculateGridDangJian(CalculateCommonFormDTO formDTO) {
// 该客户下的指标列表及权重
List<IndexGroupDetailEntity> indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(),
IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
@ -192,7 +194,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
log.error("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
throw new RenException("客户【网格相关:党建能力】指标权重信息不存在");
}
//查询总记录数
//查询总记录数(该客户下,该月份,每个网格一条,有多少条)
int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO);
if (NumConstant.ZERO == total) {
log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId()));
@ -210,10 +212,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
//指标集合
Map<String, IndexInputVO<BigDecimal>> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap);
List<HashMap<String, CalculateResult>> resultMapList = new ArrayList<>();
// 平均值计算结果,内含平均值,样本总量
HashMap<String, AvgOperationResultVO> gridAvgOpeResultMap = new HashMap<>();
//分页查询采集记录
for (int pageNo = 1; pageNo <= totalPage; pageNo++) {
int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE;
//前10条
//前10条。每个网格的党建能力的数据
List<Map<String, Object>> recordList = queryListPartyAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(),
formDTO.getMonthId(),
pageIndex,
@ -231,8 +235,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
// log.info("组织内党员的联系群众能力考评分(平均值) 单独处理");
//网格内党员的联系群众能力考评分(平均值)
String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID);
BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId);
SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue);
String monthId = (String) recordMap.get(IndexCalConstant.MONTH_ID);
AvgOperationResultVO contactMassesAvgVo = getGridContactMassesAvgValue(formDTO, gridId);
gridAvgOpeResultMap.put(gridId.concat(":").concat(monthId), contactMassesAvgVo);
SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgVo.getAvgValue());
value.getIndexValueVOs().add(contactMassesAblityValue);
}else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) {
//对应的数值
@ -251,7 +257,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
saveGridCorreLationResult(formDTO,
resultMapList,
IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),
NumConstant.ZERO_STR);
NumConstant.ZERO_STR,
gridAvgOpeResultMap);
// 清理map
gridAvgOpeResultMap.clear();
}
/**
@ -312,10 +322,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
* @description 获取网格组织内党员的联系群众能力考评分平均值
* @Date 2020/8/31 9:50
**/
private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) {
BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId);
private AvgOperationResultVO getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) {
AvgOperationResultVO result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId);
if (null == result) {
return new BigDecimal(NumConstant.ZERO_STR);
result.setAvgValue(new BigDecimal(0));
result.setSampleCount(0);
}
//FOR TEST
/*BigDecimal result=null;
@ -337,10 +348,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
* @description 组织内党员的参与议事能力考评分平均值
* @Date 2020/8/31 15:51
**/
private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) {
BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId);
private AvgOperationResultVO getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) {
AvgOperationResultVO result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId);
if (null == result) {
return new BigDecimal(NumConstant.ZERO_STR);
//return new BigDecimal(NumConstant.ZERO_STR);
result.setSampleCount(0);
result.setAvgValue(new BigDecimal(0));
}
//FOR TEST
/*BigDecimal result=null;
@ -411,7 +424,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
/**
* @param formDTO 客户id 月份id: yyyyMM
* @param resultMapList
* @param resultMapList key网格idvalue该网格各项指标的计算结果
* @param indexCode 指标编码: 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
* @param isTotal 1总分0不是
* @return void
@ -422,7 +435,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO,
List<HashMap<String, CalculateResult>> resultMapList,
String indexCode,
String isTotal) {
String isTotal,
HashMap<String, AvgOperationResultVO> avgOpeResultVo) {
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId());
String yearId = DateUtils.getYearId(formDTO.getMonthId());
//三大能力结果表
@ -463,6 +477,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
gridSubScoreEntity.setScore(detail.getScore());
gridSubScoreEntity.setWeight(detail.getWeight());
gridSubScoreEntity.setOriginValue(detail.getOriginValue());
// 为平均值类型的指标赋值样本总量
AvgOperationResultVO avgOperationResultVO = avgOpeResultVo.get(gridSubScoreEntity.getGridId().concat(":").concat(gridSubScoreEntity.getMonthId()));
if (avgOperationResultVO != null) {
gridSubScoreEntity.setSampleCount(avgOperationResultVO.getSampleCount());
} else {
gridSubScoreEntity.setSampleCount(0);
}
gridSubScoreList.add(gridSubScoreEntity);
}
});
@ -621,6 +643,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
//指标集合
Map<String, IndexInputVO<BigDecimal>> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap);
List<HashMap<String, CalculateResult>> resultMapList = new ArrayList<>();
HashMap<String, AvgOperationResultVO> avgOperationResultVo = new HashMap<>();
//分页查询采集记录
for (int pageNo = 1; pageNo <= totalPage; pageNo++) {
int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE;
@ -639,8 +662,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) {
// log.info("组织内党员的参与议事能力考评分(平均值) 单独处理");
String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID);
BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId);
SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue);
String monthId = (String) recordMap.get(IndexCalConstant.MONTH_ID);
AvgOperationResultVO joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId);
avgOperationResultVo.put(gridId.concat(":").concat(monthId), joinAvgValue);
SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue.getAvgValue());
value.getIndexValueVOs().add(contactMassesAblityValue);
}else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) {
//对应的数值
@ -659,7 +685,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
saveGridCorreLationResult(formDTO,
resultMapList,
IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),
NumConstant.ZERO_STR);
NumConstant.ZERO_STR,
avgOperationResultVo);
}
@ -696,6 +723,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
//指标集合
Map<String, IndexInputVO<BigDecimal>> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap);
List<HashMap<String, CalculateResult>> resultMapList = new ArrayList<>();
HashMap<String, AvgOperationResultVO> avgOperationResultVO = new HashMap<>();
//分页查询采集记录
for (int pageNo = 1; pageNo <= totalPage; pageNo++) {
int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE;
@ -730,7 +758,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
saveGridCorreLationResult(formDTO,
resultMapList,
IndexCodeEnum.FU_WU_NENG_LI.getCode(),
NumConstant.ZERO_STR);
NumConstant.ZERO_STR,
avgOperationResultVO);
}
/**

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql

@ -0,0 +1 @@
alter table fact_index_grid_sub_score add column SAMPLE_COUNT int(10) comment '样本量' after ORIGIN_VALUE;

49
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql

@ -0,0 +1,49 @@
-- epmet_data_statistical 库执行以下脚本
-- CREATE TABLE `fact_group_act_daily` (
-- `ID` varchar(64) NOT NULL COMMENT '主键',
-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
-- `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd',
-- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
-- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
-- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
-- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
-- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
-- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
-- `LEVEL` int(11) NOT NULL COMMENT '分类等级',
-- `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据',
-- `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据',
-- `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据',
-- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
-- `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
-- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
-- `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
-- `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
-- PRIMARY KEY (`ID`) USING BTREE
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析';
-- CREATE TABLE `fact_group_act_monthly` (
-- `ID` varchar(64) NOT NULL COMMENT '主键',
-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
-- `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM',
-- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
-- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
-- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
-- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
-- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
-- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
-- `LEVEL` int(11) NOT NULL COMMENT '分类等级',
-- `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数',
-- `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数',
-- `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数',
-- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
-- `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
-- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
-- `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
-- `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
-- PRIMARY KEY (`ID`) USING BTREE
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析';

7
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao">
</mapper>

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

@ -46,9 +46,10 @@
<!-- 获取网格内党员的联系群众能力考评分(平均值) -->
<select id="selectGridContactMassesAvgValue" parameterType="map" resultType="java.math.BigDecimal">
<select id="selectGridContactMassesAvgValue" parameterType="map" resultType="com.epmet.model.AvgOperationResultVO">
SELECT
round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE
round(AVG( SCORE ),6) AS AVG_VALUE,
count(1) AS SAMPLE_COUNT
FROM
fact_index_cpc_score m
WHERE
@ -90,9 +91,10 @@
</select>
<!-- -->
<select id="selectGridJoinIssueAvgValue" parameterType="map" resultType="java.math.BigDecimal">
<select id="selectGridJoinIssueAvgValue" parameterType="map" resultType="com.epmet.model.AvgOperationResultVO">
SELECT
round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE
round(AVG( SCORE ),6) AS AVG_VALUE,
count(1) AS SAMPLE_COUNT
FROM
fact_index_cpc_score m
WHERE

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml

@ -24,7 +24,8 @@
`CREATED_BY`,
`CREATED_TIME`,
`UPDATED_BY`,
`UPDATED_TIME`
`UPDATED_TIME`,
`SAMPLE_COUNT`
)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
@ -47,7 +48,8 @@
'APP_USER',
now(),
'APP_USER',
now()
now(),
#{item.sampleCount}
)
</foreach>
</insert>

Loading…
Cancel
Save