|
@ -87,8 +87,12 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
if (topic.size() > NumConstant.ZERO) { |
|
|
if (topic.size() > NumConstant.ZERO) { |
|
|
resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); |
|
|
resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); |
|
|
topic.forEach(t -> { |
|
|
topic.forEach(t -> { |
|
|
if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } |
|
|
if (t.getTopicStatus().equals("closed")) { |
|
|
if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } |
|
|
closedTotal.set(t.getTopicCount()); |
|
|
|
|
|
} |
|
|
|
|
|
if (t.getTopicStatus().equals("hidden")) { |
|
|
|
|
|
hiddenTotal.set(t.getTopicCount()); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
if (null != topicSHiftIssue) { |
|
|
if (null != topicSHiftIssue) { |
|
@ -142,6 +146,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("user"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
@ -153,7 +161,7 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
//2.查询直属下级组织注册用户日统计数据,默认按用户总数降序
|
|
|
//2.查询直属下级组织注册用户日统计数据,默认按用户总数降序
|
|
|
resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); |
|
|
resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); |
|
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
//3.封装数据
|
|
|
resultList.forEach(re -> { |
|
|
resultList.forEach(re -> { |
|
|
re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); |
|
|
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()))); |
|
|
re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); |
|
@ -164,6 +172,23 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//4.按要求排序并返回
|
|
|
|
|
|
Collections.sort(resultList, new Comparator<SubAgencyUserResultDTO>() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public int compare(SubAgencyUserResultDTO o1, SubAgencyUserResultDTO o2) { |
|
|
|
|
|
if ("party".equals(formDTO.getType())) { |
|
|
|
|
|
//升序
|
|
|
|
|
|
//return o1.getPartyMemberTotal().compareTo(o2.getPartyMemberTotal());
|
|
|
|
|
|
//降序
|
|
|
|
|
|
return o2.getPartyMemberTotal().compareTo(o1.getPartyMemberTotal()); |
|
|
|
|
|
} else if ("resi".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getResiTotal().compareTo(o1.getResiTotal()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return o2.getUserTotal().compareTo(o1.getUserTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -184,6 +209,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("user"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
@ -195,7 +224,7 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
//2.查询网格层级注册用户日统计数据,默认按用户总数降序
|
|
|
//2.查询网格层级注册用户日统计数据,默认按用户总数降序
|
|
|
resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); |
|
|
resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); |
|
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
//3.封装数据
|
|
|
resultList.forEach(re -> { |
|
|
resultList.forEach(re -> { |
|
|
re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); |
|
|
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()))); |
|
|
re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); |
|
@ -206,6 +235,21 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//4.按要求排序并返回
|
|
|
|
|
|
Collections.sort(resultList, new Comparator<SubGridUserResultDTO>() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public int compare(SubGridUserResultDTO o1, SubGridUserResultDTO o2) { |
|
|
|
|
|
if ("party".equals(formDTO.getType())) { |
|
|
|
|
|
//降序
|
|
|
|
|
|
return o2.getPartyMemberTotal().compareTo(o1.getPartyMemberTotal()); |
|
|
|
|
|
} else if ("resi".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getResiTotal().compareTo(o1.getResiTotal()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return o2.getUserTotal().compareTo(o1.getUserTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -226,6 +270,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("group"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
@ -237,7 +285,7 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
//2.查询直属下级组织小组日统计数据,默认按群组总数降序
|
|
|
//2.查询直属下级组织小组日统计数据,默认按群组总数降序
|
|
|
resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); |
|
|
resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); |
|
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
//3.封装数据
|
|
|
resultList.forEach(re -> { |
|
|
resultList.forEach(re -> { |
|
|
re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); |
|
|
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()))); |
|
|
re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); |
|
@ -248,6 +296,20 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//4.按要求排序并返回
|
|
|
|
|
|
Collections.sort(resultList, new Comparator<SubAgencyGroupResultDTO>() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public int compare(SubAgencyGroupResultDTO o1, SubAgencyGroupResultDTO o2) { |
|
|
|
|
|
if ("ordinary".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getOrdinaryTotal().compareTo(o1.getOrdinaryTotal()); |
|
|
|
|
|
} else if ("branch".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getBranchTotal().compareTo(o1.getBranchTotal()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return o2.getGroupTotal().compareTo(o1.getGroupTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -268,6 +330,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("group"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
@ -290,14 +356,28 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//4.按要求排序并返回
|
|
|
|
|
|
Collections.sort(resultList, new Comparator<SubGridGroupResultDTO>() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public int compare(SubGridGroupResultDTO o1, SubGridGroupResultDTO o2) { |
|
|
|
|
|
if ("ordinary".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getOrdinaryTotal().compareTo(o1.getOrdinaryTotal()); |
|
|
|
|
|
} else if ("branch".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getBranchTotal().compareTo(o1.getBranchTotal()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return o2.getGroupTotal().compareTo(o1.getGroupTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* @return |
|
|
* @Param formDTO |
|
|
* @Param formDTO |
|
|
* @Description 查询当前组织的直属下级组织话题数据 |
|
|
* @Description 查询当前组织的直属下级组织话题数据 |
|
|
* @author sun |
|
|
* @author sun |
|
|
* @return |
|
|
|
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<SubAgencyTopicResultDTO> subAgencyTopic(SubAgencyFormDTO formDTO) { |
|
|
public List<SubAgencyTopicResultDTO> subAgencyTopic(SubAgencyFormDTO formDTO) { |
|
@ -311,6 +391,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("topic"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
@ -334,8 +418,12 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
topic.forEach(t -> { |
|
|
topic.forEach(t -> { |
|
|
if (t.getAgencyId().equals(agencyId)) { |
|
|
if (t.getAgencyId().equals(agencyId)) { |
|
|
topicTotal.addAndGet(t.getTopicCount()); |
|
|
topicTotal.addAndGet(t.getTopicCount()); |
|
|
if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } |
|
|
if (t.getTopicStatus().equals("closed")) { |
|
|
if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } |
|
|
closedTotal.set(t.getTopicCount()); |
|
|
|
|
|
} |
|
|
|
|
|
if (t.getTopicStatus().equals("hidden")) { |
|
|
|
|
|
hiddenTotal.set(t.getTopicCount()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
topicShiftIssue.forEach(t -> { |
|
|
topicShiftIssue.forEach(t -> { |
|
@ -362,25 +450,30 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
resultList.add(resultDTO); |
|
|
resultList.add(resultDTO); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//3.默认按话题总数降序
|
|
|
//3.按要求排序并返回
|
|
|
Collections.sort(resultList, new Comparator<SubAgencyTopicResultDTO>() { |
|
|
Collections.sort(resultList, new Comparator<SubAgencyTopicResultDTO>() { |
|
|
@Override |
|
|
@Override |
|
|
public int compare(SubAgencyTopicResultDTO o1, SubAgencyTopicResultDTO o2) { |
|
|
public int compare(SubAgencyTopicResultDTO o1, SubAgencyTopicResultDTO o2) { |
|
|
//升序
|
|
|
if ("discussing".equals(formDTO.getType())) { |
|
|
//return o1.getTopicTotal().compareTo(o2.getTopicTotal());
|
|
|
return o2.getDiscussingTotal().compareTo(o1.getDiscussingTotal()); |
|
|
//降序
|
|
|
} else if ("closed".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getClosedTopicTotal().compareTo(o1.getClosedTopicTotal()); |
|
|
|
|
|
} else if ("shiftIssue".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getShiftIssueTotal().compareTo(o1.getShiftIssueTotal()); |
|
|
|
|
|
} else { |
|
|
return o2.getTopicTotal().compareTo(o1.getTopicTotal()); |
|
|
return o2.getTopicTotal().compareTo(o1.getTopicTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* @return |
|
|
* @Param formDTO |
|
|
* @Param formDTO |
|
|
* @Description 查询当前组织下直属网格列表话题数据 |
|
|
* @Description 查询当前组织下直属网格列表话题数据 |
|
|
* @author sun |
|
|
* @author sun |
|
|
* @return |
|
|
|
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<SubGridTopicResultDTO> subGridTopic(SubGridFormDTO formDTO) { |
|
|
public List<SubGridTopicResultDTO> subGridTopic(SubGridFormDTO formDTO) { |
|
@ -394,6 +487,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("topic"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
@ -417,8 +514,12 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
topic.forEach(t -> { |
|
|
topic.forEach(t -> { |
|
|
if (t.getGridId().equals(gridId)) { |
|
|
if (t.getGridId().equals(gridId)) { |
|
|
topicTotal.addAndGet(t.getTopicCount()); |
|
|
topicTotal.addAndGet(t.getTopicCount()); |
|
|
if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } |
|
|
if (t.getTopicStatus().equals("closed")) { |
|
|
if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } |
|
|
closedTotal.set(t.getTopicCount()); |
|
|
|
|
|
} |
|
|
|
|
|
if (t.getTopicStatus().equals("hidden")) { |
|
|
|
|
|
hiddenTotal.set(t.getTopicCount()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
topicShiftIssue.forEach(t -> { |
|
|
topicShiftIssue.forEach(t -> { |
|
@ -445,15 +546,20 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
resultList.add(resultDTO); |
|
|
resultList.add(resultDTO); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//3.默认按话题总数降序
|
|
|
//3.按要求排序并返回
|
|
|
Collections.sort(resultList, new Comparator<SubGridTopicResultDTO>() { |
|
|
Collections.sort(resultList, new Comparator<SubGridTopicResultDTO>() { |
|
|
@Override |
|
|
@Override |
|
|
public int compare(SubGridTopicResultDTO o1, SubGridTopicResultDTO o2) { |
|
|
public int compare(SubGridTopicResultDTO o1, SubGridTopicResultDTO o2) { |
|
|
//升序
|
|
|
if ("discussing".equals(formDTO.getType())) { |
|
|
//return o1.getTopicTotal().compareTo(o2.getTopicTotal());
|
|
|
return o2.getDiscussingTotal().compareTo(o1.getDiscussingTotal()); |
|
|
//降序
|
|
|
} else if ("closed".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getClosedTopicTotal().compareTo(o1.getClosedTopicTotal()); |
|
|
|
|
|
} else if ("shiftIssue".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getShiftIssueTotal().compareTo(o1.getShiftIssueTotal()); |
|
|
|
|
|
} else { |
|
|
return o2.getTopicTotal().compareTo(o1.getTopicTotal()); |
|
|
return o2.getTopicTotal().compareTo(o1.getTopicTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
@ -476,6 +582,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("issue"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
@ -487,7 +597,7 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
//2.查询直属下级组织议题日统计数据,默认按议题总数降序
|
|
|
//2.查询直属下级组织议题日统计数据,默认按议题总数降序
|
|
|
resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); |
|
|
resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); |
|
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
//3.封装数据
|
|
|
resultList.forEach(re -> { |
|
|
resultList.forEach(re -> { |
|
|
re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); |
|
|
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.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); |
|
@ -499,6 +609,22 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//4.按要求排序并返回
|
|
|
|
|
|
Collections.sort(resultList, new Comparator<SubAgencyIssueResultDTO>() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public int compare(SubAgencyIssueResultDTO o1, SubAgencyIssueResultDTO o2) { |
|
|
|
|
|
if ("voting".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getVotingTotal().compareTo(o1.getVotingTotal()); |
|
|
|
|
|
} else if ("shiftProject".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getShiftProjectTotal().compareTo(o1.getShiftProjectTotal()); |
|
|
|
|
|
} else if ("closed".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getClosedIssueTotal().compareTo(o1.getClosedIssueTotal()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return o2.getIssueTotal().compareTo(o1.getIssueTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -519,6 +645,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("issue"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
@ -530,7 +660,7 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
//2.查询网格层级议题日统计数据,默认按议题总数降序
|
|
|
//2.查询网格层级议题日统计数据,默认按议题总数降序
|
|
|
resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); |
|
|
resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); |
|
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
//3.封装数据
|
|
|
resultList.forEach(re -> { |
|
|
resultList.forEach(re -> { |
|
|
re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); |
|
|
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.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); |
|
@ -542,6 +672,22 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//4.按要求排序并返回
|
|
|
|
|
|
Collections.sort(resultList, new Comparator<SubGridIssueResultDTO>() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public int compare(SubGridIssueResultDTO o1, SubGridIssueResultDTO o2) { |
|
|
|
|
|
if ("voting".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getVotingTotal().compareTo(o1.getVotingTotal()); |
|
|
|
|
|
} else if ("shiftProject".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getShiftProjectTotal().compareTo(o1.getShiftProjectTotal()); |
|
|
|
|
|
} else if ("closed".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getClosedIssueTotal().compareTo(o1.getClosedIssueTotal()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return o2.getIssueTotal().compareTo(o1.getIssueTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -562,6 +708,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("project"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
@ -573,7 +723,7 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
//2.查询直属下级组织项目日统计数据,默认按项目总数降序
|
|
|
//2.查询直属下级组织项目日统计数据,默认按项目总数降序
|
|
|
resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); |
|
|
resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); |
|
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
//3.封装数据
|
|
|
resultList.forEach(re -> { |
|
|
resultList.forEach(re -> { |
|
|
re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); |
|
|
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()))); |
|
|
re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); |
|
@ -584,6 +734,20 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//4.按要求排序并返回
|
|
|
|
|
|
Collections.sort(resultList, new Comparator<SubAgencyProjectResultDTO>() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public int compare(SubAgencyProjectResultDTO o1, SubAgencyProjectResultDTO o2) { |
|
|
|
|
|
if ("pending".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getPendingTotal().compareTo(o1.getPendingTotal()); |
|
|
|
|
|
} else if ("closed".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getClosedProjectTotal().compareTo(o1.getClosedProjectTotal()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return o2.getProjectTotal().compareTo(o1.getProjectTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -604,6 +768,10 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
formDTO.setDateId(format.format(yesterday)); |
|
|
} |
|
|
} |
|
|
|
|
|
//排序类型,默认按用户总数降序
|
|
|
|
|
|
if (StringUtils.isBlank(formDTO.getDateId())) { |
|
|
|
|
|
formDTO.setType("project"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
//1.查询组织直属网格列表【网格维度】
|
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
|
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|
@ -615,7 +783,7 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
//2.查询网格层级项目日统计数据,默认按项目总数降序
|
|
|
//2.查询网格层级项目日统计数据,默认按项目总数降序
|
|
|
resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); |
|
|
resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); |
|
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
//3.封装数据
|
|
|
resultList.forEach(re -> { |
|
|
resultList.forEach(re -> { |
|
|
re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); |
|
|
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()))); |
|
|
re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); |
|
@ -626,6 +794,20 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//4.按要求排序并返回
|
|
|
|
|
|
Collections.sort(resultList, new Comparator<SubGridProjectResultDTO>() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public int compare(SubGridProjectResultDTO o1, SubGridProjectResultDTO o2) { |
|
|
|
|
|
if ("pending".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getPendingTotal().compareTo(o1.getPendingTotal()); |
|
|
|
|
|
} else if ("closed".equals(formDTO.getType())) { |
|
|
|
|
|
return o2.getClosedProjectTotal().compareTo(o1.getClosedProjectTotal()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return o2.getProjectTotal().compareTo(o1.getProjectTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|