| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -34,7 +34,6 @@ import com.hnac.hzims.ticket.workTicket.feign.ITicketInfoClient; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; | 
					 | 
					 | 
					 | 
					import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.hnac.hzinfo.inspect.task.feign.IInspectTaskReportClient; | 
					 | 
					 | 
					 | 
					import com.hnac.hzinfo.inspect.task.feign.IInspectTaskReportClient; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO; | 
					 | 
					 | 
					 | 
					import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import io.swagger.annotations.ApiModelProperty; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import lombok.RequiredArgsConstructor; | 
					 | 
					 | 
					 | 
					import lombok.RequiredArgsConstructor; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import lombok.extern.slf4j.Slf4j; | 
					 | 
					 | 
					 | 
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import org.apache.commons.collections4.MapUtils; | 
					 | 
					 | 
					 | 
					import org.apache.commons.collections4.MapUtils; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -142,12 +141,16 @@ public class WindHomeServiceImpl implements WindHomeService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 月发电量
 | 
					 | 
					 | 
					 | 
					        // 月发电量
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        score.setGenerateMon(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getPower).sum()); | 
					 | 
					 | 
					 | 
					        score.setGenerateMon(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getPower).sum()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 月计划发电量
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        score.setPlanMon(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getPlan).sum()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 月发电量完成率
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if(Math.abs(score.getGenerateMon()) > 0 && Math.abs(score.getPlanMon()) > 0){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setCompleteMonRate(BigDecimal.valueOf(score.getGenerateMon() / score.getPlanMon() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 月平均风速
 | 
					 | 
					 | 
					 | 
					        // 月平均风速
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        score.setSpeedRate(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getSpeed).average().getAsDouble()); | 
					 | 
					 | 
					 | 
					        score.setSpeedRate(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getSpeed).average().getAsDouble()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 月短期准确率
 | 
					 | 
					 | 
					 | 
					        // 月利用小时
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        score.setAccuracy(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getAccuracy).average().getAsDouble()); | 
					 | 
					 | 
					 | 
					        score.setAvailableMon(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getAvailable).sum()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 月超短期准确率
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        score.setUltraShortAccuracyRate(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getUltraShortAccuracy).average().getAsDouble()); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 日发电量
 | 
					 | 
					 | 
					 | 
					        // 日发电量
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        score.setGenerateDay(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),DateUtil.PATTERN_DATE))).mapToDouble(WindEntity::getPower).sum()); | 
					 | 
					 | 
					 | 
					        score.setGenerateDay(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),DateUtil.PATTERN_DATE))).mapToDouble(WindEntity::getPower).sum()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 近年发电量
 | 
					 | 
					 | 
					 | 
					        // 近年发电量
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -306,6 +309,8 @@ public class WindHomeServiceImpl implements WindHomeService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        WindKpiAppVo kpi = new WindKpiAppVo(); | 
					 | 
					 | 
					 | 
					        WindKpiAppVo kpi = new WindKpiAppVo(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 站点数量
 | 
					 | 
					 | 
					 | 
					        // 站点数量
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        kpi.setCount(stations.size()); | 
					 | 
					 | 
					 | 
					        kpi.setCount(stations.size()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 机构名称
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        this.subordinateDept(kpi); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 风电数据
 | 
					 | 
					 | 
					 | 
					        // 风电数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        List<WindEntity> winds = windService.list(new LambdaQueryWrapper<WindEntity>() {{ | 
					 | 
					 | 
					 | 
					        List<WindEntity> winds = windService.list(new LambdaQueryWrapper<WindEntity>() {{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) | 
					 | 
					 | 
					 | 
					            in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -331,6 +336,24 @@ public class WindHomeServiceImpl implements WindHomeService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /** | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * 设置省子公司名称 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param kpi | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private void subordinateDept(WindKpiAppVo kpi) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        R<List<Dept>> result = sysClient.getDeptByCurrentUser(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        Optional<Dept> optional; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        optional = result.getData().stream().min(Comparator.comparing(Dept::getDeptCategory)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        optional.ifPresent(dept -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            kpi.setDeptId(dept.getId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            kpi.setDeptName(dept.getDeptName()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            kpi.setType(dept.getDeptCategory()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * 风电app区域数据 | 
					 | 
					 | 
					 | 
					     * 风电app区域数据 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param deptId | 
					 | 
					 | 
					 | 
					     * @param deptId | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @return | 
					 | 
					 | 
					 | 
					     * @return | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -401,6 +424,10 @@ public class WindHomeServiceImpl implements WindHomeService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public WindAreaDutyVo app_area_duty(Long deptId) { | 
					 | 
					 | 
					 | 
					    public WindAreaDutyVo app_area_duty(Long deptId) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        WindAreaDutyVo areaDuty = new WindAreaDutyVo(); | 
					 | 
					 | 
					 | 
					        WindAreaDutyVo areaDuty = new WindAreaDutyVo(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        areaDuty.setDeptId(deptId); | 
					 | 
					 | 
					 | 
					        areaDuty.setDeptId(deptId); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        R<Dept> result = sysClient.getDept(deptId); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if(result.isSuccess() && ObjectUtil.isNotEmpty(result.getData())){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            areaDuty.setDeptName(result.getData().getDeptName()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // 风电统计数据
 | 
					 | 
					 | 
					 | 
					        // 风电统计数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        this.windFill(areaDuty,deptId); | 
					 | 
					 | 
					 | 
					        this.windFill(areaDuty,deptId); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |