|
|
@ -1017,6 +1017,20 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
*/ |
|
|
|
@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.按日期查询当前组织事件治理指数
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
@ -1027,7 +1041,53 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<AgencyGovrnResultDTO> subAgencyGovrnList(AgencyGovrnFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
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.按日期查询所有下级组织的事件治理指数
|
|
|
|
|
|
|
|
//3.封装数据
|
|
|
|
|
|
|
|
//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()); |
|
|
|
} else if ("grid".equals(formDTO.getType())) { |
|
|
|
return o2.getC().compareTo(o1.getC()); |
|
|
|
} else if ("community".equals(formDTO.getType())) { |
|
|
|
return o2.getD().compareTo(o1.getD()); |
|
|
|
} else if ("department".equals(formDTO.getType())) { |
|
|
|
return o2.getE().compareTo(o1.getE()); |
|
|
|
} else if ("street".equals(formDTO.getType())) { |
|
|
|
return o2.getF().compareTo(o1.getF()); |
|
|
|
} else { |
|
|
|
return o2.getA().compareTo(o1.getA()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1037,7 +1097,22 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public GridGovrnResultDTO gridGovrn(GridGovrnFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
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.按日子查询网格事件治理指数
|
|
|
|
|
|
|
|
|
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1047,7 +1122,47 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<GridGovrnResultDTO> subGridGovrnList(GridGovrnFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
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.按日期查找组织直属网格事件治理指数列表
|
|
|
|
|
|
|
|
//3.封装数据
|
|
|
|
|
|
|
|
//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()); |
|
|
|
} else if ("grid".equals(formDTO.getType())) { |
|
|
|
return o2.getC().compareTo(o1.getC()); |
|
|
|
} else { |
|
|
|
return o2.getA().compareTo(o1.getA()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|