| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				 | 
				
					@ -128,46 +128,75 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn
					 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								return R.success("暂无数据,请稍后重试"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							ArrayList<TaskStatisticsVo> res = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							TaskStatisticsVo taskStatisticsVo = new TaskStatisticsVo(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							taskStatisticsVo.setCount(fdpTaskEntities.size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							taskStatisticsVo.setPercentage("1"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							taskStatisticsVo.setLevel(0); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							taskStatisticsVo.setName("总计"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							res.add(taskStatisticsVo); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							int size = fdpTaskEntities.size(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							//在第一层去掉为null值数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							fdpTaskEntities=fdpTaskEntities.stream().filter(s->s.getFdpDeviceName()!=null).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							extracted( res,0,"总计",size,size); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								Map<String, List<FdpTaskEntity>> collectByFdpDeviceName = fdpTaskEntities.stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpDeviceName)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								getCount("",collectByFdpDeviceName, fdpTaskEntities, res, 1); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								if (Func.isEmpty(statisticsVo.getName())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									collectByFdpDeviceName.entrySet().forEach(s->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getName)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										List<FdpTaskEntity> list=s.getValue().stream().filter(sig->sig.getName()!=null).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										Map<String, List<FdpTaskEntity>> collectByName = list.stream().collect(Collectors.groupingBy(FdpTaskEntity::getName)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										getCount(s.getKey(),collectByName, s.getValue(), res, 2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										if (list.size()!=s.getValue().size()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
											//值为空单独加进来
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
											extracted( res,1,s.getKey()+"-空",s.getValue().size()-list.size(),s.getValue().size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								} else if (Func.isEmpty(statisticsVo.getCreateDept())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									collectByFdpDeviceName.entrySet().forEach(s->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										Map<Long, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getCreateDept)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										List<FdpTaskEntity> list=s.getValue().stream().filter(sig->sig.getCreateDept()!=null).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										Map<Long, List<FdpTaskEntity>> collectByName = list.stream().collect(Collectors.groupingBy(FdpTaskEntity::getCreateDept)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										getCount2(s.getKey(),collectByName, s.getValue(), res, 2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										if (list.size()!=s.getValue().size()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
											//值为空单独加进来
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
											extracted( res,1,s.getKey()+"-空",s.getValue().size()-list.size(),s.getValue().size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								}else if (Func.isEmpty(statisticsVo.getFdpOrd())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									collectByFdpDeviceName.entrySet().forEach(s->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpOrd)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										List<FdpTaskEntity> list=s.getValue().stream().filter(sig->sig.getFdpOrd()!=null).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										Map<String, List<FdpTaskEntity>> collectByName = list.stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpOrd)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										getCount(s.getKey(),collectByName, s.getValue(), res, 2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										if (list.size()!=s.getValue().size()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
											//值为空单独加进来
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
											extracted( res,1,s.getKey()+"-空",s.getValue().size()-list.size(),s.getValue().size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								}else if (Func.isEmpty(statisticsVo.getType())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									collectByFdpDeviceName.entrySet().forEach(s->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										Map<String, List<FdpTaskEntity>> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getType)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										List<FdpTaskEntity> list=s.getValue().stream().filter(sig->sig.getFdpOrd()!=null).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										Map<String, List<FdpTaskEntity>> collectByName = list.stream().collect(Collectors.groupingBy(FdpTaskEntity::getType)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										getCount(s.getKey(),collectByName, s.getValue(), res, 2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										if (list.size()!=s.getValue().size()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
											//值为空单独加进来
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
											extracted( res,1,s.getKey()+"-空",s.getValue().size()-list.size(),s.getValue().size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
										} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								return R.data(res); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						private static void extracted( ArrayList<TaskStatisticsVo> res,Integer level,String name,Integer size,Integer all) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							TaskStatisticsVo taskStatisticsByDeviceName = new TaskStatisticsVo(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							taskStatisticsByDeviceName.setCount(size); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							BigDecimal bigDecimal=BigDecimal.valueOf(all).divide(BigDecimal.valueOf(size),2,BigDecimal.ROUND_UP); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							taskStatisticsByDeviceName.setPercentage(bigDecimal.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							taskStatisticsByDeviceName.setLevel(level); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							taskStatisticsByDeviceName.setMemuName(name); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							res.add(taskStatisticsByDeviceName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						@Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						public R getTaskData(TaskStatisticsVo statisticsVo) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						public R getTaskData(TaskStatisticsVo statisticsVo,Query query) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							Wrapper<FdpTaskEntity> queryWrapper = getFdpTaskEntityWrapper(statisticsVo); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							List<FdpTaskEntity> fdpTaskEntities = super.baseMapper.selectList(queryWrapper); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							if (CollectionUtil.isEmpty(fdpTaskEntities)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							IPage pages = super.baseMapper.selectPage(Condition.getPage(query),queryWrapper); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							if (CollectionUtil.isEmpty(pages.getRecords())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								return R.success("暂无数据,请稍后重试"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							return R.data(fdpTaskEntities); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							return R.data(pages); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						private static Wrapper<FdpTaskEntity> getFdpTaskEntityWrapper(TaskStatisticsVo statisticsVo) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				 | 
				
					@ -207,13 +236,14 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn
					 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							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())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								BigDecimal bigDecimal=BigDecimal.valueOf(s.getValue().size()).divide(BigDecimal.valueOf(fdpTaskEntities.size()),2,BigDecimal.ROUND_UP); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								taskStatisticsVo.setPercentage(bigDecimal.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								taskStatisticsVo.setLevel(level); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								taskStatisticsVo.setName(key+"-"+s.getKey().toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								taskStatisticsVo.setMemuName(key+"-"+s.getKey().toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								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->{ | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				 | 
				
					@ -229,7 +259,7 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn
					 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								}else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
									deptName=""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								taskStatisticsVo.setName(key+"-"+deptName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								taskStatisticsVo.setMemuName(key+"-"+deptName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
								res.add(taskStatisticsVo); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
							}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				 | 
				
						} | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				 | 
				
					
 
					 |