|
|
@ -1029,9 +1029,13 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
|
} |
|
|
|
//1.按日期查询当前组织事件治理指数
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
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; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1064,25 +1068,43 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
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.getB().compareTo(o1.getB()); |
|
|
|
return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio()); |
|
|
|
} else if ("grid".equals(formDTO.getType())) { |
|
|
|
return o2.getC().compareTo(o1.getC()); |
|
|
|
return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio()); |
|
|
|
} else if ("community".equals(formDTO.getType())) { |
|
|
|
return o2.getD().compareTo(o1.getD()); |
|
|
|
return o2.getCommunityResolvedRatio().compareTo(o1.getCommunityResolvedRatio()); |
|
|
|
} else if ("department".equals(formDTO.getType())) { |
|
|
|
return o2.getE().compareTo(o1.getE()); |
|
|
|
return o2.getDistrictDeptResolvedRatio().compareTo(o1.getDistrictDeptResolvedRatio()); |
|
|
|
} else if ("street".equals(formDTO.getType())) { |
|
|
|
return o2.getF().compareTo(o1.getF()); |
|
|
|
return o2.getStreetResolvedRatio().compareTo(o1.getStreetResolvedRatio()); |
|
|
|
} else { |
|
|
|
return o2.getA().compareTo(o1.getA()); |
|
|
|
return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -1109,9 +1131,13 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
|
} |
|
|
|
|
|
|
|
//1.按日子查询网格事件治理指数
|
|
|
|
|
|
|
|
|
|
|
|
//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; |
|
|
|
} |
|
|
|
|
|
|
@ -1145,19 +1171,33 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
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.getB().compareTo(o1.getB()); |
|
|
|
return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio()); |
|
|
|
} else if ("grid".equals(formDTO.getType())) { |
|
|
|
return o2.getC().compareTo(o1.getC()); |
|
|
|
return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio()); |
|
|
|
} else { |
|
|
|
return o2.getA().compareTo(o1.getA()); |
|
|
|
return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|