|
|
@ -1386,7 +1386,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve |
|
|
|
return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio()); |
|
|
|
} else if ("grid".equals(formDTO.getType())) { |
|
|
|
return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio()); |
|
|
|
} else if ("community".equals(formDTO.getType())) { |
|
|
|
} else if (OrgLevelEnum.COMMUNITY.getCode().equals(formDTO.getType())) { |
|
|
|
return o2.getCommunityResolvedRatio().compareTo(o1.getCommunityResolvedRatio()); |
|
|
|
} else if ("department".equals(formDTO.getType())) { |
|
|
|
return o2.getDistrictDeptResolvedRatio().compareTo(o1.getDistrictDeptResolvedRatio()); |
|
|
@ -1679,7 +1679,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve |
|
|
|
|
|
|
|
//根据组织级别判断查询直属下级组织或网格数据
|
|
|
|
//2.直属网格
|
|
|
|
if ("community".equals(formDTO.getAgencyLevel())) { |
|
|
|
if (OrgLevelEnum.COMMUNITY.getCode().equals(formDTO.getAgencyLevel())) { |
|
|
|
//2-1.查询组织直属网格列表【网格维度】
|
|
|
|
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId()); |
|
|
|
if (gridList.size() < NumConstant.ONE) { |
|
|
@ -1755,7 +1755,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve |
|
|
|
|
|
|
|
//根据组织级别判断查询直属下级组织或网格数据
|
|
|
|
//2.直属网格
|
|
|
|
if ("community".equals(formDTO.getAgencyLevel())) { |
|
|
|
if (OrgLevelEnum.COMMUNITY.getCode().equals(formDTO.getAgencyLevel())) { |
|
|
|
//2-1.查询组织直属网格列表【网格维度】
|
|
|
|
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId()); |
|
|
|
if (gridList.size() < NumConstant.ONE) { |
|
|
@ -1888,6 +1888,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve |
|
|
|
c.setProjectCount(result.stream().mapToInt(CustomerDataManageResultDTO.CustomerDataManage::getProjectCount).sum()); |
|
|
|
c.setClosedProjectCount(result.stream().mapToInt(CustomerDataManageResultDTO.CustomerDataManage::getClosedProjectCount).sum()); |
|
|
|
c.setPatrolPeopleCount(result.stream().mapToInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolPeopleCount).sum()); |
|
|
|
c.setPatrolRoutineWorkTimes(result.stream().mapToInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolRoutineWorkTimes).sum()); |
|
|
|
c.setPatrolCount(result.stream().mapToInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolCount).sum()); |
|
|
|
c.setPatrolDurationInteger(result.stream().mapToInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolDurationInteger).sum()); |
|
|
|
c.setPatrolDuration(getHm(c.getPatrolDurationInteger())); |
|
|
@ -2002,6 +2003,12 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve |
|
|
|
patrolForm.setStartTime(startTimeForm); |
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> patrolEnd = statsStaffPatrolRecordDailyService.patrolList(patrolForm); |
|
|
|
|
|
|
|
//获取例行工作次数
|
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> workCountList = statsStaffPatrolRecordDailyService.getPatrolRecordCount(patrolForm); |
|
|
|
Map<String, List<CustomerDataManageResultDTO.CustomerDataManage>> workCountMap = null; |
|
|
|
if(workCountList != null && workCountList.size() > NumConstant.ZERO && workCountList.get(NumConstant.ZERO) != null){ |
|
|
|
workCountMap = workCountList.stream().collect(Collectors.groupingBy(CustomerDataManageResultDTO.CustomerDataManage::getOrgId)); |
|
|
|
} |
|
|
|
//NumConstant.FOUR.判断是否需要查询起始日期用户、群组、话题、议题、项目、巡查数据
|
|
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> uStartMap = new HashMap<>(); |
|
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> gStartMap = new HashMap<>(); |
|
|
@ -2023,7 +2030,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve |
|
|
|
} |
|
|
|
|
|
|
|
//5.封装数据
|
|
|
|
agencyGrid.getAgencyGridList().forEach(org -> { |
|
|
|
for (ScreenAgencyOrGridListDTO.AgencyGrid org : agencyGrid.getAgencyGridList()) { |
|
|
|
CustomerDataManageResultDTO.CustomerDataManage dto = new CustomerDataManageResultDTO.CustomerDataManage(); |
|
|
|
dto.setOrgId(org.getOrgId()); |
|
|
|
dto.setOrgName(org.getOrgName()); |
|
|
@ -2076,19 +2083,41 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve |
|
|
|
String patrolDuration = ""; |
|
|
|
int patrolDurationInteger = NumConstant.ZERO; |
|
|
|
HashSet set = new HashSet(); |
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> workCountListTemp; |
|
|
|
for (CustomerDataManageResultDTO.CustomerDataManage u : patrolEnd) { |
|
|
|
if ("community".equals(agencyGrid.getLevel()) && org.getOrgId().equals(u.getOrgId())) { |
|
|
|
if (OrgLevelEnum.COMMUNITY.getCode().equals(agencyGrid.getLevel()) && org.getOrgId().equals(u.getOrgId())) { |
|
|
|
patroCount += u.getPatrolCount(); |
|
|
|
patrolDurationInteger += u.getPatrolDurationInteger(); |
|
|
|
set.add(u.getStaffId()); |
|
|
|
} |
|
|
|
if (!"community".equals(agencyGrid.getLevel()) && u.getOrgId().contains(org.getOrgId())) { |
|
|
|
if (!OrgLevelEnum.COMMUNITY.getCode().equals(agencyGrid.getLevel()) && u.getOrgId().contains(org.getOrgId())) { |
|
|
|
patroCount += u.getPatrolCount(); |
|
|
|
patrolDurationInteger += u.getPatrolDurationInteger(); |
|
|
|
set.add(u.getStaffId()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//例行工作次数累加
|
|
|
|
int patrolRoutineWorkTimes = NumConstant.ZERO; |
|
|
|
if (workCountMap != null){ |
|
|
|
workCountListTemp = workCountMap.get(org.getOrgId()); |
|
|
|
if (CollectionUtils.isNotEmpty(workCountListTemp)) { |
|
|
|
if (OrgLevelEnum.COMMUNITY.getCode().equals(agencyGrid.getLevel())) { |
|
|
|
for (CustomerDataManageResultDTO.CustomerDataManage work : workCountListTemp) { |
|
|
|
patrolRoutineWorkTimes += work.getPatrolRoutineWorkTimes(); |
|
|
|
set.add(work.getStaffId()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (!OrgLevelEnum.COMMUNITY.getCode().equals(agencyGrid.getLevel())) { |
|
|
|
for (CustomerDataManageResultDTO.CustomerDataManage work : workCountListTemp) { |
|
|
|
patrolRoutineWorkTimes += work.getPatrolRoutineWorkTimes(); |
|
|
|
set.add(work.getStaffId()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
patro = set.size(); |
|
|
|
Integer minutes = patrolDurationInteger / 60; |
|
|
|
patrolDuration = (minutes / 60 > NumConstant.ZERO ? minutes / 60 + "小时" : "") + (minutes % 60 > NumConstant.ZERO ? minutes % 60 + "分钟" : "0分钟"); |
|
|
@ -2106,8 +2135,10 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve |
|
|
|
dto.setPatrolDuration(patrolDuration); |
|
|
|
dto.setPatrolDurationInteger(patrolDurationInteger); |
|
|
|
|
|
|
|
dto.setPatrolRoutineWorkTimes(patrolRoutineWorkTimes); |
|
|
|
|
|
|
|
dataManageList.add(dto); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//NumConstant.SIX.默认按用户总数降序
|
|
|
|
Collections.sort(dataManageList, new Comparator<CustomerDataManageResultDTO.CustomerDataManage>() { |
|
|
|