|
|
@ -134,25 +134,25 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn |
|
|
|
taskStatisticsVo.setLevel(0); |
|
|
|
taskStatisticsVo.setLevel(0); |
|
|
|
taskStatisticsVo.setName("总计"); |
|
|
|
taskStatisticsVo.setName("总计"); |
|
|
|
res.add(taskStatisticsVo); |
|
|
|
res.add(taskStatisticsVo); |
|
|
|
Map<String, List<FdpTaskEntity>> collectByCreateDept = fdpTaskEntities.stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpDeviceName)); |
|
|
|
Map<String, List<FdpTaskEntity>> collectByFdpDeviceName = fdpTaskEntities.stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpDeviceName)); |
|
|
|
getCount("",collectByCreateDept, fdpTaskEntities, res, 1); |
|
|
|
getCount("",collectByFdpDeviceName, fdpTaskEntities, res, 1); |
|
|
|
if (Func.isEmpty(statisticsVo.getName())) { |
|
|
|
if (Func.isEmpty(statisticsVo.getName())) { |
|
|
|
collectByCreateDept.entrySet().forEach(s->{ |
|
|
|
collectByFdpDeviceName.entrySet().forEach(s->{ |
|
|
|
Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getName)); |
|
|
|
Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getName)); |
|
|
|
getCount(s.getKey(),collectByName, s.getValue(), res, 2); |
|
|
|
getCount(s.getKey(),collectByName, s.getValue(), res, 2); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else if (Func.isEmpty(statisticsVo.getFdpDeviceName())){ |
|
|
|
} else if (Func.isEmpty(statisticsVo.getCreateDept())){ |
|
|
|
collectByCreateDept.entrySet().forEach(s->{ |
|
|
|
collectByFdpDeviceName.entrySet().forEach(s->{ |
|
|
|
Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpDeviceName)); |
|
|
|
Map<Long, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getCreateDept)); |
|
|
|
getCount(s.getKey(),collectByName, s.getValue(), res, 2); |
|
|
|
getCount2(s.getKey(),collectByName, s.getValue(), res, 2); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}else if (Func.isEmpty(statisticsVo.getFdpOrd())){ |
|
|
|
}else if (Func.isEmpty(statisticsVo.getFdpOrd())){ |
|
|
|
collectByCreateDept.entrySet().forEach(s->{ |
|
|
|
collectByFdpDeviceName.entrySet().forEach(s->{ |
|
|
|
Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpOrd)); |
|
|
|
Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpOrd)); |
|
|
|
getCount(s.getKey(),collectByName, s.getValue(), res, 2); |
|
|
|
getCount(s.getKey(),collectByName, s.getValue(), res, 2); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}else if (Func.isEmpty(statisticsVo.getType())){ |
|
|
|
}else if (Func.isEmpty(statisticsVo.getType())){ |
|
|
|
collectByCreateDept.entrySet().forEach(s->{ |
|
|
|
collectByFdpDeviceName.entrySet().forEach(s->{ |
|
|
|
Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getType)); |
|
|
|
Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getType)); |
|
|
|
getCount(s.getKey(),collectByName, s.getValue(), res, 2); |
|
|
|
getCount(s.getKey(),collectByName, s.getValue(), res, 2); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -179,7 +179,7 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn |
|
|
|
le(FdpTaskEntity::getCreateTime, statisticsVo.getEndTime()); |
|
|
|
le(FdpTaskEntity::getCreateTime, statisticsVo.getEndTime()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (Func.isNotEmpty(statisticsVo.getCreateDept())) { |
|
|
|
if (Func.isNotEmpty(statisticsVo.getCreateDept())) { |
|
|
|
in(FdpTaskEntity::getCreateDept, statisticsVo.getCreateDept()); |
|
|
|
eq(FdpTaskEntity::getCreateDept, statisticsVo.getCreateDept()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (Func.isNotEmpty(statisticsVo.getName())) { |
|
|
|
if (Func.isNotEmpty(statisticsVo.getName())) { |
|
|
|
like(FdpTaskEntity::getName, statisticsVo.getName()); |
|
|
|
like(FdpTaskEntity::getName, statisticsVo.getName()); |
|
|
@ -214,4 +214,23 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn |
|
|
|
res.add(taskStatisticsVo); |
|
|
|
res.add(taskStatisticsVo); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//机构类型需要转换ID为名称
|
|
|
|
|
|
|
|
private void getCount2(String key,Map<Long, List<FdpTaskEntity>> collectByCreateDept, List<FdpTaskEntity> fdpTaskEntities, ArrayList<TaskStatisticsVo> res,Integer level) { |
|
|
|
|
|
|
|
collectByCreateDept.entrySet().forEach(s->{ |
|
|
|
|
|
|
|
TaskStatisticsVo taskStatisticsVo = new TaskStatisticsVo(); |
|
|
|
|
|
|
|
taskStatisticsVo.setCount(s.getValue().size()); |
|
|
|
|
|
|
|
BigDecimal bigDecimal=BigDecimal.valueOf(s.getValue().size()).divide(BigDecimal.valueOf(fdpTaskEntities.size())); |
|
|
|
|
|
|
|
taskStatisticsVo.setPercentage(bigDecimal.toString()); |
|
|
|
|
|
|
|
taskStatisticsVo.setLevel(level); |
|
|
|
|
|
|
|
R<String> deptNameCode = sysClient.getDeptName(s.getKey()); |
|
|
|
|
|
|
|
String deptName; |
|
|
|
|
|
|
|
if (deptNameCode.isSuccess()){ |
|
|
|
|
|
|
|
deptName=deptNameCode.getData(); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
deptName=""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
taskStatisticsVo.setName(key+"-"+deptName); |
|
|
|
|
|
|
|
res.add(taskStatisticsVo); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|