|
|
@ -148,20 +148,25 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
if(approvalProjectResolvedMap.containsKey(insertEntity.getGridId())){ |
|
|
|
resolveCount = resolveCount + approvalProjectResolvedMap.get(insertEntity.getGridId()); |
|
|
|
} |
|
|
|
if(eventProjectResolvedMap.containsKey(insertEntity.getGridId())){ |
|
|
|
resolveCount = resolveCount + eventProjectResolvedMap.get(insertEntity.getGridId()); |
|
|
|
|
|
|
|
} |
|
|
|
insertEntity.setApprovalProjectResolvedCount(resolveCount); |
|
|
|
// 8、当前网格内:项目立项,结案无需解决数;默认为0,
|
|
|
|
int unResolveCount = 0; |
|
|
|
if(approvalProjectUnResolvedMap.containsKey(insertEntity.getGridId())){ |
|
|
|
unResolveCount = resolveCount + approvalProjectUnResolvedMap.get(insertEntity.getGridId()); |
|
|
|
} |
|
|
|
insertEntity.setApprovalProjectUnResolvedCount(unResolveCount); |
|
|
|
|
|
|
|
// 当前组织内:来源于事件的项目:结案已解决数
|
|
|
|
if(eventProjectResolvedMap.containsKey(insertEntity.getGridId())){ |
|
|
|
insertEntity.setEventResolvedCount(eventProjectResolvedMap.get(insertEntity.getGridId())); |
|
|
|
} |
|
|
|
|
|
|
|
// 当前组织内:来源于事件的项目:结案无需解决数
|
|
|
|
if(eventProjectUnResolvedMap.containsKey(insertEntity.getGridId())){ |
|
|
|
unResolveCount = resolveCount + eventProjectUnResolvedMap.get(insertEntity.getGridId()); |
|
|
|
insertEntity.setEventUnResolvedCount(eventProjectUnResolvedMap.get(insertEntity.getGridId())); |
|
|
|
} |
|
|
|
insertEntity.setApprovalProjectUnResolvedCount(unResolveCount); |
|
|
|
|
|
|
|
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
|
|
|
|
// 9、当前网格内,未出小组即未转议题的:话题关闭已解决数
|
|
|
|
if(inGroupTopicResolvedMap.containsKey(insertEntity.getGridId())){ |
|
|
@ -183,8 +188,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
insertEntity.setFromAgencyUnResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromAgencyUnResolvedInGridCount()); |
|
|
|
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
|
|
|
|
// 15、未出当前网格的,结案项目数=11+12+13+14
|
|
|
|
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+ |
|
|
|
insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount()); |
|
|
|
insertEntity.setGridSelfGovernProjectTotal(dtoMap.get(insertEntity.getGridId()).getGridSelfGovernProjectTotal()); |
|
|
|
|
|
|
|
//当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
|
|
|
|
insertEntity.setCommunityClosedCount(dtoMap.get(insertEntity.getGridId()).getCommunityClosedCount()); |
|
|
@ -199,7 +203,13 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
+insertEntity.getIssueResolvedCount()+insertEntity.getIssueUnResolvedCount() |
|
|
|
+insertEntity.getIssueProjectResolvedCount()+insertEntity.getIssueProjectUnResolvedCount() |
|
|
|
+insertEntity.getApprovalProjectResolvedCount()+insertEntity.getApprovalProjectUnResolvedCount()); |
|
|
|
|
|
|
|
//结案项目数
|
|
|
|
int projectClosedTotal = insertEntity.getIssueProjectResolvedCount() |
|
|
|
+ insertEntity.getIssueProjectUnResolvedCount() |
|
|
|
+ insertEntity.getApprovalProjectResolvedCount() |
|
|
|
+ insertEntity.getApprovalProjectUnResolvedCount() |
|
|
|
+ insertEntity.getEventResolvedCount() |
|
|
|
+ insertEntity.getEventUnResolvedCount(); |
|
|
|
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
|
|
|
|
//界面展示:2、党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
|
|
|
|
int groupSelfGovernRatioFz=insertEntity.getInGroupTopicResolvedCount()+insertEntity.getInGroupTopicUnResolvedCount(); |
|
|
@ -212,37 +222,37 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
|
|
|
|
// 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格)
|
|
|
|
//界面展示:3、网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数
|
|
|
|
if(NumConstant.ZERO==insertEntity.getGridSelfGovernProjectTotal()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()){ |
|
|
|
if(NumConstant.ZERO==insertEntity.getGridSelfGovernProjectTotal()||NumConstant.ZERO == projectClosedTotal){ |
|
|
|
insertEntity.setGridSelfGovernRatio(BigDecimal.ZERO); |
|
|
|
}else{ |
|
|
|
String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / insertEntity.getProblemResolvedCount()); |
|
|
|
String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / projectClosedTotal); |
|
|
|
insertEntity.setGridSelfGovernRatio(new BigDecimal(gridSelfGovernRatioStr)); |
|
|
|
} |
|
|
|
|
|
|
|
//界面展示:4、社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
|
|
|
|
//网格内出来的项目,最终由社区结案的项目数
|
|
|
|
if (NumConstant.ZERO == insertEntity.getCommunityClosedCount()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { |
|
|
|
if (NumConstant.ZERO == insertEntity.getCommunityClosedCount()||NumConstant.ZERO == projectClosedTotal) { |
|
|
|
insertEntity.setCommunityClosedRatio(BigDecimal.ZERO); |
|
|
|
}else{ |
|
|
|
String setCommunityClosedRatioStr = numberFormat.format((float) insertEntity.getCommunityClosedCount() / insertEntity.getProblemResolvedCount()); |
|
|
|
String setCommunityClosedRatioStr = numberFormat.format((float) insertEntity.getCommunityClosedCount() / projectClosedTotal); |
|
|
|
insertEntity.setCommunityClosedRatio(new BigDecimal(setCommunityClosedRatioStr)); |
|
|
|
} |
|
|
|
|
|
|
|
// 界面展示:5、街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
|
|
|
|
//网格内出来的项目,最终由街道结案的项目数
|
|
|
|
if (NumConstant.ZERO == insertEntity.getStreetClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { |
|
|
|
if (NumConstant.ZERO == insertEntity.getStreetClosedCount() || NumConstant.ZERO == projectClosedTotal) { |
|
|
|
insertEntity.setStreetClosedRatio(BigDecimal.ZERO); |
|
|
|
} else { |
|
|
|
String streetClosedRatioStr = numberFormat.format((float) insertEntity.getStreetClosedCount() / insertEntity.getProblemResolvedCount()); |
|
|
|
String streetClosedRatioStr = numberFormat.format((float) insertEntity.getStreetClosedCount() / projectClosedTotal); |
|
|
|
insertEntity.setStreetClosedRatio(new BigDecimal(streetClosedRatioStr)); |
|
|
|
} |
|
|
|
|
|
|
|
//界面展示:6、区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
|
|
|
|
//网格内出来的项目,最终由区直部门结案的项目数
|
|
|
|
if (NumConstant.ZERO == insertEntity.getDistrictDeptClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { |
|
|
|
if (NumConstant.ZERO == insertEntity.getDistrictDeptClosedCount() || NumConstant.ZERO == projectClosedTotal) { |
|
|
|
insertEntity.setDistrictDeptClosedRatio(BigDecimal.ZERO); |
|
|
|
} else { |
|
|
|
String setDistrictDeptClosedRatioStr = numberFormat.format((float) insertEntity.getDistrictDeptClosedCount() / insertEntity.getProblemResolvedCount()); |
|
|
|
String setDistrictDeptClosedRatioStr = numberFormat.format((float) insertEntity.getDistrictDeptClosedCount() / projectClosedTotal); |
|
|
|
insertEntity.setDistrictDeptClosedRatio(new BigDecimal(setDistrictDeptClosedRatioStr)); |
|
|
|
} |
|
|
|
|
|
|
@ -310,7 +320,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
int streetClosedCount=NumConstant.ZERO;; |
|
|
|
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
|
|
|
|
int districtDeptClosedCount=NumConstant.ZERO; |
|
|
|
|
|
|
|
int gridSelfGovernProjectTotal=NumConstant.ZERO; |
|
|
|
//当前网格内已结案的项目
|
|
|
|
List<GovernProjectInfoDTO> currentGridClosedProjectList = factOriginProjectMainDailyService.getGridClosedProjectList(customerId, gridId, |
|
|
|
ProjectConstant.CLOSED,null,null); |
|
|
@ -339,6 +349,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
fromAgencyUnResolvedInGridCount += 1; |
|
|
|
} |
|
|
|
} |
|
|
|
gridSelfGovernProjectTotal += 1; |
|
|
|
} else { |
|
|
|
// 3、出了网格的判断是由谁解决的?
|
|
|
|
String resolveOrgType=getProjectResolveOrgType(governProjectInfoDTO.getProjectLogDTOList()); |
|
|
@ -350,10 +361,12 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
|
|
|
|
log.info("projectId=【"+governProjectInfoDTO.getId()+"】属于街道解决"); |
|
|
|
streetClosedCount+=1; |
|
|
|
}else if("districtdept".equals(resolveOrgType)){ |
|
|
|
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
|
|
|
|
}else if("district".equals(resolveOrgType)){ |
|
|
|
// 当前网格内出来的项目:由区县结案(已解决+未解决)的项目总数
|
|
|
|
log.info("projectId=【"+governProjectInfoDTO.getId()+"】属于区直部门解决"); |
|
|
|
districtDeptClosedCount+=1; |
|
|
|
} else if ("grid".equals(resolveOrgType)) { |
|
|
|
gridSelfGovernProjectTotal += 1; |
|
|
|
} |
|
|
|
// todo 可能是 市级解决、省级解决呢???
|
|
|
|
} |
|
|
@ -366,6 +379,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
governGridClosedTotalCommonDTO.setCommunityClosedCount(communityClosedCount); |
|
|
|
governGridClosedTotalCommonDTO.setStreetClosedCount(streetClosedCount); |
|
|
|
governGridClosedTotalCommonDTO.setDistrictDeptClosedCount(districtDeptClosedCount); |
|
|
|
governGridClosedTotalCommonDTO.setGridSelfGovernProjectTotal(gridSelfGovernProjectTotal); |
|
|
|
resultMap.put(gridId, governGridClosedTotalCommonDTO); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
@ -380,7 +394,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
private String getProjectResolveOrgType(List<FactOriginProjectLogDailyDTO> projectLogDTOList) { |
|
|
|
List<Integer> handleLevelList=new ArrayList<>(); |
|
|
|
for (FactOriginProjectLogDailyDTO logDailyDTO : projectLogDTOList) { |
|
|
|
if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)||NumConstant.ZERO==logDailyDTO.getIsActive()){ |
|
|
|
if(!logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_CLOSE)||NumConstant.ZERO==logDailyDTO.getIsActive()){ |
|
|
|
//当前操作如果是退回,不参与比较
|
|
|
|
continue; |
|
|
|
} |
|
|
@ -395,32 +409,42 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove |
|
|
|
// orgType: 网格grid,部门department,组织:agency
|
|
|
|
if ("grid".equals(logDailyDTO.getOrgType())) { |
|
|
|
handleLevelList.add(NumConstant.ONE); |
|
|
|
return "grid"; |
|
|
|
} else if ("agency".equals(logDailyDTO.getOrgType())) { |
|
|
|
CustomerAgencyEntity agencyEntity=customerAgencyService.getAgencyById(logDailyDTO.getOrgId()); |
|
|
|
if("community".equals(agencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.TWO); |
|
|
|
return "community"; |
|
|
|
}else if("street".equals(agencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.THREE); |
|
|
|
return "street"; |
|
|
|
}else if("district".equals(agencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.FOUR); |
|
|
|
return "district"; |
|
|
|
}else if("city".equals(agencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.FIVE); |
|
|
|
return "city"; |
|
|
|
}else if("province".equals(agencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.SIX); |
|
|
|
return "province"; |
|
|
|
} |
|
|
|
} else if ("department".equals(logDailyDTO.getOrgType())) { |
|
|
|
CustomerAgencyEntity deptAgencyEntity=customerAgencyService.getAgencyByDeptId(logDailyDTO.getOrgId()); |
|
|
|
if("district".equals(deptAgencyEntity.getLevel())){ |
|
|
|
// 区直部门直接返回
|
|
|
|
return "districtdept"; |
|
|
|
return "district"; |
|
|
|
}else if("community".equals(deptAgencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.TWO); |
|
|
|
return "community"; |
|
|
|
}else if("street".equals(deptAgencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.THREE); |
|
|
|
return "street"; |
|
|
|
}else if("city".equals(deptAgencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.FIVE); |
|
|
|
return "city"; |
|
|
|
}else if("province".equals(deptAgencyEntity.getLevel())){ |
|
|
|
handleLevelList.add(NumConstant.SIX); |
|
|
|
return "province"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|