Browse Source

暂存

dev_shibei_match
yinzuomei 4 years ago
parent
commit
513dd6fdef
  1. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java
  2. 64
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java
  3. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java
  4. 55
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java

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

@ -79,7 +79,22 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
*/
private BigDecimal gridSelfGovernRatio;
/**
/**
* 界面展示社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT此列存储的是小数
*/
private BigDecimal communityClosedRatio;
/**
* 界面展示街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT此列存储的是小数
*/
private BigDecimal streetClosedRatio;
/**
* 界面展示区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT此列存储的是小数
*/
private BigDecimal districtDeptClosedRatio;
/**
* 1当前网格内话题关闭已解决数
*/
private Integer topicResolvedCount;
@ -155,15 +170,36 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
private Integer gridSelfGovernProjectTotal;
/**
* 当前网格内出来的项目由社区结案(已解决+未解决)的项目总数
*/
private Integer communityClosedCount;
/**
* 当前网格内出来的项目由街道结案(已解决+未解决)的项目总数
*/
private Integer streetClosedCount;
/**
* 当前网格内出来的项目由街道结案(已解决+未解决)的项目总数
*/
private Integer districtDeptClosedCount;
public FactGridGovernDailyEntity() {
this.customerId = StrConstant.EPMETY_STR;
this.dateId = StrConstant.EPMETY_STR;
this.gridId = StrConstant.EPMETY_STR;
this.pid = StrConstant.EPMETY_STR;
this.pids = StrConstant.EPMETY_STR;
//界面展示
this.problemResolvedCount = NumConstant.ZERO;
this.groupSelfGovernRatio=BigDecimal.ZERO;
this.gridSelfGovernProjectTotal=NumConstant.ZERO;
this.communityClosedRatio=BigDecimal.ZERO;
this.streetClosedRatio=BigDecimal.ZERO;
this.districtDeptClosedRatio=BigDecimal.ZERO;
this.topicResolvedCount=NumConstant.ZERO;
this.topicUnResolvedCount=NumConstant.ZERO;
this.issueResolvedCount=NumConstant.ZERO;
@ -179,5 +215,8 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
this.fromAgencyResolvedInGridCount=NumConstant.ZERO;
this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO;
this.gridSelfGovernProjectTotal=NumConstant.ZERO;
this.communityClosedCount=NumConstant.ZERO;
this.streetClosedCount=NumConstant.ZERO;
this.districtDeptClosedCount=NumConstant.ZERO;
}
}

64
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java

@ -0,0 +1,64 @@
package com.epmet.entity.evaluationindex.extract;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import lombok.Data;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/5/26 15:47
*/
@Data
public class GovernGridClosedTotalCommonDTO implements Serializable {
private static final long serialVersionUID = 7717094992132062415L;
private String gridId;
/**
* 11来源于议题的项目未出网格结案并且已解决的项目数
*/
private Integer fromIssueResolvedInGridCount;
/**
* 12来源于议题的项目未出网格结案并且无需解决的项目数
*/
private Integer fromIssueUnResolvedInGridCount;
/**
* 13来源于项目立项的项目未出网格结案并且已解决的项目数因现在网格不能立项所以此列默认为0
*/
private Integer fromAgencyResolvedInGridCount;
/**
* 14来源于项目立项的项目未出网格结案并且无需解决的项目数因现在网格不能立项所以此列默认为0
*/
private Integer fromAgencyUnResolvedInGridCount;
/**
* 当前网格内出来的项目由社区结案(已解决+未解决)的项目总数
*/
private Integer communityClosedCount;
/**
* 当前网格内出来的项目由街道结案(已解决+未解决)的项目总数
*/
private Integer streetClosedCount;
/**
* 当前网格内出来的项目由街道结案(已解决+未解决)的项目总数
*/
private Integer districtDeptClosedCount;
public GovernGridClosedTotalCommonDTO(){
this.gridId = StrConstant.EPMETY_STR;
this.fromIssueResolvedInGridCount=NumConstant.ZERO;
this.fromIssueUnResolvedInGridCount=NumConstant.ZERO;
this.fromAgencyResolvedInGridCount=NumConstant.ZERO;
this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO;
this.communityClosedCount=NumConstant.ZERO;
this.streetClosedCount=NumConstant.ZERO;
this.districtDeptClosedCount=NumConstant.ZERO;
}
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java

@ -0,0 +1,15 @@
package com.epmet.entity.evaluationindex.extract;
import lombok.Data;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/5/26 18:00
*/
@Data
public class ProjectInfoDTO implements Serializable {
}

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

@ -24,6 +24,7 @@ import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
@ -42,6 +43,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 网格的治理指数按天统计
@ -86,6 +88,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
log.info("当前客户customerId=("+customerId+")下没有网格,无需计算");
return;
}
List<String> gridIds=gridInfoDTOList.stream().map(GridInfoDTO::getGridId).collect(Collectors.toList());
List<FactGridGovernDailyEntity> insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList);
// log.info(JSON.toJSONString(insertEntityList,true));
@ -102,7 +105,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
Map<String,Integer> approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED);
Map<String, Integer> inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR);
Map<String, Integer> inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ONE_STR);
Map<String, GovernGridClosedTotalCommonDTO> dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds);
for(FactGridGovernDailyEntity insertEntity:insertEntityList){
//1、当前网格内,话题关闭已解决数
@ -154,18 +157,24 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
// todo
// 11、来源于议题的项目,未出网格结案并且已解决的项目数
insertEntity.setFromIssueResolvedInGridCount(0);
insertEntity.setFromIssueResolvedInGridCount(666);
// 12、来源于议题的项目,未出网格结案并且无需解决的项目数
insertEntity.setFromIssueUnResolvedInGridCount(0);
insertEntity.setFromIssueUnResolvedInGridCount(666);
// 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyResolvedInGridCount(0);
insertEntity.setFromAgencyResolvedInGridCount(666);
// 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyUnResolvedInGridCount(0);
insertEntity.setFromAgencyUnResolvedInGridCount(666);
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
// 15、未出当前网格的,结案项目数=11+12+13+14
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+
insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount());
//当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
insertEntity.setCommunityClosedCount(666);
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setStreetClosedCount(666);
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setDistrictDeptClosedCount(666);
//界面展示:1、问题解决总数=1+2+3+4+5+6+7+8
insertEntity.setProblemResolvedCount(insertEntity.getTopicResolvedCount()+insertEntity.getTopicUnResolvedCount()
@ -191,6 +200,34 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / insertEntity.getProblemResolvedCount());
insertEntity.setGridSelfGovernRatio(new BigDecimal(gridSelfGovernRatioStr));
}
//界面展示:4、社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
//网格内出来的项目,最终由社区结案的项目数
if (NumConstant.ZERO == insertEntity.getCommunityClosedCount()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()) {
insertEntity.setCommunityClosedRatio(BigDecimal.ZERO);
}else{
String setCommunityClosedRatioStr = numberFormat.format((float) insertEntity.getCommunityClosedCount() / insertEntity.getProblemResolvedCount());
insertEntity.setCommunityClosedRatio(new BigDecimal(setCommunityClosedRatioStr));
}
// 界面展示:5、街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
//网格内出来的项目,最终由街道结案的项目数
if (NumConstant.ZERO == insertEntity.getStreetClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) {
insertEntity.setStreetClosedRatio(BigDecimal.ZERO);
} else {
String streetClosedRatioStr = numberFormat.format((float) insertEntity.getStreetClosedCount() / insertEntity.getProblemResolvedCount());
insertEntity.setStreetClosedRatio(new BigDecimal(streetClosedRatioStr));
}
//界面展示:6、区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
//网格内出来的项目,最终由区直部门结案的项目数
if (NumConstant.ZERO == insertEntity.getDistrictDeptClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) {
insertEntity.setDistrictDeptClosedRatio(BigDecimal.ZERO);
} else {
String setDistrictDeptClosedRatioStr = numberFormat.format((float) insertEntity.getDistrictDeptClosedCount() / insertEntity.getProblemResolvedCount());
insertEntity.setDistrictDeptClosedRatio(new BigDecimal(setDistrictDeptClosedRatioStr));
}
}
// 先删除,后新增
// 3、批量删除
@ -204,6 +241,14 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
log.info("extractFactGridGovernDaily completed");
}
private Map<String, GovernGridClosedTotalCommonDTO> getGovernGridClosedTotalCommonDTOMap(String customerId, List<String> gridIds) {
Map<String, GovernGridClosedTotalCommonDTO> resultMap=new HashMap<>();
for(String gridId:gridIds){
}
return resultMap;
}
/**
* 构造要插入的数据每个网格一天一条数据初始赋值0
*

Loading…
Cancel
Save