|  |  | @ -3,8 +3,8 @@ package com.hnac.hzims.operational.main.service.impl; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.afterturn.easypoi.entity.ImageEntity; |  |  |  | import cn.afterturn.easypoi.entity.ImageEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |  |  |  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.EquipmentConstants; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.equipment.entity.PlanGenerationEntity; |  |  |  | import com.hnac.hzims.equipment.entity.PlanGenerationEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.hnac.hzims.equipment.feign.IEmParamClient; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.equipment.feign.IPlanGenertionClient; |  |  |  | import com.hnac.hzims.equipment.feign.IPlanGenertionClient; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; |  |  |  | import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.message.dto.MailPushDto; |  |  |  | import com.hnac.hzims.message.dto.MailPushDto; | 
			
		
	
	
		
		
			
				
					|  |  | @ -20,17 +20,16 @@ import com.hnac.hzims.operational.main.vo.AreaMonthReportVo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.main.vo.HydropowerUnitRealVo; |  |  |  | import com.hnac.hzims.operational.main.vo.HydropowerUnitRealVo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.main.vo.MaintainVo; |  |  |  | import com.hnac.hzims.operational.main.vo.MaintainVo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.main.vo.OverhaulVo; |  |  |  | import com.hnac.hzims.operational.main.vo.OverhaulVo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.report.vo.CheckChartVo; |  |  |  | import com.hnac.hzims.operational.report.vo.*; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.report.vo.DutyDefectVO; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.report.vo.MonPowerPercentageVo; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.report.vo.TicketChartCell; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.station.entity.StationEntity; |  |  |  | import com.hnac.hzims.operational.station.entity.StationEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.station.service.IStationService; |  |  |  | import com.hnac.hzims.operational.station.service.IStationService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.util.JFreeUtil; |  |  |  | import com.hnac.hzims.operational.util.JFreeUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.operational.util.TimeUtils; |  |  |  | import com.hnac.hzims.operational.util.TimeUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.hnac.hzims.operational.util.WordUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO; |  |  |  | import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.safeproduct.feign.ISafeCheckClient; |  |  |  | import com.hnac.hzims.safeproduct.feign.ISafeCheckClient; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.safeproduct.feign.ISafeEquipmentTrialClient; |  |  |  | import com.hnac.hzims.safeproduct.feign.ISafeEquipmentTrialClient; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.hnac.hzims.ticket.constants.TicketConstants; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; |  |  |  | import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; |  |  |  | import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.hnac.hzims.ticket.workTicket.feign.ITicketInfoClient; |  |  |  | import com.hnac.hzims.ticket.workTicket.feign.ITicketInfoClient; | 
			
		
	
	
		
		
			
				
					|  |  | @ -48,6 +47,7 @@ import org.apache.poi.ss.usermodel.FillPatternType; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.apache.poi.ss.usermodel.HorizontalAlignment; |  |  |  | import org.apache.poi.ss.usermodel.HorizontalAlignment; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.apache.poi.ss.usermodel.VerticalAlignment; |  |  |  | import org.apache.poi.ss.usermodel.VerticalAlignment; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.apache.poi.ss.util.CellRangeAddress; |  |  |  | import org.apache.poi.ss.util.CellRangeAddress; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import org.jfree.data.category.DefaultCategoryDataset; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springblade.core.tool.api.R; |  |  |  | import org.springblade.core.tool.api.R; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springblade.core.tool.utils.CollectionUtil; |  |  |  | import org.springblade.core.tool.utils.CollectionUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springblade.core.tool.utils.DateUtil; |  |  |  | import org.springblade.core.tool.utils.DateUtil; | 
			
		
	
	
		
		
			
				
					|  |  | @ -83,7 +83,7 @@ import java.util.stream.Collectors; | 
			
		
	
		
		
			
				
					
					|  |  |  |  */ |  |  |  |  */ | 
			
		
	
		
		
			
				
					
					|  |  |  | @Service |  |  |  | @Service | 
			
		
	
		
		
			
				
					
					|  |  |  | @RequiredArgsConstructor |  |  |  | @RequiredArgsConstructor | 
			
		
	
		
		
			
				
					
					|  |  |  | public class AreaMonthReportServiceImpl implements IAreaMonthReportService { |  |  |  | public class AreaMonthReportServiceImpl  implements IAreaMonthReportService { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @NotNull |  |  |  |     @NotNull | 
			
		
	
		
		
			
				
					
					|  |  |  |     private final IMainTaskStatisticService mainTaskStatisticService; |  |  |  |     private final IMainTaskStatisticService mainTaskStatisticService; | 
			
		
	
	
		
		
			
				
					|  |  | @ -96,6 +96,8 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |     @NotNull |  |  |  |     @NotNull | 
			
		
	
		
		
			
				
					
					|  |  |  |     private final IPlanGenertionClient planGenertionClient; |  |  |  |     private final IPlanGenertionClient planGenertionClient; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @NotNull |  |  |  |     @NotNull | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private final IEmParamClient emParamClient; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @NotNull | 
			
		
	
		
		
			
				
					
					|  |  |  |     private final SideHustleServiceImpl sideHustleService; |  |  |  |     private final SideHustleServiceImpl sideHustleService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @NotNull |  |  |  |     @NotNull | 
			
		
	
		
		
			
				
					
					|  |  |  |     private final AnalyseDataServiceImpl analyseDataService; |  |  |  |     private final AnalyseDataServiceImpl analyseDataService; | 
			
		
	
	
		
		
			
				
					|  |  | @ -201,6 +203,49 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return R.data("success"); |  |  |  |         return R.data("success"); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public static void main(String[] args) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         HashMap<String, Object> map = new HashMap<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<TicketChartVo> ticketList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         TicketConstants.TicketTypeNameEnum[] values = TicketConstants.TicketTypeNameEnum.values(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         TicketChartVo sum=new TicketChartVo(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<TicketChartCell> sas = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         sum.setDeptName("总计"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (TicketConstants.TicketTypeNameEnum value : values) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 TicketChartCell ticketChartCell = new TicketChartCell(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketChartCell.setTicketType(value.getType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketChartCell.setTicketName(value.getFileName()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 Integer integer = Integer.valueOf(value.getType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketChartCell.setTicketMon(30+ integer); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BigDecimal d=BigDecimal.valueOf(integer).divide(BigDecimal.valueOf(100),2,BigDecimal.ROUND_UP); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketChartCell.setTicketMonPerc(0.3+ d.doubleValue()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 sas.add(ticketChartCell); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         sum.setChartCells(sas); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ticketList.add(sum); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //两票柱状图数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // 创建数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         DefaultCategoryDataset dataset = new DefaultCategoryDataset(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (TicketChartVo chartVo : ticketList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (int i = 0; i < chartVo.getChartCells().size(); i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 TicketChartCell ticketChartCell = chartVo.getChartCells().get(i); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 dataset.addValue(ticketChartCell.getTicketMon(), ticketChartCell.getTicketName(), ticketChartCell.getTicketName()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         DefaultCategoryDataset datasetLine = new DefaultCategoryDataset(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (TicketChartVo chartVo : ticketList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (int i = 0; i < chartVo.getChartCells().size(); i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 TicketChartCell ticketChartCell = chartVo.getChartCells().get(i); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 datasetLine.addValue(ticketChartCell.getTicketMonPerc(), "合格率", ticketChartCell.getTicketName()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String title="水电运维项目两票统计表"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String domainAxis="数量"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String rangeAxis="票据类型"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ImageEntity ticketImage = JFreeUtil.iCreateBarLineChart(false, title, domainAxis, rangeAxis, dataset, datasetLine,662, 378); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         map.put("ticketImage", ticketImage); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         WordUtils.exportWord("template/waterMonV4.docx", "F:/", "888.docx", map); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |     public R exportHydropowerStationMonthReport(HttpServletResponse response, HashMap<String, Object> map, Integer year, Integer month, Integer date, Long deptId) { |  |  |  |     public R exportHydropowerStationMonthReport(HttpServletResponse response, HashMap<String, Object> map, Integer year, Integer month, Integer date, Long deptId) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         R<String> deptNameR = sysClient.getDeptName(deptId); |  |  |  |         R<String> deptNameR = sysClient.getDeptName(deptId); | 
			
		
	
	
		
		
			
				
					|  |  | @ -209,11 +254,11 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         String deptName = deptNameR.getData(); |  |  |  |         String deptName = deptNameR.getData(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         R<List<Dept>> deptR = sysClient.getDeptByType("200000", deptId, 4); |  |  |  |         R<List<Dept>> deptR = sysClient.getDeptByType("200000", deptId, 4); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (!deptR.isSuccess()||deptR.getData()==null) { |  |  |  |         if (!deptR.isSuccess() || deptR.getData() == null) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             return R.fail("该机构不包含水站信息"); |  |  |  |             return R.fail("该机构不包含水站信息"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<Dept> deptList = deptR.getData().stream().filter(s -> s.getStationId() != null).collect(Collectors.toList()); |  |  |  |         List<Dept> deptList = deptR.getData().stream().filter(s -> s.getStationId() != null).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (deptList==null) { |  |  |  |         if (deptList == null) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             return R.fail("该机构不包含水站信息"); |  |  |  |             return R.fail("该机构不包含水站信息"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<Long> deptIds = deptList.stream().map(s -> s.getId()).collect(Collectors.toList()); |  |  |  |         List<Long> deptIds = deptList.stream().map(s -> s.getId()).collect(Collectors.toList()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -235,20 +280,31 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         String yearBeforeStart = TimeUtils.getYear(yearBefore); |  |  |  |         String yearBeforeStart = TimeUtils.getYear(yearBefore); | 
			
		
	
		
		
			
				
					
					|  |  |  |         String yearBeforeEnd = TimeUtils.getYearEnd(yearBefore); |  |  |  |         String yearBeforeEnd = TimeUtils.getYearEnd(yearBefore); | 
			
		
	
		
		
			
				
					
					|  |  |  |         // 今年当月
 |  |  |  |         // 今年当月
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         String monthStart = TimeUtils.getMonthStart(year,month); |  |  |  |         String monthStart = TimeUtils.getMonthStart(year, month); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         String monthEnd = TimeUtils.getMonthEnd(year,month); |  |  |  |         String monthEnd = TimeUtils.getMonthEnd(year, month); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         String monthEndV2 = TimeUtils.getMonthEndV2(year,month); |  |  |  |         String monthEndV2 = TimeUtils.getMonthEndV2(year, month); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         // 今年上个月
 |  |  |  |         // 今年上个月
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         String beforeMonthStart = TimeUtils.getMonthStart(year,monthBefore); |  |  |  |         String beforeMonthStart = TimeUtils.getMonthStart(year, monthBefore); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         String beforeMonthEnd = TimeUtils.getMonthEnd(year,monthBefore); |  |  |  |         String beforeMonthEnd = TimeUtils.getMonthEnd(year, monthBefore); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         // 去年当月
 |  |  |  |         // 去年当月
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         String monthStartBeforeYear = TimeUtils.getMonthStart(yearBefore,month); |  |  |  |         String monthStartBeforeYear = TimeUtils.getMonthStart(yearBefore, month); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         String monthEndBeforeYear = TimeUtils.getMonthEnd(yearBefore,month); |  |  |  |         String monthEndBeforeYear = TimeUtils.getMonthEnd(yearBefore, month); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         // 所有设备信息
 |  |  |  |         // 所有设备信息
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<EminfoAndEmParamVo> devices = mainSystemMonitoringService.getEmInfoList(); |  |  |  |         List<EminfoAndEmParamVo> devices = mainSystemMonitoringService.getEmInfoList(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) redisTemplate.opsForValue().get(load_hydropower_unit_real_key); |  |  |  |         List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) redisTemplate.opsForValue().get(load_hydropower_unit_real_key); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<HydropowerUnitRealVo> realsByDept = reals.stream().filter(s -> deptIds.contains(s.getDeptId())).collect(Collectors.toList()); |  |  |  | //        R<Integer> installedCapacityCountByDepts = emParamClient.getInstalledCapacityCountByDepts(deptIds);
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        if (installedCapacityCountByDepts.isSuccess()){
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            double sum = Optional.ofNullable(installedCapacityCountByDepts.getData())
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                    .orElse(new ArrayList<>()).stream()
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                    .filter(s -> s.getInstalledCapacity() != null)
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                    .mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            map.put("installedCapacity", 0);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        List<HydropowerUnitRealVo> realsByDept = reals.stream().filter(s -> deptIds.contains(s.getDeptId())).collect(Collectors.toList());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //      TODO 伪造数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<HydropowerUnitRealVo> realsByDept = reals.stream().filter(s -> deptIds.contains(s.getDeptId())).map(s->{s.setInstalledCapacity(3.2);return s;}).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         //		装机容量占比数据组装
 |  |  |  |         //		装机容量占比数据组装
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         //总容量
 |  |  |  |         //总容量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         double sum = Optional.ofNullable(realsByDept) |  |  |  |         double sum = Optional.ofNullable(realsByDept) | 
			
		
	
	
		
		
			
				
					|  |  | @ -262,23 +318,22 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .filter(s -> s.getInstalledCapacity() != null) |  |  |  |                 .filter(s -> s.getInstalledCapacity() != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .collect(Collectors.groupingBy(HydropowerUnitRealVo::getDeptId)); |  |  |  |                 .collect(Collectors.groupingBy(HydropowerUnitRealVo::getDeptId)); | 
			
		
	
		
		
			
				
					
					|  |  |  |         Map<String, Double> capacityProportionMap = new HashMap<>(); |  |  |  |         Map<String, Double> capacityProportionMap = new HashMap<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         for ( |  |  |  |         for (Map.Entry<Long, List<HydropowerUnitRealVo>> longListEntry : listMap.entrySet()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 Map.Entry<Long, List<HydropowerUnitRealVo>> longListEntry : listMap.entrySet()) { |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             BigDecimal bigDecimal = BigDecimal.valueOf(0); |  |  |  |             BigDecimal bigDecimal = BigDecimal.valueOf(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (HydropowerUnitRealVo hydropowerUnitRealVo : longListEntry.getValue()) { |  |  |  |             for (HydropowerUnitRealVo hydropowerUnitRealVo : longListEntry.getValue()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 bigDecimal = BigDecimal.valueOf(hydropowerUnitRealVo.getInstalledCapacity()).add(bigDecimal); |  |  |  |                 bigDecimal = BigDecimal.valueOf(hydropowerUnitRealVo.getInstalledCapacity()).add(bigDecimal); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (Dept dept : deptList) { |  |  |  |             for (Dept dept : deptList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (dept.getDeptCode().equals(longListEntry.getKey())) { |  |  |  |                 if (dept.getId().equals(longListEntry.getKey())) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     capacityProportionMap.put(dept.getDeptName(), bigDecimal.doubleValue()); |  |  |  |                     capacityProportionMap.put(dept.getDeptName(), bigDecimal.doubleValue()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         //装机容量占比图
 |  |  |  |         //装机容量占比图
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         ImageEntity capacityProportionChart = JFreeUtil.pieChartByDouble("水电项目装机容量占比图", capacityProportionMap, 1260, 60600); |  |  |  |         ImageEntity capacityProportionChart = JFreeUtil.pieChartByDouble("水电项目装机容量占比图", capacityProportionMap, 500, 400); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         map.put("capacityProportionChart", capacityProportionChart); |  |  |  |         map.put("capacityProportionChart", capacityProportionChart); | 
			
		
	
		
		
			
				
					
					|  |  |  | //各发电站发电量环比图+表格数据组装
 |  |  |  | //各发电站发电量环比图+表格数据组装
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<MonPowerPercentageVo> powerPercentageVoList=new ArrayList<>(); |  |  |  |         List<MonPowerPercentageVo> powerPercentageVoList = new ArrayList<>(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         for (Dept dept : deptList) { |  |  |  |         for (Dept dept : deptList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             MonPowerPercentageVo powerVo = new MonPowerPercentageVo(); |  |  |  |             MonPowerPercentageVo powerVo = new MonPowerPercentageVo(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setDeptId(dept.getId()); |  |  |  |             powerVo.setDeptId(dept.getId()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -288,162 +343,214 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |             BigDecimal powerMonth = new BigDecimal(0); |  |  |  |             BigDecimal powerMonth = new BigDecimal(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |             BigDecimal powerMonthBefore = new BigDecimal(0); |  |  |  |             BigDecimal powerMonthBefore = new BigDecimal(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |             BigDecimal powerMonthYearBefore = new BigDecimal(0); |  |  |  |             BigDecimal powerMonthYearBefore = new BigDecimal(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |             Float planGeneration=0f; |  |  |  |             Double planGeneration = 0d; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             List<PlanGenerationEntity> planYearData = planGenertionClient.getPlanGenerationByParam(null, Arrays.asList(dept.getId().toString()), year.toString()); |  |  |  | //                todo shuju
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if(CollectionUtils.isNotEmpty(planYearData)){ |  |  |  | //            List<PlanGenerationEntity> planYearData = planGenertionClient.getPlanGenerationByParam(null, Arrays.asList(dept.getId().toString()), year.toString());
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 planGeneration = planYearData.get(0).getPlanGeneration(); |  |  |  |             PlanGenerationEntity planGenerationEntity=new PlanGenerationEntity(); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             planGenerationEntity.setPlanGeneration(2f); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             List<PlanGenerationEntity> planYearData =new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             planYearData.add(planGenerationEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (CollectionUtils.isNotEmpty(planYearData)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 planGeneration = Double.valueOf(planYearData.get(0).getPlanGeneration()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             // 站点设备集合
 |  |  |  |             // 站点设备集合
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(dept.getId())).collect(Collectors.toList()); |  |  |  |             List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(dept.getId())).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (EminfoAndEmParamVo device : stationDevices) { |  |  |  |             for (EminfoAndEmParamVo device : stationDevices) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //今年发电量
 |  |  |  |                 //今年发电量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<AnalyseDataTaosVO> analyseData = analyseDataService.periodTargetData(yearStart, yearEnd, 3, EquipmentConstants.CycleTypeEnum.YEAR_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION); |  |  |  | //                List<AnalyseDataTaosVO> analyseData = analyseDataService.periodTargetData(yearStart, yearEnd, 3, EquipmentConstants.CycleTypeEnum.YEAR_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION);
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AnalyseDataTaosVO analyseData1=new AnalyseDataTaosVO(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseData1.setVal("2"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 List<AnalyseDataTaosVO> analyseData =new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseData.add(analyseData1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 //                    todo 数据还原
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (CollectionUtil.isNotEmpty(analyseData)) { |  |  |  |                 if (CollectionUtil.isNotEmpty(analyseData)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BigDecimal yearPower = analyseData.stream().filter(ktv -> ktv.getVal() != null) |  |  |  |                     BigDecimal yearPower = analyseData.stream().filter(ktv -> ktv.getVal() != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |                             .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getVal()))) |  |  |  |                             .map(ktv -> BigDecimal.valueOf(Double.valueOf(ktv.getVal()))) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     powerYear = powerYear.add(yearPower); |  |  |  |                     powerYear = powerYear.add(yearPower); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //去年发电量
 |  |  |  |                 //去年发电量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<AnalyseDataTaosVO> analyseDataYearBefore = analyseDataService.periodTargetData(yearBeforeStart, yearBeforeEnd, 3, EquipmentConstants.CycleTypeEnum.YEAR_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION); |  |  |  | //                List<AnalyseDataTaosVO> analyseDataYearBefore = analyseDataService.periodTargetData(yearBeforeStart, yearBeforeEnd, 3, EquipmentConstants.CycleTypeEnum.YEAR_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION);
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AnalyseDataTaosVO analyseDataYearBefore1=new AnalyseDataTaosVO(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseDataYearBefore1.setVal("16"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 List<AnalyseDataTaosVO> analyseDataYearBefore =new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseDataYearBefore.add(analyseDataYearBefore1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 //                    todo 数据还原
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (CollectionUtil.isNotEmpty(analyseDataYearBefore)) { |  |  |  |                 if (CollectionUtil.isNotEmpty(analyseDataYearBefore)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BigDecimal powerBefore = analyseDataYearBefore.stream().filter(ktv -> ktv.getVal() != null) |  |  |  |                     BigDecimal powerBefore = analyseDataYearBefore.stream().filter(ktv -> ktv.getVal() != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |                             .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getVal()))) |  |  |  |                             .map(ktv -> BigDecimal.valueOf(Double.valueOf(ktv.getVal()))) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     powerYearBefore = powerYearBefore.add(powerBefore); |  |  |  |                     powerYearBefore = powerYearBefore.add(powerBefore); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //今年当月发电量
 |  |  |  |                 //今年当月发电量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<AnalyseDataTaosVO> analyseDataMonth= analyseDataService.periodTargetData(monthStart, monthEnd, 3, EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION); |  |  |  | //                List<AnalyseDataTaosVO> analyseDataMonth = analyseDataService.periodTargetData(monthStart, monthEnd, 3, EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION);
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AnalyseDataTaosVO analyseDataMonth1=new AnalyseDataTaosVO(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseDataMonth1.setVal("0.66"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 List<AnalyseDataTaosVO> analyseDataMonth =new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseDataMonth.add(analyseDataMonth1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 //                    todo 数据还原
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (CollectionUtil.isNotEmpty(analyseDataMonth)) { |  |  |  |                 if (CollectionUtil.isNotEmpty(analyseDataMonth)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BigDecimal powerBefore = analyseDataMonth.stream().filter(ktv -> ktv.getVal() != null) |  |  |  |                     BigDecimal powerBefore = analyseDataMonth.stream().filter(ktv -> ktv.getVal() != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |                             .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getVal()))) |  |  |  |                             .map(ktv -> BigDecimal.valueOf(Double.valueOf(ktv.getVal()))) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     powerMonth = powerMonth.add(powerBefore); |  |  |  |                     powerMonth = powerMonth.add(powerBefore); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //上个月发电量
 |  |  |  |                 //上个月发电量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<AnalyseDataTaosVO> analyseDataMonthBefore = analyseDataService.periodTargetData(beforeMonthStart, beforeMonthEnd, 3, EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION); |  |  |  | //                List<AnalyseDataTaosVO> analyseDataMonthBefore = analyseDataService.periodTargetData(beforeMonthStart, beforeMonthEnd, 3, EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION);
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AnalyseDataTaosVO analyseDataMonthBefore1=new AnalyseDataTaosVO(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseDataMonthBefore1.setVal("0.56"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 List<AnalyseDataTaosVO> analyseDataMonthBefore =new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseDataMonthBefore.add(analyseDataMonthBefore1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                todo 数据还原
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (CollectionUtil.isNotEmpty(analyseDataMonthBefore)) { |  |  |  |                 if (CollectionUtil.isNotEmpty(analyseDataMonthBefore)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BigDecimal powerBefore = analyseDataMonthBefore.stream().filter(ktv -> ktv.getVal() != null) |  |  |  |                     BigDecimal powerBefore = analyseDataMonthBefore.stream().filter(ktv -> ktv.getVal() != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |                             .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getVal()))) |  |  |  |                             .map(ktv -> BigDecimal.valueOf(Double.valueOf(ktv.getVal()))) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     powerMonthBefore = powerMonthBefore.add(powerBefore); |  |  |  |                     powerMonthBefore = powerMonthBefore.add(powerBefore); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //去年当月发电量
 |  |  |  |                 //去年当月发电量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<AnalyseDataTaosVO> analyseDataMonthBeforeYear = analyseDataService.periodTargetData(monthStartBeforeYear, monthEndBeforeYear, 3, EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION); |  |  |  | //                List<AnalyseDataTaosVO> analyseDataMonthBeforeYear = analyseDataService.periodTargetData(monthStartBeforeYear, monthEndBeforeYear, 3, EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(), device.getEmCode(), HomePageConstant.ELECTRICITY_CONSUMPTION);
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AnalyseDataTaosVO analyseDataMonthBeforeYear1=new AnalyseDataTaosVO(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseDataMonthBeforeYear1.setVal("0.3"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 List<AnalyseDataTaosVO> analyseDataMonthBeforeYear =new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 analyseDataMonthBeforeYear.add(analyseDataMonthBeforeYear1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                todo 数据还原
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (CollectionUtil.isNotEmpty(analyseDataMonthBeforeYear)) { |  |  |  |                 if (CollectionUtil.isNotEmpty(analyseDataMonthBeforeYear)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BigDecimal powerBefore = analyseDataMonthBeforeYear.stream().filter(ktv -> ktv.getVal() != null) |  |  |  |                     BigDecimal powerBefore = analyseDataMonthBeforeYear.stream().filter(ktv -> ktv.getVal() != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |                             .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getVal()))) |  |  |  |                             .map(ktv -> BigDecimal.valueOf(Double.valueOf(ktv.getVal()))) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                             .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     powerMonthYearBefore = powerMonthYearBefore.add(powerBefore); |  |  |  |                     powerMonthYearBefore = powerMonthYearBefore.add(powerBefore); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setPowerYear(powerYear.floatValue()); |  |  |  |             powerVo.setPowerYear(powerYear.doubleValue()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setPowerMonYearBefore(powerYearBefore.floatValue()); |  |  |  |             powerVo.setPowerYearBefore(powerYearBefore.doubleValue()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             BigDecimal yearPercentage =new BigDecimal(0); |  |  |  |             BigDecimal yearPercentage = new BigDecimal(0); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             BigDecimal planPercentage =new BigDecimal(0); |  |  |  |             BigDecimal planPercentage = new BigDecimal(0); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if (!powerYearBefore.equals(0)){ |  |  |  |             if (powerYearBefore.compareTo(BigDecimal.ZERO)!=0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 yearPercentage=  powerYearBefore.divide(powerYear, 4, BigDecimal.ROUND_UP); |  |  |  |                 yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, BigDecimal.ROUND_UP); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 planPercentage=  powerYearBefore.divide(BigDecimal.valueOf(planGeneration), 4, BigDecimal.ROUND_UP); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setPlanPercentage(planPercentage.floatValue()); |  |  |  |                 if (BigDecimal.valueOf(planGeneration).compareTo(BigDecimal.ZERO)!=0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setPowerYearPercentage(yearPercentage.floatValue()); |  |  |  |                 planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration), 2, BigDecimal.ROUND_UP); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setPowerMon(powerMonth.floatValue()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setPowerMonBefore(powerMonthBefore.floatValue()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setPowerMonYearBefore(powerMonthYearBefore.floatValue()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             BigDecimal monPercentage =new BigDecimal(0); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (!powerMonthYearBefore.equals(0)){ |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 monPercentage=  powerMonthYearBefore.divide(powerMonth, 4, BigDecimal.ROUND_UP); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             powerVo.setPowerMonPercentage(monPercentage.floatValue()); |  |  |  |             powerVo.setPlanPercentage(planPercentage.doubleValue()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             powerVo.setPowerYearPercentage(yearPercentage.doubleValue()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             powerVo.setPowerMon(powerMonth.doubleValue()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             powerVo.setPowerMonBefore(powerMonthBefore.doubleValue()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             powerVo.setPowerMonYearBefore(powerMonthYearBefore.doubleValue()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             BigDecimal monPercentage = new BigDecimal(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (powerMonthYearBefore.compareTo(BigDecimal.ZERO)!=0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 monPercentage = (powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, BigDecimal.ROUND_UP); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             powerVo.setPowerMonPercentage(monPercentage.doubleValue()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             powerPercentageVoList.add(powerVo); |  |  |  |             powerPercentageVoList.add(powerVo); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | //        各发电站发电量环比图数据组装
 |  |  |  | //        各发电站发电量环比图数据组装
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         //表格总计
 |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         List<PlanGenerationEntity> planYearAll = planGenertionClient.getPlanGenerationByParam(null,Arrays.asList(deptId.toString()),  year.toString()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<PlanGenerationEntity> planMonAll = planGenertionClient.getPlanGenerationByParam(null,Arrays.asList(deptId.toString()),  year+"-"+month); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         getTabelSum(deptId, powerPercentageVoList,planYearAll,planMonAll,map); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         //柱状图图数据
 |  |  |  |         //柱状图图数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //        todo 把柱状重新写一个方法展示
 |  |  |  |         // 创建数据
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         String[] monthArray = {"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月"}; |  |  |  |         DefaultCategoryDataset powerDataset = new DefaultCategoryDataset(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         double[] value = {20, 30, 25, 50, 40, 25, 50, 40}; |  |  |  |         for (MonPowerPercentageVo monPowerPercentageVo : powerPercentageVoList) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         ImageEntity powerChainHistogram = JFreeUtil.lineChart("测试111", monthArray, value, 300, 200); |  |  |  |             powerDataset.addValue(monPowerPercentageVo.getPowerMonYearBefore(),monthBefore +"月", monPowerPercentageVo.getDeptName()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             powerDataset.addValue(monPowerPercentageVo.getPowerMon(), month +"月", monPowerPercentageVo.getDeptName()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String powerTitle=deptName+"水电运维项目各电站发电量环比对比图(万kWh)"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String powerDomainAxis="发电量"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String powerRangeAxis="站点名称"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ImageEntity powerChainHistogram = JFreeUtil.iCreateBarChart( powerTitle, powerDomainAxis, powerRangeAxis, powerDataset, 500, 400); | 
			
		
	
		
		
			
				
					
					|  |  |  |         map.put("powerChainHistogram", powerChainHistogram); |  |  |  |         map.put("powerChainHistogram", powerChainHistogram); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //柱状图下的表格
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (powerPercentageVoList != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ArrayList<HashMap<String, String>> powerMap = new ArrayList<>(powerPercentageVoList.size()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (MonPowerPercentageVo monPowerPercentageVo : powerPercentageVoList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 HashMap<String, String> power = new HashMap<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 power.put("name", monPowerPercentageVo.getDeptName()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 power.put("monthBefore", String.valueOf(monPowerPercentageVo.getPowerMonBefore())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 power.put("month", String.valueOf(monPowerPercentageVo.getPowerMon())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 powerMap.add(power); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             map.put("power", powerMap); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //表格总计
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<PlanGenerationEntity> planYearAll = planGenertionClient.getPlanGenerationByParam(null, Arrays.asList(deptId.toString()), year.toString()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<PlanGenerationEntity> planMonAll = planGenertionClient.getPlanGenerationByParam(null, Arrays.asList(deptId.toString()), year + "-" + month); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         getTabelSum(deptId, powerPercentageVoList, planYearAll, planMonAll, map); | 
			
		
	
		
		
			
				
					
					|  |  |  |         //发电情况统计表数据
 |  |  |  |         //发电情况统计表数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |        if(powerPercentageVoList!=null){ |  |  |  |         if (powerPercentageVoList != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |            ArrayList<HashMap<String, String>> list = new ArrayList<>(powerPercentageVoList.size()); |  |  |  |             ArrayList<HashMap<String, String>> list = new ArrayList<>(powerPercentageVoList.size()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |            for (MonPowerPercentageVo monPowerPercentageVo : powerPercentageVoList) { |  |  |  |             for (MonPowerPercentageVo monPowerPercentageVo : powerPercentageVoList) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                HashMap<String, String> temp = new HashMap<>(8); |  |  |  |                 HashMap<String, String> temp = new HashMap<>(8); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                temp.put("name", monPowerPercentageVo.getDeptName()); |  |  |  |                 temp.put("name", monPowerPercentageVo.getDeptName()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                temp.put("powerMonBefore", monPowerPercentageVo.getPowerMonYearBefore().toString()); |  |  |  |                 temp.put("powerMonBefore", String.valueOf(monPowerPercentageVo.getPowerMonYearBefore())); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                temp.put("powerYearBefore", monPowerPercentageVo.getPowerYearBefore().toString()); |  |  |  |                 temp.put("powerYearBefore", String.valueOf(monPowerPercentageVo.getPowerYearBefore())); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                temp.put("mon", monPowerPercentageVo.getPowerMon().toString()); |  |  |  |                 temp.put("mon",String.valueOf(monPowerPercentageVo.getPowerMon())); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                temp.put("year", monPowerPercentageVo.getPowerYear().toString()); |  |  |  |                 temp.put("year",String.valueOf(monPowerPercentageVo.getPowerYear())); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                temp.put("monPercentage", monPowerPercentageVo.getPowerMonPercentage().toString()); |  |  |  |                 temp.put("monPercentage", monPowerPercentageVo.getPowerMonPercentage()*100+"%"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                temp.put("yearPercentage", monPowerPercentageVo.getPowerYearPercentage().toString()); |  |  |  |                 temp.put("yearPercentage", monPowerPercentageVo.getPowerYearPercentage()*100+"%"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                temp.put("plan", monPowerPercentageVo.getPlanPercentage().toString()); |  |  |  |                 temp.put("plan",monPowerPercentageVo.getPlanPercentage()*100+"%"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                list.add(temp); |  |  |  |                 list.add(temp); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |            } |  |  |  |             } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |            map.put("powerGeneration", list); |  |  |  |             map.put("powerGeneration", list); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |        } |  |  |  |         } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         //本月缺陷
 |  |  |  |         //本月缺陷
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         LambdaQueryWrapper<OperPhenomenonEntity> wrapper = Wrappers.lambdaQuery(); |  |  |  |         LambdaQueryWrapper<OperPhenomenonEntity> wrapper = Wrappers.lambdaQuery(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.ge(OperPhenomenonEntity::getCreateTime, monthStart); |  |  |  |         wrapper.ge(OperPhenomenonEntity::getCreateTime, monthStart); | 
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.le(OperPhenomenonEntity::getCreateTime,monthEndV2); |  |  |  |         wrapper.le(OperPhenomenonEntity::getCreateTime, monthEndV2); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         wrapper.eq(OperPhenomenonEntity::getIsDefect, TreatMethodConstant.IS_DEFECT); |  |  |  |         wrapper.eq(OperPhenomenonEntity::getIsDefect, TreatMethodConstant.IS_DEFECT); | 
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.eq(OperPhenomenonEntity::getDiscriminateStatus, TreatMethodConstant.AUTO_SCREENED); |  |  |  |         wrapper.eq(OperPhenomenonEntity::getDiscriminateStatus, TreatMethodConstant.AUTO_SCREENED); | 
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.in(OperPhenomenonEntity::getCreateDept, deptIds); |  |  |  |         wrapper.in(OperPhenomenonEntity::getCreateDept, deptIds); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<OperPhenomenonEntity> monPhenomenonList = operPhenomenonService.list(wrapper); |  |  |  |         List<OperPhenomenonEntity> monPhenomenonList = operPhenomenonService.list(wrapper); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         monPhenomenonList= monPhenomenonList.stream().filter(s -> s.getDefectLevel() != null).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<OperPhenomenonEntity> monConclusionList = monPhenomenonList.stream().filter(s -> s.getConclusionStatus().equals(1)).collect(Collectors.toList()); |  |  |  |         List<OperPhenomenonEntity> monConclusionList = monPhenomenonList.stream().filter(s -> s.getConclusionStatus().equals(1)).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  | //       各电站缺陷处理统计表
 |  |  |  | //       各电站缺陷处理统计表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         monConclusionList.stream().sorted(Comparator.comparing(OperPhenomenonEntity::getDefectGrading).reversed().thenComparing(OperPhenomenonEntity::getCreateTime)); |  |  |  |         monConclusionList.stream().sorted(Comparator.comparing(OperPhenomenonEntity::getDefectGrading).reversed().thenComparing(OperPhenomenonEntity::getCreateTime)); | 
			
		
	
		
		
			
				
					
					|  |  |  |         ArrayList<HashMap<String, String>> checkList = new ArrayList<>(monConclusionList.size()); |  |  |  |         ArrayList<HashMap<String, String>> checkList = new ArrayList<>(monConclusionList.size()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         for (OperPhenomenonEntity operPhenomenonEntity : monConclusionList) { |  |  |  |         for (OperPhenomenonEntity operPhenomenonEntity : monConclusionList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             Long createDept = operPhenomenonEntity.getCreateDept(); |  |  |  |             Long createDept = operPhenomenonEntity.getCreateDept(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             R<String> createDeptName= sysClient.getDeptName(createDept); |  |  |  |             R<String> createDeptName = sysClient.getDeptName(createDept); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if (!createDeptName.isSuccess()&&createDeptName.getData()!=null){ |  |  |  |             if (!createDeptName.isSuccess() && createDeptName.getData() != null) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 continue; |  |  |  |                 continue; | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             //表格数据
 |  |  |  |             //表格数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             HashMap<String, String> temp = new HashMap<>(); |  |  |  |             HashMap<String, String> temp = new HashMap<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("name", "name1"); |  |  |  |             temp.put("name", createDeptName.getData()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("name",createDeptName.getData()); |  |  |  |             temp.put("level", operPhenomenonEntity.getDefectGrading()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("level",operPhenomenonEntity.getDefectGrading()); |  |  |  |             temp.put("createTime", operPhenomenonEntity.getCreateTime().toString()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("createTime",operPhenomenonEntity.getCreateTime().toString()); |  |  |  |             temp.put("findTime", operPhenomenonEntity.getFindTime().toString()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("findTime",operPhenomenonEntity.getFindTime().toString()); |  |  |  |             temp.put("descripiton", operPhenomenonEntity.getDescripiton()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("descripiton",operPhenomenonEntity.getDescripiton()); |  |  |  |             temp.put("disposeDesc", operPhenomenonEntity.getDisposeDesc()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("disposeDesc",operPhenomenonEntity.getDisposeDesc()); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             checkList.add(temp); |  |  |  |             checkList.add(temp); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         map.put("checkList",checkList); |  |  |  |         map.put("checkList", checkList); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | //各电站缺陷统计表
 |  |  |  | //各电站缺陷统计表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         //本年缺陷
 |  |  |  |         //本年缺陷
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         LambdaQueryWrapper<OperPhenomenonEntity> wrapperYear= Wrappers.lambdaQuery(); |  |  |  |         LambdaQueryWrapper<OperPhenomenonEntity> wrapperYear = Wrappers.lambdaQuery(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.ge(OperPhenomenonEntity::getCreateTime, yearStart); |  |  |  |         wrapperYear.ge(OperPhenomenonEntity::getCreateTime, yearStart); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.le(OperPhenomenonEntity::getCreateTime,yearEndV2); |  |  |  |         wrapperYear.le(OperPhenomenonEntity::getCreateTime, yearEndV2); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.eq(OperPhenomenonEntity::getIsDefect, TreatMethodConstant.IS_DEFECT); |  |  |  |         wrapperYear.eq(OperPhenomenonEntity::getIsDefect, TreatMethodConstant.IS_DEFECT); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.eq(OperPhenomenonEntity::getDiscriminateStatus, TreatMethodConstant.AUTO_SCREENED); |  |  |  |         wrapperYear.eq(OperPhenomenonEntity::getDiscriminateStatus, TreatMethodConstant.AUTO_SCREENED); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         wrapper.in(OperPhenomenonEntity::getCreateDept, deptIds); |  |  |  |         wrapperYear.in(OperPhenomenonEntity::getCreateDept, deptIds); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         List<OperPhenomenonEntity> yearPhenomenonEntities = operPhenomenonService.list(wrapperYear); |  |  |  |         List<OperPhenomenonEntity> yearPhenomenonEntities = operPhenomenonService.list(wrapperYear); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         yearPhenomenonEntities= yearPhenomenonEntities.stream().filter(s ->StringUtil.isNotBlank(s.getDefectGrading())).filter(s -> ObjectUtil.isNotEmpty(s.getCreateDept())).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<OperPhenomenonEntity> yearConclusionList = yearPhenomenonEntities.stream().filter(s -> s.getConclusionStatus().equals(1)).collect(Collectors.toList()); |  |  |  |         List<OperPhenomenonEntity> yearConclusionList = yearPhenomenonEntities.stream().filter(s -> s.getConclusionStatus().equals(1)).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ArrayList<HashMap<String, String>> checkStatistics = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<CheckChartVo> checkChartRes = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollectionUtil.isEmpty(yearPhenomenonEntities)) { |  |  |  |         if (CollectionUtil.isEmpty(yearPhenomenonEntities)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             ArrayList<HashMap<String, String>> checkStatistics = new ArrayList<>(1); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             //表格数据
 |  |  |  |             //表格数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             HashMap<String, String> temp = new HashMap<>(7); |  |  |  |             HashMap<String, String> temp = new HashMap<>(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             temp.put("deptName", "总计"); |  |  |  |             temp.put("deptName", "总计"); | 
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("checkLevel","0"); |  |  |  |             temp.put("checkLevel", "0"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("findShortagesMon","0"); |  |  |  |             temp.put("findShortagesMon", "0"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("shortagesMon","0"); |  |  |  |             temp.put("shortagesMon", "0"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("findShortagesYear","0"); |  |  |  |             temp.put("findShortagesYear", "0"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("shortagesYear","0"); |  |  |  |             temp.put("shortagesYear", "0"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             temp.put("shortagesRate","0"); |  |  |  |             temp.put("shortagesRate", "0"); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             checkList.add(temp); |  |  |  |             checkList.add(temp); | 
			
		
	
		
		
			
				
					
					|  |  |  |             map.put("checkStatistics",checkStatistics); |  |  |  |             map.put("checkStatistics", checkStatistics); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         }else { |  |  |  |         } else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             List<CheckChartVo> checkChartRes=new ArrayList<>(); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             Map<Long, Map<String, List<OperPhenomenonEntity>>> phenomenonMap = yearPhenomenonEntities.stream().collect( |  |  |  |             Map<Long, Map<String, List<OperPhenomenonEntity>>> phenomenonMap = yearPhenomenonEntities.stream().collect( | 
			
		
	
		
		
			
				
					
					|  |  |  |                     Collectors.groupingBy(OperPhenomenonEntity::getCreateDept, |  |  |  |                     Collectors.groupingBy(OperPhenomenonEntity::getCreateDept, | 
			
		
	
		
		
			
				
					
					|  |  |  |                             Collectors.groupingBy(OperPhenomenonEntity::getDefectGrading))); |  |  |  |                             Collectors.groupingBy(OperPhenomenonEntity::getDefectGrading))); | 
			
		
	
	
		
		
			
				
					|  |  | @ -452,13 +559,13 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 for (Map.Entry<String, List<OperPhenomenonEntity>> levelList : deptMapEntry.getValue().entrySet()) { |  |  |  |                 for (Map.Entry<String, List<OperPhenomenonEntity>> levelList : deptMapEntry.getValue().entrySet()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     Integer findShortagesYear = levelList.getValue().size(); |  |  |  |                     Integer findShortagesYear = levelList.getValue().size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     Integer shortagesYear = yearConclusionList.stream().filter(s -> s.getDefectLevel().equals(deptMapEntry)).filter(s -> s.getDefectLevel().equals(deptMapEntry)).collect(Collectors.toList()).size(); |  |  |  |                     Integer shortagesYear = yearConclusionList.stream().filter(s -> s.getDefectLevel().equals(deptMapEntry)).filter(s -> s.getDefectLevel().equals(deptMapEntry)).collect(Collectors.toList()).size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     Double shortagesRate=0d; |  |  |  |                     Double shortagesRate = 0d; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     if (findShortagesYear!=0&&shortagesYear!=0){ |  |  |  |                     if (findShortagesYear != 0 && shortagesYear != 0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         shortagesRate=BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear),2,BigDecimal.ROUND_UP).doubleValue(); |  |  |  |                         shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                    } |  |  |  |                     } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     Integer findShortagesMon=Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()) .stream().filter(s -> s.getDefectLevel().equals(deptMapEntry)).filter(s -> s.getDefectLevel().equals(deptMapEntry)).collect(Collectors.toList()).size(); |  |  |  |                     Integer findShortagesMon = Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(deptMapEntry)).filter(s -> s.getDefectLevel().equals(deptMapEntry)).collect(Collectors.toList()).size(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     Integer shortagesMon=Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(deptMapEntry)).filter(s -> s.getDefectLevel().equals(deptMapEntry)).collect(Collectors.toList()).size(); |  |  |  |                     Integer shortagesMon = Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(deptMapEntry)).filter(s -> s.getDefectLevel().equals(deptMapEntry)).collect(Collectors.toList()).size(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     CheckChartVo checkChartVo=new CheckChartVo(deptName1.getData(),levelList.getKey(),findShortagesMon,shortagesMon,findShortagesYear,shortagesYear,shortagesRate); |  |  |  |                     CheckChartVo checkChartVo = new CheckChartVo(deptName1.getData(), levelList.getKey(), findShortagesMon, shortagesMon, findShortagesYear, shortagesYear, shortagesRate); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     checkChartRes.add(checkChartVo); |  |  |  |                     checkChartRes.add(checkChartVo); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
	
		
		
			
				
					|  |  | @ -467,16 +574,31 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (Map.Entry<String, List<OperPhenomenonEntity>> levelPhenomenon : levelPhenomenonList.entrySet()) { |  |  |  |             for (Map.Entry<String, List<OperPhenomenonEntity>> levelPhenomenon : levelPhenomenonList.entrySet()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 Integer findShortagesYear = levelPhenomenon.getValue().size(); |  |  |  |                 Integer findShortagesYear = levelPhenomenon.getValue().size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 Integer shortagesYear = Optional.ofNullable(yearConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelPhenomenon)).collect(Collectors.toList()).size(); |  |  |  |                 Integer shortagesYear = Optional.ofNullable(yearConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelPhenomenon)).collect(Collectors.toList()).size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 Double shortagesRate=0d; |  |  |  |                 Double shortagesRate = 0d; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 if (findShortagesYear!=0&&shortagesYear!=0){ |  |  |  |                 if (findShortagesYear != 0 && shortagesYear != 0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     shortagesRate=BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear),2,BigDecimal.ROUND_UP).doubleValue(); |  |  |  |                     shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue(); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 Integer findShortagesMon= Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelPhenomenon)).collect(Collectors.toList()).size(); |  |  |  |                 Integer findShortagesMon = Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelPhenomenon)).collect(Collectors.toList()).size(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 Integer shortagesMon= Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelPhenomenon)).collect(Collectors.toList()).size(); |  |  |  |                 Integer shortagesMon = Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelPhenomenon)).collect(Collectors.toList()).size(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 CheckChartVo checkChartVo=new CheckChartVo("总计",levelPhenomenon.getKey(),findShortagesMon,shortagesMon,findShortagesYear,shortagesYear,shortagesRate); |  |  |  |                 CheckChartVo checkChartVo = new CheckChartVo("总计", levelPhenomenon.getKey(), findShortagesMon, shortagesMon, findShortagesYear, shortagesYear, shortagesRate); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 checkChartRes.add(checkChartVo); |  |  |  |                 checkChartRes.add(checkChartVo); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (CheckChartVo checkChartRe : checkChartRes) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //表格数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             HashMap<String, String> temp = new HashMap<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             temp.put("deptName", checkChartRe.getDeptName()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             temp.put("checkLevel", checkChartRe.getCheckLevel()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             temp.put("findShortagesMon",checkChartRe.getFindShortagesMon().toString()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             temp.put("shortagesMon",checkChartRe.getShortagesMon().toString()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             temp.put("findShortagesYear", checkChartRe.getShortagesYear().toString()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             temp.put("shortagesYear", checkChartRe.getFindShortagesYear().toString()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             temp.put("shortagesRate", checkChartRe.getShortagesRate().toString()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             checkList.add(temp); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             map.put("checkStatistics", checkStatistics); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //        if (CollectionUtils.isNotEmpty(ticketNumbers)) {
 |  |  |  | //        if (CollectionUtils.isNotEmpty(ticketNumbers)) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //            String percent = PercentCountUtils.getPercent(evaluateEntities.size(), ticketNumbers.size());
 |  |  |  | //            String percent = PercentCountUtils.getPercent(evaluateEntities.size(), ticketNumbers.size());
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -486,82 +608,159 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         R<List<WorkTicketInfoEntity>> yearTicket = ticketInfoClient.getWorkTicketByTime(yearStart, yearEndV2); |  |  |  |         R<List<WorkTicketInfoEntity>> yearTicket = ticketInfoClient.getWorkTicketByTime(yearStart, yearEndV2); | 
			
		
	
		
		
			
				
					
					|  |  |  |         R<List<StandardTicketInfoEntity>> yearOperateTicket = ticketInfoClient.getOperateTicketByTime(yearStart, yearEndV2); |  |  |  |         R<List<StandardTicketInfoEntity>> yearOperateTicket = ticketInfoClient.getOperateTicketByTime(yearStart, yearEndV2); | 
			
		
	
		
		
			
				
					
					|  |  |  |         R<List<WorkTicketInfoEntity>> monthTicket = ticketInfoClient.getWorkTicketByTime(monthStart, monthEndV2); |  |  |  |         R<List<WorkTicketInfoEntity>> monthTicket = ticketInfoClient.getWorkTicketByTime(monthStart, monthEndV2); | 
			
		
	
		
		
			
				
					
					|  |  |  |         R<List<StandardTicketInfoEntity>>  monthOperateTicket = ticketInfoClient.getOperateTicketByTime(monthStart, monthEndV2); |  |  |  |         R<List<StandardTicketInfoEntity>> monthOperateTicket = ticketInfoClient.getOperateTicketByTime(monthStart, monthEndV2); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (!monthTicket.isSuccess()||!yearTicket.isSuccess()){ |  |  |  |         if (!monthTicket.isSuccess() || !yearTicket.isSuccess() || !yearOperateTicket.isSuccess() || !monthOperateTicket.isSuccess()) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             return R.fail("两票查询异常,请稍后重试"); |  |  |  |             return R.fail("两票查询异常,请稍后重试"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         List<TicketChartVo> ticketList = new ArrayList<>(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         yearPhenomenonEntities.stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getDefectGrading)); |  |  |  |         for (Dept dept : deptList) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |             String stationId = dept.getStationId(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //年工作票分组统计
 |  |  |  |             if (stationId==null){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         Map<String, Map<String, List<WorkTicketInfoEntity>>> yearTicketCollect = Optional.ofNullable(yearTicket.getData()).orElse(new ArrayList<>()).stream() |  |  |  |                 continue; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .filter(s->s.getSignageCode()!=null) |  |  |  |             } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .collect(Collectors.groupingBy(WorkTicketInfoEntity::getSignageCode, |  |  |  |             TicketChartVo chartVo = new TicketChartVo(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         Collectors.groupingBy(WorkTicketInfoEntity::getType))); |  |  |  |             chartVo.setDeptName(dept.getDeptName()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //        合格率计算
 |  |  |  |             List<TicketChartCell> cellList = new ArrayList<>(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //        Optional.ofNullable(yearTicket.getData()).orElse(new ArrayList<>()).stream()
 |  |  |  |             for (TicketConstants.TicketTypeNameEnum value : TicketConstants.TicketTypeNameEnum.values()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                .filter(s->s.getSignageCode()!=null)
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         //年操作票分组统计
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         Map<String, Map<String, List<StandardTicketInfoEntity>>>  yearOperateTicketCollect   = Optional.ofNullable(yearOperateTicket.getData()).orElse(new ArrayList<>()).stream() |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .filter(s->s.getSignageCode()!=null) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .collect(Collectors.groupingBy(StandardTicketInfoEntity::getSignageCode, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         Collectors.groupingBy(StandardTicketInfoEntity::getTicketType))); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         for (Map.Entry<String, Map<String, List<WorkTicketInfoEntity>>> deptTicketCollect : yearTicketCollect.entrySet()) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             List<TicketChartCell> cellList=new ArrayList<>(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (Map.Entry<String, List<WorkTicketInfoEntity>> ticketCollect : deptTicketCollect.getValue().entrySet()) { |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 TicketChartCell ticketChartCell = new TicketChartCell(); |  |  |  |                 TicketChartCell ticketChartCell = new TicketChartCell(); | 
			
		
	
		
		
			
				
					
					|  |  |  |               //年合格率和数量
 |  |  |  |                 ticketChartCell.setTicketType(value.getType()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 Integer count = ticketCollect.getValue().size(); |  |  |  |                 ticketChartCell.setTicketName(value.getFileName()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                 if (value.getTicketType()==2){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 Long passCount =ticketCollect.getValue().stream().filter(s->s.getStatus()==1).count(); |  |  |  |                     List<WorkTicketInfoEntity> yearTicketCollect = Optional.ofNullable(yearTicket.getData()).orElse(new ArrayList<>()).stream() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                Double ticketYearPerc=BigDecimal.valueOf(passCount).divide(BigDecimal.valueOf(count),2,BigDecimal.ROUND_UP).doubleValue(); |  |  |  |                             .filter(s ->stationId.equals(s.getSignageCode())) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                ticketChartCell.setTicketYear(count); |  |  |  |                             .filter(s -> s.getType().equals(value.getType())).collect(Collectors.toList()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                ticketChartCell.setTicketYeaPercr(ticketYearPerc); |  |  |  |                     List<WorkTicketInfoEntity> monthTicketCollect = Optional.ofNullable(monthTicket.getData()).orElse(new ArrayList<>()).stream() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 if (monthTicket.getData()!=null){ |  |  |  |                             .filter(s -> s.getSignageCode().equals(stationId)) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     ticketChartCell.setTicketMon(0); |  |  |  |                             .filter(s -> s.getType().equals(value.getType())).collect(Collectors.toList()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     ticketChartCell.setTicketMonPerc(0d); |  |  |  |                     if (CollectionUtils.isNotEmpty(yearTicketCollect)){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 }else { |  |  |  |                         //年合格率和数量
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                // 月合格率和数量
 |  |  |  |                         Integer count = yearTicketCollect.size(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     List<WorkTicketInfoEntity> monthTicketCollect = monthTicket.getData().stream() |  |  |  |                         ticketChartCell.setTicketYear(count); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             .filter(s -> s.getCreateDept().equals(deptTicketCollect.getKey())) |  |  |  |                         List<Long> ticketIds = yearTicketCollect.stream().map(s -> s.getId()).collect(Collectors.toList()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             .filter(s -> s.getType().equals(ticketCollect.getKey())).collect(Collectors.toList()); |  |  |  |                         R<Long> ticketPassCount = ticketInfoClient.getTicketPassByIds(ticketIds); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     ticketChartCell.setTicketMon(monthTicketCollect.size()); |  |  |  |                         if (ticketPassCount.isSuccess() && ticketPassCount.getData() != null&&count!=0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     Integer passCountMon =(int)  monthTicketCollect.stream().filter(s->s.getStatus()==1).count(); |  |  |  |                             Double ticketYearPerc = BigDecimal.valueOf(ticketPassCount.getData()).divide(BigDecimal.valueOf(count), 2, BigDecimal.ROUND_UP).doubleValue(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     Double ticketMonPerc=BigDecimal.valueOf(passCountMon).divide(BigDecimal.valueOf(monthTicketCollect.size()),2,BigDecimal.ROUND_UP).doubleValue(); |  |  |  |                             ticketChartCell.setTicketYeaPercr(ticketYearPerc); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     ticketChartCell.setTicketMonPerc(ticketMonPerc); |  |  |  |                         } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (CollectionUtils.isNotEmpty(monthTicketCollect)){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         //月合格率和数量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         Integer count = monthTicketCollect.size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ticketChartCell.setTicketMon(count); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         List<Long> monthTicketIds = monthTicketCollect.stream().map(s -> s.getId()).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         R<Long> ticketMonthPassCount = ticketInfoClient.getTicketPassByIds(monthTicketIds); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if (ticketMonthPassCount.isSuccess() && ticketMonthPassCount.getData() != null&&count!=0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             Double ticketMonthPerc = BigDecimal.valueOf(ticketMonthPassCount.getData()).divide(BigDecimal.valueOf(count), 2, BigDecimal.ROUND_UP).doubleValue(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             ticketChartCell.setTicketMonPerc(ticketMonthPerc); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (value.getTicketType()==1){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     List<StandardTicketInfoEntity> yearOperateCollect = Optional.ofNullable(yearOperateTicket.getData()).orElse(new ArrayList<>()).stream() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .filter(s ->stationId.equals(s.getSignageCode())) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .filter(s -> s.getTicketType().equals(value.getType())).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     List<StandardTicketInfoEntity> monthOperateCollect = Optional.ofNullable(monthOperateTicket.getData()).orElse(new ArrayList<>()).stream() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .filter(s -> s.getSignageCode().equals(stationId)) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .filter(s -> s.getTicketType().equals(value.getType())).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (CollectionUtils.isNotEmpty(yearOperateCollect)){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         //年合格率和数量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         Integer count = yearOperateCollect.size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ticketChartCell.setTicketYear(count); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         List<Long> ticketIds = yearOperateCollect.stream().map(s -> s.getId()).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         R<Long> ticketPassCount = ticketInfoClient.getTicketPassByIds(ticketIds); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if (ticketPassCount.isSuccess() && ticketPassCount.getData() != null&&count!=0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             Double ticketYearPerc = BigDecimal.valueOf(ticketPassCount.getData()).divide(BigDecimal.valueOf(count), 2, BigDecimal.ROUND_UP).doubleValue(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             ticketChartCell.setTicketYeaPercr(ticketYearPerc); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (CollectionUtils.isNotEmpty(monthOperateCollect)){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         //月合格率和数量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         Integer count = monthOperateCollect.size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ticketChartCell.setTicketMon(count); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         List<Long> monthTicketIds = monthOperateCollect.stream().map(s -> s.getId()).collect(Collectors.toList()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         R<Long> ticketMonthPassCount = ticketInfoClient.getTicketPassByIds(monthTicketIds); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if (ticketMonthPassCount.isSuccess() && ticketMonthPassCount.getData() != null&&count!=0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             Double ticketMonthPerc = BigDecimal.valueOf(ticketMonthPassCount.getData()).divide(BigDecimal.valueOf(count), 2, BigDecimal.ROUND_UP).doubleValue(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             ticketChartCell.setTicketMonPerc(ticketMonthPerc); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 cellList.add(ticketChartCell); |  |  |  |                 cellList.add(ticketChartCell); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  | //            拿到对应的厂站进行分组展示
 |  |  |  |             chartVo.setChartCells(cellList); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             Map<String, List<StandardTicketInfoEntity>> deptOperateTicketCollect = yearOperateTicketCollect.get(deptTicketCollect.getKey()); |  |  |  |             ticketList.add(chartVo); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if (deptOperateTicketCollect==null){ |  |  |  |         } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 TicketChartCell ticketChartCell = new TicketChartCell(); |  |  |  |         List<TicketChartCell> sumCollect=new ArrayList<>(); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |          ticketList.stream().map(s -> sumCollect.addAll(s.getChartCells())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Map<String, List<TicketChartCell>> groupingCollect = sumCollect.stream().collect(Collectors.groupingBy(TicketChartCell::getTicketType)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (Map.Entry<String, List<TicketChartCell>> mapTicketChart : groupingCollect.entrySet()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             TicketChartCell sumCell=new TicketChartCell(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sumCell.setTicketType(mapTicketChart.getKey()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sumCell.setTicketName(TicketConstants.TicketTypeNameEnum.getTicketNameByType(mapTicketChart.getKey())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             List<TicketChartCell> ticketChartValue = mapTicketChart.getValue(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sumCell.setTicketMon(ticketChartValue.stream().mapToInt(TicketChartCell::getTicketMon).sum()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sumCell.setTicketYear(ticketChartValue.stream().mapToInt(TicketChartCell::getTicketYear).sum()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sumCell.setTicketMonPerc(ticketChartValue.stream().mapToDouble(TicketChartCell::getTicketMonPerc).sum()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sumCell.setTicketYeaPercr(ticketChartValue.stream().mapToDouble(TicketChartCell::getTicketYeaPercr).sum()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sumCollect.add(sumCell); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         TicketChartVo ticketChartVo=new TicketChartVo(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ticketChartVo.setDeptName("总计"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ticketChartVo.setChartCells(sumCollect); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //两票表格数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ArrayList<HashMap<String, String>> ticketListRes = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (TicketChartVo chartVo : ticketList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             HashMap<String, String> ticketMap = new HashMap<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (TicketChartCell chartCell : chartVo.getChartCells()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 String ticketType = chartCell.getTicketType(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketMap.put("deptName",chartVo.getDeptName()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketMap.put("info","执行"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketMap.put("infoPass","合格率"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketMap.put("ticketMon"+ticketType,String.valueOf(chartCell.getTicketMon())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketMap.put("ticketYear"+ticketType,String.valueOf(chartCell.getTicketYear())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketMap.put("ticketMonPerc"+ticketType,String.valueOf(chartCell.getTicketMonPerc())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ticketMap.put("ticketYeaPercr"+ticketType,String.valueOf(chartCell.getTicketYeaPercr())); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (Map.Entry<String, List<StandardTicketInfoEntity>> operateTicketCollect : deptOperateTicketCollect.entrySet()) { |  |  |  |             ticketListRes.add(ticketMap); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         map.put("ticketList", ticketListRes); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //两票柱状图数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // 创建数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         DefaultCategoryDataset dataset = new DefaultCategoryDataset(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (TicketChartVo chartVo : ticketList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (int i = 0; i < chartVo.getChartCells().size(); i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 TicketChartCell ticketChartCell = chartVo.getChartCells().get(i); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 dataset.addValue(ticketChartCell.getTicketMon(), String.valueOf(i), ticketChartCell.getTicketName()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         DefaultCategoryDataset datasetLine = new DefaultCategoryDataset(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         for (TicketChartVo chartVo : ticketList) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |             for (int i = 0; i < chartVo.getChartCells().size(); i++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                 TicketChartCell ticketChartCell = chartVo.getChartCells().get(i); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         //模拟表格数据
 |  |  |  |                 datasetLine.addValue(ticketChartCell.getTicketMonPerc(), ticketChartCell.getTicketName(), ticketChartCell.getTicketName()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         ArrayList<HashMap<String, String>> list = new ArrayList<>(2); |  |  |  |             } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         HashMap<String, String> temp = new HashMap<>(3); |  |  |  |         String title=deptName+"水电运维项目两票统计表"; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         temp.put("name", "name1"); |  |  |  |         String domainAxis="数量"; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //		temp.put("name", "第一个人");
 |  |  |  |         String rangeAxis="票据类型"; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //		temp.put("age", "23");
 |  |  |  |         ImageEntity ticketImage = JFreeUtil.iCreateBarLineChart(true, title, domainAxis, rangeAxis, dataset, datasetLine,662, 378); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         list.add(temp); |  |  |  |         map.put("ticketImage", ticketImage); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         temp = new HashMap<>(3); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         temp.put("name", "2"); |  |  |  | //        //模拟表格数据
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //		temp.put("name", "第二个人");
 |  |  |  | //        ArrayList<HashMap<String, String>> list = new ArrayList<>(2);
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //		temp.put("age", "24");
 |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         list.add(temp); |  |  |  | //        HashMap<String, String> temp = new HashMap<>(3);
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         map.put("safelist", list); |  |  |  | //        temp.put("name", "name1");
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////		temp.put("name", "第一个人");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////		temp.put("age", "23");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        list.add(temp);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        temp = new HashMap<>(3);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        temp.put("name", "2");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////		temp.put("name", "第二个人");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////		temp.put("age", "24");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        list.add(temp);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        map.put("safelist", list);
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //        //模拟柱状图图数据
 |  |  |  | //        //模拟柱状图图数据
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -571,75 +770,76 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { | 
			
		
	
		
		
			
				
					
					|  |  |  | //        map.put("lineEntity", lineEntity);
 |  |  |  | //        map.put("lineEntity", lineEntity);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         return R.success("成功"); |  |  |  |         return R.success("成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //        //todo
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     private static void getTabelSum(Long deptId, List<MonPowerPercentageVo> powerPercentageVoList, List<PlanGenerationEntity> planYearAll, List<PlanGenerationEntity> planMonAll,HashMap<String, Object> map) { |  |  |  |     private static void getTabelSum(Long deptId, List<MonPowerPercentageVo> powerPercentageVoList, List<PlanGenerationEntity> planYearAll, List<PlanGenerationEntity> planMonAll, HashMap<String, Object> map) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         Float planGeneration=0f; |  |  |  |         Float planGeneration = 0f; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollectionUtil.isNotEmpty(planYearAll)){ |  |  |  |         if (CollectionUtil.isNotEmpty(planYearAll)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             planGeneration  = planYearAll.get(0).getPlanGeneration(); |  |  |  |             planGeneration = planYearAll.get(0).getPlanGeneration(); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         Float planMonGeneration=0f; |  |  |  |         Float planMonGeneration = 0f; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollectionUtil.isNotEmpty(planYearAll)){ |  |  |  |         if (CollectionUtil.isNotEmpty(planYearAll)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             planMonGeneration  = planMonAll.get(0).getPlanGeneration(); |  |  |  |             planMonGeneration = planMonAll.get(0).getPlanGeneration(); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         MonPowerPercentageVo powerVo = new MonPowerPercentageVo(); |  |  |  |         MonPowerPercentageVo powerVo = new MonPowerPercentageVo(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setDeptId(deptId); |  |  |  |         powerVo.setDeptId(deptId); | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setDeptName("总计"); |  |  |  |         powerVo.setDeptName("总计"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal powerYear= powerPercentageVoList.stream().filter(s->s.getPowerYear()!=null) |  |  |  |         BigDecimal powerYear = powerPercentageVoList.stream() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                  .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getPowerYear()))) |  |  |  |                 .map(ktv -> BigDecimal.valueOf(ktv.getPowerYear())) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                  .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setPowerYear(powerYear.floatValue()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         map.put("powerYear",powerYear.toString()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal powerYearBefore= powerPercentageVoList.stream().filter(s->s.getPowerYearBefore()!=null) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getPowerYearBefore()))) |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setPowerMonYearBefore(powerYearBefore.floatValue()); |  |  |  |         powerVo.setPowerYear(powerYear.doubleValue()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal yearPercentage =new BigDecimal(0); |  |  |  |         map.put("powerYear", powerYear.toString()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal planPercentage =new BigDecimal(0); |  |  |  |         BigDecimal powerYearBefore = powerPercentageVoList.stream() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (!powerYearBefore.equals(0)){ |  |  |  |                 .map(ktv -> BigDecimal.valueOf(ktv.getPowerYearBefore())) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         powerVo.setPowerYearBefore(powerYearBefore.doubleValue()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BigDecimal yearPercentage = new BigDecimal(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BigDecimal planPercentage = new BigDecimal(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (powerYearBefore.compareTo(BigDecimal.ZERO)!=0) { | 
			
		
	
		
		
			
				
					
					|  |  |  | //            年累计环比
 |  |  |  | //            年累计环比
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             yearPercentage=  powerYearBefore.divide(powerYear, 4, BigDecimal.ROUND_UP); |  |  |  |             yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, BigDecimal.ROUND_UP); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             planPercentage=  powerYearBefore.divide(BigDecimal.valueOf(planGeneration), 4, BigDecimal.ROUND_UP); |  |  |  |         } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (BigDecimal.valueOf(planGeneration).compareTo(BigDecimal.ZERO)!=0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration), 2, BigDecimal.ROUND_UP); | 
			
		
	
		
		
			
				
					
					|  |  |  | //            年计划完成率
 |  |  |  | //            年计划完成率
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             map.put("yearCompletionRate",planPercentage.toString()); |  |  |  |             map.put("yearCompletionRate", planPercentage.toString()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             map.put("yearCompletionRate", 0); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setPowerYearPercentage(yearPercentage.floatValue()); |  |  |  |         powerVo.setPowerYearPercentage(yearPercentage.doubleValue()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setPlanPercentage(planPercentage.floatValue()); |  |  |  |         powerVo.setPlanPercentage(planPercentage.doubleValue()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal powerMonth= powerPercentageVoList.stream().filter(s->s.getPowerMon()!=null) |  |  |  |         BigDecimal powerMonth = powerPercentageVoList.stream() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getPowerMon()))) |  |  |  |                 .map(ktv -> BigDecimal.valueOf(ktv.getPowerMon())) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  | //       项目月发电量
 |  |  |  | //       项目月发电量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setPowerMon(powerMonth.floatValue()); |  |  |  |         powerVo.setPowerMon(powerMonth.doubleValue()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         map.put("powerMon",powerMonth.toString()); |  |  |  |         map.put("powerMon", powerMonth.toString()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | //        项目月计划完成量
 |  |  |  | //        项目月计划完成量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal planMonPercentage =new BigDecimal(0); |  |  |  |         BigDecimal planMonPercentage = new BigDecimal(0); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (!powerMonth.equals(0)&&planMonGeneration!=0){ |  |  |  |         if (powerMonth.compareTo(BigDecimal.ZERO)!=0 &&BigDecimal.valueOf(planMonGeneration).compareTo(BigDecimal.ZERO)!=0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             planMonPercentage=  powerMonth.divide(BigDecimal.valueOf(planMonGeneration), 4, BigDecimal.ROUND_UP); |  |  |  |             planMonPercentage = powerMonth.divide(BigDecimal.valueOf(planMonGeneration), 2, BigDecimal.ROUND_UP); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         map.put("monCompletionRate",planMonPercentage); |  |  |  |         map.put("monCompletionRate", planMonPercentage); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal powerMonthBefore= powerPercentageVoList.stream().filter(s->s.getPowerMonBefore()!=null) |  |  |  |         BigDecimal powerMonthBefore = powerPercentageVoList.stream() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getPowerMonBefore()))) |  |  |  |                 .map(ktv -> BigDecimal.valueOf(ktv.getPowerMonBefore())) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setPowerMonBefore(powerMonthBefore.floatValue()); |  |  |  |         powerVo.setPowerMonBefore(powerMonthBefore.doubleValue()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal powerMonthYearBefore= powerPercentageVoList.stream().filter(s->s.getPowerMonYearBefore()!=null) |  |  |  |         BigDecimal powerMonthYearBefore = powerPercentageVoList.stream() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .map(ktv -> BigDecimal.valueOf(Float.valueOf(ktv.getPowerMonYearBefore()))) |  |  |  |                 .map(ktv -> BigDecimal.valueOf(ktv.getPowerMonYearBefore())) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); |  |  |  |                 .reduce(BigDecimal.ZERO, BigDecimal::add); | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setPowerMonYearBefore(powerMonthYearBefore.floatValue()); |  |  |  |         powerVo.setPowerMonYearBefore(powerMonthYearBefore.doubleValue()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal monPercentage =new BigDecimal(0); |  |  |  |         BigDecimal monPercentage = new BigDecimal(0); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (!powerMonthYearBefore.equals(0)){ |  |  |  |         if (powerMonthYearBefore.compareTo(BigDecimal.ZERO)!=0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             monPercentage=  powerMonthYearBefore.divide(powerMonth, 4, BigDecimal.ROUND_UP); |  |  |  |             monPercentage =(powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, BigDecimal.ROUND_UP); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         //发电量环比增加
 |  |  |  |         //发电量环比增加
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         BigDecimal monAdd=powerMonth.subtract(powerMonthBefore); |  |  |  |         BigDecimal monAdd = powerMonth.subtract(powerMonthBefore); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (monAdd.equals(0)){ |  |  |  |         if (powerMonthBefore.compareTo(BigDecimal.ZERO)==0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             map.put("percentageAdd",0); |  |  |  |             map.put("percentageAdd", 0); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         }else { |  |  |  |         } else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             map.put("percentageAdd", monAdd.divide(powerMonth, 4, BigDecimal.ROUND_UP).toString()); |  |  |  |             map.put("percentageAdd", monAdd.divide(powerMonthBefore, 2, BigDecimal.ROUND_UP).toString()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         powerVo.setPowerMonPercentage(monPercentage.floatValue()); |  |  |  |         powerVo.setPowerMonPercentage(monPercentage.doubleValue()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         powerPercentageVoList.add(powerVo); |  |  |  |         powerPercentageVoList.add(powerVo); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |