diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventReportServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventReportServiceImpl.java index 71a2f7c67..00ae5d872 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventReportServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventReportServiceImpl.java @@ -935,12 +935,12 @@ public class EventReportServiceImpl implements EventReportService { //添加detail for (EventDetail detail : info) { for (DictData data : reasonData) { - if (detail.getAdvanceReason().equals(data.getId())) { + if (data.getId().equals(detail.getAdvanceReason())) { detail.setAdvanceReason(data.getName()); } } for (DictData data : typeData) { - if (detail.getAdvanceType().equals(data.getId())) { + if (data.getId().equals(detail.getAdvanceType())) { detail.setAdvanceType(data.getName()); } } @@ -961,13 +961,13 @@ public class EventReportServiceImpl implements EventReportService { for (EventDetail detail : info) { for (DictData data : reasonData) { reasonMap.put(data.getName(), 0); - if (detail.getAdvanceReason().equals(data.getId())) { + if (data.getId().equals(detail.getAdvanceReason())) { detail.setAdvanceReason(data.getName()); } } for (DictData data : typeData) { typeMap.put(data.getName(), 0); - if (detail.getAdvanceType().equals(data.getId())) { + if (data.getId().equals(detail.getAdvanceType())) { detail.setAdvanceType(data.getName()); } } diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java index 5017908e8..e61a816b6 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java @@ -163,8 +163,8 @@ public class ReportServiceImpl implements ReportService { //查区域 List data = generalDeviceInfoClient.getPracticalAllDeviceInfo(businessParam).getData(); List lineIds = data.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList()); - List generalVOS = new ArrayList<>(); - if(CollUtil.isNotEmpty(lineIds)){ + List generalVOS = new ArrayList<>(); + if (CollUtil.isNotEmpty(lineIds)) { HashMap condMap = new HashMap<>(); condMap.put("startTime", DateUtil.beginOfDay(DateUtil.parse(businessParam.getSearchBeginTime())).toString()); condMap.put("endTime", DateUtil.endOfDay(DateUtil.parse(businessParam.getSearchEndTime())).toString()); @@ -427,8 +427,8 @@ public class ReportServiceImpl implements ReportService { if (CollectionUtil.isEmpty(lineIds)) { throw new BusinessException(DeviceResponseEnum.DEPT_LINE_EMPTY); } - Page pageInfo=new Page<>(); - if(waveTypeParam.getType() != 3){ + Page pageInfo = new Page<>(); + if (waveTypeParam.getType() != 3) { pageInfo = eventDetailService.page(new Page<>(waveTypeParam.getPageNum(), waveTypeParam.getPageSize()), new LambdaQueryWrapper() .in(RmpEventDetailPO::getMeasurementPointId, lineIds) .eq(StrUtil.isNotBlank(voltageData.getId()), RmpEventDetailPO::getEventType, voltageData.getId()) @@ -436,8 +436,8 @@ public class ReportServiceImpl implements ReportService { .le(StringUtils.isNotBlank(waveTypeParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(waveTypeParam.getSearchEndTime()))) .orderByDesc(RmpEventDetailPO::getStartTime) ); - }else{ - pageInfo.setRecords(eventDetailService.list( new LambdaQueryWrapper() + } else { + pageInfo.setRecords(eventDetailService.list(new LambdaQueryWrapper() .in(RmpEventDetailPO::getMeasurementPointId, lineIds) .eq(StrUtil.isNotBlank(voltageData.getId()), RmpEventDetailPO::getEventType, voltageData.getId()) .ge(StringUtils.isNotBlank(waveTypeParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(waveTypeParam.getSearchBeginTime()))) @@ -500,20 +500,22 @@ public class ReportServiceImpl implements ReportService { return page; } - private List getMonitorList(String orgID) { - //获取所有子部门信息 - List deptDTOList = deptFeignClient.getDeptDescendantIndexes(orgID, WebUtil.filterDeptType()).getData(); - if (CollUtil.isEmpty(deptDTOList)) { - throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); - } - //单位code集合 - List orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - //查询监测点信息 - PmsMonitorParam pmsMonitorParam = new PmsMonitorParam(); - pmsMonitorParam.setOrgIds(orgCodeList); //单位codes - List monitorList = monitorClient.getMonitorInfoListByCond(pmsMonitorParam).getData(); //监测点信息 - return monitorList; + + private List getMonitorList(String orgID) { + //获取所有子部门信息 + List deptDTOList = deptFeignClient.getDeptDescendantIndexes(orgID, WebUtil.filterDeptType()).getData(); + if (CollUtil.isEmpty(deptDTOList)) { + throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } + //单位code集合 + List orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + //查询监测点信息 + PmsMonitorParam pmsMonitorParam = new PmsMonitorParam(); + pmsMonitorParam.setOrgIds(orgCodeList); //单位codes + List monitorList = monitorClient.getMonitorInfoListByCond(pmsMonitorParam).getData(); //监测点信息 + return monitorList; + } + /** * 暂降次数统计 * @@ -651,7 +653,8 @@ public class ReportServiceImpl implements ReportService { /** * 生成暂态报告xlsx - * @param businessParam + * + * @param businessParam * @return * @throws TemplateException * @throws IOException @@ -2004,10 +2007,10 @@ public class ReportServiceImpl implements ReportService { */ @Override public Page getEventReport(WaveTypeParam deviceInfoParam) { - Page page = new Page<>(deviceInfoParam.getPageNum(),deviceInfoParam.getPageSize()); + Page page = new Page<>(deviceInfoParam.getPageNum(), deviceInfoParam.getPageSize()); List generalDeviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(deviceInfoParam).getData(); List lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList()); - if(CollUtil.isEmpty(lineIds)){ + if (CollUtil.isEmpty(lineIds)) { return page; } @@ -2080,30 +2083,20 @@ public class ReportServiceImpl implements ReportService { List eventTypeList = type.getData(); for (WaveTypeVO waveTypeVO : eventDetailList) { - if (waveTypeVO.getAdvanceReason() != null) { - for (DictData dictData : eventReasonList) { - //将字典数据id与VO中属性eventReason对应的字符串进行比较 - if (waveTypeVO.getAdvanceReason().equals(dictData.getId())) { - waveTypeVO.setAdvanceReason(dictData.getName()); - } + for (DictData dictData : eventReasonList) { + //将字典数据id与VO中属性eventReason对应的字符串进行比较 + if (dictData.getId().equals(waveTypeVO.getAdvanceReason())) { + waveTypeVO.setAdvanceReason(dictData.getName()); } - } else { - //抛出异常,当前暂态原因为空 - throw new BusinessException(EventResponseEnum.EVENT_REASON_NOT_FOUND); } } for (WaveTypeVO waveTypeVO : eventDetailList) { - if (waveTypeVO.getAdvanceType() != null) { - for (DictData dictData : eventTypeList) { - //将字典数据id与VO中属性eventType对应的字符串进行比较 - if (waveTypeVO.getAdvanceType().equals(dictData.getId())) { - waveTypeVO.setAdvanceType(dictData.getName()); - } + for (DictData dictData : eventTypeList) { + //将字典数据id与VO中属性eventType对应的字符串进行比较 + if (dictData.getId().equals(waveTypeVO.getAdvanceType())) { + waveTypeVO.setAdvanceType(dictData.getName()); } - } else { - //抛出异常,当前暂态类型为空 - throw new BusinessException(EventResponseEnum.EVENT_TYPE_NOT_FOUND); } } @@ -2133,220 +2126,592 @@ public class ReportServiceImpl implements ReportService { } else { typeName = "暂降"; } - //事件统计表格(部门查询) - List generalDeviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(areaReportParam).getData(); + //事件统计表格(部门查询) + List generalDeviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(areaReportParam).getData(); - //这是总的监测点id - List lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList()); + //这是总的监测点id + List lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList()); - //创建部门参数数据 - AreaReportParam areaParam = new AreaReportParam(); - areaParam.setDeptIndex(areaReportParam.getDeptIndex()); - //创建Code对象 - SimpleDTO simpleDTO = new SimpleDTO(); - //电压等级 - simpleDTO.setCode(StatisticsEnum.VOLTAGE_LEVEL.getCode()); - simpleDTO.setName(StatisticsEnum.VOLTAGE_LEVEL.getName()); + //创建部门参数数据 + AreaReportParam areaParam = new AreaReportParam(); + areaParam.setDeptIndex(areaReportParam.getDeptIndex()); + //创建Code对象 + SimpleDTO simpleDTO = new SimpleDTO(); + //电压等级 + simpleDTO.setCode(StatisticsEnum.VOLTAGE_LEVEL.getCode()); + simpleDTO.setName(StatisticsEnum.VOLTAGE_LEVEL.getName()); - areaParam.setStatisticalType(simpleDTO); - areaParam.setMonitorFlag(areaReportParam.getMonitorFlag()); - areaParam.setPowerFlag(areaReportParam.getPowerFlag()); - areaParam.setServerName(areaReportParam.getServerName()); - areaParam.setStatFlag(areaReportParam.getStatFlag()); - areaParam.setSearchBeginTime(areaReportParam.getSearchBeginTime()); - areaParam.setSearchEndTime(areaReportParam.getSearchEndTime()); + areaParam.setStatisticalType(simpleDTO); + areaParam.setMonitorFlag(areaReportParam.getMonitorFlag()); + areaParam.setPowerFlag(areaReportParam.getPowerFlag()); + areaParam.setServerName(areaReportParam.getServerName()); + areaParam.setStatFlag(areaReportParam.getStatFlag()); + areaParam.setSearchBeginTime(areaReportParam.getSearchBeginTime()); + areaParam.setSearchEndTime(areaReportParam.getSearchEndTime()); - //提前创建,不然获取不到(初始化数据) - if (CollUtil.isEmpty(lineIds)) { - throw new BusinessException(EventResponseEnum.NOT_FOUND); - } - List eventDetailList = getEventDetailListInfo(areaReportParam, lineIds,areaReportParam.getWaveType()); - List voltageParamList = generalDeviceInfoClient.getPracticalAllDeviceInfo(areaParam).getData(); + //提前创建,不然获取不到(初始化数据) + if (CollUtil.isEmpty(lineIds)) { + throw new BusinessException(EventResponseEnum.NOT_FOUND); + } + List eventDetailList = getEventDetailListInfo(areaReportParam, lineIds, areaReportParam.getWaveType()); + List voltageParamList = generalDeviceInfoClient.getPracticalAllDeviceInfo(areaParam).getData(); - //创建幅值计数器 - int oneCount2 = 0; + //创建幅值计数器 + int oneCount2 = 0; - //创建ITIC与F47计数器 - int oneCount3 = 0; - int twoCount5 = 0; + //创建ITIC与F47计数器 + int oneCount3 = 0; + int twoCount5 = 0; - //创建暂降密度表和密度图的计数器 - int oneCount4 = 0; - int twoCount1 = 0; + //创建暂降密度表和密度图的计数器 + int oneCount4 = 0; + int twoCount1 = 0; - //创建暂降事件表格和图的计数器 - int oneCount5 = 0; - int twoCount2 = 0; + //创建暂降事件表格和图的计数器 + int oneCount5 = 0; + int twoCount2 = 0; - //创建暂态类型图和暂态类型表格计数器 - int oneCount6 = 0; - int twoCount3 = 0; + //创建暂态类型图和暂态类型表格计数器 + int oneCount6 = 0; + int twoCount3 = 0; - //创建暂态原因图和暂态原因表格计数器 - int oneCount7 = 0; - int twoCount4 = 0; + //创建暂态原因图和暂态原因表格计数器 + int oneCount7 = 0; + int twoCount4 = 0; - //提前创建计数(累计监测点数量) - Integer eventCount = 0; - //如果集合中有id将id进行拼接 + //提前创建计数(累计监测点数量) + Integer eventCount = 0; + //如果集合中有id将id进行拼接 + if (CollectionUtil.isNotEmpty(lineIds)) { + //获取累计监测点数量 + eventCount = eventDetailList.size(); + } + + + //准备word表中参数 + //获取监测点总数量 + int size = lineIds.size(); + //还有当前传入的部门名称(例如:中国)需要等邓哥的公共方法 + String deptName = deptFeignClient.getDeptById(areaReportParam.getDeptIndex()).getData().getName(); + + + /** + * =====================生成word=========================== + */ + //设置序号初始值 + int oneCount = 1; + + //创建word文档(poi生成word) + XWPFDocument doc = new XWPFDocument();// 创建Word文件 + XWPFParagraph p = doc.createParagraph();// 新建一个段落 + + // 设定标题格式,可以生成可点击的序号 + WordUtils.setHeadingStyle(doc); + + //设置对齐 + p.setAlignment(ParagraphAlignment.CENTER); + XWPFRun r = p.createRun();//创建段落文本 + r.addBreak(); + r.addBreak(); + r.addBreak(); + r.addBreak(); + r.addBreak(); + r.addBreak(); + r.setText(deptName + "供电公司"); + r.setBold(true);//设置为粗体 + r.setFontSize(14);//字体大小 + r.addBreak(); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.CENTER); + XWPFRun r1 = p.createRun();//创建段落文本 + r1.setText("电压" + typeName + "事件区域报告"); + r1.setBold(true);//设置为粗体 + r1.setFontSize(36);//字体大小 + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.CENTER); + XWPFRun r2 = p.createRun();//创建段落文本 + //获取当前时间 + Date date = new Date(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy 年 MM 月 dd 日"); + String time = dateFormat.format(date); + + r2.setText("日期: " + time); + r2.setBold(true);//设置为粗体 + r2.setFontSize(14);//字体大小 + + r2.addBreak(); + r2.addBreak(); + r2.addBreak(); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.CENTER); + XWPFRun r3 = p.createRun();//创建段落文本 + r3.setText("电压" + typeName + "事件区域报告"); + r3.setFontSize(24);//字体大小 + + + createTitle(doc, "1. 引言", "标题 1", 0, 15); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r5 = p.createRun();//创建段落文本 + r5.setText(" " + deptName + "电网总共有" + size + "个监测点。" + deptName + "电网在所选择时间段" + areaReportParam.getSearchBeginTime() + " 至 " + areaReportParam.getSearchEndTime() + + "累计监测到" + typeName + "事件" + eventCount + "条,本报告按照监测点分布," + typeName + "事件统计," + typeName + "事件点图," + typeName + "热力图," + typeName + "密度图," + typeName + "概率分布图,事件关联统计," + typeName + "类型统计," + typeName + "原因统计等方面进行数据分析。"); + r5.setFontSize(11);//字体大小 + + + createTitle(doc, "2. 报告分析对象", "标题 1", 0, 15); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r7 = p.createRun();//创建段落文本 + r7.setText(" " + deptName + "。"); + r7.setFontSize(11);//字体大小 + + + createTitle(doc, "3. 报告分析时间", "标题 1", 0, 15); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r9 = p.createRun();//创建段落文本 + r9.setText(" " + areaReportParam.getSearchBeginTime() + " 至 " + areaReportParam.getSearchEndTime() + "。"); + r9.setFontSize(11);//字体大小 + + + createTitle(doc, "4. 汇总信息", "标题 1", 0, 15); + + //1.监测网分布 + if (areaReportParam.isMonitorDistributeChart()) { + //监测网分布 + + + //在线监测点数 + Integer onLineIdCount = 0; if (CollectionUtil.isNotEmpty(lineIds)) { - //获取累计监测点数量 - eventCount = eventDetailList.size(); + onLineIdCount = lineFeignClient.getOnLineCount(lineIds).getData(); } + //离线总监测点数 + Integer unLineCount = Integer.valueOf(lineIds.size()) - onLineIdCount; + //在线率 + Double onlineRate = (onLineIdCount.doubleValue()) / (Double.valueOf(String.valueOf(lineIds.size()))) * 100; - //准备word表中参数 - //获取监测点总数量 - int size = lineIds.size(); - //还有当前传入的部门名称(例如:中国)需要等邓哥的公共方法 - String deptName = deptFeignClient.getDeptById(areaReportParam.getDeptIndex()).getData().getName(); + NumberFormat nf = NumberFormat.getNumberInstance(); + // 保留两位小数 + nf.setMaximumFractionDigits(2); + // 如果不需要四舍五入 + nf.setRoundingMode(RoundingMode.UP); + + String onlineRateResult = nf.format(onlineRate); /** - * =====================生成word=========================== + * =========================续写word文档============================================== */ - //设置序号初始值 - int oneCount = 1; - - //创建word文档(poi生成word) - XWPFDocument doc = new XWPFDocument();// 创建Word文件 - XWPFParagraph p = doc.createParagraph();// 新建一个段落 - - // 设定标题格式,可以生成可点击的序号 - WordUtils.setHeadingStyle(doc); - - //设置对齐 - p.setAlignment(ParagraphAlignment.CENTER); - XWPFRun r = p.createRun();//创建段落文本 - r.addBreak(); - r.addBreak(); - r.addBreak(); - r.addBreak(); - r.addBreak(); - r.addBreak(); - r.setText(deptName + "供电公司"); - r.setBold(true);//设置为粗体 - r.setFontSize(14);//字体大小 - r.addBreak(); - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.CENTER); - XWPFRun r1 = p.createRun();//创建段落文本 - r1.setText("电压" + typeName + "事件区域报告"); - r1.setBold(true);//设置为粗体 - r1.setFontSize(36);//字体大小 - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.CENTER); - XWPFRun r2 = p.createRun();//创建段落文本 - //获取当前时间 - Date date = new Date(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy 年 MM 月 dd 日"); - String time = dateFormat.format(date); - - r2.setText("日期: " + time); - r2.setBold(true);//设置为粗体 - r2.setFontSize(14);//字体大小 - - r2.addBreak(); - r2.addBreak(); - r2.addBreak(); - - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.CENTER); - XWPFRun r3 = p.createRun();//创建段落文本 - r3.setText("电压" + typeName + "事件区域报告"); - r3.setFontSize(24);//字体大小 - - - createTitle(doc, "1. 引言", "标题 1", 0, 15); - + createTitle(doc, "4." + oneCount + " 监测网分布", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r5 = p.createRun();//创建段落文本 - r5.setText(" " + deptName + "电网总共有" + size + "个监测点。" + deptName + "电网在所选择时间段" + areaReportParam.getSearchBeginTime() + " 至 " + areaReportParam.getSearchEndTime() + - "累计监测到" + typeName + "事件" + eventCount + "条,本报告按照监测点分布," + typeName + "事件统计," + typeName + "事件点图," + typeName + "热力图," + typeName + "密度图," + typeName + "概率分布图,事件关联统计," + typeName + "类型统计," + typeName + "原因统计等方面进行数据分析。"); - r5.setFontSize(11);//字体大小 + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + deptName + "电网总共有监测点" + size + "个。监测点在线率达到" + onlineRateResult + "%(通讯正常为:" + onLineIdCount + "个,通讯异常为:" + unLineCount + "个)" + + "[通讯正常/总监测点数(统计时候排除检修和热备用监测点)],具体见下图:"); + r12.setFontSize(11);//字体大小 - createTitle(doc, "2. 报告分析对象", "标题 1", 0, 15); + //todo 分布地图代码未实现 + //序号计数进行++ + oneCount++; - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r7 = p.createRun();//创建段落文本 - r7.setText(" " + deptName + "。"); - r7.setFontSize(11);//字体大小 + /** + * =======================================word结束========================================= + */ + } + List lindIds = eventDetailList.stream().map(EventDetailNew::getLineId).collect(Collectors.toList()); + //2.暂降事件三表季图像判断 + if (areaReportParam.isEventCountTable() || areaReportParam.isEventCountChart()) { + //所有的表结果装入集合 + Map areaCount = new HashMap<>(); + Map voltageCount = new HashMap<>(); + //暂降事件最多的两个电压 + Set topVoltage = new HashSet<>(); - createTitle(doc, "3. 报告分析时间", "标题 1", 0, 15); + //1.部门信息。传入参数(判断统计类型) + if (Objects.nonNull(areaReportParam.getStatisticalType().getCode()) && areaReportParam.getStatisticalType().getCode().equals("Power_Network")) { + //进行遍历集合获得子区域名及其所有监测点id + for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { + //当前子部门下所有id + List lineIndexes = generalDeviceDTO.getLineIndexes(); + //如果集合中有id将id进行拼接 + if (CollectionUtil.isNotEmpty(lineIndexes)) { - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r9 = p.createRun();//创建段落文本 - r9.setText(" " + areaReportParam.getSearchBeginTime() + " 至 " + areaReportParam.getSearchEndTime() + "。"); - r9.setFontSize(11);//字体大小 + List countSize = lindIds.stream().filter(x -> lineIndexes.contains(x)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(countSize)) { + areaCount.put(generalDeviceDTO.getName(), countSize.size()); + } else { + areaCount.put(generalDeviceDTO.getName(), 0); + } - createTitle(doc, "4. 汇总信息", "标题 1", 0, 15); - - //1.监测网分布 - if (areaReportParam.isMonitorDistributeChart()) { - //监测网分布 - - - //在线监测点数 - Integer onLineIdCount = 0; - if (CollectionUtil.isNotEmpty(lineIds)) { - onLineIdCount = lineFeignClient.getOnLineCount(lineIds).getData(); + } else { + //为空put 0 + areaCount.put(generalDeviceDTO.getName(), 0); + } } - //离线总监测点数 - Integer unLineCount = Integer.valueOf(lineIds.size()) - onLineIdCount; - //在线率 - Double onlineRate = (onLineIdCount.doubleValue()) / (Double.valueOf(String.valueOf(lineIds.size()))) * 100; + //2.电压集合(统计类型:电压) + List areaParamList = voltageParamList; + //进行遍历集合获得子区域名及其所有监测点id + for (GeneralDeviceDTO generalDeviceDTO : areaParamList) { - NumberFormat nf = NumberFormat.getNumberInstance(); - // 保留两位小数 - nf.setMaximumFractionDigits(2); - // 如果不需要四舍五入 - nf.setRoundingMode(RoundingMode.UP); + //当前子部门下所有id + List lineIndexes = generalDeviceDTO.getLineIndexes(); - String onlineRateResult = nf.format(onlineRate); + //如果集合中有id将id进行拼接 + if (CollectionUtil.isNotEmpty(lineIndexes)) { + + //总条数 + List countSize = lindIds.stream().filter(x -> lineIndexes.contains(x)).collect(Collectors.toList()); + + if (CollUtil.isNotEmpty(countSize)) { + voltageCount.put(generalDeviceDTO.getName(), countSize.size()); + } else { + voltageCount.put(generalDeviceDTO.getName(), 0); + } + + } else { + //为空put 0 + voltageCount.put(generalDeviceDTO.getName(), 0); + } + } + //数据排序 + Map linkMap = getSort(voltageCount); + //最多暂降事件的两个电压名称 + topVoltage = linkMap.keySet(); + + } - /** - * =========================续写word文档============================================== - */ + //根据月份来进行查看暂降 + //提前创建对象 + int dayOfMonth = 0; + //最后集合 + List timeSVoList = new ArrayList<>(); + //表格参数 + String table; + + //月 + if ("0".equals(areaReportParam.getInterval())) { + table = "月份"; + + List dayCount = new ArrayList<>(); + List timeList = new ArrayList<>(); + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM"); + //进行for循环获取所有事件的时间 + for (EventDetailNew eventDetail : eventDetailList) { + //获取暂降事件时间 + + dayCount.add(DateUtil.format(DateUtil.parse(eventDetail.getStartTime()), fmt)); + + //创建对象 + AreaEventMonthParam timeParam = new AreaEventMonthParam(); + timeParam.setDayOrMonth(DateUtil.format(DateUtil.parse(eventDetail.getStartTime()), fmt)); + timeParam.setEventAssIndex(eventDetail.getEventassIndex()); + timeList.add(timeParam); + } + + //Map集和 + Map> relevanceMap = new HashMap<>(); + List list = new ArrayList<>(); + + for (AreaEventMonthParam areaEventMonthParam : timeList) { + //如果存在 + if (relevanceMap.containsKey(areaEventMonthParam.getDayOrMonth())) { + list = relevanceMap.get(areaEventMonthParam.getDayOrMonth()); + list.add(areaEventMonthParam.getEventAssIndex()); + relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list)); + } else { + List list1 = new ArrayList<>(); + list1.add(areaEventMonthParam.getEventAssIndex()); + relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list1)); + } + } + //创建map集和装当天和次数 + Map resultMap = new HashMap<>(); + for (String day : dayCount) { + if (resultMap.containsKey(day)) { + resultMap.put(day, resultMap.get(day) + 1); + } else { + resultMap.put(day, 1); + } + } + + //获取未关联的暂态事件 + Map eventAssDetail = eventDetailList.stream().filter(x -> StrUtil.isBlank(x.getEventassIndex())) + .collect(Collectors.groupingBy(x -> DateUtil.format(DateUtil.parse(x.getStartTime()), fmt), Collectors.counting())); + + //开始时间 + LocalDate beginTime = LocalDate.parse(areaReportParam.getSearchBeginTime()); + LocalDate end = LocalDate.parse(areaReportParam.getSearchEndTime()); + //因为是比较月份,将起始时间的天数加给结束时间,不然while一直不能结束循环 + + String substring1 = end.toString().substring(0, 8); + String substring2 = beginTime.toString().substring(8, 10); + + String s1 = substring1 + substring2; + LocalDate endTime = LocalDate.parse(s1); + Set keySet = resultMap.keySet(); + + while (!beginTime.equals(endTime.plus(1, ChronoUnit.MONTHS))) { + if (keySet.contains(beginTime.toString().substring(0, 7))) { + Integer countSize = resultMap.get(beginTime.toString().substring(0, 7)); + TimeSVO timeVO = new TimeSVO(); + timeVO.setTimes(countSize.toString()); + timeVO.setYear(String.valueOf(beginTime.getYear())); + + //todo 不知道代码是否是写错了,时间判断有问题 + if (beginTime.getMonthValue() < 10) { + timeVO.setMonth("0" + beginTime.getMonthValue() + ""); + } else { + timeVO.setMonth(beginTime.getMonthValue() + ""); + } + + timeVO.setFulltime(beginTime.toString().substring(0, 7)); + + //遍历 如果时间相同,将所有关联处理事件次数赋值上去 + if (eventAssDetail.containsKey(beginTime.toString().substring(0, 7))) { + timeVO.setEventAssIndex(Math.toIntExact(eventAssDetail.get(beginTime.toString().substring(0, 7)))); + } else { + timeVO.setEventAssIndex(0); + } + timeSVoList.add(timeVO); + } else { + TimeSVO timeVO = new TimeSVO(); + timeVO.setTimes("0"); + timeVO.setYear(String.valueOf(beginTime.getYear())); + + //todo 未知问题:是否是代码错误 + if (beginTime.getMonthValue() < 10) { + timeVO.setMonth("0" + beginTime.getMonthValue() + ""); + } else { + timeVO.setMonth(beginTime.getMonthValue() + ""); + } + timeVO.setEventAssIndex(0); + timeVO.setFulltime(beginTime.toString().substring(0, 7)); + timeSVoList.add(timeVO); + } + + beginTime = beginTime.plus(1, ChronoUnit.MONTHS); + } + + //数据排序 + Map linkMap = getSort(resultMap); + //暂降次数最多 + List collect = linkMap.keySet().stream().collect(Collectors.toList()); + //赋值 + dayOfMonth = Integer.parseInt(collect.get(0).substring(5, 7)); + } else { + table = "天数"; + + List dayCount = new ArrayList<>(); + List timeList = new ArrayList<>(); - createTitle(doc, "4." + oneCount + " 监测网分布", "标题 2", 200, 11); + //进行for循环获取所有事件的时间 + for (EventDetailNew eventDetail : eventDetailList) { + //获取暂降事件时间 + dayCount.add(DateUtil.formatDate(DateUtil.parse(eventDetail.getStartTime()))); + + //创建对象 + AreaEventMonthParam timeParam = new AreaEventMonthParam(); + timeParam.setDayOrMonth(DateUtil.formatDate(DateUtil.parse(eventDetail.getStartTime()))); + timeParam.setEventAssIndex(eventDetail.getEventassIndex()); + timeList.add(timeParam); + } + + //Map集和 + Map> relevanceMap = new HashMap<>(); + List list = new ArrayList<>(); + + for (AreaEventMonthParam areaEventMonthParam : timeList) { + //如果存在 + if (relevanceMap.containsKey(areaEventMonthParam.getDayOrMonth())) { + list = relevanceMap.get(areaEventMonthParam.getDayOrMonth()); + list.add(areaEventMonthParam.getEventAssIndex()); + relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list)); + } else { + List list1 = new ArrayList<>(); + list1.add(areaEventMonthParam.getEventAssIndex()); + relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list1)); + } + } + //创建map集和装当天和次数 + Map resultMap = new HashMap<>(); + for (String day : dayCount) { + if (resultMap.containsKey(day)) { + resultMap.put(day, resultMap.get(day) + 1); + } else { + resultMap.put(day, 1); + } + } + //获取未关联的暂态事件 + Map eventAssDetail = eventDetailList.stream().filter(x -> StrUtil.isBlank(x.getEventassIndex())) + .collect(Collectors.groupingBy(x -> DateUtil.formatDate(DateUtil.parse(x.getStartTime())), Collectors.counting())); + + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + //开始时间 + LocalDate beginTime = LocalDate.parse(areaReportParam.getSearchBeginTime(), fmt); + LocalDate endTime = LocalDate.parse(areaReportParam.getSearchEndTime(), fmt); + + Set keySet = resultMap.keySet(); + + while (!beginTime.equals(endTime.plus(1, ChronoUnit.DAYS))) { + if (keySet.contains(beginTime.toString())) { + + //获取暂降次数 + Integer countSize = resultMap.get(beginTime.toString()); + TimeSVO timeVO = new TimeSVO(); + timeVO.setTimes(countSize.toString()); + + if (beginTime.getDayOfMonth() < 10) { + timeVO.setDay("0" + beginTime.getDayOfMonth() + ""); + } else { + timeVO.setDay(beginTime.getDayOfMonth() + ""); + } + + timeVO.setYear(String.valueOf(beginTime.getYear())); + //todo 不知道代码是否是写错了,时间判断有问题 + if (beginTime.getMonthValue() < 10) { + timeVO.setMonth("0" + beginTime.getMonthValue() + ""); + } else { + timeVO.setMonth(beginTime.getMonthValue() + ""); + } + timeVO.setFulltime(beginTime.toString()); + //遍历 如果时间相同,将所有关联处理事件次数赋值上去 + if (eventAssDetail.containsKey(beginTime.toString())) { + timeVO.setEventAssIndex(Math.toIntExact(eventAssDetail.get(beginTime.toString()))); + } else { + timeVO.setEventAssIndex(0); + } + timeSVoList.add(timeVO); + } else { + TimeSVO timeVO = new TimeSVO(); + timeVO.setTimes("0"); + if (beginTime.getDayOfMonth() < 10) { + timeVO.setDay("0" + beginTime.getDayOfMonth() + ""); + } else { + timeVO.setDay(beginTime.getDayOfMonth() + ""); + } + timeVO.setYear(String.valueOf(beginTime.getYear())); + + //todo 未知问题:是否是代码错误 + if (beginTime.getMonthValue() < 10) { + timeVO.setMonth("0" + beginTime.getMonthValue() + ""); + } else { + timeVO.setMonth(beginTime.getMonthValue() + ""); + } + timeVO.setEventAssIndex(0); + timeVO.setFulltime(beginTime.toString()); + timeSVoList.add(timeVO); + } + + beginTime = beginTime.plus(1, ChronoUnit.DAYS); + } + + //数据排序 + Map linkMap = getSort(resultMap); + //暂降次数最多 + List collect = linkMap.keySet().stream().collect(Collectors.toList()); + + //赋值 + dayOfMonth = LocalDate.parse(collect.get(0)).getDayOfMonth(); + + } + + //最高暂降事件的两个电压值 +// System.out.println(topVoltage); + //转为List + List topVoltageList = new ArrayList<>(); + for (String s : topVoltage) { + topVoltageList.add(s); + } + //表格 + if (areaReportParam.isEventCountTable()) { + + //创建表题计数 + int twoCount = 1; + + //与暂降事件图形共享序号 + oneCount5 = oneCount; + + + createTitle(doc, "4." + oneCount + " " + typeName + "事件列表", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网总共有监测点" + size + "个。监测点在线率达到" + onlineRateResult + "%(通讯正常为:" + onLineIdCount + "个,通讯异常为:" + unLineCount + "个)" + - "[通讯正常/总监测点数(统计时候排除检修和热备用监测点)],具体见下图:"); + r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条," + topVoltageList.get(0) + "、" + topVoltageList.get(1) + "" + typeName + "事件居多," + + "第" + dayOfMonth + "" + table + "" + typeName + "事件居多,具体见下表(图):"); r12.setFontSize(11);//字体大小 - //todo 分布地图代码未实现 + createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "事件表格", "标题 3", 400, 11); + twoCount2 = twoCount; + + //第一张表 + XWPFTable monitorInfo = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); + // 表格第一行 + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "区域", "电压" + typeName + "次数"); + //塞入数据 + for (String s : areaCount.keySet()) { + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, s, areaCount.get(s).toString()); + } + + + //第二张表 + XWPFTable monitorInfo1 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph1 = WordUtils.getCenterParagraph(doc); + // 表格第一行 + insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, true, "电压等级", "电压" + typeName + "次数"); + //塞入数据 + for (String s : voltageCount.keySet()) { + insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, false, s, voltageCount.get(s).toString()); + } + + + //第三张表 + XWPFTable monitorInfo2 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); + // 表格第一行 + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "" + table + "", "电压" + typeName + "次数"); + //塞入数据 + for (int i = 0; i < timeSVoList.size(); i++) { + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, timeSVoList.get(i).getFulltime(), timeSVoList.get(i).getTimes()); + } //序号计数进行++ oneCount++; @@ -2354,1808 +2719,1525 @@ public class ReportServiceImpl implements ReportService { /** * =======================================word结束========================================= */ + } - List lindIds = eventDetailList.stream().map(EventDetailNew::getLineId).collect(Collectors.toList()); - //2.暂降事件三表季图像判断 - if (areaReportParam.isEventCountTable() || areaReportParam.isEventCountChart()) { - //所有的表结果装入集合 - Map areaCount = new HashMap<>(); - Map voltageCount = new HashMap<>(); - //暂降事件最多的两个电压 - Set topVoltage = new HashSet<>(); + //图形 + if (areaReportParam.isEventCountChart()) { + twoCount2++; + createTitle(doc, "4." + oneCount5 + "." + twoCount2 + " " + typeName + "事件图形", "标题 3", 400, 11); - //1.部门信息。传入参数(判断统计类型) - if (Objects.nonNull(areaReportParam.getStatisticalType().getCode()) && areaReportParam.getStatisticalType().getCode().equals("Power_Network")) { - //进行遍历集合获得子区域名及其所有监测点id - for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { - - //当前子部门下所有id - List lineIndexes = generalDeviceDTO.getLineIndexes(); - //如果集合中有id将id进行拼接 - if (CollectionUtil.isNotEmpty(lineIndexes)) { - - List countSize = lindIds.stream().filter(x -> lineIndexes.contains(x)).collect(Collectors.toList()); - - if (CollUtil.isNotEmpty(countSize)) { - areaCount.put(generalDeviceDTO.getName(), countSize.size()); - } else { - areaCount.put(generalDeviceDTO.getName(), 0); - } - - } else { - //为空put 0 - areaCount.put(generalDeviceDTO.getName(), 0); - } - } - - //2.电压集合(统计类型:电压) - List areaParamList = voltageParamList; - //进行遍历集合获得子区域名及其所有监测点id - for (GeneralDeviceDTO generalDeviceDTO : areaParamList) { - - //当前子部门下所有id - List lineIndexes = generalDeviceDTO.getLineIndexes(); - - //如果集合中有id将id进行拼接 - if (CollectionUtil.isNotEmpty(lineIndexes)) { - - //总条数 - List countSize = lindIds.stream().filter(x -> lineIndexes.contains(x)).collect(Collectors.toList()); - - if (CollUtil.isNotEmpty(countSize)) { - voltageCount.put(generalDeviceDTO.getName(), countSize.size()); - } else { - voltageCount.put(generalDeviceDTO.getName(), 0); - } - - } else { - //为空put 0 - voltageCount.put(generalDeviceDTO.getName(), 0); - } - } - //数据排序 - Map linkMap = getSort(voltageCount); - //最多暂降事件的两个电压名称 - topVoltage = linkMap.keySet(); + //创建部门与监测点次数的map集合 + Map lineCount = new HashMap<>(); + for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { + lineCount.put(generalDeviceDTO.getName(), generalDeviceDTO.getLineIndexes().size()); } - - //根据月份来进行查看暂降 - //提前创建对象 - int dayOfMonth = 0; - //最后集合 - List timeSVoList = new ArrayList<>(); - //表格参数 - String table; - - //月 - if ("0".equals(areaReportParam.getInterval())) { - table = "月份"; - - List dayCount = new ArrayList<>(); - List timeList = new ArrayList<>(); - DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM"); - //进行for循环获取所有事件的时间 - for (EventDetailNew eventDetail : eventDetailList) { - //获取暂降事件时间 - - dayCount.add(DateUtil.format(DateUtil.parse(eventDetail.getStartTime()), fmt)); - - //创建对象 - AreaEventMonthParam timeParam = new AreaEventMonthParam(); - timeParam.setDayOrMonth(DateUtil.format(DateUtil.parse(eventDetail.getStartTime()), fmt)); - timeParam.setEventAssIndex(eventDetail.getEventassIndex()); - timeList.add(timeParam); - } - - //Map集和 - Map> relevanceMap = new HashMap<>(); - List list = new ArrayList<>(); - - for (AreaEventMonthParam areaEventMonthParam : timeList) { - //如果存在 - if (relevanceMap.containsKey(areaEventMonthParam.getDayOrMonth())) { - list = relevanceMap.get(areaEventMonthParam.getDayOrMonth()); - list.add(areaEventMonthParam.getEventAssIndex()); - relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list)); - } else { - List list1 = new ArrayList<>(); - list1.add(areaEventMonthParam.getEventAssIndex()); - relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list1)); - } - } - //创建map集和装当天和次数 - Map resultMap = new HashMap<>(); - for (String day : dayCount) { - if (resultMap.containsKey(day)) { - resultMap.put(day, resultMap.get(day) + 1); - } else { - resultMap.put(day, 1); + //创建x,y参数 + List xdata = new ArrayList<>(); + List ydata = new ArrayList<>(); + //根据区域名称进行匹配 + for (String name : areaCount.keySet()) { + //将监测点的数量拼接在部门下面 + for (String s : lineCount.keySet()) { + if (s.equals(name)) { + xdata.add(name + "\n" + "(" + lineCount.get(s) + ")"); } } - //获取未关联的暂态事件 - Map eventAssDetail = eventDetailList.stream().filter(x -> StrUtil.isBlank(x.getEventassIndex())) - .collect(Collectors.groupingBy(x -> DateUtil.format(DateUtil.parse(x.getStartTime()), fmt), Collectors.counting())); + ydata.add(areaCount.get(name)); + } - //开始时间 - LocalDate beginTime = LocalDate.parse(areaReportParam.getSearchBeginTime()); - LocalDate end = LocalDate.parse(areaReportParam.getSearchEndTime()); - //因为是比较月份,将起始时间的天数加给结束时间,不然while一直不能结束循环 + String qytj = drawPicUtil.drawEventRegion(xdata, ydata); + createPic(doc, qytj, "" + typeName + "事件图形"); - String substring1 = end.toString().substring(0, 8); - String substring2 = beginTime.toString().substring(8, 10); - String s1 = substring1 + substring2; - LocalDate endTime = LocalDate.parse(s1); - Set keySet = resultMap.keySet(); - - while (!beginTime.equals(endTime.plus(1, ChronoUnit.MONTHS))) { - if (keySet.contains(beginTime.toString().substring(0, 7))) { - Integer countSize = resultMap.get(beginTime.toString().substring(0, 7)); - TimeSVO timeVO = new TimeSVO(); - timeVO.setTimes(countSize.toString()); - timeVO.setYear(String.valueOf(beginTime.getYear())); - - //todo 不知道代码是否是写错了,时间判断有问题 - if (beginTime.getMonthValue() < 10) { - timeVO.setMonth("0" + beginTime.getMonthValue() + ""); - } else { - timeVO.setMonth(beginTime.getMonthValue() + ""); - } - - timeVO.setFulltime(beginTime.toString().substring(0, 7)); - - //遍历 如果时间相同,将所有关联处理事件次数赋值上去 - if(eventAssDetail.containsKey(beginTime.toString().substring(0, 7))){ - timeVO.setEventAssIndex(Math.toIntExact(eventAssDetail.get(beginTime.toString().substring(0, 7)))); - }else{ - timeVO.setEventAssIndex(0); - } - timeSVoList.add(timeVO); - } else { - TimeSVO timeVO = new TimeSVO(); - timeVO.setTimes("0"); - timeVO.setYear(String.valueOf(beginTime.getYear())); - - //todo 未知问题:是否是代码错误 - if (beginTime.getMonthValue() < 10) { - timeVO.setMonth("0" + beginTime.getMonthValue() + ""); - } else { - timeVO.setMonth(beginTime.getMonthValue() + ""); - } - timeVO.setEventAssIndex(0); - timeVO.setFulltime(beginTime.toString().substring(0, 7)); - timeSVoList.add(timeVO); - } - - beginTime = beginTime.plus(1, ChronoUnit.MONTHS); + //月份统计 + //创建x,y参数 + List xdata1 = new ArrayList<>(); + List ydata1 = new ArrayList<>(); + List ydata2 = new ArrayList<>(); + for (TimeSVO timeSVO : timeSVoList) { + if ("天数".equals(table)) { + xdata1.add(timeSVO.getFulltime().substring(5)); + } else { + xdata1.add(timeSVO.getFulltime()); } + ydata1.add(Integer.parseInt(timeSVO.getTimes())); + ydata2.add(timeSVO.getEventAssIndex()); + } + String yftj = drawPicUtil.drawEventAssociatedUnassociated(xdata1, ydata1, ydata2, table); + createPic(doc, yftj, "" + typeName + "事件图形"); - //数据排序 - Map linkMap = getSort(resultMap); - //暂降次数最多 - List collect = linkMap.keySet().stream().collect(Collectors.toList()); - //赋值 - dayOfMonth = Integer.parseInt(collect.get(0).substring(5, 7)); + + //创建电压uiiiuuuu与监测点次数的map集合 + List areaParamList = voltageParamList; + Map lineCount1 = new HashMap<>(); + for (GeneralDeviceDTO generalDeviceDTO : areaParamList) { + lineCount1.put(generalDeviceDTO.getName(), generalDeviceDTO.getLineIndexes().size()); + } + //创建x,y参数 + List xdata3 = new ArrayList<>(); + List ydata3 = new ArrayList<>(); + //根据电压名称进行匹配 + for (String name : voltageCount.keySet()) { + //将监测点的数量拼接在部门下面 + for (String s : lineCount1.keySet()) { + if (s.equals(name)) { + xdata3.add(name + "\n" + "(" + lineCount1.get(s) + ")"); + } + } + ydata3.add(voltageCount.get(name)); + } + + String dydj = drawPicUtil.drawEventVoltageLevel(xdata3, ydata3); + createPic(doc, dydj, "" + typeName + "事件图形"); + + + /** + * =======================================word结束========================================= + */ + } + + + } + + //3.密度图 + if (areaReportParam.isDensityTable() || areaReportParam.isDensityChart()) { + + //暂降密度图形 + AreaTableParam areaTableParam = new AreaTableParam(); + + //创建结果集合 + List info = eventDetailList; + + //将sql结果集放入,共用一个sql,减少查询时间 + AreaTableParam areaTableParam1 = new AreaTableParam(); + areaTableParam1.setInfo(info); + + + List iEC28VOResult = IEC28Area(areaTableParam1); + List iEC411VOResult = IEC411Area(areaTableParam1); + List dISDIPVOResult = eventDisdipArea(areaTableParam1); + + + //IEC411 <1% 总共集合 + List lessOneIEC411 = new ArrayList<>(); + //IEC411 1~40% 总共集合 + List lessFortyIEC411 = new ArrayList<>(); + //IEC411 40~70% 总共集合 + List lessSeventyIEC411 = new ArrayList<>(); + + + //IEC28 <1% 总共集合 + List lessOneIEC28 = new ArrayList<>(); + //IEC411 <10 总共集合 + List lessTenIEC28 = new ArrayList<>(); + //IEC411 <20 总共集合 + List lessTwentyIEC28 = new ArrayList<>(); + //IEC411 <30 总共集合 + List lessThirtyIEC28 = new ArrayList<>(); + //IEC411 <40 总共集合 + List lessFortyIEC28 = new ArrayList<>(); + //IEC411 <50 总共集合 + List lessFiftyIEC28 = new ArrayList<>(); + //IEC411 <60 总共集合 + List lessSixtyIEC28 = new ArrayList<>(); + //IEC411 <70 总共集合 + List lessSeventyIEC28 = new ArrayList<>(); + //IEC411 <80 总共集合 + List lessEightyIEC28 = new ArrayList<>(); + //IEC411 <90 总共集合 + List lessNinetyIEC28 = new ArrayList<>(); + //IEC411 <120 总共集合 + List lessHundredTwentyIEC28 = new ArrayList<>(); + //IEC411 <130 总共集合 + List lessHundredThirtyIEC28 = new ArrayList<>(); + //IEC411 <140 总共集合 + List lessHundredFortyIEC28 = new ArrayList<>(); + //IEC411 <150 总共集合 + List lessHundredFiftyIEC28 = new ArrayList<>(); + //IEC411 <160 总共集合 + List lessHundredSixtyIEC28 = new ArrayList<>(); + //IEC411 <170 总共集合 + List lessHundredSeventyIEC28 = new ArrayList<>(); + //IEC411 <180 总共集合 + List lessHundredEightyIEC28 = new ArrayList<>(); + + + //DISDIP = 10% + List equalTenDISDIP = new ArrayList<>(); + //DISDIP = 40% + List equalFortyDISDIP = new ArrayList<>(); + //DISDIP = 70% + List equalSeventyDISDIP = new ArrayList<>(); + //DISDIP = 85% + List equalEightyFiveDISDIP = new ArrayList<>(); + //DISDIP = 90% + List equalNinetyDISDIP = new ArrayList<>(); + + + //遍历将集合按名称分开 + for (int i1 = 0; i1 < iEC411VOResult.size(); i1++) { + if ("<1%".equals(iEC411VOResult.get(i1).getName())) { + //放入集合 + lessOneIEC411.add(iEC411VOResult.get(i1)); + } else if ("1~40%".equals(iEC411VOResult.get(i1).getName())) { + //放入集合 + lessFortyIEC411.add(iEC411VOResult.get(i1)); } else { - table = "天数"; - - List dayCount = new ArrayList<>(); - List timeList = new ArrayList<>(); - - - //进行for循环获取所有事件的时间 - for (EventDetailNew eventDetail : eventDetailList) { - //获取暂降事件时间 - dayCount.add(DateUtil.formatDate(DateUtil.parse(eventDetail.getStartTime()))); - - //创建对象 - AreaEventMonthParam timeParam = new AreaEventMonthParam(); - timeParam.setDayOrMonth(DateUtil.formatDate(DateUtil.parse(eventDetail.getStartTime()))); - timeParam.setEventAssIndex(eventDetail.getEventassIndex()); - timeList.add(timeParam); - } - - //Map集和 - Map> relevanceMap = new HashMap<>(); - List list = new ArrayList<>(); - - for (AreaEventMonthParam areaEventMonthParam : timeList) { - //如果存在 - if (relevanceMap.containsKey(areaEventMonthParam.getDayOrMonth())) { - list = relevanceMap.get(areaEventMonthParam.getDayOrMonth()); - list.add(areaEventMonthParam.getEventAssIndex()); - relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list)); - } else { - List list1 = new ArrayList<>(); - list1.add(areaEventMonthParam.getEventAssIndex()); - relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list1)); - } - } - //创建map集和装当天和次数 - Map resultMap = new HashMap<>(); - for (String day : dayCount) { - if (resultMap.containsKey(day)) { - resultMap.put(day, resultMap.get(day) + 1); - } else { - resultMap.put(day, 1); - } - } - //获取未关联的暂态事件 - Map eventAssDetail = eventDetailList.stream().filter(x -> StrUtil.isBlank(x.getEventassIndex())) - .collect(Collectors.groupingBy(x -> DateUtil.formatDate(DateUtil.parse(x.getStartTime())), Collectors.counting())); - - DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - //开始时间 - LocalDate beginTime = LocalDate.parse(areaReportParam.getSearchBeginTime(), fmt); - LocalDate endTime = LocalDate.parse(areaReportParam.getSearchEndTime(), fmt); - - Set keySet = resultMap.keySet(); - - while (!beginTime.equals(endTime.plus(1, ChronoUnit.DAYS))) { - if (keySet.contains(beginTime.toString())) { - - //获取暂降次数 - Integer countSize = resultMap.get(beginTime.toString()); - TimeSVO timeVO = new TimeSVO(); - timeVO.setTimes(countSize.toString()); - - if (beginTime.getDayOfMonth() < 10) { - timeVO.setDay("0" + beginTime.getDayOfMonth() + ""); - } else { - timeVO.setDay(beginTime.getDayOfMonth() + ""); - } - - timeVO.setYear(String.valueOf(beginTime.getYear())); - //todo 不知道代码是否是写错了,时间判断有问题 - if (beginTime.getMonthValue() < 10) { - timeVO.setMonth("0" + beginTime.getMonthValue() + ""); - } else { - timeVO.setMonth(beginTime.getMonthValue() + ""); - } - timeVO.setFulltime(beginTime.toString()); - //遍历 如果时间相同,将所有关联处理事件次数赋值上去 - if(eventAssDetail.containsKey(beginTime.toString())){ - timeVO.setEventAssIndex(Math.toIntExact(eventAssDetail.get(beginTime.toString()))); - }else{ - timeVO.setEventAssIndex(0); - } - timeSVoList.add(timeVO); - } else { - TimeSVO timeVO = new TimeSVO(); - timeVO.setTimes("0"); - if (beginTime.getDayOfMonth() < 10) { - timeVO.setDay("0" + beginTime.getDayOfMonth() + ""); - } else { - timeVO.setDay(beginTime.getDayOfMonth() + ""); - } - timeVO.setYear(String.valueOf(beginTime.getYear())); - - //todo 未知问题:是否是代码错误 - if (beginTime.getMonthValue() < 10) { - timeVO.setMonth("0" + beginTime.getMonthValue() + ""); - } else { - timeVO.setMonth(beginTime.getMonthValue() + ""); - } - timeVO.setEventAssIndex(0); - timeVO.setFulltime(beginTime.toString()); - timeSVoList.add(timeVO); - } - - beginTime = beginTime.plus(1, ChronoUnit.DAYS); - } - - //数据排序 - Map linkMap = getSort(resultMap); - //暂降次数最多 - List collect = linkMap.keySet().stream().collect(Collectors.toList()); - - //赋值 - dayOfMonth = LocalDate.parse(collect.get(0)).getDayOfMonth(); - + //放入集合 + lessSeventyIEC411.add(iEC411VOResult.get(i1)); } - - //最高暂降事件的两个电压值 -// System.out.println(topVoltage); - //转为List - List topVoltageList = new ArrayList<>(); - for (String s : topVoltage) { - topVoltageList.add(s); - } - //表格 - if (areaReportParam.isEventCountTable()) { - - //创建表题计数 - int twoCount = 1; - - //与暂降事件图形共享序号 - oneCount5 = oneCount; - - - createTitle(doc, "4." + oneCount + " " + typeName + "事件列表", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条," + topVoltageList.get(0) + "、" + topVoltageList.get(1) + "" + typeName + "事件居多," + - "第" + dayOfMonth + "" + table + "" + typeName + "事件居多,具体见下表(图):"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "事件表格", "标题 3", 400, 11); - twoCount2 = twoCount; - - //第一张表 - XWPFTable monitorInfo = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); - // 表格第一行 - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "区域", "电压" + typeName + "次数"); - //塞入数据 - for (String s : areaCount.keySet()) { - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, s, areaCount.get(s).toString()); - } - - - //第二张表 - XWPFTable monitorInfo1 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph1 = WordUtils.getCenterParagraph(doc); - // 表格第一行 - insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, true, "电压等级", "电压" + typeName + "次数"); - //塞入数据 - for (String s : voltageCount.keySet()) { - insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, false, s, voltageCount.get(s).toString()); - } - - - //第三张表 - XWPFTable monitorInfo2 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); - // 表格第一行 - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "" + table + "", "电压" + typeName + "次数"); - //塞入数据 - for (int i = 0; i < timeSVoList.size(); i++) { - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, timeSVoList.get(i).getFulltime(), timeSVoList.get(i).getTimes()); - } - - //序号计数进行++ - oneCount++; - - /** - * =======================================word结束========================================= - */ - - } - - //图形 - if (areaReportParam.isEventCountChart()) { - twoCount2++; - createTitle(doc, "4." + oneCount5 + "." + twoCount2 + " " + typeName + "事件图形", "标题 3", 400, 11); - - - //创建部门与监测点次数的map集合 - Map lineCount = new HashMap<>(); - for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { - lineCount.put(generalDeviceDTO.getName(), generalDeviceDTO.getLineIndexes().size()); - } - - //创建x,y参数 - List xdata = new ArrayList<>(); - List ydata = new ArrayList<>(); - //根据区域名称进行匹配 - for (String name : areaCount.keySet()) { - //将监测点的数量拼接在部门下面 - for (String s : lineCount.keySet()) { - if (s.equals(name)) { - xdata.add(name + "\n" + "(" + lineCount.get(s) + ")"); - } - } - - ydata.add(areaCount.get(name)); - } - - String qytj = drawPicUtil.drawEventRegion(xdata, ydata); - createPic(doc, qytj, "" + typeName + "事件图形"); - - - //月份统计 - //创建x,y参数 - List xdata1 = new ArrayList<>(); - List ydata1 = new ArrayList<>(); - List ydata2 = new ArrayList<>(); - for (TimeSVO timeSVO : timeSVoList) { - if ("天数".equals(table)) { - xdata1.add(timeSVO.getFulltime().substring(5)); - } else { - xdata1.add(timeSVO.getFulltime()); - } - ydata1.add(Integer.parseInt(timeSVO.getTimes())); - ydata2.add(timeSVO.getEventAssIndex()); - } - String yftj = drawPicUtil.drawEventAssociatedUnassociated(xdata1, ydata1, ydata2, table); - createPic(doc, yftj, "" + typeName + "事件图形"); - - - //创建电压uiiiuuuu与监测点次数的map集合 - List areaParamList = voltageParamList; - Map lineCount1 = new HashMap<>(); - for (GeneralDeviceDTO generalDeviceDTO : areaParamList) { - lineCount1.put(generalDeviceDTO.getName(), generalDeviceDTO.getLineIndexes().size()); - } - //创建x,y参数 - List xdata3 = new ArrayList<>(); - List ydata3 = new ArrayList<>(); - //根据电压名称进行匹配 - for (String name : voltageCount.keySet()) { - //将监测点的数量拼接在部门下面 - for (String s : lineCount1.keySet()) { - if (s.equals(name)) { - xdata3.add(name + "\n" + "(" + lineCount1.get(s) + ")"); - } - } - ydata3.add(voltageCount.get(name)); - } - - String dydj = drawPicUtil.drawEventVoltageLevel(xdata3, ydata3); - createPic(doc, dydj, "" + typeName + "事件图形"); - - - /** - * =======================================word结束========================================= - */ - } - - } - //3.密度图 - if (areaReportParam.isDensityTable() || areaReportParam.isDensityChart()) { - //暂降密度图形 - AreaTableParam areaTableParam = new AreaTableParam(); + //遍历将集合按名称分开 + for (int i1 = 0; i1 < iEC28VOResult.size(); i1++) { + if ("1>U>=0".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessOneIEC28.add(iEC28VOResult.get(i1)); + } else if ("10>U>=1".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessTenIEC28.add(iEC28VOResult.get(i1)); + } else if ("20>U>=10".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessTwentyIEC28.add(iEC28VOResult.get(i1)); + } else if ("30>U>=20".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessThirtyIEC28.add(iEC28VOResult.get(i1)); + } else if ("40>U>=30".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessFortyIEC28.add(iEC28VOResult.get(i1)); + } else if ("50>U>=40".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessFiftyIEC28.add(iEC28VOResult.get(i1)); + } else if ("60>U>=50".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessSixtyIEC28.add(iEC28VOResult.get(i1)); + } else if ("70>U>=60".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessSeventyIEC28.add(iEC28VOResult.get(i1)); + } else if ("80>U>=70".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessEightyIEC28.add(iEC28VOResult.get(i1)); + } else if ("90>U>=80".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessNinetyIEC28.add(iEC28VOResult.get(i1)); + } else if ("120>U>=110".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredTwentyIEC28.add(iEC28VOResult.get(i1)); + } else if ("130>U>=120".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredThirtyIEC28.add(iEC28VOResult.get(i1)); + } else if ("140>U>=130".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredFortyIEC28.add(iEC28VOResult.get(i1)); + } else if ("150>U>=140".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredFiftyIEC28.add(iEC28VOResult.get(i1)); + } else if ("160>U>=150".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredSixtyIEC28.add(iEC28VOResult.get(i1)); + } else if ("170>U>=160".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredSeventyIEC28.add(iEC28VOResult.get(i1)); + } else { + //放入集合 + lessHundredEightyIEC28.add(iEC28VOResult.get(i1)); - //创建结果集合 - List info = eventDetailList; + } + } - //将sql结果集放入,共用一个sql,减少查询时间 - AreaTableParam areaTableParam1 = new AreaTableParam(); - areaTableParam1.setInfo(info); + //遍历将集合按名称分开 + for (int i1 = 0; i1 < dISDIPVOResult.size(); i1++) { + if ("10%".equals(dISDIPVOResult.get(i1).getName())) { + //放入集合 + equalTenDISDIP.add(dISDIPVOResult.get(i1)); + } else if ("40%".equals(dISDIPVOResult.get(i1).getName())) { + //放入集合 + equalFortyDISDIP.add(dISDIPVOResult.get(i1)); + } else if ("70%".equals(dISDIPVOResult.get(i1).getName())) { + //放入集合 + equalSeventyDISDIP.add(dISDIPVOResult.get(i1)); + } else if ("85%".equals(dISDIPVOResult.get(i1).getName())) { + //放入集合 + equalEightyFiveDISDIP.add(dISDIPVOResult.get(i1)); + } else { + //放入集合 + equalNinetyDISDIP.add(dISDIPVOResult.get(i1)); + } + } - List iEC28VOResult = IEC28Area(areaTableParam1); - List iEC411VOResult = IEC411Area(areaTableParam1); - List dISDIPVOResult = eventDisdipArea(areaTableParam1); + //遍历集合中的参数 + IEC411CountParam iec411LessOne = new IEC411CountParam(); - - //IEC411 <1% 总共集合 - List lessOneIEC411 = new ArrayList<>(); - //IEC411 1~40% 总共集合 - List lessFortyIEC411 = new ArrayList<>(); - //IEC411 40~70% 总共集合 - List lessSeventyIEC411 = new ArrayList<>(); - - - //IEC28 <1% 总共集合 - List lessOneIEC28 = new ArrayList<>(); - //IEC411 <10 总共集合 - List lessTenIEC28 = new ArrayList<>(); - //IEC411 <20 总共集合 - List lessTwentyIEC28 = new ArrayList<>(); - //IEC411 <30 总共集合 - List lessThirtyIEC28 = new ArrayList<>(); - //IEC411 <40 总共集合 - List lessFortyIEC28 = new ArrayList<>(); - //IEC411 <50 总共集合 - List lessFiftyIEC28 = new ArrayList<>(); - //IEC411 <60 总共集合 - List lessSixtyIEC28 = new ArrayList<>(); - //IEC411 <70 总共集合 - List lessSeventyIEC28 = new ArrayList<>(); - //IEC411 <80 总共集合 - List lessEightyIEC28 = new ArrayList<>(); - //IEC411 <90 总共集合 - List lessNinetyIEC28 = new ArrayList<>(); - //IEC411 <120 总共集合 - List lessHundredTwentyIEC28 = new ArrayList<>(); - //IEC411 <130 总共集合 - List lessHundredThirtyIEC28 = new ArrayList<>(); - //IEC411 <140 总共集合 - List lessHundredFortyIEC28 = new ArrayList<>(); - //IEC411 <150 总共集合 - List lessHundredFiftyIEC28 = new ArrayList<>(); - //IEC411 <160 总共集合 - List lessHundredSixtyIEC28 = new ArrayList<>(); - //IEC411 <170 总共集合 - List lessHundredSeventyIEC28 = new ArrayList<>(); - //IEC411 <180 总共集合 - List lessHundredEightyIEC28 = new ArrayList<>(); - - - //DISDIP = 10% - List equalTenDISDIP = new ArrayList<>(); - //DISDIP = 40% - List equalFortyDISDIP = new ArrayList<>(); - //DISDIP = 70% - List equalSeventyDISDIP = new ArrayList<>(); - //DISDIP = 85% - List equalEightyFiveDISDIP = new ArrayList<>(); - //DISDIP = 90% - List equalNinetyDISDIP = new ArrayList<>(); - - - //遍历将集合按名称分开 - for (int i1 = 0; i1 < iEC411VOResult.size(); i1++) { - if ("<1%".equals(iEC411VOResult.get(i1).getName())) { - //放入集合 - lessOneIEC411.add(iEC411VOResult.get(i1)); - } else if ("1~40%".equals(iEC411VOResult.get(i1).getName())) { - //放入集合 - lessFortyIEC411.add(iEC411VOResult.get(i1)); - } else { - //放入集合 - lessSeventyIEC411.add(iEC411VOResult.get(i1)); - } + for (IEC411VO iec411VO : lessOneIEC411) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec411LessOne.getName())) { + iec411LessOne.setName(iec411VO.getName()); } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec411VO.getTenTwentyMs())) { + int tenToTwenty = iec411LessOne.getTenToTwenty(); + iec411LessOne.setTenToTwenty(tenToTwenty++); + } + if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { + int twentyToHundred = iec411LessOne.getTwentyToHundred(); + iec411LessOne.setTenToTwenty(twentyToHundred++); + } + if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { + int zeroOneToZeroTwo = iec411LessOne.getZeroOneToZeroTwo(); + iec411LessOne.setTenToTwenty(zeroOneToZeroTwo++); + } + if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { + int zeroTwoToZeroFive = iec411LessOne.getZeroTwoToZeroFive(); + iec411LessOne.setTenToTwenty(zeroTwoToZeroFive++); + } + if (!"0".equals(iec411VO.getZeroPiontFive1S())) { + int zeroFiveToOne = iec411LessOne.getZeroFiveToOne(); + iec411LessOne.setTenToTwenty(zeroFiveToOne++); + } + if (!"0".equals(iec411VO.getGreater1S())) { + int lessOne = iec411LessOne.getLessOne(); + iec411LessOne.setTenToTwenty(lessOne++); + } + } - //遍历将集合按名称分开 - for (int i1 = 0; i1 < iEC28VOResult.size(); i1++) { - if ("1>U>=0".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessOneIEC28.add(iEC28VOResult.get(i1)); - } else if ("10>U>=1".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessTenIEC28.add(iEC28VOResult.get(i1)); - } else if ("20>U>=10".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessTwentyIEC28.add(iEC28VOResult.get(i1)); - } else if ("30>U>=20".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessThirtyIEC28.add(iEC28VOResult.get(i1)); - } else if ("40>U>=30".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessFortyIEC28.add(iEC28VOResult.get(i1)); - } else if ("50>U>=40".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessFiftyIEC28.add(iEC28VOResult.get(i1)); - } else if ("60>U>=50".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessSixtyIEC28.add(iEC28VOResult.get(i1)); - } else if ("70>U>=60".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessSeventyIEC28.add(iEC28VOResult.get(i1)); - } else if ("80>U>=70".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessEightyIEC28.add(iEC28VOResult.get(i1)); - } else if ("90>U>=80".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessNinetyIEC28.add(iEC28VOResult.get(i1)); - } else if ("120>U>=110".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredTwentyIEC28.add(iEC28VOResult.get(i1)); - } else if ("130>U>=120".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredThirtyIEC28.add(iEC28VOResult.get(i1)); - } else if ("140>U>=130".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredFortyIEC28.add(iEC28VOResult.get(i1)); - } else if ("150>U>=140".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredFiftyIEC28.add(iEC28VOResult.get(i1)); - } else if ("160>U>=150".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredSixtyIEC28.add(iEC28VOResult.get(i1)); - } else if ("170>U>=160".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredSeventyIEC28.add(iEC28VOResult.get(i1)); - } else { - //放入集合 - lessHundredEightyIEC28.add(iEC28VOResult.get(i1)); + //遍历集合中的参数 + IEC411CountParam iec411LessForty = new IEC411CountParam(); - } + for (IEC411VO iec411VO : lessFortyIEC411) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec411LessForty.getName())) { + iec411LessForty.setName(iec411VO.getName()); } - //遍历将集合按名称分开 - for (int i1 = 0; i1 < dISDIPVOResult.size(); i1++) { - if ("10%".equals(dISDIPVOResult.get(i1).getName())) { - //放入集合 - equalTenDISDIP.add(dISDIPVOResult.get(i1)); - } else if ("40%".equals(dISDIPVOResult.get(i1).getName())) { - //放入集合 - equalFortyDISDIP.add(dISDIPVOResult.get(i1)); - } else if ("70%".equals(dISDIPVOResult.get(i1).getName())) { - //放入集合 - equalSeventyDISDIP.add(dISDIPVOResult.get(i1)); - } else if ("85%".equals(dISDIPVOResult.get(i1).getName())) { - //放入集合 - equalEightyFiveDISDIP.add(dISDIPVOResult.get(i1)); - } else { - //放入集合 - equalNinetyDISDIP.add(dISDIPVOResult.get(i1)); - } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec411VO.getTenTwentyMs())) { + int tenToTwenty = iec411LessForty.getTenToTwenty(); + iec411LessForty.setTenToTwenty(tenToTwenty++); + } + if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { + int twentyToHundred = iec411LessForty.getTwentyToHundred(); + iec411LessForty.setTenToTwenty(twentyToHundred++); + } + if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { + int zeroOneToZeroTwo = iec411LessForty.getZeroOneToZeroTwo(); + iec411LessForty.setTenToTwenty(zeroOneToZeroTwo++); + } + if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { + int zeroTwoToZeroFive = iec411LessForty.getZeroTwoToZeroFive(); + iec411LessForty.setTenToTwenty(zeroTwoToZeroFive++); + } + if (!"0".equals(iec411VO.getZeroPiontFive1S())) { + int zeroFiveToOne = iec411LessForty.getZeroFiveToOne(); + iec411LessForty.setTenToTwenty(zeroFiveToOne++); + } + if (!"0".equals(iec411VO.getGreater1S())) { + int lessOne = iec411LessForty.getLessOne(); + iec411LessForty.setTenToTwenty(lessOne++); + } + } + + //遍历集合中的参数 + IEC411CountParam iec411LessSeventy = new IEC411CountParam(); + + for (IEC411VO iec411VO : lessSeventyIEC411) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec411LessSeventy.getName())) { + iec411LessSeventy.setName(iec411VO.getName()); } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec411VO.getTenTwentyMs())) { + int tenToTwenty = iec411LessSeventy.getTenToTwenty(); + iec411LessSeventy.setTenToTwenty(tenToTwenty++); + } + if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { + int twentyToHundred = iec411LessSeventy.getTwentyToHundred(); + iec411LessSeventy.setTenToTwenty(twentyToHundred++); + } + if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { + int zeroOneToZeroTwo = iec411LessSeventy.getZeroOneToZeroTwo(); + iec411LessSeventy.setTenToTwenty(zeroOneToZeroTwo++); + } + if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { + int zeroTwoToZeroFive = iec411LessSeventy.getZeroTwoToZeroFive(); + iec411LessSeventy.setTenToTwenty(zeroTwoToZeroFive++); + } + if (!"0".equals(iec411VO.getZeroPiontFive1S())) { + int zeroFiveToOne = iec411LessSeventy.getZeroFiveToOne(); + iec411LessSeventy.setTenToTwenty(zeroFiveToOne++); + } + if (!"0".equals(iec411VO.getGreater1S())) { + int lessOne = iec411LessSeventy.getLessOne(); + iec411LessSeventy.setTenToTwenty(lessOne++); + } + } - //遍历集合中的参数 - IEC411CountParam iec411LessOne = new IEC411CountParam(); + /** + * ================第一张表结束====================== + */ - for (IEC411VO iec411VO : lessOneIEC411) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec411LessOne.getName())) { - iec411LessOne.setName(iec411VO.getName()); - } + DISDIPCountParam disdipEqualTen = new DISDIPCountParam(); - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec411VO.getTenTwentyMs())) { - int tenToTwenty = iec411LessOne.getTenToTwenty(); - iec411LessOne.setTenToTwenty(tenToTwenty++); - } - if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { - int twentyToHundred = iec411LessOne.getTwentyToHundred(); - iec411LessOne.setTenToTwenty(twentyToHundred++); - } - if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { - int zeroOneToZeroTwo = iec411LessOne.getZeroOneToZeroTwo(); - iec411LessOne.setTenToTwenty(zeroOneToZeroTwo++); - } - if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { - int zeroTwoToZeroFive = iec411LessOne.getZeroTwoToZeroFive(); - iec411LessOne.setTenToTwenty(zeroTwoToZeroFive++); - } - if (!"0".equals(iec411VO.getZeroPiontFive1S())) { - int zeroFiveToOne = iec411LessOne.getZeroFiveToOne(); - iec411LessOne.setTenToTwenty(zeroFiveToOne++); - } - if (!"0".equals(iec411VO.getGreater1S())) { - int lessOne = iec411LessOne.getLessOne(); - iec411LessOne.setTenToTwenty(lessOne++); - } + for (DISDIPVO disdipvo : equalTenDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualTen.getName())) { + disdipEqualTen.setName(disdipvo.getName()); } - //遍历集合中的参数 - IEC411CountParam iec411LessForty = new IEC411CountParam(); + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualTen.getTwenty(); + disdipEqualTen.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualTen.getOneHundredMS(); + disdipEqualTen.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualTen.getFiveHundredMS(); + disdipEqualTen.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualTen.getOne(); + disdipEqualTen.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualTen.getThree(); + disdipEqualTen.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualTen.getTwenty(); + disdipEqualTen.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualTen.getSixty(); + disdipEqualTen.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualTen.getOneHundredAndEighty(); + disdipEqualTen.setOneHundredAndEighty(oneHundredAndEighty++); + } + } - for (IEC411VO iec411VO : lessFortyIEC411) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec411LessForty.getName())) { - iec411LessForty.setName(iec411VO.getName()); - } + DISDIPCountParam disdipEqualForty = new DISDIPCountParam(); - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec411VO.getTenTwentyMs())) { - int tenToTwenty = iec411LessForty.getTenToTwenty(); - iec411LessForty.setTenToTwenty(tenToTwenty++); - } - if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { - int twentyToHundred = iec411LessForty.getTwentyToHundred(); - iec411LessForty.setTenToTwenty(twentyToHundred++); - } - if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { - int zeroOneToZeroTwo = iec411LessForty.getZeroOneToZeroTwo(); - iec411LessForty.setTenToTwenty(zeroOneToZeroTwo++); - } - if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { - int zeroTwoToZeroFive = iec411LessForty.getZeroTwoToZeroFive(); - iec411LessForty.setTenToTwenty(zeroTwoToZeroFive++); - } - if (!"0".equals(iec411VO.getZeroPiontFive1S())) { - int zeroFiveToOne = iec411LessForty.getZeroFiveToOne(); - iec411LessForty.setTenToTwenty(zeroFiveToOne++); - } - if (!"0".equals(iec411VO.getGreater1S())) { - int lessOne = iec411LessForty.getLessOne(); - iec411LessForty.setTenToTwenty(lessOne++); - } + for (DISDIPVO disdipvo : equalFortyDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualForty.getName())) { + disdipEqualForty.setName(disdipvo.getName()); } - //遍历集合中的参数 - IEC411CountParam iec411LessSeventy = new IEC411CountParam(); + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualForty.getTwenty(); + disdipEqualForty.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualForty.getOneHundredMS(); + disdipEqualForty.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualForty.getFiveHundredMS(); + disdipEqualForty.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualForty.getOne(); + disdipEqualForty.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualForty.getThree(); + disdipEqualForty.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualForty.getTwenty(); + disdipEqualForty.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualForty.getSixty(); + disdipEqualForty.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualForty.getOneHundredAndEighty(); + disdipEqualForty.setOneHundredAndEighty(oneHundredAndEighty++); + } + } - for (IEC411VO iec411VO : lessSeventyIEC411) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec411LessSeventy.getName())) { - iec411LessSeventy.setName(iec411VO.getName()); - } + DISDIPCountParam disdipEqualSeventy = new DISDIPCountParam(); - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec411VO.getTenTwentyMs())) { - int tenToTwenty = iec411LessSeventy.getTenToTwenty(); - iec411LessSeventy.setTenToTwenty(tenToTwenty++); - } - if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { - int twentyToHundred = iec411LessSeventy.getTwentyToHundred(); - iec411LessSeventy.setTenToTwenty(twentyToHundred++); - } - if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { - int zeroOneToZeroTwo = iec411LessSeventy.getZeroOneToZeroTwo(); - iec411LessSeventy.setTenToTwenty(zeroOneToZeroTwo++); - } - if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { - int zeroTwoToZeroFive = iec411LessSeventy.getZeroTwoToZeroFive(); - iec411LessSeventy.setTenToTwenty(zeroTwoToZeroFive++); - } - if (!"0".equals(iec411VO.getZeroPiontFive1S())) { - int zeroFiveToOne = iec411LessSeventy.getZeroFiveToOne(); - iec411LessSeventy.setTenToTwenty(zeroFiveToOne++); - } - if (!"0".equals(iec411VO.getGreater1S())) { - int lessOne = iec411LessSeventy.getLessOne(); - iec411LessSeventy.setTenToTwenty(lessOne++); - } + for (DISDIPVO disdipvo : equalSeventyDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualSeventy.getName())) { + disdipEqualSeventy.setName(disdipvo.getName()); } - /** - * ================第一张表结束====================== - */ + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualSeventy.getTwenty(); + disdipEqualSeventy.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualSeventy.getOneHundredMS(); + disdipEqualSeventy.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualSeventy.getFiveHundredMS(); + disdipEqualSeventy.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualSeventy.getOne(); + disdipEqualSeventy.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualSeventy.getThree(); + disdipEqualSeventy.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualSeventy.getTwenty(); + disdipEqualSeventy.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualSeventy.getSixty(); + disdipEqualSeventy.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualSeventy.getOneHundredAndEighty(); + disdipEqualSeventy.setOneHundredAndEighty(oneHundredAndEighty++); + } + } - DISDIPCountParam disdipEqualTen = new DISDIPCountParam(); + DISDIPCountParam disdipEqualEighty = new DISDIPCountParam(); - for (DISDIPVO disdipvo : equalTenDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualTen.getName())) { - disdipEqualTen.setName(disdipvo.getName()); - } - - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualTen.getTwenty(); - disdipEqualTen.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualTen.getOneHundredMS(); - disdipEqualTen.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualTen.getFiveHundredMS(); - disdipEqualTen.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualTen.getOne(); - disdipEqualTen.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualTen.getThree(); - disdipEqualTen.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualTen.getTwenty(); - disdipEqualTen.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualTen.getSixty(); - disdipEqualTen.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualTen.getOneHundredAndEighty(); - disdipEqualTen.setOneHundredAndEighty(oneHundredAndEighty++); - } + for (DISDIPVO disdipvo : equalEightyFiveDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualEighty.getName())) { + disdipEqualEighty.setName(disdipvo.getName()); } - DISDIPCountParam disdipEqualForty = new DISDIPCountParam(); + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualEighty.getTwenty(); + disdipEqualEighty.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualEighty.getOneHundredMS(); + disdipEqualEighty.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualEighty.getFiveHundredMS(); + disdipEqualEighty.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualEighty.getOne(); + disdipEqualEighty.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualEighty.getThree(); + disdipEqualEighty.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualEighty.getTwenty(); + disdipEqualEighty.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualEighty.getSixty(); + disdipEqualEighty.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualEighty.getOneHundredAndEighty(); + disdipEqualEighty.setOneHundredAndEighty(oneHundredAndEighty++); + } + } + DISDIPCountParam disdipEqualNinety = new DISDIPCountParam(); - for (DISDIPVO disdipvo : equalFortyDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualForty.getName())) { - disdipEqualForty.setName(disdipvo.getName()); - } - - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualForty.getTwenty(); - disdipEqualForty.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualForty.getOneHundredMS(); - disdipEqualForty.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualForty.getFiveHundredMS(); - disdipEqualForty.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualForty.getOne(); - disdipEqualForty.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualForty.getThree(); - disdipEqualForty.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualForty.getTwenty(); - disdipEqualForty.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualForty.getSixty(); - disdipEqualForty.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualForty.getOneHundredAndEighty(); - disdipEqualForty.setOneHundredAndEighty(oneHundredAndEighty++); - } + for (DISDIPVO disdipvo : equalNinetyDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualNinety.getName())) { + disdipEqualNinety.setName(disdipvo.getName()); } - DISDIPCountParam disdipEqualSeventy = new DISDIPCountParam(); + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualNinety.getTwenty(); + disdipEqualNinety.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualNinety.getOneHundredMS(); + disdipEqualNinety.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualNinety.getFiveHundredMS(); + disdipEqualNinety.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualNinety.getOne(); + disdipEqualNinety.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualNinety.getThree(); + disdipEqualNinety.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualNinety.getTwenty(); + disdipEqualNinety.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualNinety.getSixty(); + disdipEqualNinety.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualNinety.getOneHundredAndEighty(); + disdipEqualNinety.setOneHundredAndEighty(oneHundredAndEighty++); + } + } - for (DISDIPVO disdipvo : equalSeventyDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualSeventy.getName())) { - disdipEqualSeventy.setName(disdipvo.getName()); - } + /** + * ======================第二张表结束============================== + */ - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualSeventy.getTwenty(); - disdipEqualSeventy.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualSeventy.getOneHundredMS(); - disdipEqualSeventy.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualSeventy.getFiveHundredMS(); - disdipEqualSeventy.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualSeventy.getOne(); - disdipEqualSeventy.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualSeventy.getThree(); - disdipEqualSeventy.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualSeventy.getTwenty(); - disdipEqualSeventy.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualSeventy.getSixty(); - disdipEqualSeventy.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualSeventy.getOneHundredAndEighty(); - disdipEqualSeventy.setOneHundredAndEighty(oneHundredAndEighty++); + //创建计数对象 + IEC28CountParam iec28CountLessOne = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessOneIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessOne.getName())) { + iec28CountLessOne.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessOne.getZeroZeroTwoToZeroOne(); + iec28CountLessOne.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessOne.getZeroOneToZeroTwentyFive(); + iec28CountLessOne.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessOne.getZeroTwentyFiveToZeroFive(); + iec28CountLessOne.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessOne.getZeroFiveToOne(); + iec28CountLessOne.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessOne.getOneToThree(); + iec28CountLessOne.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessOne.getThreeToTwenty(); + iec28CountLessOne.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessOne.getTwentyToSixty(); + iec28CountLessOne.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessOne.getSixtyToOneHundredAndEighty(); + iec28CountLessOne.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessTen = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessTenIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessTen.getName())) { + iec28CountLessTen.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessTen.getZeroZeroTwoToZeroOne(); + iec28CountLessTen.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessTen.getZeroOneToZeroTwentyFive(); + iec28CountLessTen.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessTen.getZeroTwentyFiveToZeroFive(); + iec28CountLessTen.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessTen.getZeroFiveToOne(); + iec28CountLessTen.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessTen.getOneToThree(); + iec28CountLessTen.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessTen.getThreeToTwenty(); + iec28CountLessTen.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessTen.getTwentyToSixty(); + iec28CountLessTen.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessTen.getSixtyToOneHundredAndEighty(); + iec28CountLessTen.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessTwenty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessTwentyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessTwenty.getName())) { + iec28CountLessTwenty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessTwenty.getZeroZeroTwoToZeroOne(); + iec28CountLessTwenty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessTwenty.getZeroOneToZeroTwentyFive(); + iec28CountLessTwenty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessTwenty.getZeroTwentyFiveToZeroFive(); + iec28CountLessTwenty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessTwenty.getZeroFiveToOne(); + iec28CountLessTwenty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessTwenty.getOneToThree(); + iec28CountLessTwenty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessTwenty.getThreeToTwenty(); + iec28CountLessTwenty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessTwenty.getTwentyToSixty(); + iec28CountLessTwenty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessTwenty.getSixtyToOneHundredAndEighty(); + iec28CountLessTwenty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessThirty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessThirtyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessThirty.getName())) { + iec28CountLessThirty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessThirty.getZeroZeroTwoToZeroOne(); + iec28CountLessThirty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessThirty.getZeroOneToZeroTwentyFive(); + iec28CountLessThirty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessThirty.getZeroTwentyFiveToZeroFive(); + iec28CountLessThirty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessThirty.getZeroFiveToOne(); + iec28CountLessThirty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessThirty.getOneToThree(); + iec28CountLessThirty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessThirty.getThreeToTwenty(); + iec28CountLessThirty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessThirty.getTwentyToSixty(); + iec28CountLessThirty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessThirty.getSixtyToOneHundredAndEighty(); + iec28CountLessThirty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessForty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessFortyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessForty.getName())) { + iec28CountLessForty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessForty.getZeroZeroTwoToZeroOne(); + iec28CountLessForty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessForty.getZeroOneToZeroTwentyFive(); + iec28CountLessForty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessForty.getZeroTwentyFiveToZeroFive(); + iec28CountLessForty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessForty.getZeroFiveToOne(); + iec28CountLessForty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessForty.getOneToThree(); + iec28CountLessForty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessForty.getThreeToTwenty(); + iec28CountLessForty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessForty.getTwentyToSixty(); + iec28CountLessForty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessForty.getSixtyToOneHundredAndEighty(); + iec28CountLessForty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessFifty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessFiftyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessFifty.getName())) { + iec28CountLessFifty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessFifty.getZeroZeroTwoToZeroOne(); + iec28CountLessFifty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessFifty.getZeroOneToZeroTwentyFive(); + iec28CountLessFifty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessFifty.getZeroTwentyFiveToZeroFive(); + iec28CountLessFifty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessFifty.getZeroFiveToOne(); + iec28CountLessFifty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessFifty.getOneToThree(); + iec28CountLessFifty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessFifty.getThreeToTwenty(); + iec28CountLessFifty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessFifty.getTwentyToSixty(); + iec28CountLessFifty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessFifty.getSixtyToOneHundredAndEighty(); + iec28CountLessFifty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessSixty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessSixtyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessSixty.getName())) { + iec28CountLessSixty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessSixty.getZeroZeroTwoToZeroOne(); + iec28CountLessSixty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessSixty.getZeroOneToZeroTwentyFive(); + iec28CountLessSixty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessSixty.getZeroTwentyFiveToZeroFive(); + iec28CountLessSixty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessSixty.getZeroFiveToOne(); + iec28CountLessSixty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessSixty.getOneToThree(); + iec28CountLessSixty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessSixty.getThreeToTwenty(); + iec28CountLessSixty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessSixty.getTwentyToSixty(); + iec28CountLessSixty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessSixty.getSixtyToOneHundredAndEighty(); + iec28CountLessSixty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessSeventy = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessSeventyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessSeventy.getName())) { + iec28CountLessSeventy.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessSeventy.getZeroZeroTwoToZeroOne(); + iec28CountLessSeventy.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessSeventy.getZeroOneToZeroTwentyFive(); + iec28CountLessSeventy.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessSeventy.getZeroTwentyFiveToZeroFive(); + iec28CountLessSeventy.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessSeventy.getZeroFiveToOne(); + iec28CountLessSeventy.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessSeventy.getOneToThree(); + iec28CountLessSeventy.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessSeventy.getThreeToTwenty(); + iec28CountLessSeventy.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessSeventy.getTwentyToSixty(); + iec28CountLessSeventy.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessSeventy.getSixtyToOneHundredAndEighty(); + iec28CountLessSeventy.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessEighty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessEightyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessEighty.getName())) { + iec28CountLessEighty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessEighty.getZeroZeroTwoToZeroOne(); + iec28CountLessEighty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessEighty.getZeroOneToZeroTwentyFive(); + iec28CountLessEighty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessEighty.getZeroTwentyFiveToZeroFive(); + iec28CountLessEighty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessEighty.getZeroFiveToOne(); + iec28CountLessEighty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessEighty.getOneToThree(); + iec28CountLessEighty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessEighty.getThreeToTwenty(); + iec28CountLessEighty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessEighty.getTwentyToSixty(); + iec28CountLessEighty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessEighty.getSixtyToOneHundredAndEighty(); + iec28CountLessEighty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + //创建计数对象 + IEC28CountParam iec28CountLessNinety = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessNinetyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessNinety.getName())) { + iec28CountLessNinety.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessNinety.getZeroZeroTwoToZeroOne(); + iec28CountLessNinety.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessNinety.getZeroOneToZeroTwentyFive(); + iec28CountLessNinety.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessNinety.getZeroTwentyFiveToZeroFive(); + iec28CountLessNinety.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessNinety.getZeroFiveToOne(); + iec28CountLessNinety.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessNinety.getOneToThree(); + iec28CountLessNinety.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessNinety.getThreeToTwenty(); + iec28CountLessNinety.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessNinety.getTwentyToSixty(); + iec28CountLessNinety.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessNinety.getSixtyToOneHundredAndEighty(); + iec28CountLessNinety.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + //创建计数对象 + IEC28CountParam iec28CountLessHundredTwenty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredTwentyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredTwenty.getName())) { + iec28CountLessHundredTwenty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredTwenty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredTwenty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredTwenty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredTwenty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredTwenty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredTwenty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredTwenty.getZeroFiveToOne(); + iec28CountLessHundredTwenty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredTwenty.getOneToThree(); + iec28CountLessHundredTwenty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredTwenty.getThreeToTwenty(); + iec28CountLessHundredTwenty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredTwenty.getTwentyToSixty(); + iec28CountLessHundredTwenty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredTwenty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredTwenty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredThirty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredThirtyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredThirty.getName())) { + iec28CountLessHundredThirty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredThirty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredThirty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredThirty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredThirty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredThirty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredThirty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredThirty.getZeroFiveToOne(); + iec28CountLessHundredThirty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredThirty.getOneToThree(); + iec28CountLessHundredThirty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredThirty.getThreeToTwenty(); + iec28CountLessHundredThirty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredThirty.getTwentyToSixty(); + iec28CountLessHundredThirty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredThirty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredThirty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + //创建计数对象 + IEC28CountParam iec28CountLessHundredForty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredFortyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredForty.getName())) { + iec28CountLessHundredForty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredForty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredForty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredForty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredForty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredForty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredForty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredForty.getZeroFiveToOne(); + iec28CountLessHundredForty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredForty.getOneToThree(); + iec28CountLessHundredForty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredForty.getThreeToTwenty(); + iec28CountLessHundredForty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredForty.getTwentyToSixty(); + iec28CountLessHundredForty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredForty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredForty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredFifty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredFiftyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredFifty.getName())) { + iec28CountLessHundredFifty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredFifty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredFifty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredFifty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredFifty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredFifty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredFifty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredFifty.getZeroFiveToOne(); + iec28CountLessHundredFifty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredFifty.getOneToThree(); + iec28CountLessHundredFifty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredFifty.getThreeToTwenty(); + iec28CountLessHundredFifty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredFifty.getTwentyToSixty(); + iec28CountLessHundredFifty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredFifty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredFifty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredSixty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredSixtyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredSixty.getName())) { + iec28CountLessHundredSixty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredSixty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredSixty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredSixty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredSixty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredSixty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredSixty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredSixty.getZeroFiveToOne(); + iec28CountLessHundredSixty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredSixty.getOneToThree(); + iec28CountLessHundredSixty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredSixty.getThreeToTwenty(); + iec28CountLessHundredSixty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredSixty.getTwentyToSixty(); + iec28CountLessHundredSixty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredSixty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredSixty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredSeventy = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredSeventyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredSeventy.getName())) { + iec28CountLessHundredSeventy.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredSeventy.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredSeventy.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredSeventy.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredSeventy.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredSeventy.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredSeventy.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredSeventy.getZeroFiveToOne(); + iec28CountLessHundredSeventy.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredSeventy.getOneToThree(); + iec28CountLessHundredSeventy.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredSeventy.getThreeToTwenty(); + iec28CountLessHundredSeventy.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredSeventy.getTwentyToSixty(); + iec28CountLessHundredSeventy.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredSeventy.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredSeventy.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredEighty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredEightyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredEighty.getName())) { + iec28CountLessHundredEighty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredEighty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredEighty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredEighty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredEighty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredEighty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredEighty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredEighty.getZeroFiveToOne(); + iec28CountLessHundredEighty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredEighty.getOneToThree(); + iec28CountLessHundredEighty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredEighty.getThreeToTwenty(); + iec28CountLessHundredEighty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredEighty.getTwentyToSixty(); + iec28CountLessHundredEighty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredEighty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredEighty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + /** + * =========================第三张表结束=============================== + */ + + + //汇总放入集合 + List iec411Result = new ArrayList<>(); + iec411Result.add(iec411LessOne); + iec411Result.add(iec411LessForty); + iec411Result.add(iec411LessSeventy); + + List disdipResult = new ArrayList<>(); + disdipResult.add(disdipEqualTen); + disdipResult.add(disdipEqualForty); + disdipResult.add(disdipEqualSeventy); + disdipResult.add(disdipEqualEighty); + disdipResult.add(disdipEqualNinety); + + List iec28Result = new ArrayList<>(); + iec28Result.add(iec28CountLessOne); + iec28Result.add(iec28CountLessTen); + iec28Result.add(iec28CountLessTwenty); + iec28Result.add(iec28CountLessThirty); + iec28Result.add(iec28CountLessForty); + iec28Result.add(iec28CountLessFifty); + iec28Result.add(iec28CountLessSixty); + iec28Result.add(iec28CountLessSeventy); + iec28Result.add(iec28CountLessEighty); + iec28Result.add(iec28CountLessNinety); + iec28Result.add(iec28CountLessHundredTwenty); + iec28Result.add(iec28CountLessHundredThirty); + iec28Result.add(iec28CountLessHundredForty); + iec28Result.add(iec28CountLessHundredFifty); + iec28Result.add(iec28CountLessHundredSixty); + iec28Result.add(iec28CountLessHundredSeventy); + iec28Result.add(iec28CountLessHundredEighty); + + + Map resultMap = new HashMap<>(); + + for (int i = 0; i < iec28Result.size(); i++) { + + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getSixtyToOneHundredAndEighty()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getOneToThree()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroFiveToOne()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroOneToZeroTwentyFive()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroTwentyFiveToZeroFive()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getThreeToTwenty()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getTwentyToSixty()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroZeroTwoToZeroOne()); + } + + //todo 还要对集合中哪个次数最多挑出第一位 + Map linkMap = getSort(resultMap); + + //存放结果的集合 + List resultList = new ArrayList(); + + for (String s : linkMap.keySet()) { + resultList.add(s); + resultList.add(linkMap.get(s).toString()); + } + + //最多暂降事件名称 + for (int i = 0; i < iec28Result.size(); i++) { + if (iec28Result.get(i).getName().equals(resultList.get(0))) { + if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroZeroTwoToZeroOne()))) { + resultList.add("0.02~0.1"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroOneToZeroTwentyFive()))) { + resultList.add("0.1~0.25"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroTwentyFiveToZeroFive()))) { + resultList.add("0.25~0.5"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroFiveToOne()))) { + resultList.add("0.5~1"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getOneToThree()))) { + resultList.add("1~3"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getThreeToTwenty()))) { + resultList.add("3~20"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getTwentyToSixty()))) { + resultList.add("20~60"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getSixtyToOneHundredAndEighty()))) { + resultList.add("60~180"); + break; } } + } + //System.out.println(resultList); - DISDIPCountParam disdipEqualEighty = new DISDIPCountParam(); - for (DISDIPVO disdipvo : equalEightyFiveDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualEighty.getName())) { - disdipEqualEighty.setName(disdipvo.getName()); - } + //3.1密度密度表格 + if (areaReportParam.isDensityTable()) { + //创建表题计数 + int twoCount = 1; - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualEighty.getTwenty(); - disdipEqualEighty.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualEighty.getOneHundredMS(); - disdipEqualEighty.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualEighty.getFiveHundredMS(); - disdipEqualEighty.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualEighty.getOne(); - disdipEqualEighty.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualEighty.getThree(); - disdipEqualEighty.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualEighty.getTwenty(); - disdipEqualEighty.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualEighty.getSixty(); - disdipEqualEighty.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualEighty.getOneHundredAndEighty(); - disdipEqualEighty.setOneHundredAndEighty(oneHundredAndEighty++); - } - } - DISDIPCountParam disdipEqualNinety = new DISDIPCountParam(); + //同步给暂降密度图 + oneCount4 = oneCount; - for (DISDIPVO disdipvo : equalNinetyDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualNinety.getName())) { - disdipEqualNinety.setName(disdipvo.getName()); - } + createTitle(doc, "4." + oneCount + " " + typeName + "密度", "标题 2", 200, 11); - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualNinety.getTwenty(); - disdipEqualNinety.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualNinety.getOneHundredMS(); - disdipEqualNinety.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualNinety.getFiveHundredMS(); - disdipEqualNinety.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualNinety.getOne(); - disdipEqualNinety.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualNinety.getThree(); - disdipEqualNinety.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualNinety.getTwenty(); - disdipEqualNinety.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualNinety.getSixty(); - disdipEqualNinety.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualNinety.getOneHundredAndEighty(); - disdipEqualNinety.setOneHundredAndEighty(oneHundredAndEighty++); - } + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + typeName + "密度统计可以从幅值和持续时间两个维度直接地反映" + typeName + "事件发生情况,主要反应事件的发生次数," + + "中国电网在所选择的分析时间内" + typeName + "事件主要集中在幅值为" + resultList.get(0) + ",持续时间为" + resultList.get(2) + "[根据 IEC 61000-2-8:(公共电网电压" + typeName + "测量统计)算出" + typeName + "事件发生最多的区间],具体见表(图):"); + r12.setFontSize(11);//字体大小 + + + createTitle(doc, "4." + oneCount + "." + twoCount + " DISDIP表格:国际发配电联盟(UNIPEDE)", "标题 3", 400, 11); + + //第一张表 + XWPFTable monitorInfo = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "剩余电压", "20ms", "100ms", "500ms", "1s", "3s", "20s", "60s", "180s"); + + + //塞入数据 + for (int i = 0; i < disdipResult.size(); i++) { + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, disdipResult.get(i).getName(), String.valueOf(disdipResult.get(i).getTwentyMS()), + String.valueOf(disdipResult.get(i).getOneHundredMS()), String.valueOf(disdipResult.get(i).getFiveHundredMS()), String.valueOf(disdipResult.get(i).getOne()), String.valueOf(disdipResult.get(i).getThree()), + String.valueOf(disdipResult.get(i).getTwenty()), String.valueOf(disdipResult.get(i).getSixty()), String.valueOf(disdipResult.get(i).getOneHundredAndEighty())); } - /** - * ======================第二张表结束============================== - */ + twoCount++; - //创建计数对象 - IEC28CountParam iec28CountLessOne = new IEC28CountParam(); - for (IEC28VO iec28VO : lessOneIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessOne.getName())) { - iec28CountLessOne.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessOne.getZeroZeroTwoToZeroOne(); - iec28CountLessOne.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessOne.getZeroOneToZeroTwentyFive(); - iec28CountLessOne.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessOne.getZeroTwentyFiveToZeroFive(); - iec28CountLessOne.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessOne.getZeroFiveToOne(); - iec28CountLessOne.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessOne.getOneToThree(); - iec28CountLessOne.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessOne.getThreeToTwenty(); - iec28CountLessOne.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessOne.getTwentyToSixty(); - iec28CountLessOne.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessOne.getSixtyToOneHundredAndEighty(); - iec28CountLessOne.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } + createTitle(doc, "4." + oneCount + "." + twoCount + " IEC 61000-4-11:(用电终端的电压" + typeName + "抗度)", "标题 3", 400, 11); + + //第二张表 + XWPFTable monitorInfo1 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph1 = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, true, "剩余电压", "10~20ms", "20~100ms", "0.1~0.2s", "0.2~0.5s", "0.5~1s", ">1s"); + + + //塞入数据 + for (int i = 0; i < iec411Result.size(); i++) { + insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, false, iec411Result.get(i).getName(), String.valueOf(iec411Result.get(i).getTenToTwenty()), String.valueOf(iec411Result.get(i).getTwentyToHundred()), + String.valueOf(iec411Result.get(i).getZeroOneToZeroTwo()), String.valueOf(iec411Result.get(i).getZeroTwoToZeroFive()), String.valueOf(iec411Result.get(i).getZeroFiveToOne()), String.valueOf(iec411Result.get(i).getLessOne())); } - - //创建计数对象 - IEC28CountParam iec28CountLessTen = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessTenIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessTen.getName())) { - iec28CountLessTen.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessTen.getZeroZeroTwoToZeroOne(); - iec28CountLessTen.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessTen.getZeroOneToZeroTwentyFive(); - iec28CountLessTen.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessTen.getZeroTwentyFiveToZeroFive(); - iec28CountLessTen.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessTen.getZeroFiveToOne(); - iec28CountLessTen.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessTen.getOneToThree(); - iec28CountLessTen.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessTen.getThreeToTwenty(); - iec28CountLessTen.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessTen.getTwentyToSixty(); - iec28CountLessTen.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessTen.getSixtyToOneHundredAndEighty(); - iec28CountLessTen.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } + twoCount++; - //创建计数对象 - IEC28CountParam iec28CountLessTwenty = new IEC28CountParam(); + createTitle(doc, "4." + oneCount + "." + twoCount + " IEC 61000-2-8:(公共电网电压" + typeName + "测量统计)", "标题 3", 400, 11); - for (IEC28VO iec28VO : lessTwentyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessTwenty.getName())) { - iec28CountLessTwenty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessTwenty.getZeroZeroTwoToZeroOne(); - iec28CountLessTwenty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessTwenty.getZeroOneToZeroTwentyFive(); - iec28CountLessTwenty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessTwenty.getZeroTwentyFiveToZeroFive(); - iec28CountLessTwenty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessTwenty.getZeroFiveToOne(); - iec28CountLessTwenty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessTwenty.getOneToThree(); - iec28CountLessTwenty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessTwenty.getThreeToTwenty(); - iec28CountLessTwenty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessTwenty.getTwentyToSixty(); - iec28CountLessTwenty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessTwenty.getSixtyToOneHundredAndEighty(); - iec28CountLessTwenty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } + //第二张表 + XWPFTable monitorInfo2 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "剩余电压", "0.02~0.1s", "0.1~0.25s", "0.25~0.5s", "0.5~1s", "1~3s", "3~20s", "20~60s", "60~180s"); - //创建计数对象 - IEC28CountParam iec28CountLessThirty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessThirtyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessThirty.getName())) { - iec28CountLessThirty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessThirty.getZeroZeroTwoToZeroOne(); - iec28CountLessThirty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessThirty.getZeroOneToZeroTwentyFive(); - iec28CountLessThirty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessThirty.getZeroTwentyFiveToZeroFive(); - iec28CountLessThirty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessThirty.getZeroFiveToOne(); - iec28CountLessThirty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessThirty.getOneToThree(); - iec28CountLessThirty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessThirty.getThreeToTwenty(); - iec28CountLessThirty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessThirty.getTwentyToSixty(); - iec28CountLessThirty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessThirty.getSixtyToOneHundredAndEighty(); - iec28CountLessThirty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessForty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessFortyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessForty.getName())) { - iec28CountLessForty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessForty.getZeroZeroTwoToZeroOne(); - iec28CountLessForty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessForty.getZeroOneToZeroTwentyFive(); - iec28CountLessForty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessForty.getZeroTwentyFiveToZeroFive(); - iec28CountLessForty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessForty.getZeroFiveToOne(); - iec28CountLessForty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessForty.getOneToThree(); - iec28CountLessForty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessForty.getThreeToTwenty(); - iec28CountLessForty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessForty.getTwentyToSixty(); - iec28CountLessForty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessForty.getSixtyToOneHundredAndEighty(); - iec28CountLessForty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessFifty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessFiftyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessFifty.getName())) { - iec28CountLessFifty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessFifty.getZeroZeroTwoToZeroOne(); - iec28CountLessFifty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessFifty.getZeroOneToZeroTwentyFive(); - iec28CountLessFifty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessFifty.getZeroTwentyFiveToZeroFive(); - iec28CountLessFifty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessFifty.getZeroFiveToOne(); - iec28CountLessFifty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessFifty.getOneToThree(); - iec28CountLessFifty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessFifty.getThreeToTwenty(); - iec28CountLessFifty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessFifty.getTwentyToSixty(); - iec28CountLessFifty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessFifty.getSixtyToOneHundredAndEighty(); - iec28CountLessFifty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessSixty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessSixtyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessSixty.getName())) { - iec28CountLessSixty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessSixty.getZeroZeroTwoToZeroOne(); - iec28CountLessSixty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessSixty.getZeroOneToZeroTwentyFive(); - iec28CountLessSixty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessSixty.getZeroTwentyFiveToZeroFive(); - iec28CountLessSixty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessSixty.getZeroFiveToOne(); - iec28CountLessSixty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessSixty.getOneToThree(); - iec28CountLessSixty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessSixty.getThreeToTwenty(); - iec28CountLessSixty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessSixty.getTwentyToSixty(); - iec28CountLessSixty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessSixty.getSixtyToOneHundredAndEighty(); - iec28CountLessSixty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessSeventy = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessSeventyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessSeventy.getName())) { - iec28CountLessSeventy.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessSeventy.getZeroZeroTwoToZeroOne(); - iec28CountLessSeventy.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessSeventy.getZeroOneToZeroTwentyFive(); - iec28CountLessSeventy.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessSeventy.getZeroTwentyFiveToZeroFive(); - iec28CountLessSeventy.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessSeventy.getZeroFiveToOne(); - iec28CountLessSeventy.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessSeventy.getOneToThree(); - iec28CountLessSeventy.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessSeventy.getThreeToTwenty(); - iec28CountLessSeventy.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessSeventy.getTwentyToSixty(); - iec28CountLessSeventy.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessSeventy.getSixtyToOneHundredAndEighty(); - iec28CountLessSeventy.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessEighty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessEightyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessEighty.getName())) { - iec28CountLessEighty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessEighty.getZeroZeroTwoToZeroOne(); - iec28CountLessEighty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessEighty.getZeroOneToZeroTwentyFive(); - iec28CountLessEighty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessEighty.getZeroTwentyFiveToZeroFive(); - iec28CountLessEighty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessEighty.getZeroFiveToOne(); - iec28CountLessEighty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessEighty.getOneToThree(); - iec28CountLessEighty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessEighty.getThreeToTwenty(); - iec28CountLessEighty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessEighty.getTwentyToSixty(); - iec28CountLessEighty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessEighty.getSixtyToOneHundredAndEighty(); - iec28CountLessEighty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - //创建计数对象 - IEC28CountParam iec28CountLessNinety = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessNinetyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessNinety.getName())) { - iec28CountLessNinety.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessNinety.getZeroZeroTwoToZeroOne(); - iec28CountLessNinety.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessNinety.getZeroOneToZeroTwentyFive(); - iec28CountLessNinety.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessNinety.getZeroTwentyFiveToZeroFive(); - iec28CountLessNinety.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessNinety.getZeroFiveToOne(); - iec28CountLessNinety.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessNinety.getOneToThree(); - iec28CountLessNinety.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessNinety.getThreeToTwenty(); - iec28CountLessNinety.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessNinety.getTwentyToSixty(); - iec28CountLessNinety.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessNinety.getSixtyToOneHundredAndEighty(); - iec28CountLessNinety.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - //创建计数对象 - IEC28CountParam iec28CountLessHundredTwenty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredTwentyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredTwenty.getName())) { - iec28CountLessHundredTwenty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredTwenty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredTwenty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredTwenty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredTwenty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredTwenty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredTwenty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredTwenty.getZeroFiveToOne(); - iec28CountLessHundredTwenty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredTwenty.getOneToThree(); - iec28CountLessHundredTwenty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredTwenty.getThreeToTwenty(); - iec28CountLessHundredTwenty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredTwenty.getTwentyToSixty(); - iec28CountLessHundredTwenty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredTwenty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredTwenty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredThirty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredThirtyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredThirty.getName())) { - iec28CountLessHundredThirty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredThirty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredThirty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredThirty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredThirty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredThirty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredThirty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredThirty.getZeroFiveToOne(); - iec28CountLessHundredThirty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredThirty.getOneToThree(); - iec28CountLessHundredThirty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredThirty.getThreeToTwenty(); - iec28CountLessHundredThirty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredThirty.getTwentyToSixty(); - iec28CountLessHundredThirty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredThirty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredThirty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - //创建计数对象 - IEC28CountParam iec28CountLessHundredForty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredFortyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredForty.getName())) { - iec28CountLessHundredForty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredForty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredForty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredForty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredForty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredForty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredForty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredForty.getZeroFiveToOne(); - iec28CountLessHundredForty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredForty.getOneToThree(); - iec28CountLessHundredForty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredForty.getThreeToTwenty(); - iec28CountLessHundredForty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredForty.getTwentyToSixty(); - iec28CountLessHundredForty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredForty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredForty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredFifty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredFiftyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredFifty.getName())) { - iec28CountLessHundredFifty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredFifty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredFifty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredFifty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredFifty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredFifty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredFifty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredFifty.getZeroFiveToOne(); - iec28CountLessHundredFifty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredFifty.getOneToThree(); - iec28CountLessHundredFifty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredFifty.getThreeToTwenty(); - iec28CountLessHundredFifty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredFifty.getTwentyToSixty(); - iec28CountLessHundredFifty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredFifty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredFifty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredSixty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredSixtyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredSixty.getName())) { - iec28CountLessHundredSixty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredSixty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredSixty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredSixty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredSixty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredSixty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredSixty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredSixty.getZeroFiveToOne(); - iec28CountLessHundredSixty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredSixty.getOneToThree(); - iec28CountLessHundredSixty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredSixty.getThreeToTwenty(); - iec28CountLessHundredSixty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredSixty.getTwentyToSixty(); - iec28CountLessHundredSixty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredSixty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredSixty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredSeventy = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredSeventyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredSeventy.getName())) { - iec28CountLessHundredSeventy.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredSeventy.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredSeventy.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredSeventy.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredSeventy.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredSeventy.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredSeventy.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredSeventy.getZeroFiveToOne(); - iec28CountLessHundredSeventy.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredSeventy.getOneToThree(); - iec28CountLessHundredSeventy.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredSeventy.getThreeToTwenty(); - iec28CountLessHundredSeventy.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredSeventy.getTwentyToSixty(); - iec28CountLessHundredSeventy.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredSeventy.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredSeventy.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredEighty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredEightyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredEighty.getName())) { - iec28CountLessHundredEighty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredEighty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredEighty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredEighty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredEighty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredEighty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredEighty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredEighty.getZeroFiveToOne(); - iec28CountLessHundredEighty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredEighty.getOneToThree(); - iec28CountLessHundredEighty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredEighty.getThreeToTwenty(); - iec28CountLessHundredEighty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredEighty.getTwentyToSixty(); - iec28CountLessHundredEighty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredEighty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredEighty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - /** - * =========================第三张表结束=============================== - */ - - - //汇总放入集合 - List iec411Result = new ArrayList<>(); - iec411Result.add(iec411LessOne); - iec411Result.add(iec411LessForty); - iec411Result.add(iec411LessSeventy); - - List disdipResult = new ArrayList<>(); - disdipResult.add(disdipEqualTen); - disdipResult.add(disdipEqualForty); - disdipResult.add(disdipEqualSeventy); - disdipResult.add(disdipEqualEighty); - disdipResult.add(disdipEqualNinety); - - List iec28Result = new ArrayList<>(); - iec28Result.add(iec28CountLessOne); - iec28Result.add(iec28CountLessTen); - iec28Result.add(iec28CountLessTwenty); - iec28Result.add(iec28CountLessThirty); - iec28Result.add(iec28CountLessForty); - iec28Result.add(iec28CountLessFifty); - iec28Result.add(iec28CountLessSixty); - iec28Result.add(iec28CountLessSeventy); - iec28Result.add(iec28CountLessEighty); - iec28Result.add(iec28CountLessNinety); - iec28Result.add(iec28CountLessHundredTwenty); - iec28Result.add(iec28CountLessHundredThirty); - iec28Result.add(iec28CountLessHundredForty); - iec28Result.add(iec28CountLessHundredFifty); - iec28Result.add(iec28CountLessHundredSixty); - iec28Result.add(iec28CountLessHundredSeventy); - iec28Result.add(iec28CountLessHundredEighty); - - - Map resultMap = new HashMap<>(); - + //塞入数据 for (int i = 0; i < iec28Result.size(); i++) { - - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getSixtyToOneHundredAndEighty()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getOneToThree()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroFiveToOne()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroOneToZeroTwentyFive()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroTwentyFiveToZeroFive()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getThreeToTwenty()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getTwentyToSixty()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroZeroTwoToZeroOne()); + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, iec28Result.get(i).getName(), String.valueOf(iec28Result.get(i).getZeroZeroTwoToZeroOne()), String.valueOf(iec28Result.get(i).getZeroOneToZeroTwentyFive()), + String.valueOf(iec28Result.get(i).getZeroTwentyFiveToZeroFive()), String.valueOf(iec28Result.get(i).getZeroFiveToOne()), String.valueOf(iec28Result.get(i).getOneToThree()), String.valueOf(iec28Result.get(i).getThreeToTwenty()), + String.valueOf(iec28Result.get(i).getTwentyToSixty()), String.valueOf(iec28Result.get(i).getSixtyToOneHundredAndEighty())); } - //todo 还要对集合中哪个次数最多挑出第一位 - Map linkMap = getSort(resultMap); + //同步给暂降密度表格 + twoCount1 = twoCount; + //序号计数进行++ + oneCount++; + } - //存放结果的集合 - List resultList = new ArrayList(); + //3.2暂降密度图表 + if (areaReportParam.isDensityChart()) { - for (String s : linkMap.keySet()) { - resultList.add(s); - resultList.add(linkMap.get(s).toString()); - } - - //最多暂降事件名称 - for (int i = 0; i < iec28Result.size(); i++) { - if (iec28Result.get(i).getName().equals(resultList.get(0))) { - if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroZeroTwoToZeroOne()))) { - resultList.add("0.02~0.1"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroOneToZeroTwentyFive()))) { - resultList.add("0.1~0.25"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroTwentyFiveToZeroFive()))) { - resultList.add("0.25~0.5"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroFiveToOne()))) { - resultList.add("0.5~1"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getOneToThree()))) { - resultList.add("1~3"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getThreeToTwenty()))) { - resultList.add("3~20"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getTwentyToSixty()))) { - resultList.add("20~60"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getSixtyToOneHundredAndEighty()))) { - resultList.add("60~180"); - break; - } - } - } - //System.out.println(resultList); - - - //3.1密度密度表格 + //如果暂降幅值被勾选,就不需要进行写段落 if (areaReportParam.isDensityTable()) { - //创建表题计数 + twoCount1++; + + //如果幅值图存在与幅值的序号保持同步 + createTitle(doc, "4." + oneCount4 + "." + twoCount1 + " " + typeName + "密度图", "标题 3", 400, 11); + + //代码 + List eventDetails = BeanUtil.copyToList(info, EventDetail.class); + Integer[][] eventDensityData = eventReportService.getCoords(eventDetails); + String str = drawPicUtil.drawEventDensity(eventDensityData); + createPic(doc, str, "" + typeName + "密度图形"); + } else { int twoCount = 1; - - //同步给暂降密度图 - oneCount4 = oneCount; - createTitle(doc, "4." + oneCount + " " + typeName + "密度", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 @@ -4166,138 +4248,129 @@ public class ReportServiceImpl implements ReportService { r12.setFontSize(11);//字体大小 - createTitle(doc, "4." + oneCount + "." + twoCount + " DISDIP表格:国际发配电联盟(UNIPEDE)", "标题 3", 400, 11); - - //第一张表 - XWPFTable monitorInfo = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "剩余电压", "20ms", "100ms", "500ms", "1s", "3s", "20s", "60s", "180s"); + createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "密度图", "标题 3", 400, 11); - //塞入数据 - for (int i = 0; i < disdipResult.size(); i++) { - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, disdipResult.get(i).getName(), String.valueOf(disdipResult.get(i).getTwentyMS()), - String.valueOf(disdipResult.get(i).getOneHundredMS()), String.valueOf(disdipResult.get(i).getFiveHundredMS()), String.valueOf(disdipResult.get(i).getOne()), String.valueOf(disdipResult.get(i).getThree()), - String.valueOf(disdipResult.get(i).getTwenty()), String.valueOf(disdipResult.get(i).getSixty()), String.valueOf(disdipResult.get(i).getOneHundredAndEighty())); - } + //代码 + List eventDetails = BeanUtil.copyToList(info, EventDetail.class); + Integer[][] eventDensityData = eventReportService.getCoords(eventDetails); + String str = drawPicUtil.drawEventDensity(eventDensityData); + createPic(doc, str, "" + typeName + "密度图形"); - twoCount++; - - - createTitle(doc, "4." + oneCount + "." + twoCount + " IEC 61000-4-11:(用电终端的电压" + typeName + "抗度)", "标题 3", 400, 11); - - //第二张表 - XWPFTable monitorInfo1 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph1 = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, true, "剩余电压", "10~20ms", "20~100ms", "0.1~0.2s", "0.2~0.5s", "0.5~1s", ">1s"); - - - //塞入数据 - for (int i = 0; i < iec411Result.size(); i++) { - insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, false, iec411Result.get(i).getName(), String.valueOf(iec411Result.get(i).getTenToTwenty()), String.valueOf(iec411Result.get(i).getTwentyToHundred()), - String.valueOf(iec411Result.get(i).getZeroOneToZeroTwo()), String.valueOf(iec411Result.get(i).getZeroTwoToZeroFive()), String.valueOf(iec411Result.get(i).getZeroFiveToOne()), String.valueOf(iec411Result.get(i).getLessOne())); - } - - twoCount++; - - - createTitle(doc, "4." + oneCount + "." + twoCount + " IEC 61000-2-8:(公共电网电压" + typeName + "测量统计)", "标题 3", 400, 11); - - //第二张表 - XWPFTable monitorInfo2 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "剩余电压", "0.02~0.1s", "0.1~0.25s", "0.25~0.5s", "0.5~1s", "1~3s", "3~20s", "20~60s", "60~180s"); - - - //塞入数据 - for (int i = 0; i < iec28Result.size(); i++) { - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, iec28Result.get(i).getName(), String.valueOf(iec28Result.get(i).getZeroZeroTwoToZeroOne()), String.valueOf(iec28Result.get(i).getZeroOneToZeroTwentyFive()), - String.valueOf(iec28Result.get(i).getZeroTwentyFiveToZeroFive()), String.valueOf(iec28Result.get(i).getZeroFiveToOne()), String.valueOf(iec28Result.get(i).getOneToThree()), String.valueOf(iec28Result.get(i).getThreeToTwenty()), - String.valueOf(iec28Result.get(i).getTwentyToSixty()), String.valueOf(iec28Result.get(i).getSixtyToOneHundredAndEighty())); - } - - //同步给暂降密度表格 - twoCount1 = twoCount; //序号计数进行++ oneCount++; } + } + } - //3.2暂降密度图表 - if (areaReportParam.isDensityChart()) { + //4.itic图 + if (areaReportParam.isItic()) { + //itic图 + List detailList = eventDetailList; - //如果暂降幅值被勾选,就不需要进行写段落 - if (areaReportParam.isDensityTable()) { - twoCount1++; + List obs = new ArrayList<>(); + ArrayList> list = new ArrayList<>(); + for (EventDetailNew eventDetail : detailList) { + obs.add(new OB(Double.parseDouble(eventDetail.getDuration() / 1000 + "") + , Double.parseDouble(eventDetail.getFeatureAmplitude() * 100 + ""))); - //如果幅值图存在与幅值的序号保持同步 - createTitle(doc, "4." + oneCount4 + "." + twoCount1 + " " + typeName + "密度图", "标题 3", 400, 11); - - //代码 - List eventDetails = BeanUtil.copyToList(info, EventDetail.class); - Integer[][] eventDensityData = eventReportService.getCoords(eventDetails); - String str = drawPicUtil.drawEventDensity(eventDensityData); - createPic(doc, str, "" + typeName + "密度图形"); - } else { - int twoCount = 1; - createTitle(doc, "4." + oneCount + " " + typeName + "密度", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + typeName + "密度统计可以从幅值和持续时间两个维度直接地反映" + typeName + "事件发生情况,主要反应事件的发生次数," + - "中国电网在所选择的分析时间内" + typeName + "事件主要集中在幅值为" + resultList.get(0) + ",持续时间为" + resultList.get(2) + "[根据 IEC 61000-2-8:(公共电网电压" + typeName + "测量统计)算出" + typeName + "事件发生最多的区间],具体见表(图):"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "密度图", "标题 3", 400, 11); - - - //代码 - List eventDetails = BeanUtil.copyToList(info, EventDetail.class); - Integer[][] eventDensityData = eventReportService.getCoords(eventDetails); - String str = drawPicUtil.drawEventDensity(eventDensityData); - createPic(doc, str, "" + typeName + "密度图形"); - - //序号计数进行++ - oneCount++; - } - } + ArrayList doubles = new ArrayList<>(); + doubles.add(Double.parseDouble(eventDetail.getDuration() / 1000 + "")); + doubles.add(Double.parseDouble(String.valueOf(eventDetail.getFeatureAmplitude() * 100))); + list.add(doubles); } - //4.itic图 + List result = getITICArea(obs); + + /** + * =========================续写word文档============================================== + */ + //创建表题计数 + int twoCount = 1; + + oneCount3 = oneCount; + + createTitle(doc, "4." + oneCount3 + " " + typeName + "事件点图", "标题 2", 200, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + typeName + "事件点图统计分成ITIC曲线和F47曲线展示。"); + r12.setFontSize(11);//字体大小 + + + createTitle(doc, "4." + oneCount3 + "." + twoCount + " ITIC 曲线", "标题 3", 400, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r13 = p.createRun();//创建段落文本 + r13.setText(" ITIC曲线中可容忍" + typeName + "记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); + r13.setFontSize(11);//字体大小 + + + String itic = drawPicUtil.drawItic(list); + createPic(doc, itic, "ITIC曲线"); + + + twoCount5 = twoCount; + //序号计数进行++ + oneCount++; + + /** + * =======================================word结束========================================= + */ + + + } + + //5.f47图 + if (areaReportParam.isF47()) { + //f47图 + List detailList = eventDetailList; + + List obs = new ArrayList<>(); + + ArrayList> list = new ArrayList<>(); + for (EventDetailNew eventDetail : detailList) { + obs.add(new OB(Double.parseDouble(eventDetail.getDuration() / 1000 + ""), Double.parseDouble(eventDetail.getFeatureAmplitude() * 100 + ""))); + + ArrayList doubles = new ArrayList<>(); + doubles.add(Double.parseDouble(eventDetail.getDuration() / 1000 + "")); + doubles.add(Double.parseDouble(String.valueOf(eventDetail.getFeatureAmplitude() * 100))); + list.add(doubles); + } + + + List result = getF47Area(obs); + + /** + * =========================续写word文档============================================== + */ + if (areaReportParam.isItic()) { - //itic图 - List detailList = eventDetailList; + twoCount5++; - List obs = new ArrayList<>(); - ArrayList> list = new ArrayList<>(); - for (EventDetailNew eventDetail : detailList) { - obs.add(new OB(Double.parseDouble(eventDetail.getDuration() / 1000 + "") - , Double.parseDouble(eventDetail.getFeatureAmplitude() * 100 + ""))); + createTitle(doc, "4." + oneCount3 + "." + twoCount5 + " F47 曲线", "标题 3", 400, 11); - ArrayList doubles = new ArrayList<>(); - doubles.add(Double.parseDouble(eventDetail.getDuration() / 1000 + "")); - doubles.add(Double.parseDouble(String.valueOf(eventDetail.getFeatureAmplitude() * 100))); - list.add(doubles); - } + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r13 = p.createRun();//创建段落文本 + r13.setText(" F47曲线中可容忍" + typeName + "记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); + r13.setFontSize(11);//字体大小 - List result = getITICArea(obs); + String f47 = drawPicUtil.drawF47(list); + createPic(doc, f47, "SEMI F47曲线"); /** - * =========================续写word文档============================================== + * =======================================word结束========================================= */ + } else { //创建表题计数 int twoCount = 1; oneCount3 = oneCount; - createTitle(doc, "4." + oneCount3 + " " + typeName + "事件点图", "标题 2", 200, 11); + createTitle(doc, "4." + oneCount + " " + typeName + "事件点图", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); @@ -4306,205 +4379,259 @@ public class ReportServiceImpl implements ReportService { r12.setFontSize(11);//字体大小 - createTitle(doc, "4." + oneCount3 + "." + twoCount + " ITIC 曲线", "标题 3", 400, 11); + createTitle(doc, "4." + oneCount + "." + twoCount + " F47 曲线", "标题 3", 400, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); XWPFRun r13 = p.createRun();//创建段落文本 - r13.setText(" ITIC曲线中可容忍" + typeName + "记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); + r13.setText(" F47曲线中可容忍" + typeName + "降记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); r13.setFontSize(11);//字体大小 - String itic = drawPicUtil.drawItic(list); - createPic(doc, itic, "ITIC曲线"); + String f47 = drawPicUtil.drawF47(list); + createPic(doc, f47, "SEMI F47曲线"); - twoCount5 = twoCount; //序号计数进行++ oneCount++; /** * =======================================word结束========================================= */ - - } - //5.f47图 - if (areaReportParam.isF47()) { - //f47图 - List detailList = eventDetailList; - List obs = new ArrayList<>(); + } - ArrayList> list = new ArrayList<>(); - for (EventDetailNew eventDetail : detailList) { - obs.add(new OB(Double.parseDouble(eventDetail.getDuration() / 1000 + ""), Double.parseDouble(eventDetail.getFeatureAmplitude() * 100 + ""))); + //6.暂降增幅 + if (areaReportParam.isSagAmplitude()) { + //暂降分布幅值 + //创建结果集合 + List info = eventDetailList; - ArrayList doubles = new ArrayList<>(); - doubles.add(Double.parseDouble(eventDetail.getDuration() / 1000 + "")); - doubles.add(Double.parseDouble(String.valueOf(eventDetail.getFeatureAmplitude() * 100))); - list.add(doubles); + //将sql结果集放入,共用一个sql,减少查询时间 + AreaTableParam areaTableParam1 = new AreaTableParam(); + areaTableParam1.setStartTime(areaReportParam.getSearchBeginTime()); + areaTableParam1.setEndTime(areaReportParam.getSearchEndTime()); + areaTableParam1.setInfo(info); + ProbabilityVO probabilityDistributionArea = getProbabilityDistributionArea(areaTableParam1); + + + List eventvalue = probabilityDistributionArea.getEventvalue(); + + List amplitudeList = new ArrayList<>(); + + List xName = new ArrayList<>(); + xName.add("0"); + xName.add("10%"); + xName.add("20%"); + xName.add("30%"); + xName.add("40%"); + xName.add("50%"); + xName.add("60%"); + xName.add("70%"); + xName.add("80%"); + xName.add("90%"); + //将幅值绑定对应的x值,放入集合 + for (int i = 0; i < eventvalue.size(); i++) { + AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); + amplitudeCountParam.setXName(xName.get(i)); + amplitudeCountParam.setYValue(eventvalue.get(i)); + amplitudeList.add(amplitudeCountParam); + } + //存储幅值结果集合 + List amplitudeResult = new ArrayList<>(); + for (int i = 1; i < amplitudeList.size(); i++) { + if (!amplitudeList.get(i).getYValue().equals(amplitudeList.get(i - 1).getYValue())) { + amplitudeResult.add(amplitudeList.get(i - 1).getXName()); + amplitudeResult.add(amplitudeList.get(i).getXName()); + break; + } else if (amplitudeList.get(0).getYValue().equals(amplitudeList.get(amplitudeList.size() - 1).getYValue())) { + amplitudeResult.add(amplitudeList.get(0).getXName()); + amplitudeResult.add(amplitudeList.get(amplitudeList.size() - 1).getXName()); + break; } - - - List result = getF47Area(obs); - - /** - * =========================续写word文档============================================== - */ - - if (areaReportParam.isItic()) { - twoCount5++; - - createTitle(doc, "4." + oneCount3 + "." + twoCount5 + " F47 曲线", "标题 3", 400, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r13 = p.createRun();//创建段落文本 - r13.setText(" F47曲线中可容忍" + typeName + "记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); - r13.setFontSize(11);//字体大小 - - String f47 = drawPicUtil.drawF47(list); - createPic(doc, f47, "SEMI F47曲线"); - - /** - * =======================================word结束========================================= - */ - } else { - //创建表题计数 - int twoCount = 1; - - oneCount3 = oneCount; - - createTitle(doc, "4." + oneCount + " " + typeName + "事件点图", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + typeName + "事件点图统计分成ITIC曲线和F47曲线展示。"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " F47 曲线", "标题 3", 400, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r13 = p.createRun();//创建段落文本 - r13.setText(" F47曲线中可容忍" + typeName + "降记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); - r13.setFontSize(11);//字体大小 - - - String f47 = drawPicUtil.drawF47(list); - createPic(doc, f47, "SEMI F47曲线"); - - - //序号计数进行++ - oneCount++; - - /** - * =======================================word结束========================================= - */ - } - - } - //6.暂降增幅 + + List eventvalue1 = probabilityDistributionArea.getSisttime(); + + List amplitudeList1 = new ArrayList<>(); + + List xName1 = new ArrayList<>(); + xName1.add("0.01"); + xName1.add("0.1"); + xName1.add("0.25"); + xName1.add("0.5"); + xName1.add("1"); + xName1.add("3"); + xName1.add("20"); + xName1.add("60"); + xName1.add("180"); + //将幅值绑定对应的x值,放入集合 + for (int i = 0; i < eventvalue1.size(); i++) { + AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); + amplitudeCountParam.setXName(xName1.get(i)); + amplitudeCountParam.setYValue(eventvalue1.get(i)); + amplitudeList1.add(amplitudeCountParam); + } + //存储幅值结果集合 + List amplitudeResult1 = new ArrayList<>(); + for (int i = 1; i < amplitudeList1.size(); i++) { + if (!amplitudeList1.get(i).getYValue().equals(amplitudeList1.get(i - 1).getYValue())) { + amplitudeResult1.add(amplitudeList1.get(i - 1).getXName()); + amplitudeResult1.add(amplitudeList1.get(i).getXName()); + break; + } else if (amplitudeList1.get(0).getYValue().equals(amplitudeList1.get(amplitudeList1.size() - 1).getYValue())) { + amplitudeResult1.add(amplitudeList1.get(0).getXName()); + amplitudeResult1.add(amplitudeList1.get(amplitudeList1.size() - 1).getXName()); + break; + } + } + + + /** + * =========================续写word文档============================================== + */ + //创建表题计数 + int twoCount = 1; + + oneCount2 = oneCount; + + createTitle(doc, "4." + oneCount2 + " " + typeName + "幅值概率分布图", "标题 2", 200, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + typeName + "概率分布图分成" + typeName + "幅值概率分布和持续时间概率分布图,中国电网在所选择的分析时间内" + typeName + "事件从幅值概率分布统计主要集中在幅值为" + amplitudeResult.get(0) + "~" + amplitudeResult.get(1) + "之间," + + "从持续时间统计主要集中在持续时间为" + amplitudeResult1.get(0) + "~" + amplitudeResult1.get(1) + "[持续时间排序,选择" + typeName + "记录发生最多的区域],如下表(图):"); + r12.setFontSize(11);//字体大小 + + + createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "幅值的概率分布", "标题 3", 400, 11); + + + List ybardata = probabilityDistributionArea.getPereventvalue(); + List ylinedata = probabilityDistributionArea.getEventvalue(); + String fz = drawPicUtil.drawEventAmplitude(ylinedata, ybardata); + createPic(doc, fz, "" + typeName + "幅值的概率分布"); + + + //序号计数进行++ + oneCount++; + + /** + * =======================================word结束========================================= + */ + + } + + //7.暂降持续时间 + if (areaReportParam.isDuration()) { + + //持续时间概率分布 + AreaTableParam areaTableParam = new AreaTableParam(); + + //创建结果集合 + List info = eventDetailList; + + //将sql结果集放入,共用一个sql,减少查询时间 + AreaTableParam areaTableParam1 = new AreaTableParam(); + areaTableParam1.setInfo(info); + ProbabilityVO probabilityDistributionArea = getProbabilityDistributionArea(areaTableParam1); + + List eventvalue = probabilityDistributionArea.getEventvalue(); + List amplitudeList = new ArrayList<>(); + + List xName = new ArrayList<>(); + xName.add("0"); + xName.add("10%"); + xName.add("20%"); + xName.add("30%"); + xName.add("40%"); + xName.add("50%"); + xName.add("60%"); + xName.add("70%"); + xName.add("80%"); + xName.add("90%"); + //将幅值绑定对应的x值,放入集合 + for (int i = 0; i < eventvalue.size(); i++) { + AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); + amplitudeCountParam.setXName(xName.get(i)); + amplitudeCountParam.setYValue(eventvalue.get(i)); + amplitudeList.add(amplitudeCountParam); + } + //存储幅值结果集合 + List amplitudeResult = new ArrayList<>(); + for (int i = 1; i < amplitudeList.size(); i++) { + if (!amplitudeList.get(i).getYValue().equals(amplitudeList.get(i - 1).getYValue())) { + amplitudeResult.add(amplitudeList.get(i - 1).getXName()); + amplitudeResult.add(amplitudeList.get(i).getXName()); + break; + } else if (amplitudeList.get(0).getYValue().equals(amplitudeList.get(amplitudeList.size() - 1).getYValue())) { + amplitudeResult.add(amplitudeList.get(0).getXName()); + amplitudeResult.add(amplitudeList.get(amplitudeList.size() - 1).getXName()); + break; + } + } + + + List eventvalue1 = probabilityDistributionArea.getSisttime(); + + List amplitudeList1 = new ArrayList<>(); + + List xName1 = new ArrayList<>(); + xName1.add("0.01"); + xName1.add("0.1"); + xName1.add("0.25"); + xName1.add("0.5"); + xName1.add("1"); + xName1.add("3"); + xName1.add("20"); + xName1.add("60"); + xName1.add("180"); + //将幅值绑定对应的x值,放入集合 + for (int i = 0; i < eventvalue1.size(); i++) { + AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); + amplitudeCountParam.setXName(xName1.get(i)); + amplitudeCountParam.setYValue(eventvalue1.get(i)); + amplitudeList1.add(amplitudeCountParam); + } + //存储幅值结果集合 + List amplitudeResult1 = new ArrayList<>(); + for (int i = 1; i < amplitudeList1.size(); i++) { + if (!amplitudeList1.get(i).getYValue().equals(amplitudeList1.get(i - 1).getYValue())) { + amplitudeResult1.add(amplitudeList1.get(i - 1).getXName()); + amplitudeResult1.add(amplitudeList1.get(i).getXName()); + break; + } else if (amplitudeList1.get(0).getYValue().equals(amplitudeList1.get(amplitudeList1.size() - 1).getYValue())) { + amplitudeResult1.add(amplitudeList1.get(0).getXName()); + amplitudeResult1.add(amplitudeList1.get(amplitudeList1.size() - 1).getXName()); + break; + } + } + /** + * =========================续写word文档============================================== + */ + + //创建表题计数 + int twoCount = 1; + + //如果暂降幅值被勾选,就不需要进行写段落 if (areaReportParam.isSagAmplitude()) { - //暂降分布幅值 - //创建结果集合 - List info = eventDetailList; + twoCount++; - //将sql结果集放入,共用一个sql,减少查询时间 - AreaTableParam areaTableParam1 = new AreaTableParam(); - areaTableParam1.setStartTime(areaReportParam.getSearchBeginTime()); - areaTableParam1.setEndTime(areaReportParam.getSearchEndTime()); - areaTableParam1.setInfo(info); - ProbabilityVO probabilityDistributionArea = getProbabilityDistributionArea(areaTableParam1); + //如果幅值图存在与幅值的序号保持同步 + createTitle(doc, "4." + oneCount2 + "." + twoCount + " 持续时间的概率分函数", "标题 3", 400, 11); - List eventvalue = probabilityDistributionArea.getEventvalue(); - - List amplitudeList = new ArrayList<>(); - - List xName = new ArrayList<>(); - xName.add("0"); - xName.add("10%"); - xName.add("20%"); - xName.add("30%"); - xName.add("40%"); - xName.add("50%"); - xName.add("60%"); - xName.add("70%"); - xName.add("80%"); - xName.add("90%"); - //将幅值绑定对应的x值,放入集合 - for (int i = 0; i < eventvalue.size(); i++) { - AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); - amplitudeCountParam.setXName(xName.get(i)); - amplitudeCountParam.setYValue(eventvalue.get(i)); - amplitudeList.add(amplitudeCountParam); - } - //存储幅值结果集合 - List amplitudeResult = new ArrayList<>(); - for (int i = 1; i < amplitudeList.size(); i++) { - if (!amplitudeList.get(i).getYValue().equals(amplitudeList.get(i - 1).getYValue())) { - amplitudeResult.add(amplitudeList.get(i - 1).getXName()); - amplitudeResult.add(amplitudeList.get(i).getXName()); - break; - } else if (amplitudeList.get(0).getYValue().equals(amplitudeList.get(amplitudeList.size() - 1).getYValue())) { - amplitudeResult.add(amplitudeList.get(0).getXName()); - amplitudeResult.add(amplitudeList.get(amplitudeList.size() - 1).getXName()); - break; - } - } + List ybardata = probabilityDistributionArea.getPersisttime(); + List ylinedata = probabilityDistributionArea.getSisttime(); + String sj = drawPicUtil.drawPersistentTime(ylinedata, ybardata); + createPic(doc, sj, "持续时间的概率分布函数"); - List eventvalue1 = probabilityDistributionArea.getSisttime(); - - List amplitudeList1 = new ArrayList<>(); - - List xName1 = new ArrayList<>(); - xName1.add("0.01"); - xName1.add("0.1"); - xName1.add("0.25"); - xName1.add("0.5"); - xName1.add("1"); - xName1.add("3"); - xName1.add("20"); - xName1.add("60"); - xName1.add("180"); - //将幅值绑定对应的x值,放入集合 - for (int i = 0; i < eventvalue1.size(); i++) { - AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); - amplitudeCountParam.setXName(xName1.get(i)); - amplitudeCountParam.setYValue(eventvalue1.get(i)); - amplitudeList1.add(amplitudeCountParam); - } - //存储幅值结果集合 - List amplitudeResult1 = new ArrayList<>(); - for (int i = 1; i < amplitudeList1.size(); i++) { - if (!amplitudeList1.get(i).getYValue().equals(amplitudeList1.get(i - 1).getYValue())) { - amplitudeResult1.add(amplitudeList1.get(i - 1).getXName()); - amplitudeResult1.add(amplitudeList1.get(i).getXName()); - break; - } else if (amplitudeList1.get(0).getYValue().equals(amplitudeList1.get(amplitudeList1.size() - 1).getYValue())) { - amplitudeResult1.add(amplitudeList1.get(0).getXName()); - amplitudeResult1.add(amplitudeList1.get(amplitudeList1.size() - 1).getXName()); - break; - } - } - - - /** - * =========================续写word文档============================================== - */ - //创建表题计数 - int twoCount = 1; - - oneCount2 = oneCount; - + } else { createTitle(doc, "4." + oneCount2 + " " + typeName + "幅值概率分布图", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 @@ -4515,254 +4642,178 @@ public class ReportServiceImpl implements ReportService { r12.setFontSize(11);//字体大小 - createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "幅值的概率分布", "标题 3", 400, 11); + createTitle(doc, "4." + oneCount + "." + twoCount + " 时序时间的概率分函数", "标题 3", 400, 11); - List ybardata = probabilityDistributionArea.getPereventvalue(); - List ylinedata = probabilityDistributionArea.getEventvalue(); - String fz = drawPicUtil.drawEventAmplitude(ylinedata, ybardata); - createPic(doc, fz, "" + typeName + "幅值的概率分布"); + List ybardata = probabilityDistributionArea.getPersisttime(); + List ylinedata = probabilityDistributionArea.getSisttime(); + String sj = drawPicUtil.drawPersistentTime(ylinedata, ybardata); + createPic(doc, sj, "持续时间的概率分布函数"); //序号计数进行++ oneCount++; + } + /** + * =======================================word结束========================================= + */ + } - /** - * =======================================word结束========================================= - */ + //8.事件关联统计表格 + if (areaReportParam.isEventRelevanceCountTable()) { + //事件关联统计表格 + int resultCount = 0; + List resultList = new ArrayList<>(); + + List eventList = eventDetailList.stream().filter(e -> StrUtil.isNotBlank(e.getEventassIndex())).collect(Collectors.toList()); + + if (CollectionUtil.isNotEmpty(eventList)) { + //记录条数 + resultCount = eventList.size(); + List ids = eventList.stream().map(EventDetailNew::getEventassIndex).collect(Collectors.toList()); + List eventAssList = eventDetailMapper.ListEventass(ids); + + for (Eventass eventass : eventAssList) { + EventassCountParam eventassCountParam = new EventassCountParam(); + String dateTime = LocalDateTimeUtil.format(eventass.getTimeId(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")); + eventassCountParam.setAssTime(dateTime); + //获取时间 + eventassCountParam.setEventTime(dateTime); + eventassCountParam.setDescribe(eventass.getContentDes()); + resultList.add(eventassCountParam); + } } - //7.暂降持续时间 - if (areaReportParam.isDuration()) { + createTitle(doc, "4." + oneCount + " 事件关联分析", "标题 2", 200, 11); - //持续时间概率分布 - AreaTableParam areaTableParam = new AreaTableParam(); + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + //归一化需要高级算法,先字符串代替 + r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条,归一化统计后共" + resultCount + "[此为归一化后的暂态事件结果]条,,具体如下图所示:"); + r12.setFontSize(11);//字体大小 - //创建结果集合 - List info = eventDetailList; - //将sql结果集放入,共用一个sql,减少查询时间 - AreaTableParam areaTableParam1 = new AreaTableParam(); - areaTableParam1.setInfo(info); - ProbabilityVO probabilityDistributionArea = getProbabilityDistributionArea(areaTableParam1); + //第三张表 + XWPFTable monitorInfo2 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); - List eventvalue = probabilityDistributionArea.getEventvalue(); - List amplitudeList = new ArrayList<>(); + // 表格第一行 + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "时间", "事件关联分析名称", "事件关联分析表述"); - List xName = new ArrayList<>(); - xName.add("0"); - xName.add("10%"); - xName.add("20%"); - xName.add("30%"); - xName.add("40%"); - xName.add("50%"); - xName.add("60%"); - xName.add("70%"); - xName.add("80%"); - xName.add("90%"); - //将幅值绑定对应的x值,放入集合 - for (int i = 0; i < eventvalue.size(); i++) { - AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); - amplitudeCountParam.setXName(xName.get(i)); - amplitudeCountParam.setYValue(eventvalue.get(i)); - amplitudeList.add(amplitudeCountParam); - } - //存储幅值结果集合 - List amplitudeResult = new ArrayList<>(); - for (int i = 1; i < amplitudeList.size(); i++) { - if (!amplitudeList.get(i).getYValue().equals(amplitudeList.get(i - 1).getYValue())) { - amplitudeResult.add(amplitudeList.get(i - 1).getXName()); - amplitudeResult.add(amplitudeList.get(i).getXName()); - break; - } else if (amplitudeList.get(0).getYValue().equals(amplitudeList.get(amplitudeList.size() - 1).getYValue())) { - amplitudeResult.add(amplitudeList.get(0).getXName()); - amplitudeResult.add(amplitudeList.get(amplitudeList.size() - 1).getXName()); - break; - } + + //塞入数据 + for (int i = 0; i < resultList.size(); i++) { + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, resultList.get(i).getAssTime(), resultList.get(i).getEventTime(), resultList.get(i).getDescribe()); + } + //序号计数进行++ + oneCount++; + + /** + * =======================================word结束========================================= + */ + + } + + //9.暂降原因表和暂降原因图形生成 + if (areaReportParam.isEventReasonTable() || areaReportParam.isEventReasonChart()) { + //查询字典表 + List reasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData(); + + //新建map集合装入参数 + Map reasonMap = reasonList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); + + //获得所有值 + Set typeSet = reasonMap.keySet(); + List listReason = new ArrayList<>(typeSet); + + //创建Map结果集合 + Map resultMap = new HashMap<>(); + + //优化数据(根据暂降原因,进行分组统计有多少条数据,key:暂降原因id,value:次数) + Map reasonMapCount = eventDetailList.stream() + .filter(x -> StrUtil.isNotBlank(x.getAdvanceReason())) + .collect(Collectors.groupingBy(EventDetailNew::getAdvanceReason, Collectors.counting())); + //将数据重新整合为(key:暂降原因的名称,value:暂降原因测次数) + reasonMap.forEach((key, value) -> { + if (reasonMapCount.containsKey(key)) { + resultMap.put(value, Math.toIntExact(reasonMapCount.get(key))); + } else { + resultMap.put(value, 0); } + }); + //todo 还要对集合中哪个次数最多挑出第一位 + //获取entrySet + Map linkMap = getSort(resultMap); + //最多暂降事件名称 + Set topSet = linkMap.keySet(); + List topList = new ArrayList<>(topSet); - List eventvalue1 = probabilityDistributionArea.getSisttime(); - - List amplitudeList1 = new ArrayList<>(); - - List xName1 = new ArrayList<>(); - xName1.add("0.01"); - xName1.add("0.1"); - xName1.add("0.25"); - xName1.add("0.5"); - xName1.add("1"); - xName1.add("3"); - xName1.add("20"); - xName1.add("60"); - xName1.add("180"); - //将幅值绑定对应的x值,放入集合 - for (int i = 0; i < eventvalue1.size(); i++) { - AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); - amplitudeCountParam.setXName(xName1.get(i)); - amplitudeCountParam.setYValue(eventvalue1.get(i)); - amplitudeList1.add(amplitudeCountParam); - } - //存储幅值结果集合 - List amplitudeResult1 = new ArrayList<>(); - for (int i = 1; i < amplitudeList1.size(); i++) { - if (!amplitudeList1.get(i).getYValue().equals(amplitudeList1.get(i - 1).getYValue())) { - amplitudeResult1.add(amplitudeList1.get(i - 1).getXName()); - amplitudeResult1.add(amplitudeList1.get(i).getXName()); - break; - } else if (amplitudeList1.get(0).getYValue().equals(amplitudeList1.get(amplitudeList1.size() - 1).getYValue())) { - amplitudeResult1.add(amplitudeList1.get(0).getXName()); - amplitudeResult1.add(amplitudeList1.get(amplitudeList1.size() - 1).getXName()); - break; - } - } - /** - * =========================续写word文档============================================== - */ - + //暂降原因表格 + if (areaReportParam.isEventReasonTable()) { + //暂降原因表格 //创建表题计数 int twoCount = 1; - //如果暂降幅值被勾选,就不需要进行写段落 - if (areaReportParam.isSagAmplitude()) { - twoCount++; - - //如果幅值图存在与幅值的序号保持同步 - createTitle(doc, "4." + oneCount2 + "." + twoCount + " 持续时间的概率分函数", "标题 3", 400, 11); - - - List ybardata = probabilityDistributionArea.getPersisttime(); - List ylinedata = probabilityDistributionArea.getSisttime(); - String sj = drawPicUtil.drawPersistentTime(ylinedata, ybardata); - createPic(doc, sj, "持续时间的概率分布函数"); - - - } else { - createTitle(doc, "4." + oneCount2 + " " + typeName + "幅值概率分布图", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + typeName + "概率分布图分成" + typeName + "幅值概率分布和持续时间概率分布图,中国电网在所选择的分析时间内" + typeName + "事件从幅值概率分布统计主要集中在幅值为" + amplitudeResult.get(0) + "~" + amplitudeResult.get(1) + "之间," + - "从持续时间统计主要集中在持续时间为" + amplitudeResult1.get(0) + "~" + amplitudeResult1.get(1) + "[持续时间排序,选择" + typeName + "记录发生最多的区域],如下表(图):"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " 时序时间的概率分函数", "标题 3", 400, 11); - - - List ybardata = probabilityDistributionArea.getPersisttime(); - List ylinedata = probabilityDistributionArea.getSisttime(); - String sj = drawPicUtil.drawPersistentTime(ylinedata, ybardata); - createPic(doc, sj, "持续时间的概率分布函数"); - - - //序号计数进行++ - oneCount++; - } - /** - * =======================================word结束========================================= - */ - } - - //8.事件关联统计表格 - if (areaReportParam.isEventRelevanceCountTable()) { - //事件关联统计表格 - - int resultCount = 0; - List resultList = new ArrayList<>(); - - List eventList = eventDetailList.stream().filter(e ->StrUtil.isNotBlank(e.getEventassIndex())).collect(Collectors.toList()); - - if (CollectionUtil.isNotEmpty(eventList)) { - //记录条数 - resultCount= eventList.size(); - List ids = eventList.stream().map(EventDetailNew::getEventassIndex).collect(Collectors.toList()); - List eventAssList = eventDetailMapper.ListEventass(ids); - - for (Eventass eventass : eventAssList) { - EventassCountParam eventassCountParam = new EventassCountParam(); - String dateTime = LocalDateTimeUtil.format(eventass.getTimeId(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")); - eventassCountParam.setAssTime(dateTime); - //获取时间 - eventassCountParam.setEventTime(dateTime); - eventassCountParam.setDescribe(eventass.getContentDes()); - resultList.add(eventassCountParam); - } - } - - createTitle(doc, "4." + oneCount + " 事件关联分析", "标题 2", 200, 11); + oneCount7 = oneCount; + createTitle(doc, "4." + oneCount + " 原因统计", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); XWPFRun r12 = p.createRun();//创建段落文本 - //归一化需要高级算法,先字符串代替 - r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条,归一化统计后共" + resultCount + "[此为归一化后的暂态事件结果]条,,具体如下图所示:"); + r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态原因为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); r12.setFontSize(11);//字体大小 - //第三张表 - XWPFTable monitorInfo2 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); + createTitle(doc, "4." + oneCount + "." + twoCount + " 原因统计表格", "标题 3", 400, 11); + + //第一张表 + XWPFTable monitorInfo = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); // 表格第一行 - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "时间", "事件关联分析名称", "事件关联分析表述"); - + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "暂态类型", "电压" + typeName + "次数"); //塞入数据 - for (int i = 0; i < resultList.size(); i++) { - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, resultList.get(i).getAssTime(), resultList.get(i).getEventTime(), resultList.get(i).getDescribe()); + for (String name : resultMap.keySet()) { + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, name, resultMap.get(name).toString()); + } + + twoCount4 = twoCount; //序号计数进行++ oneCount++; - /** - * =======================================word结束========================================= - */ - } - //9.暂降原因表和暂降原因图形生成 - if (areaReportParam.isEventReasonTable() || areaReportParam.isEventReasonChart()) { - //查询字典表 - List reasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData(); - - //新建map集合装入参数 - Map reasonMap = reasonList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); - - //获得所有值 - Set typeSet = reasonMap.keySet(); - List listReason = new ArrayList<>(typeSet); - - //创建Map结果集合 - Map resultMap = new HashMap<>(); - - //优化数据(根据暂降原因,进行分组统计有多少条数据,key:暂降原因id,value:次数) - Map reasonMapCount = eventDetailList.stream().collect(Collectors.groupingBy(EventDetailNew::getAdvanceReason, Collectors.counting())); - //将数据重新整合为(key:暂降原因的名称,value:暂降原因测次数) - reasonMap.forEach((key, value) -> { - if (reasonMapCount.containsKey(key)) { - resultMap.put(value, Math.toIntExact(reasonMapCount.get(key))); - } else { - resultMap.put(value, 0); - } - }); - - //todo 还要对集合中哪个次数最多挑出第一位 - //获取entrySet - Map linkMap = getSort(resultMap); - //最多暂降事件名称 - Set topSet = linkMap.keySet(); - List topList = new ArrayList<>(topSet); - - //暂降原因表格 + //暂降原因图表 + if (areaReportParam.isEventReasonChart()) { if (areaReportParam.isEventReasonTable()) { - //暂降原因表格 + + createTitle(doc, "4." + oneCount7 + "." + twoCount4 + " 原因统计图", "标题 3", 400, 11); + + //创建x,y参数 + List xdata = new ArrayList<>(); + + List> list = new ArrayList<>(); + Map map; + for (String name : resultMap.keySet()) { + xdata.add(name); + + map = new LinkedHashMap<>(); + map.put("value", resultMap.get(name)); + map.put("name", name); + list.add(map); + } + + String tr = drawPicUtil.drawReason(xdata, list); + createPic(doc, tr, "" + typeName + "原因图"); + } else { //创建表题计数 int twoCount = 1; - oneCount7 = oneCount; createTitle(doc, "4." + oneCount + " 原因统计", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 @@ -4772,126 +4823,127 @@ public class ReportServiceImpl implements ReportService { r12.setFontSize(11);//字体大小 - createTitle(doc, "4." + oneCount + "." + twoCount + " 原因统计表格", "标题 3", 400, 11); + createTitle(doc, "4." + oneCount + "." + twoCount + " 原因统计图", "标题 3", 400, 11); - //第一张表 - XWPFTable monitorInfo = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); + //创建x,y参数 + List xdata = new ArrayList<>(); - // 表格第一行 - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "暂态类型", "电压" + typeName + "次数"); - - //塞入数据 + List> list = new ArrayList<>(); + Map map; for (String name : resultMap.keySet()) { - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, name, resultMap.get(name).toString()); + xdata.add(name); + map = new LinkedHashMap<>(); + map.put("value", resultMap.get(name)); + map.put("name", name); + list.add(map); } - twoCount4 = twoCount; + String tr = drawPicUtil.drawReason(xdata, list); + createPic(doc, tr, "" + typeName + "原因图"); + //序号计数进行++ oneCount++; - - } - - //暂降原因图表 - if (areaReportParam.isEventReasonChart()) { - if (areaReportParam.isEventReasonTable()) { - - createTitle(doc, "4." + oneCount7 + "." + twoCount4 + " 原因统计图", "标题 3", 400, 11); - - //创建x,y参数 - List xdata = new ArrayList<>(); - - List> list = new ArrayList<>(); - Map map; - for (String name : resultMap.keySet()) { - xdata.add(name); - - map = new LinkedHashMap<>(); - map.put("value", resultMap.get(name)); - map.put("name", name); - list.add(map); - } - - String tr = drawPicUtil.drawReason(xdata, list); - createPic(doc, tr, "" + typeName + "原因图"); - } else { - //创建表题计数 - int twoCount = 1; - - createTitle(doc, "4." + oneCount + " 原因统计", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态原因为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " 原因统计图", "标题 3", 400, 11); - - //创建x,y参数 - List xdata = new ArrayList<>(); - - List> list = new ArrayList<>(); - Map map; - for (String name : resultMap.keySet()) { - xdata.add(name); - - map = new LinkedHashMap<>(); - map.put("value", resultMap.get(name)); - map.put("name", name); - list.add(map); - } - - String tr = drawPicUtil.drawReason(xdata, list); - createPic(doc, tr, "" + typeName + "原因图"); - - //序号计数进行++ - oneCount++; - } } } + } - //10.暂降类型表格 和 暂降类型图表 - if (areaReportParam.isEventTypeTable() || areaReportParam.isEventTypeChart()) { + //10.暂降类型表格 和 暂降类型图表 + if (areaReportParam.isEventTypeTable() || areaReportParam.isEventTypeChart()) { - //查询字典表(暂降类型) - List typeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData(); - //新建map集合装入参数 - Map typeMap = typeList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); + //查询字典表(暂降类型) + List typeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData(); + //新建map集合装入参数 + Map typeMap = typeList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); - //获得所有值 - Set typeSet = typeMap.keySet(); - List listReason = new ArrayList<>(typeSet); + //获得所有值 + Set typeSet = typeMap.keySet(); + List listReason = new ArrayList<>(typeSet); - //创建Map结果集合 - Map resultMap = new HashMap<>(); + //创建Map结果集合 + Map resultMap = new HashMap<>(); - //优化数据(根据暂降类型,进行分组统计有多少条数据,key:暂降类型id,value:次数) - Map typeMapCount = eventDetailList.stream().collect(Collectors.groupingBy(EventDetailNew::getEventType, Collectors.counting())); - //将数据重新整合为(key:暂降类型的名称,value:暂降类型次数) - typeMap.forEach((key, value) -> { - if (typeMapCount.containsKey(key)) { - resultMap.put(value, Math.toIntExact(typeMapCount.get(key))); - } else { - resultMap.put(value, 0); - } - }); + //优化数据(根据暂降类型,进行分组统计有多少条数据,key:暂降类型id,value:次数) + Map typeMapCount = eventDetailList.stream().collect(Collectors.groupingBy(EventDetailNew::getEventType, Collectors.counting())); + //将数据重新整合为(key:暂降类型的名称,value:暂降类型次数) + typeMap.forEach((key, value) -> { + if (typeMapCount.containsKey(key)) { + resultMap.put(value, Math.toIntExact(typeMapCount.get(key))); + } else { + resultMap.put(value, 0); + } + }); - //todo 还要对集合中哪个次数最多挑出第一位 - //获取entrySet - Map linkMap = getSort(resultMap); - //最多暂降事件名称 - Set topSet = linkMap.keySet(); - List topList = new ArrayList<>(topSet); + //todo 还要对集合中哪个次数最多挑出第一位 + //获取entrySet + Map linkMap = getSort(resultMap); + //最多暂降事件名称 + Set topSet = linkMap.keySet(); + List topList = new ArrayList<>(topSet); - //暂降类型表格 + //暂降类型表格 + if (areaReportParam.isEventTypeTable()) { + //创建表题计数 + int twoCount = 1; + oneCount6 = oneCount; + + createTitle(doc, "4." + oneCount + " 类型统计", "标题 2", 200, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态类型为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); + r12.setFontSize(11);//字体大小 + + + createTitle(doc, "4." + oneCount + "." + twoCount + " 类型统计表格", "标题 3", 400, 11); + + //第一张表 + XWPFTable monitorInfo = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "暂态类型", "电压" + typeName + "次数"); + + + //塞入数据 + for (String name : resultMap.keySet()) { + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, name, resultMap.get(name).toString()); + } + + twoCount3 = twoCount; + //序号计数进行++ + oneCount++; + } + //暂降类型图形 + if (areaReportParam.isEventTypeChart()) { if (areaReportParam.isEventTypeTable()) { + twoCount3++; + createTitle(doc, "4." + oneCount6 + "." + twoCount3 + " 类型统计图", "标题 3", 400, 11); + + + //创建x,y参数 + List xdata = new ArrayList<>(); + + List> reasonList = new ArrayList<>(); + Map map; + for (String name : resultMap.keySet()) { + xdata.add(name); + + map = new LinkedHashMap<>(); + map.put("value", resultMap.get(name)); + map.put("name", name); + reasonList.add(map); + } + + String tr = drawPicUtil.drawType(xdata, reasonList); + createPic(doc, tr, "" + typeName + "类型图"); + + } else { //创建表题计数 int twoCount = 1; - oneCount6 = oneCount; + createTitle(doc, "4." + oneCount + " 类型统计", "标题 2", 200, 11); @@ -4901,143 +4953,86 @@ public class ReportServiceImpl implements ReportService { r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态类型为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); r12.setFontSize(11);//字体大小 + createTitle(doc, "4." + oneCount + "." + twoCount + " 类型统计图", "标题 3", 400, 11); - createTitle(doc, "4." + oneCount + "." + twoCount + " 类型统计表格", "标题 3", 400, 11); + //创建x,y参数 + List xdata = new ArrayList<>(); - //第一张表 - XWPFTable monitorInfo = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "暂态类型", "电压" + typeName + "次数"); - - - //塞入数据 + List> reasonList = new ArrayList<>(); + Map map; for (String name : resultMap.keySet()) { - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, name, resultMap.get(name).toString()); + xdata.add(name); + + map = new LinkedHashMap<>(); + map.put("value", resultMap.get(name)); + map.put("name", name); + reasonList.add(map); } - twoCount3 = twoCount; + String tr = drawPicUtil.drawType(xdata, reasonList); + createPic(doc, tr, "" + typeName + "类型图"); + //序号计数进行++ oneCount++; } - //暂降类型图形 - if (areaReportParam.isEventTypeChart()) { - if (areaReportParam.isEventTypeTable()) { - twoCount3++; - createTitle(doc, "4." + oneCount6 + "." + twoCount3 + " 类型统计图", "标题 3", 400, 11); - - - //创建x,y参数 - List xdata = new ArrayList<>(); - - List> reasonList = new ArrayList<>(); - Map map; - for (String name : resultMap.keySet()) { - xdata.add(name); - - map = new LinkedHashMap<>(); - map.put("value", resultMap.get(name)); - map.put("name", name); - reasonList.add(map); - } - - String tr = drawPicUtil.drawType(xdata, reasonList); - createPic(doc, tr, "" + typeName + "类型图"); - - } else { - //创建表题计数 - int twoCount = 1; - - - createTitle(doc, "4." + oneCount + " 类型统计", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态类型为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); - r12.setFontSize(11);//字体大小 - - createTitle(doc, "4." + oneCount + "." + twoCount + " 类型统计图", "标题 3", 400, 11); - - //创建x,y参数 - List xdata = new ArrayList<>(); - - List> reasonList = new ArrayList<>(); - Map map; - for (String name : resultMap.keySet()) { - xdata.add(name); - - map = new LinkedHashMap<>(); - map.put("value", resultMap.get(name)); - map.put("name", name); - reasonList.add(map); - } - - String tr = drawPicUtil.drawType(xdata, reasonList); - createPic(doc, tr, "" + typeName + "类型图"); - - //序号计数进行++ - oneCount++; - } - } - } - //11.暂降热力图 - if (areaReportParam.isThermodynamicChart()) { - //暂降热力图 - createTitle(doc, "4." + oneCount + " " + typeName + "热力图", "标题 2", 200, 11); + } - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条,使用颜色将地图上按照" + typeName + "记录发生频率进行描绘,所形成的热力具体见下图:"); - r12.setFontSize(11);//字体大小 + //11.暂降热力图 + if (areaReportParam.isThermodynamicChart()) { + //暂降热力图 + createTitle(doc, "4." + oneCount + " " + typeName + "热力图", "标题 2", 200, 11); - //所有的表结果装入集合 - Map areaCount1 = new HashMap<>(); + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条,使用颜色将地图上按照" + typeName + "记录发生频率进行描绘,所形成的热力具体见下图:"); + r12.setFontSize(11);//字体大小 - //进行遍历集合获得子区域名及其所有监测点id - //根据省级获取部门下面的信息图 - for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { + //所有的表结果装入集合 + Map areaCount1 = new HashMap<>(); - //当前子部门下所有id - List lineIndexes = generalDeviceDTO.getLineIndexes(); + //进行遍历集合获得子区域名及其所有监测点id + //根据省级获取部门下面的信息图 + for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { - //如果集合中有id将id进行拼接 - if (CollectionUtil.isNotEmpty(lineIndexes)) { - //数据统计 - Integer eventDetailCount = getEventDetailCount(areaReportParam, lineIndexes); - areaCount1.put(generalDeviceDTO.getName(), eventDetailCount); - } else { - //为空put 0 - areaCount1.put(generalDeviceDTO.getName(), 0); - } + //当前子部门下所有id + List lineIndexes = generalDeviceDTO.getLineIndexes(); + + //如果集合中有id将id进行拼接 + if (CollectionUtil.isNotEmpty(lineIndexes)) { + //数据统计 + Integer eventDetailCount = getEventDetailCount(areaReportParam, lineIndexes); + areaCount1.put(generalDeviceDTO.getName(), eventDetailCount); + } else { + //为空put 0 + areaCount1.put(generalDeviceDTO.getName(), 0); } - - - //转为List对象集合 - List areaCountList1 = new ArrayList<>(); - for (String s : areaCount1.keySet()) { - ReportCountParam reportCountParam = new ReportCountParam(); - reportCountParam.setName(s); - reportCountParam.setCount(areaCount1.get(s).toString()); - areaCountList1.add(reportCountParam); - } - - //序号计数进行++ - oneCount++; } - //文件下载 - ServletOutputStream outputStream = response.getOutputStream(); - String fileName = URLEncoder.encode(deptName + "热力图.docx", "UTF-8"); - response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); - response.setContentType("application/octet-stream;charset=UTF-8"); - doc.write(outputStream); - outputStream.close(); + //转为List对象集合 + List areaCountList1 = new ArrayList<>(); + for (String s : areaCount1.keySet()) { + ReportCountParam reportCountParam = new ReportCountParam(); + reportCountParam.setName(s); + reportCountParam.setCount(areaCount1.get(s).toString()); + areaCountList1.add(reportCountParam); + } + + //序号计数进行++ + oneCount++; + } + + + //文件下载 + ServletOutputStream outputStream = response.getOutputStream(); + String fileName = URLEncoder.encode(deptName + "热力图.docx", "UTF-8"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); + response.setContentType("application/octet-stream;charset=UTF-8"); + doc.write(outputStream); + outputStream.close(); } @@ -5050,230 +5045,603 @@ public class ReportServiceImpl implements ReportService { } else { typeName = "暂降"; } - PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam(); - pmsDeviceInfoParam.setDeptIndex(areaReportParam.getDeptIndex()); - //获取统计类型 - pmsDeviceInfoParam.setStatisticalType(areaReportParam.getStatisticalType()); - //获取主网台账信息 - List generalDeviceDTOList = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData(); - //这是总的监测点id - List lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getMonitorIdList().stream()).distinct().collect(Collectors.toList()); + PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam(); + pmsDeviceInfoParam.setDeptIndex(areaReportParam.getDeptIndex()); + //获取统计类型 + pmsDeviceInfoParam.setStatisticalType(areaReportParam.getStatisticalType()); + //获取主网台账信息 + List generalDeviceDTOList = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData(); + //这是总的监测点id + List lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getMonitorIdList().stream()).distinct().collect(Collectors.toList()); - //提前创建,不然获取不到(初始化数据) - if (CollUtil.isEmpty(lineIds)) { - throw new BusinessException(EventResponseEnum.NOT_LINEID); - } - List eventDetailList = getEventDetailListInfo(areaReportParam, lineIds,areaReportParam.getWaveType()); - if (CollectionUtil.isEmpty(eventDetailList)) { - throw new BusinessException(CommonResponseEnum.NO_DATA); - } - - //电压集合(统计类型:电压)根据监测点数据进行电压分组 - List voltageParamList = new ArrayList<>(); - List data = monitorClient.getMonitorList(lineIds).getData(); - Map> voltageMap = data.stream().collect(Collectors.groupingBy(Monitor::getVoltageLevel)); - //获取电压字典 - List voltageData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData(); - PmsGeneralDeviceDTO deviceDTO; - for (DictData voltageDatum : voltageData) { - deviceDTO = new PmsGeneralDeviceDTO(); - if (voltageMap.containsKey(voltageDatum.getId())) { - deviceDTO.setIndex(voltageDatum.getId()); - deviceDTO.setName(voltageDatum.getName()); - //获取检测点id - List monitorIds = voltageMap.get(voltageDatum.getId()).stream().map(Monitor::getId).collect(Collectors.toList()); - deviceDTO.setMonitorIdList(monitorIds); - } else { - deviceDTO.setIndex(voltageDatum.getId()); - deviceDTO.setName(voltageDatum.getName()); - } - voltageParamList.add(deviceDTO); + //提前创建,不然获取不到(初始化数据) + if (CollUtil.isEmpty(lineIds)) { + throw new BusinessException(EventResponseEnum.NOT_LINEID); + } + List eventDetailList = getEventDetailListInfo(areaReportParam, lineIds, areaReportParam.getWaveType()); + if (CollectionUtil.isEmpty(eventDetailList)) { + throw new BusinessException(CommonResponseEnum.NO_DATA); + } + + //电压集合(统计类型:电压)根据监测点数据进行电压分组 + List voltageParamList = new ArrayList<>(); + List data = monitorClient.getMonitorList(lineIds).getData(); + Map> voltageMap = data.stream().collect(Collectors.groupingBy(Monitor::getVoltageLevel)); + //获取电压字典 + List voltageData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData(); + PmsGeneralDeviceDTO deviceDTO; + for (DictData voltageDatum : voltageData) { + deviceDTO = new PmsGeneralDeviceDTO(); + if (voltageMap.containsKey(voltageDatum.getId())) { + deviceDTO.setIndex(voltageDatum.getId()); + deviceDTO.setName(voltageDatum.getName()); + //获取检测点id + List monitorIds = voltageMap.get(voltageDatum.getId()).stream().map(Monitor::getId).collect(Collectors.toList()); + deviceDTO.setMonitorIdList(monitorIds); + } else { + deviceDTO.setIndex(voltageDatum.getId()); + deviceDTO.setName(voltageDatum.getName()); } + voltageParamList.add(deviceDTO); + } - //创建幅值计数器 - int oneCount2 = 0; + //创建幅值计数器 + int oneCount2 = 0; - //创建ITIC与F47计数器 - int oneCount3 = 0; - int twoCount5 = 0; + //创建ITIC与F47计数器 + int oneCount3 = 0; + int twoCount5 = 0; - //创建暂降密度表和密度图的计数器 - int oneCount4 = 0; - int twoCount1 = 0; + //创建暂降密度表和密度图的计数器 + int oneCount4 = 0; + int twoCount1 = 0; - //创建暂降事件表格和图的计数器 - int oneCount5 = 0; - int twoCount2 = 0; + //创建暂降事件表格和图的计数器 + int oneCount5 = 0; + int twoCount2 = 0; - //创建暂态类型图和暂态类型表格计数器 - int oneCount6 = 0; - int twoCount3 = 0; + //创建暂态类型图和暂态类型表格计数器 + int oneCount6 = 0; + int twoCount3 = 0; - //创建暂态原因图和暂态原因表格计数器 - int oneCount7 = 0; - int twoCount4 = 0; + //创建暂态原因图和暂态原因表格计数器 + int oneCount7 = 0; + int twoCount4 = 0; - //提前创建计数(累计监测点数量) - Integer eventCount = 0; - //如果集合中有id将id进行拼接 + //提前创建计数(累计监测点数量) + Integer eventCount = 0; + //如果集合中有id将id进行拼接 + if (CollectionUtil.isNotEmpty(lineIds)) { + //获取累计监测点数量 + eventCount = eventDetailList.size(); + } + + + //准备word表中参数 + //获取监测点总数量 + int size = lineIds.size(); + //还有当前传入的部门名称(例如:中国)需要等邓哥的公共方法 + String deptName = deptFeignClient.getDeptById(areaReportParam.getDeptIndex()).getData().getName(); + + + /** + * =====================生成word=========================== + */ + //设置序号初始值 + int oneCount = 1; + + //创建word文档(poi生成word) + XWPFDocument doc = new XWPFDocument();// 创建Word文件 + XWPFParagraph p = doc.createParagraph();// 新建一个段落 + + // 设定标题格式,可以生成可点击的序号 + WordUtils.setHeadingStyle(doc); + + //设置对齐 + p.setAlignment(ParagraphAlignment.CENTER); + XWPFRun r = p.createRun();//创建段落文本 + r.addBreak(); + r.addBreak(); + r.addBreak(); + r.addBreak(); + r.addBreak(); + r.addBreak(); + r.setText(deptName + "供电公司"); + r.setBold(true);//设置为粗体 + r.setFontSize(14);//字体大小 + r.addBreak(); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.CENTER); + XWPFRun r1 = p.createRun();//创建段落文本 + r1.setText("电压" + typeName + "事件区域报告"); + r1.setBold(true);//设置为粗体 + r1.setFontSize(36);//字体大小 + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + r1.addBreak(); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.CENTER); + XWPFRun r2 = p.createRun();//创建段落文本 + //获取当前时间 + Date date = new Date(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy 年 MM 月 dd 日"); + String time = dateFormat.format(date); + + r2.setText("日期: " + time); + r2.setBold(true);//设置为粗体 + r2.setFontSize(14);//字体大小 + + r2.addBreak(); + r2.addBreak(); + r2.addBreak(); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.CENTER); + XWPFRun r3 = p.createRun();//创建段落文本 + r3.setText("电压" + typeName + "事件区域报告"); + r3.setFontSize(24);//字体大小 + + + createTitle(doc, "1. 引言", "标题 1", 0, 15); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r5 = p.createRun();//创建段落文本 + r5.setText(" " + deptName + "电网总共有" + size + "个监测点。" + deptName + "电网在所选择时间段" + areaReportParam.getSearchBeginTime() + " 至 " + areaReportParam.getSearchEndTime() + + "累计监测到" + typeName + "事件" + eventCount + "条,本报告按照监测点分布," + typeName + "事件统计," + typeName + "事件点图," + typeName + "热力图," + typeName + "密度图," + typeName + "概率分布图,事件关联统计," + typeName + "类型统计," + typeName + "原因统计等方面进行数据分析。"); + r5.setFontSize(11);//字体大小 + + + createTitle(doc, "2. 报告分析对象", "标题 1", 0, 15); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r7 = p.createRun();//创建段落文本 + r7.setText(" " + deptName + "。"); + r7.setFontSize(11);//字体大小 + + + createTitle(doc, "3. 报告分析时间", "标题 1", 0, 15); + + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r9 = p.createRun();//创建段落文本 + r9.setText(" " + areaReportParam.getSearchBeginTime() + " 至 " + areaReportParam.getSearchEndTime() + "。"); + r9.setFontSize(11);//字体大小 + + + createTitle(doc, "4. 汇总信息", "标题 1", 0, 15); + + //1.监测网分布 + if (areaReportParam.isMonitorDistributeChart()) { + //监测网分布 + + + //在线监测点数 + Integer onLineIdCount = 0; if (CollectionUtil.isNotEmpty(lineIds)) { - //获取累计监测点数量 - eventCount = eventDetailList.size(); + //获取监测点状态运行 + DictData runState = dicDataFeignClient.getDicDataByName(DicDataEnum.RUN.getName()).getData(); + onLineIdCount = data.stream().filter(ol -> ol.getMonitorState().equals(runState.getId())).collect(Collectors.toList()).size(); } + //离线总监测点数 + Integer unLineCount = Integer.valueOf(lineIds.size()) - onLineIdCount; + //在线率 + Double onlineRate = (onLineIdCount.doubleValue()) / (Double.valueOf(String.valueOf(lineIds.size()))) * 100; - //准备word表中参数 - //获取监测点总数量 - int size = lineIds.size(); - //还有当前传入的部门名称(例如:中国)需要等邓哥的公共方法 - String deptName = deptFeignClient.getDeptById(areaReportParam.getDeptIndex()).getData().getName(); + NumberFormat nf = NumberFormat.getNumberInstance(); + // 保留两位小数 + nf.setMaximumFractionDigits(2); + // 如果不需要四舍五入 + nf.setRoundingMode(RoundingMode.UP); + + String onlineRateResult = nf.format(onlineRate); /** - * =====================生成word=========================== + * =========================续写word文档============================================== */ - //设置序号初始值 - int oneCount = 1; - - //创建word文档(poi生成word) - XWPFDocument doc = new XWPFDocument();// 创建Word文件 - XWPFParagraph p = doc.createParagraph();// 新建一个段落 - - // 设定标题格式,可以生成可点击的序号 - WordUtils.setHeadingStyle(doc); - - //设置对齐 - p.setAlignment(ParagraphAlignment.CENTER); - XWPFRun r = p.createRun();//创建段落文本 - r.addBreak(); - r.addBreak(); - r.addBreak(); - r.addBreak(); - r.addBreak(); - r.addBreak(); - r.setText(deptName + "供电公司"); - r.setBold(true);//设置为粗体 - r.setFontSize(14);//字体大小 - r.addBreak(); - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.CENTER); - XWPFRun r1 = p.createRun();//创建段落文本 - r1.setText("电压" + typeName + "事件区域报告"); - r1.setBold(true);//设置为粗体 - r1.setFontSize(36);//字体大小 - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - r1.addBreak(); - - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.CENTER); - XWPFRun r2 = p.createRun();//创建段落文本 - //获取当前时间 - Date date = new Date(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy 年 MM 月 dd 日"); - String time = dateFormat.format(date); - - r2.setText("日期: " + time); - r2.setBold(true);//设置为粗体 - r2.setFontSize(14);//字体大小 - - r2.addBreak(); - r2.addBreak(); - r2.addBreak(); - - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.CENTER); - XWPFRun r3 = p.createRun();//创建段落文本 - r3.setText("电压" + typeName + "事件区域报告"); - r3.setFontSize(24);//字体大小 - - - createTitle(doc, "1. 引言", "标题 1", 0, 15); - + createTitle(doc, "4." + oneCount + " 监测网分布", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r5 = p.createRun();//创建段落文本 - r5.setText(" " + deptName + "电网总共有" + size + "个监测点。" + deptName + "电网在所选择时间段" + areaReportParam.getSearchBeginTime() + " 至 " + areaReportParam.getSearchEndTime() + - "累计监测到" + typeName + "事件" + eventCount + "条,本报告按照监测点分布," + typeName + "事件统计," + typeName + "事件点图," + typeName + "热力图," + typeName + "密度图," + typeName + "概率分布图,事件关联统计," + typeName + "类型统计," + typeName + "原因统计等方面进行数据分析。"); - r5.setFontSize(11);//字体大小 + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + deptName + "电网总共有监测点" + size + "个。监测点在线率达到" + onlineRateResult + "%(通讯正常为:" + onLineIdCount + "个,通讯异常为:" + unLineCount + "个)" + + "[通讯正常/总监测点数(统计时候排除检修和热备用监测点)],具体见下图:"); + r12.setFontSize(11);//字体大小 - createTitle(doc, "2. 报告分析对象", "标题 1", 0, 15); + //todo 分布地图代码未实现 + //序号计数进行++ + oneCount++; - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r7 = p.createRun();//创建段落文本 - r7.setText(" " + deptName + "。"); - r7.setFontSize(11);//字体大小 + /** + * =======================================word结束========================================= + */ + } + List lindIds = eventDetailList.stream().map(EventDetailNew::getLineId).collect(Collectors.toList()); + //2.暂降事件三表季图像判断 + if (areaReportParam.isEventCountTable() || areaReportParam.isEventCountChart()) { + //所有的表结果装入集合 + Map areaCount = new HashMap<>(); + Map voltageCount = new HashMap<>(); + //暂降事件最多的两个电压 + Set topVoltage = new HashSet<>(); - createTitle(doc, "3. 报告分析时间", "标题 1", 0, 15); + //1.部门信息。传入参数(判断统计类型) + if (Objects.nonNull(areaReportParam.getStatisticalType().getCode()) && areaReportParam.getStatisticalType().getCode().equals("Power_Network")) { + //进行遍历集合获得子区域名及其所有监测点id + for (PmsGeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { + //当前子部门下所有id + List lineIndexes = generalDeviceDTO.getMonitorIdList(); + //如果集合中有id将id进行拼接 + if (CollectionUtil.isNotEmpty(lineIndexes)) { + //总条数 + List countSize = lindIds.stream().filter(x -> lineIndexes.contains(x)).collect(Collectors.toList()); - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r9 = p.createRun();//创建段落文本 - r9.setText(" " + areaReportParam.getSearchBeginTime() + " 至 " + areaReportParam.getSearchEndTime() + "。"); - r9.setFontSize(11);//字体大小 + if (CollUtil.isNotEmpty(countSize)) { + areaCount.put(generalDeviceDTO.getName(), countSize.size()); + } else { + areaCount.put(generalDeviceDTO.getName(), 0); + } - - createTitle(doc, "4. 汇总信息", "标题 1", 0, 15); - - //1.监测网分布 - if (areaReportParam.isMonitorDistributeChart()) { - //监测网分布 - - - //在线监测点数 - Integer onLineIdCount = 0; - if (CollectionUtil.isNotEmpty(lineIds)) { - //获取监测点状态运行 - DictData runState = dicDataFeignClient.getDicDataByName(DicDataEnum.RUN.getName()).getData(); - onLineIdCount = data.stream().filter(ol -> ol.getMonitorState().equals(runState.getId())).collect(Collectors.toList()).size(); + } else { + //为空put 0 + areaCount.put(generalDeviceDTO.getName(), 0); + } } - //离线总监测点数 - Integer unLineCount = Integer.valueOf(lineIds.size()) - onLineIdCount; - //在线率 - Double onlineRate = (onLineIdCount.doubleValue()) / (Double.valueOf(String.valueOf(lineIds.size()))) * 100; + //2.电压集合(统计类型:电压) + List areaParamList = voltageParamList; + //进行遍历集合获得子区域名及其所有监测点id + for (PmsGeneralDeviceDTO generalDeviceDTO : areaParamList) { - NumberFormat nf = NumberFormat.getNumberInstance(); - // 保留两位小数 - nf.setMaximumFractionDigits(2); - // 如果不需要四舍五入 - nf.setRoundingMode(RoundingMode.UP); + //当前子部门下所有id + List lineIndexes = generalDeviceDTO.getMonitorIdList(); - String onlineRateResult = nf.format(onlineRate); + //如果集合中有id将id进行拼接 + if (CollectionUtil.isNotEmpty(lineIndexes)) { + + List countSize = lindIds.stream().filter(x -> lineIndexes.contains(x)).collect(Collectors.toList()); + + if (CollUtil.isNotEmpty(countSize)) { + voltageCount.put(generalDeviceDTO.getName(), countSize.size()); + } else { + voltageCount.put(generalDeviceDTO.getName(), 0); + } + + } else { + //为空put 0 + voltageCount.put(generalDeviceDTO.getName(), 0); + } + } + //数据排序 + Map linkMap = getSort(voltageCount); + //最多暂降事件的两个电压名称 + topVoltage = linkMap.keySet(); + + } - /** - * =========================续写word文档============================================== - */ + //根据月份来进行查看暂降 + //提前创建对象 + int dayOfMonth = 0; + //最后集合 + List timeSVoList = new ArrayList<>(); + //表格参数 + String table = ""; + + //月 + if ("0".equals(areaReportParam.getInterval())) { + table = "月份"; + + List dayCount = new ArrayList<>(); + List timeList = new ArrayList<>(); + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM"); + //进行for循环获取所有事件的时间 + for (EventDetailNew eventDetail : eventDetailList) { + //获取暂降事件时间 + dayCount.add(DateUtil.format(DateUtil.parse(eventDetail.getStartTime()), fmt)); + + //创建对象 + AreaEventMonthParam timeParam = new AreaEventMonthParam(); + timeParam.setDayOrMonth(DateUtil.format(DateUtil.parse(eventDetail.getStartTime()), fmt)); + timeParam.setEventAssIndex(eventDetail.getEventassIndex()); + timeList.add(timeParam); + } + + //Map集和 + Map> relevanceMap = new HashMap<>(); + List list = new ArrayList<>(); + + for (AreaEventMonthParam areaEventMonthParam : timeList) { + //如果存在 + if (relevanceMap.containsKey(areaEventMonthParam.getDayOrMonth())) { + list = relevanceMap.get(areaEventMonthParam.getDayOrMonth()); + list.add(areaEventMonthParam.getEventAssIndex()); + relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list)); + } else { + List list1 = new ArrayList<>(); + list1.add(areaEventMonthParam.getEventAssIndex()); + relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list1)); + } + } + //创建map集和装当天和次数 + Map resultMap = new HashMap<>(); + for (String day : dayCount) { + if (resultMap.containsKey(day)) { + resultMap.put(day, resultMap.get(day) + 1); + } else { + resultMap.put(day, 1); + } + } + //获取未关联的暂态事件 + Map eventAssDetail = eventDetailList.stream().filter(x -> StrUtil.isBlank(x.getEventassIndex())) + .collect(Collectors.groupingBy(x -> DateUtil.format(DateUtil.parse(x.getStartTime()), fmt), Collectors.counting())); - createTitle(doc, "4." + oneCount + " 监测网分布", "标题 2", 200, 11); + //开始时间 + LocalDate beginTime = LocalDate.parse(areaReportParam.getSearchBeginTime()); + LocalDate end = LocalDate.parse(areaReportParam.getSearchEndTime()); + //因为是比较月份,将起始时间的天数加给结束时间,不然while一直不能结束循环 + + String substring1 = end.toString().substring(0, 8); + String substring2 = beginTime.toString().substring(8, 10); + + String s1 = substring1 + substring2; + LocalDate endTime = LocalDate.parse(s1); + Set keySet = resultMap.keySet(); + + while (!beginTime.equals(endTime.plus(1, ChronoUnit.MONTHS))) { + if (keySet.contains(beginTime.toString().substring(0, 7))) { + Integer countSize = resultMap.get(beginTime.toString().substring(0, 7)); + TimeSVO timeVO = new TimeSVO(); + timeVO.setTimes(countSize.toString()); + timeVO.setYear(String.valueOf(beginTime.getYear())); + + //todo 不知道代码是否是写错了,时间判断有问题 +// if (beginTime.getDayOfMonth() < 10) { + if (beginTime.getMonthValue() < 10) { + timeVO.setMonth("0" + beginTime.getMonthValue() + ""); + } else { + timeVO.setMonth(beginTime.getMonthValue() + ""); + } + + timeVO.setFulltime(beginTime.toString().substring(0, 7)); + //遍历 如果时间相同,将所有关联处理事件次数赋值上去 + if (eventAssDetail.containsKey(beginTime.toString().substring(0, 7))) { + timeVO.setEventAssIndex(Math.toIntExact(eventAssDetail.get(beginTime.toString().substring(0, 7)))); + } else { + timeVO.setEventAssIndex(0); + } + timeSVoList.add(timeVO); + } else { + TimeSVO timeVO = new TimeSVO(); + timeVO.setTimes("0"); + timeVO.setYear(String.valueOf(beginTime.getYear())); + + //todo 未知问题:是否是代码错误 + if (beginTime.getMonthValue() < 10) { + timeVO.setMonth("0" + beginTime.getMonthValue() + ""); + } else { + timeVO.setMonth(beginTime.getMonthValue() + ""); + } + timeVO.setEventAssIndex(0); + timeVO.setFulltime(beginTime.toString().substring(0, 7)); + timeSVoList.add(timeVO); + } + + beginTime = beginTime.plus(1, ChronoUnit.MONTHS); + } + + //数据排序 + Map linkMap = getSort(resultMap); + //暂降次数最多 + List collect = linkMap.keySet().stream().collect(Collectors.toList()); + //赋值 + dayOfMonth = Integer.parseInt(collect.get(0).substring(5, 7)); + } else { + table = "天数"; + + List dayCount = new ArrayList<>(); + List timeList = new ArrayList<>(); + + //进行for循环获取所有事件的时间 + for (EventDetailNew eventDetail : eventDetailList) { + //获取暂降事件时间 + /* String timeId = eventDetail.getTimeId(); + Date date1 = DateUtil.parse(timeId); + int day = Integer.parseInt(String.format("%td",date1));*/ + dayCount.add(DateUtil.formatDate(DateUtil.parse(eventDetail.getStartTime()))); + + //创建对象 + AreaEventMonthParam timeParam = new AreaEventMonthParam(); + timeParam.setDayOrMonth(DateUtil.formatDate(DateUtil.parse(eventDetail.getStartTime()))); + timeParam.setEventAssIndex(eventDetail.getEventassIndex()); + timeList.add(timeParam); + } + + //Map集和 + Map> relevanceMap = new HashMap<>(); + List list = new ArrayList<>(); + + for (AreaEventMonthParam areaEventMonthParam : timeList) { + //如果存在 + if (relevanceMap.containsKey(areaEventMonthParam.getDayOrMonth())) { + list = relevanceMap.get(areaEventMonthParam.getDayOrMonth()); + list.add(areaEventMonthParam.getEventAssIndex()); + relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list)); + } else { + List list1 = new ArrayList<>(); + list1.add(areaEventMonthParam.getEventAssIndex()); + relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list1)); + } + } + //创建map集和装当天和次数 + Map resultMap = new HashMap<>(); + for (String day : dayCount) { + if (resultMap.containsKey(day)) { + resultMap.put(day, resultMap.get(day) + 1); + } else { + resultMap.put(day, 1); + } + } + + //获取未关联的暂态事件 + Map eventAssDetail = eventDetailList.stream().filter(x -> StrUtil.isBlank(x.getEventassIndex())) + .collect(Collectors.groupingBy(x -> DateUtil.formatDate(DateUtil.parse(x.getStartTime())), Collectors.counting())); + + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + //开始时间 + LocalDate beginTime = LocalDate.parse(areaReportParam.getSearchBeginTime(), fmt); + LocalDate endTime = LocalDate.parse(areaReportParam.getSearchEndTime(), fmt); + + Set keySet = resultMap.keySet(); + + while (!beginTime.equals(endTime.plus(1, ChronoUnit.DAYS))) { + if (keySet.contains(beginTime.toString())) { + + //获取暂降次数 + Integer countSize = resultMap.get(beginTime.toString()); + TimeSVO timeVO = new TimeSVO(); + timeVO.setTimes(countSize.toString()); + + if (beginTime.getDayOfMonth() < 10) { + timeVO.setDay("0" + beginTime.getDayOfMonth() + ""); + } else { + timeVO.setDay(beginTime.getDayOfMonth() + ""); + } + + timeVO.setYear(String.valueOf(beginTime.getYear())); + //todo 不知道代码是否是写错了,时间判断有问题 + if (beginTime.getMonthValue() < 10) { + timeVO.setMonth("0" + beginTime.getMonthValue() + ""); + } else { + timeVO.setMonth(beginTime.getMonthValue() + ""); + } + timeVO.setFulltime(beginTime.toString()); + //遍历 如果时间相同,将所有关联处理事件次数赋值上去 + if (eventAssDetail.containsKey(beginTime.toString())) { + timeVO.setEventAssIndex(Math.toIntExact(eventAssDetail.get(beginTime.toString()))); + } else { + timeVO.setEventAssIndex(0); + } + timeSVoList.add(timeVO); + } else { + TimeSVO timeVO = new TimeSVO(); + timeVO.setTimes("0"); + if (beginTime.getDayOfMonth() < 10) { + timeVO.setDay("0" + beginTime.getDayOfMonth() + ""); + } else { + timeVO.setDay(beginTime.getDayOfMonth() + ""); + } + timeVO.setYear(String.valueOf(beginTime.getYear())); + + //todo 未知问题:是否是代码错误 + if (beginTime.getMonthValue() < 10) { + timeVO.setMonth("0" + beginTime.getMonthValue() + ""); + } else { + timeVO.setMonth(beginTime.getMonthValue() + ""); + } + timeVO.setEventAssIndex(0); + timeVO.setFulltime(beginTime.toString()); + timeSVoList.add(timeVO); + } + + beginTime = beginTime.plus(1, ChronoUnit.DAYS); + } + + //数据排序 + Map linkMap = getSort(resultMap); + //暂降次数最多 + List collect = linkMap.keySet().stream().collect(Collectors.toList()); + + //赋值 + dayOfMonth = LocalDate.parse(collect.get(0)).getDayOfMonth(); + + } + + //最高暂降事件的两个电压值 +// System.out.println(topVoltage); + //转为List + List topVoltageList = new ArrayList<>(); + for (String s : topVoltage) { + topVoltageList.add(s); + } + //表格 + if (areaReportParam.isEventCountTable()) { + + //创建表题计数 + int twoCount = 1; + + //与暂降事件图形共享序号 + oneCount5 = oneCount; + + + createTitle(doc, "4." + oneCount + " " + typeName + "事件列表", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网总共有监测点" + size + "个。监测点在线率达到" + onlineRateResult + "%(通讯正常为:" + onLineIdCount + "个,通讯异常为:" + unLineCount + "个)" + - "[通讯正常/总监测点数(统计时候排除检修和热备用监测点)],具体见下图:"); + r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条," + topVoltageList.get(0) + "、" + topVoltageList.get(1) + "" + typeName + "事件居多," + + "第" + dayOfMonth + "" + table + "" + typeName + "事件居多,具体见下表(图):"); r12.setFontSize(11);//字体大小 - //todo 分布地图代码未实现 + createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "事件表格", "标题 3", 400, 11); + twoCount2 = twoCount; + + //第一张表 + XWPFTable monitorInfo = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); + // 表格第一行 + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "区域", "电压" + typeName + "次数"); + //塞入数据 + for (String s : areaCount.keySet()) { + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, s, areaCount.get(s).toString()); + } + + + //第二张表 + XWPFTable monitorInfo1 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph1 = WordUtils.getCenterParagraph(doc); + // 表格第一行 + insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, true, "电压等级", "电压" + typeName + "次数"); + //塞入数据 + for (String s : voltageCount.keySet()) { + insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, false, s, voltageCount.get(s).toString()); + } + + + //第三张表 + XWPFTable monitorInfo2 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); + // 表格第一行 + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "" + table + "", "电压" + typeName + "次数"); + //塞入数据 + for (int i = 0; i < timeSVoList.size(); i++) { + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, timeSVoList.get(i).getFulltime(), timeSVoList.get(i).getTimes()); + } //序号计数进行++ oneCount++; @@ -5281,1811 +5649,1526 @@ public class ReportServiceImpl implements ReportService { /** * =======================================word结束========================================= */ + } - List lindIds = eventDetailList.stream().map(EventDetailNew::getLineId).collect(Collectors.toList()); - //2.暂降事件三表季图像判断 - if (areaReportParam.isEventCountTable() || areaReportParam.isEventCountChart()) { - //所有的表结果装入集合 - Map areaCount = new HashMap<>(); - Map voltageCount = new HashMap<>(); - //暂降事件最多的两个电压 - Set topVoltage = new HashSet<>(); + //图形 + if (areaReportParam.isEventCountChart()) { + twoCount2++; + createTitle(doc, "4." + oneCount5 + "." + twoCount2 + " " + typeName + "事件图形", "标题 3", 400, 11); - //1.部门信息。传入参数(判断统计类型) - if (Objects.nonNull(areaReportParam.getStatisticalType().getCode()) && areaReportParam.getStatisticalType().getCode().equals("Power_Network")) { - //进行遍历集合获得子区域名及其所有监测点id - for (PmsGeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { - //当前子部门下所有id - List lineIndexes = generalDeviceDTO.getMonitorIdList(); - //如果集合中有id将id进行拼接 - if (CollectionUtil.isNotEmpty(lineIndexes)) { - //总条数 - List countSize = lindIds.stream().filter(x -> lineIndexes.contains(x)).collect(Collectors.toList()); + //创建部门与监测点次数的map集合 + Map lineCount = new HashMap<>(); + for (PmsGeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { + lineCount.put(generalDeviceDTO.getName(), generalDeviceDTO.getMonitorIdList().size()); + } - if (CollUtil.isNotEmpty(countSize)) { - areaCount.put(generalDeviceDTO.getName(), countSize.size()); - } else { - areaCount.put(generalDeviceDTO.getName(), 0); - } - - } else { - //为空put 0 - areaCount.put(generalDeviceDTO.getName(), 0); + //创建x,y参数 + List xdata = new ArrayList<>(); + List ydata = new ArrayList<>(); + //根据区域名称进行匹配 + for (String name : areaCount.keySet()) { + //将监测点的数量拼接在部门下面 + for (String s : lineCount.keySet()) { + if (s.equals(name)) { + xdata.add(name + "\n" + "(" + lineCount.get(s) + ")"); } } - //2.电压集合(统计类型:电压) - List areaParamList = voltageParamList; - //进行遍历集合获得子区域名及其所有监测点id - for (PmsGeneralDeviceDTO generalDeviceDTO : areaParamList) { + ydata.add(areaCount.get(name)); + } - //当前子部门下所有id - List lineIndexes = generalDeviceDTO.getMonitorIdList(); + String qytj = drawPicUtil.drawEventRegion(xdata, ydata); + createPic(doc, qytj, "" + typeName + "事件图形"); - //如果集合中有id将id进行拼接 - if (CollectionUtil.isNotEmpty(lineIndexes)) { - List countSize = lindIds.stream().filter(x -> lineIndexes.contains(x)).collect(Collectors.toList()); - - if (CollUtil.isNotEmpty(countSize)) { - voltageCount.put(generalDeviceDTO.getName(), countSize.size()); - } else { - voltageCount.put(generalDeviceDTO.getName(), 0); - } - - } else { - //为空put 0 - voltageCount.put(generalDeviceDTO.getName(), 0); - } + //月份统计 + //创建x,y参数 + List xdata1 = new ArrayList<>(); + List ydata1 = new ArrayList<>(); + List ydata2 = new ArrayList<>(); + for (TimeSVO timeSVO : timeSVoList) { + if ("天数".equals(table)) { + xdata1.add(timeSVO.getFulltime().substring(5)); + } else { + xdata1.add(timeSVO.getFulltime()); } - //数据排序 - Map linkMap = getSort(voltageCount); - //最多暂降事件的两个电压名称 - topVoltage = linkMap.keySet(); - + ydata1.add(Integer.parseInt(timeSVO.getTimes())); + ydata2.add(timeSVO.getEventAssIndex()); } - //根据月份来进行查看暂降 - //提前创建对象 - int dayOfMonth = 0; - //最后集合 - List timeSVoList = new ArrayList<>(); - //表格参数 - String table = ""; + String yftj = drawPicUtil.drawEventAssociatedUnassociated(xdata1, ydata1, ydata2, table); + createPic(doc, yftj, "" + typeName + "事件图形"); - //月 - if ("0".equals(areaReportParam.getInterval())) { - table = "月份"; - List dayCount = new ArrayList<>(); - List timeList = new ArrayList<>(); - DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM"); - //进行for循环获取所有事件的时间 - for (EventDetailNew eventDetail : eventDetailList) { - //获取暂降事件时间 - dayCount.add(DateUtil.format(DateUtil.parse(eventDetail.getStartTime()), fmt)); - - //创建对象 - AreaEventMonthParam timeParam = new AreaEventMonthParam(); - timeParam.setDayOrMonth(DateUtil.format(DateUtil.parse(eventDetail.getStartTime()), fmt)); - timeParam.setEventAssIndex(eventDetail.getEventassIndex()); - timeList.add(timeParam); - } - - //Map集和 - Map> relevanceMap = new HashMap<>(); - List list = new ArrayList<>(); - - for (AreaEventMonthParam areaEventMonthParam : timeList) { - //如果存在 - if (relevanceMap.containsKey(areaEventMonthParam.getDayOrMonth())) { - list = relevanceMap.get(areaEventMonthParam.getDayOrMonth()); - list.add(areaEventMonthParam.getEventAssIndex()); - relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list)); - } else { - List list1 = new ArrayList<>(); - list1.add(areaEventMonthParam.getEventAssIndex()); - relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list1)); + //创建电压uiiiuuuu与监测点次数的map集合 + List areaParamList = voltageParamList; + Map lineCount1 = new HashMap<>(); + for (PmsGeneralDeviceDTO generalDeviceDTO : areaParamList) { + lineCount1.put(generalDeviceDTO.getName(), generalDeviceDTO.getMonitorIdList().size()); + } + //创建x,y参数 + List xdata3 = new ArrayList<>(); + List ydata3 = new ArrayList<>(); + //根据电压名称进行匹配 + for (String name : voltageCount.keySet()) { + //将监测点的数量拼接在部门下面 + for (String s : lineCount1.keySet()) { + if (s.equals(name)) { + xdata3.add(name + "\n" + "(" + lineCount1.get(s) + ")"); } } - //创建map集和装当天和次数 - Map resultMap = new HashMap<>(); - for (String day : dayCount) { - if (resultMap.containsKey(day)) { - resultMap.put(day, resultMap.get(day) + 1); - } else { - resultMap.put(day, 1); - } - } - //获取未关联的暂态事件 - Map eventAssDetail = eventDetailList.stream().filter(x -> StrUtil.isBlank(x.getEventassIndex())) - .collect(Collectors.groupingBy(x -> DateUtil.format(DateUtil.parse(x.getStartTime()), fmt), Collectors.counting())); + ydata3.add(voltageCount.get(name)); + } + + String dydj = drawPicUtil.drawEventVoltageLevel(xdata3, ydata3); + createPic(doc, dydj, "" + typeName + "事件图形"); - //开始时间 - LocalDate beginTime = LocalDate.parse(areaReportParam.getSearchBeginTime()); - LocalDate end = LocalDate.parse(areaReportParam.getSearchEndTime()); - //因为是比较月份,将起始时间的天数加给结束时间,不然while一直不能结束循环 + /** + * =======================================word结束========================================= + */ + } - String substring1 = end.toString().substring(0, 8); - String substring2 = beginTime.toString().substring(8, 10); - String s1 = substring1 + substring2; - LocalDate endTime = LocalDate.parse(s1); - Set keySet = resultMap.keySet(); + } - while (!beginTime.equals(endTime.plus(1, ChronoUnit.MONTHS))) { - if (keySet.contains(beginTime.toString().substring(0, 7))) { - Integer countSize = resultMap.get(beginTime.toString().substring(0, 7)); - TimeSVO timeVO = new TimeSVO(); - timeVO.setTimes(countSize.toString()); - timeVO.setYear(String.valueOf(beginTime.getYear())); + //3.密度图 + if (areaReportParam.isDensityTable() || areaReportParam.isDensityChart()) { - //todo 不知道代码是否是写错了,时间判断有问题 -// if (beginTime.getDayOfMonth() < 10) { - if (beginTime.getMonthValue() < 10) { - timeVO.setMonth("0" + beginTime.getMonthValue() + ""); - } else { - timeVO.setMonth(beginTime.getMonthValue() + ""); - } + //暂降密度图形 + AreaTableParam areaTableParam = new AreaTableParam(); - timeVO.setFulltime(beginTime.toString().substring(0, 7)); - //遍历 如果时间相同,将所有关联处理事件次数赋值上去 - if(eventAssDetail.containsKey(beginTime.toString().substring(0, 7))){ - timeVO.setEventAssIndex(Math.toIntExact(eventAssDetail.get(beginTime.toString().substring(0, 7)))); - }else{ - timeVO.setEventAssIndex(0); - } - timeSVoList.add(timeVO); - } else { - TimeSVO timeVO = new TimeSVO(); - timeVO.setTimes("0"); - timeVO.setYear(String.valueOf(beginTime.getYear())); + //创建结果集合 + List info = eventDetailList; - //todo 未知问题:是否是代码错误 - if (beginTime.getMonthValue() < 10) { - timeVO.setMonth("0" + beginTime.getMonthValue() + ""); - } else { - timeVO.setMonth(beginTime.getMonthValue() + ""); - } - timeVO.setEventAssIndex(0); - timeVO.setFulltime(beginTime.toString().substring(0, 7)); - timeSVoList.add(timeVO); - } + //将sql结果集放入,共用一个sql,减少查询时间 + AreaTableParam areaTableParam1 = new AreaTableParam(); + areaTableParam1.setInfo(info); - beginTime = beginTime.plus(1, ChronoUnit.MONTHS); - } - //数据排序 - Map linkMap = getSort(resultMap); - //暂降次数最多 - List collect = linkMap.keySet().stream().collect(Collectors.toList()); - //赋值 - dayOfMonth = Integer.parseInt(collect.get(0).substring(5, 7)); + List iEC28VOResult = IEC28Area(areaTableParam1); + List iEC411VOResult = IEC411Area(areaTableParam1); + List dISDIPVOResult = eventDisdipArea(areaTableParam1); + + + //IEC411 <1% 总共集合 + List lessOneIEC411 = new ArrayList<>(); + //IEC411 1~40% 总共集合 + List lessFortyIEC411 = new ArrayList<>(); + //IEC411 40~70% 总共集合 + List lessSeventyIEC411 = new ArrayList<>(); + + + //IEC28 <1% 总共集合 + List lessOneIEC28 = new ArrayList<>(); + //IEC411 <10 总共集合 + List lessTenIEC28 = new ArrayList<>(); + //IEC411 <20 总共集合 + List lessTwentyIEC28 = new ArrayList<>(); + //IEC411 <30 总共集合 + List lessThirtyIEC28 = new ArrayList<>(); + //IEC411 <40 总共集合 + List lessFortyIEC28 = new ArrayList<>(); + //IEC411 <50 总共集合 + List lessFiftyIEC28 = new ArrayList<>(); + //IEC411 <60 总共集合 + List lessSixtyIEC28 = new ArrayList<>(); + //IEC411 <70 总共集合 + List lessSeventyIEC28 = new ArrayList<>(); + //IEC411 <80 总共集合 + List lessEightyIEC28 = new ArrayList<>(); + //IEC411 <90 总共集合 + List lessNinetyIEC28 = new ArrayList<>(); + //IEC411 <120 总共集合 + List lessHundredTwentyIEC28 = new ArrayList<>(); + //IEC411 <130 总共集合 + List lessHundredThirtyIEC28 = new ArrayList<>(); + //IEC411 <140 总共集合 + List lessHundredFortyIEC28 = new ArrayList<>(); + //IEC411 <150 总共集合 + List lessHundredFiftyIEC28 = new ArrayList<>(); + //IEC411 <160 总共集合 + List lessHundredSixtyIEC28 = new ArrayList<>(); + //IEC411 <170 总共集合 + List lessHundredSeventyIEC28 = new ArrayList<>(); + //IEC411 <180 总共集合 + List lessHundredEightyIEC28 = new ArrayList<>(); + + + //DISDIP = 10% + List equalTenDISDIP = new ArrayList<>(); + //DISDIP = 40% + List equalFortyDISDIP = new ArrayList<>(); + //DISDIP = 70% + List equalSeventyDISDIP = new ArrayList<>(); + //DISDIP = 85% + List equalEightyFiveDISDIP = new ArrayList<>(); + //DISDIP = 90% + List equalNinetyDISDIP = new ArrayList<>(); + + + //遍历将集合按名称分开 + for (int i1 = 0; i1 < iEC411VOResult.size(); i1++) { + if ("<1%".equals(iEC411VOResult.get(i1).getName())) { + //放入集合 + lessOneIEC411.add(iEC411VOResult.get(i1)); + } else if ("1~40%".equals(iEC411VOResult.get(i1).getName())) { + //放入集合 + lessFortyIEC411.add(iEC411VOResult.get(i1)); } else { - table = "天数"; - - List dayCount = new ArrayList<>(); - List timeList = new ArrayList<>(); - - //进行for循环获取所有事件的时间 - for (EventDetailNew eventDetail : eventDetailList) { - //获取暂降事件时间 - /* String timeId = eventDetail.getTimeId(); - Date date1 = DateUtil.parse(timeId); - int day = Integer.parseInt(String.format("%td",date1));*/ - dayCount.add(DateUtil.formatDate(DateUtil.parse(eventDetail.getStartTime()))); - - //创建对象 - AreaEventMonthParam timeParam = new AreaEventMonthParam(); - timeParam.setDayOrMonth(DateUtil.formatDate(DateUtil.parse(eventDetail.getStartTime()))); - timeParam.setEventAssIndex(eventDetail.getEventassIndex()); - timeList.add(timeParam); - } - - //Map集和 - Map> relevanceMap = new HashMap<>(); - List list = new ArrayList<>(); - - for (AreaEventMonthParam areaEventMonthParam : timeList) { - //如果存在 - if (relevanceMap.containsKey(areaEventMonthParam.getDayOrMonth())) { - list = relevanceMap.get(areaEventMonthParam.getDayOrMonth()); - list.add(areaEventMonthParam.getEventAssIndex()); - relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list)); - } else { - List list1 = new ArrayList<>(); - list1.add(areaEventMonthParam.getEventAssIndex()); - relevanceMap.put(areaEventMonthParam.getDayOrMonth(), (list1)); - } - } - //创建map集和装当天和次数 - Map resultMap = new HashMap<>(); - for (String day : dayCount) { - if (resultMap.containsKey(day)) { - resultMap.put(day, resultMap.get(day) + 1); - } else { - resultMap.put(day, 1); - } - } - - //获取未关联的暂态事件 - Map eventAssDetail = eventDetailList.stream().filter(x -> StrUtil.isBlank(x.getEventassIndex())) - .collect(Collectors.groupingBy(x -> DateUtil.formatDate(DateUtil.parse(x.getStartTime())), Collectors.counting())); - - DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - //开始时间 - LocalDate beginTime = LocalDate.parse(areaReportParam.getSearchBeginTime(), fmt); - LocalDate endTime = LocalDate.parse(areaReportParam.getSearchEndTime(), fmt); - - Set keySet = resultMap.keySet(); - - while (!beginTime.equals(endTime.plus(1, ChronoUnit.DAYS))) { - if (keySet.contains(beginTime.toString())) { - - //获取暂降次数 - Integer countSize = resultMap.get(beginTime.toString()); - TimeSVO timeVO = new TimeSVO(); - timeVO.setTimes(countSize.toString()); - - if (beginTime.getDayOfMonth() < 10) { - timeVO.setDay("0" + beginTime.getDayOfMonth() + ""); - } else { - timeVO.setDay(beginTime.getDayOfMonth() + ""); - } - - timeVO.setYear(String.valueOf(beginTime.getYear())); - //todo 不知道代码是否是写错了,时间判断有问题 - if (beginTime.getMonthValue() < 10) { - timeVO.setMonth("0" + beginTime.getMonthValue() + ""); - } else { - timeVO.setMonth(beginTime.getMonthValue() + ""); - } - timeVO.setFulltime(beginTime.toString()); - //遍历 如果时间相同,将所有关联处理事件次数赋值上去 - if(eventAssDetail.containsKey(beginTime.toString())){ - timeVO.setEventAssIndex(Math.toIntExact(eventAssDetail.get(beginTime.toString()))); - }else{ - timeVO.setEventAssIndex(0); - } - timeSVoList.add(timeVO); - } else { - TimeSVO timeVO = new TimeSVO(); - timeVO.setTimes("0"); - if (beginTime.getDayOfMonth() < 10) { - timeVO.setDay("0" + beginTime.getDayOfMonth() + ""); - } else { - timeVO.setDay(beginTime.getDayOfMonth() + ""); - } - timeVO.setYear(String.valueOf(beginTime.getYear())); - - //todo 未知问题:是否是代码错误 - if (beginTime.getMonthValue() < 10) { - timeVO.setMonth("0" + beginTime.getMonthValue() + ""); - } else { - timeVO.setMonth(beginTime.getMonthValue() + ""); - } - timeVO.setEventAssIndex(0); - timeVO.setFulltime(beginTime.toString()); - timeSVoList.add(timeVO); - } - - beginTime = beginTime.plus(1, ChronoUnit.DAYS); - } - - //数据排序 - Map linkMap = getSort(resultMap); - //暂降次数最多 - List collect = linkMap.keySet().stream().collect(Collectors.toList()); - - //赋值 - dayOfMonth = LocalDate.parse(collect.get(0)).getDayOfMonth(); - + //放入集合 + lessSeventyIEC411.add(iEC411VOResult.get(i1)); } - - //最高暂降事件的两个电压值 -// System.out.println(topVoltage); - //转为List - List topVoltageList = new ArrayList<>(); - for (String s : topVoltage) { - topVoltageList.add(s); - } - //表格 - if (areaReportParam.isEventCountTable()) { - - //创建表题计数 - int twoCount = 1; - - //与暂降事件图形共享序号 - oneCount5 = oneCount; - - - createTitle(doc, "4." + oneCount + " " + typeName + "事件列表", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条," + topVoltageList.get(0) + "、" + topVoltageList.get(1) + "" + typeName + "事件居多," + - "第" + dayOfMonth + "" + table + "" + typeName + "事件居多,具体见下表(图):"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "事件表格", "标题 3", 400, 11); - twoCount2 = twoCount; - - //第一张表 - XWPFTable monitorInfo = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); - // 表格第一行 - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "区域", "电压" + typeName + "次数"); - //塞入数据 - for (String s : areaCount.keySet()) { - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, s, areaCount.get(s).toString()); - } - - - //第二张表 - XWPFTable monitorInfo1 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph1 = WordUtils.getCenterParagraph(doc); - // 表格第一行 - insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, true, "电压等级", "电压" + typeName + "次数"); - //塞入数据 - for (String s : voltageCount.keySet()) { - insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, false, s, voltageCount.get(s).toString()); - } - - - //第三张表 - XWPFTable monitorInfo2 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); - // 表格第一行 - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "" + table + "", "电压" + typeName + "次数"); - //塞入数据 - for (int i = 0; i < timeSVoList.size(); i++) { - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, timeSVoList.get(i).getFulltime(), timeSVoList.get(i).getTimes()); - } - - //序号计数进行++ - oneCount++; - - /** - * =======================================word结束========================================= - */ - - } - - //图形 - if (areaReportParam.isEventCountChart()) { - twoCount2++; - createTitle(doc, "4." + oneCount5 + "." + twoCount2 + " " + typeName + "事件图形", "标题 3", 400, 11); - - - //创建部门与监测点次数的map集合 - Map lineCount = new HashMap<>(); - for (PmsGeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { - lineCount.put(generalDeviceDTO.getName(), generalDeviceDTO.getMonitorIdList().size()); - } - - //创建x,y参数 - List xdata = new ArrayList<>(); - List ydata = new ArrayList<>(); - //根据区域名称进行匹配 - for (String name : areaCount.keySet()) { - //将监测点的数量拼接在部门下面 - for (String s : lineCount.keySet()) { - if (s.equals(name)) { - xdata.add(name + "\n" + "(" + lineCount.get(s) + ")"); - } - } - - ydata.add(areaCount.get(name)); - } - - String qytj = drawPicUtil.drawEventRegion(xdata, ydata); - createPic(doc, qytj, "" + typeName + "事件图形"); - - - //月份统计 - //创建x,y参数 - List xdata1 = new ArrayList<>(); - List ydata1 = new ArrayList<>(); - List ydata2 = new ArrayList<>(); - for (TimeSVO timeSVO : timeSVoList) { - if ("天数".equals(table)) { - xdata1.add(timeSVO.getFulltime().substring(5)); - } else { - xdata1.add(timeSVO.getFulltime()); - } - ydata1.add(Integer.parseInt(timeSVO.getTimes())); - ydata2.add(timeSVO.getEventAssIndex()); - } - - - String yftj = drawPicUtil.drawEventAssociatedUnassociated(xdata1, ydata1, ydata2, table); - createPic(doc, yftj, "" + typeName + "事件图形"); - - - //创建电压uiiiuuuu与监测点次数的map集合 - List areaParamList = voltageParamList; - Map lineCount1 = new HashMap<>(); - for (PmsGeneralDeviceDTO generalDeviceDTO : areaParamList) { - lineCount1.put(generalDeviceDTO.getName(), generalDeviceDTO.getMonitorIdList().size()); - } - //创建x,y参数 - List xdata3 = new ArrayList<>(); - List ydata3 = new ArrayList<>(); - //根据电压名称进行匹配 - for (String name : voltageCount.keySet()) { - //将监测点的数量拼接在部门下面 - for (String s : lineCount1.keySet()) { - if (s.equals(name)) { - xdata3.add(name + "\n" + "(" + lineCount1.get(s) + ")"); - } - } - ydata3.add(voltageCount.get(name)); - } - - String dydj = drawPicUtil.drawEventVoltageLevel(xdata3, ydata3); - createPic(doc, dydj, "" + typeName + "事件图形"); - - - /** - * =======================================word结束========================================= - */ - } - - } - //3.密度图 - if (areaReportParam.isDensityTable() || areaReportParam.isDensityChart()) { - //暂降密度图形 - AreaTableParam areaTableParam = new AreaTableParam(); + //遍历将集合按名称分开 + for (int i1 = 0; i1 < iEC28VOResult.size(); i1++) { + if ("1>U>=0".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessOneIEC28.add(iEC28VOResult.get(i1)); + } else if ("10>U>=1".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessTenIEC28.add(iEC28VOResult.get(i1)); + } else if ("20>U>=10".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessTwentyIEC28.add(iEC28VOResult.get(i1)); + } else if ("30>U>=20".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessThirtyIEC28.add(iEC28VOResult.get(i1)); + } else if ("40>U>=30".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessFortyIEC28.add(iEC28VOResult.get(i1)); + } else if ("50>U>=40".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessFiftyIEC28.add(iEC28VOResult.get(i1)); + } else if ("60>U>=50".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessSixtyIEC28.add(iEC28VOResult.get(i1)); + } else if ("70>U>=60".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessSeventyIEC28.add(iEC28VOResult.get(i1)); + } else if ("80>U>=70".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessEightyIEC28.add(iEC28VOResult.get(i1)); + } else if ("90>U>=80".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessNinetyIEC28.add(iEC28VOResult.get(i1)); + } else if ("120>U>=110".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredTwentyIEC28.add(iEC28VOResult.get(i1)); + } else if ("130>U>=120".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredThirtyIEC28.add(iEC28VOResult.get(i1)); + } else if ("140>U>=130".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredFortyIEC28.add(iEC28VOResult.get(i1)); + } else if ("150>U>=140".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredFiftyIEC28.add(iEC28VOResult.get(i1)); + } else if ("160>U>=150".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredSixtyIEC28.add(iEC28VOResult.get(i1)); + } else if ("170>U>=160".equals(iEC28VOResult.get(i1).getName())) { + //放入集合 + lessHundredSeventyIEC28.add(iEC28VOResult.get(i1)); + } else { + //放入集合 + lessHundredEightyIEC28.add(iEC28VOResult.get(i1)); - //创建结果集合 - List info = eventDetailList; + } + } - //将sql结果集放入,共用一个sql,减少查询时间 - AreaTableParam areaTableParam1 = new AreaTableParam(); - areaTableParam1.setInfo(info); + //遍历将集合按名称分开 + for (int i1 = 0; i1 < dISDIPVOResult.size(); i1++) { + if ("10%".equals(dISDIPVOResult.get(i1).getName())) { + //放入集合 + equalTenDISDIP.add(dISDIPVOResult.get(i1)); + } else if ("40%".equals(dISDIPVOResult.get(i1).getName())) { + //放入集合 + equalFortyDISDIP.add(dISDIPVOResult.get(i1)); + } else if ("70%".equals(dISDIPVOResult.get(i1).getName())) { + //放入集合 + equalSeventyDISDIP.add(dISDIPVOResult.get(i1)); + } else if ("85%".equals(dISDIPVOResult.get(i1).getName())) { + //放入集合 + equalEightyFiveDISDIP.add(dISDIPVOResult.get(i1)); + } else { + //放入集合 + equalNinetyDISDIP.add(dISDIPVOResult.get(i1)); + } + } - List iEC28VOResult = IEC28Area(areaTableParam1); - List iEC411VOResult = IEC411Area(areaTableParam1); - List dISDIPVOResult = eventDisdipArea(areaTableParam1); + //遍历集合中的参数 + IEC411CountParam iec411LessOne = new IEC411CountParam(); - - //IEC411 <1% 总共集合 - List lessOneIEC411 = new ArrayList<>(); - //IEC411 1~40% 总共集合 - List lessFortyIEC411 = new ArrayList<>(); - //IEC411 40~70% 总共集合 - List lessSeventyIEC411 = new ArrayList<>(); - - - //IEC28 <1% 总共集合 - List lessOneIEC28 = new ArrayList<>(); - //IEC411 <10 总共集合 - List lessTenIEC28 = new ArrayList<>(); - //IEC411 <20 总共集合 - List lessTwentyIEC28 = new ArrayList<>(); - //IEC411 <30 总共集合 - List lessThirtyIEC28 = new ArrayList<>(); - //IEC411 <40 总共集合 - List lessFortyIEC28 = new ArrayList<>(); - //IEC411 <50 总共集合 - List lessFiftyIEC28 = new ArrayList<>(); - //IEC411 <60 总共集合 - List lessSixtyIEC28 = new ArrayList<>(); - //IEC411 <70 总共集合 - List lessSeventyIEC28 = new ArrayList<>(); - //IEC411 <80 总共集合 - List lessEightyIEC28 = new ArrayList<>(); - //IEC411 <90 总共集合 - List lessNinetyIEC28 = new ArrayList<>(); - //IEC411 <120 总共集合 - List lessHundredTwentyIEC28 = new ArrayList<>(); - //IEC411 <130 总共集合 - List lessHundredThirtyIEC28 = new ArrayList<>(); - //IEC411 <140 总共集合 - List lessHundredFortyIEC28 = new ArrayList<>(); - //IEC411 <150 总共集合 - List lessHundredFiftyIEC28 = new ArrayList<>(); - //IEC411 <160 总共集合 - List lessHundredSixtyIEC28 = new ArrayList<>(); - //IEC411 <170 总共集合 - List lessHundredSeventyIEC28 = new ArrayList<>(); - //IEC411 <180 总共集合 - List lessHundredEightyIEC28 = new ArrayList<>(); - - - //DISDIP = 10% - List equalTenDISDIP = new ArrayList<>(); - //DISDIP = 40% - List equalFortyDISDIP = new ArrayList<>(); - //DISDIP = 70% - List equalSeventyDISDIP = new ArrayList<>(); - //DISDIP = 85% - List equalEightyFiveDISDIP = new ArrayList<>(); - //DISDIP = 90% - List equalNinetyDISDIP = new ArrayList<>(); - - - //遍历将集合按名称分开 - for (int i1 = 0; i1 < iEC411VOResult.size(); i1++) { - if ("<1%".equals(iEC411VOResult.get(i1).getName())) { - //放入集合 - lessOneIEC411.add(iEC411VOResult.get(i1)); - } else if ("1~40%".equals(iEC411VOResult.get(i1).getName())) { - //放入集合 - lessFortyIEC411.add(iEC411VOResult.get(i1)); - } else { - //放入集合 - lessSeventyIEC411.add(iEC411VOResult.get(i1)); - } + for (IEC411VO iec411VO : lessOneIEC411) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec411LessOne.getName())) { + iec411LessOne.setName(iec411VO.getName()); } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec411VO.getTenTwentyMs())) { + int tenToTwenty = iec411LessOne.getTenToTwenty(); + iec411LessOne.setTenToTwenty(tenToTwenty++); + } + if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { + int twentyToHundred = iec411LessOne.getTwentyToHundred(); + iec411LessOne.setTenToTwenty(twentyToHundred++); + } + if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { + int zeroOneToZeroTwo = iec411LessOne.getZeroOneToZeroTwo(); + iec411LessOne.setTenToTwenty(zeroOneToZeroTwo++); + } + if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { + int zeroTwoToZeroFive = iec411LessOne.getZeroTwoToZeroFive(); + iec411LessOne.setTenToTwenty(zeroTwoToZeroFive++); + } + if (!"0".equals(iec411VO.getZeroPiontFive1S())) { + int zeroFiveToOne = iec411LessOne.getZeroFiveToOne(); + iec411LessOne.setTenToTwenty(zeroFiveToOne++); + } + if (!"0".equals(iec411VO.getGreater1S())) { + int lessOne = iec411LessOne.getLessOne(); + iec411LessOne.setTenToTwenty(lessOne++); + } + } - //遍历将集合按名称分开 - for (int i1 = 0; i1 < iEC28VOResult.size(); i1++) { - if ("1>U>=0".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessOneIEC28.add(iEC28VOResult.get(i1)); - } else if ("10>U>=1".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessTenIEC28.add(iEC28VOResult.get(i1)); - } else if ("20>U>=10".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessTwentyIEC28.add(iEC28VOResult.get(i1)); - } else if ("30>U>=20".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessThirtyIEC28.add(iEC28VOResult.get(i1)); - } else if ("40>U>=30".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessFortyIEC28.add(iEC28VOResult.get(i1)); - } else if ("50>U>=40".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessFiftyIEC28.add(iEC28VOResult.get(i1)); - } else if ("60>U>=50".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessSixtyIEC28.add(iEC28VOResult.get(i1)); - } else if ("70>U>=60".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessSeventyIEC28.add(iEC28VOResult.get(i1)); - } else if ("80>U>=70".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessEightyIEC28.add(iEC28VOResult.get(i1)); - } else if ("90>U>=80".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessNinetyIEC28.add(iEC28VOResult.get(i1)); - } else if ("120>U>=110".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredTwentyIEC28.add(iEC28VOResult.get(i1)); - } else if ("130>U>=120".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredThirtyIEC28.add(iEC28VOResult.get(i1)); - } else if ("140>U>=130".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredFortyIEC28.add(iEC28VOResult.get(i1)); - } else if ("150>U>=140".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredFiftyIEC28.add(iEC28VOResult.get(i1)); - } else if ("160>U>=150".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredSixtyIEC28.add(iEC28VOResult.get(i1)); - } else if ("170>U>=160".equals(iEC28VOResult.get(i1).getName())) { - //放入集合 - lessHundredSeventyIEC28.add(iEC28VOResult.get(i1)); - } else { - //放入集合 - lessHundredEightyIEC28.add(iEC28VOResult.get(i1)); + //遍历集合中的参数 + IEC411CountParam iec411LessForty = new IEC411CountParam(); - } + for (IEC411VO iec411VO : lessFortyIEC411) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec411LessForty.getName())) { + iec411LessForty.setName(iec411VO.getName()); } - //遍历将集合按名称分开 - for (int i1 = 0; i1 < dISDIPVOResult.size(); i1++) { - if ("10%".equals(dISDIPVOResult.get(i1).getName())) { - //放入集合 - equalTenDISDIP.add(dISDIPVOResult.get(i1)); - } else if ("40%".equals(dISDIPVOResult.get(i1).getName())) { - //放入集合 - equalFortyDISDIP.add(dISDIPVOResult.get(i1)); - } else if ("70%".equals(dISDIPVOResult.get(i1).getName())) { - //放入集合 - equalSeventyDISDIP.add(dISDIPVOResult.get(i1)); - } else if ("85%".equals(dISDIPVOResult.get(i1).getName())) { - //放入集合 - equalEightyFiveDISDIP.add(dISDIPVOResult.get(i1)); - } else { - //放入集合 - equalNinetyDISDIP.add(dISDIPVOResult.get(i1)); - } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec411VO.getTenTwentyMs())) { + int tenToTwenty = iec411LessForty.getTenToTwenty(); + iec411LessForty.setTenToTwenty(tenToTwenty++); + } + if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { + int twentyToHundred = iec411LessForty.getTwentyToHundred(); + iec411LessForty.setTenToTwenty(twentyToHundred++); + } + if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { + int zeroOneToZeroTwo = iec411LessForty.getZeroOneToZeroTwo(); + iec411LessForty.setTenToTwenty(zeroOneToZeroTwo++); + } + if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { + int zeroTwoToZeroFive = iec411LessForty.getZeroTwoToZeroFive(); + iec411LessForty.setTenToTwenty(zeroTwoToZeroFive++); + } + if (!"0".equals(iec411VO.getZeroPiontFive1S())) { + int zeroFiveToOne = iec411LessForty.getZeroFiveToOne(); + iec411LessForty.setTenToTwenty(zeroFiveToOne++); + } + if (!"0".equals(iec411VO.getGreater1S())) { + int lessOne = iec411LessForty.getLessOne(); + iec411LessForty.setTenToTwenty(lessOne++); + } + } + + //遍历集合中的参数 + IEC411CountParam iec411LessSeventy = new IEC411CountParam(); + + for (IEC411VO iec411VO : lessSeventyIEC411) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec411LessSeventy.getName())) { + iec411LessSeventy.setName(iec411VO.getName()); } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec411VO.getTenTwentyMs())) { + int tenToTwenty = iec411LessSeventy.getTenToTwenty(); + iec411LessSeventy.setTenToTwenty(tenToTwenty++); + } + if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { + int twentyToHundred = iec411LessSeventy.getTwentyToHundred(); + iec411LessSeventy.setTenToTwenty(twentyToHundred++); + } + if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { + int zeroOneToZeroTwo = iec411LessSeventy.getZeroOneToZeroTwo(); + iec411LessSeventy.setTenToTwenty(zeroOneToZeroTwo++); + } + if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { + int zeroTwoToZeroFive = iec411LessSeventy.getZeroTwoToZeroFive(); + iec411LessSeventy.setTenToTwenty(zeroTwoToZeroFive++); + } + if (!"0".equals(iec411VO.getZeroPiontFive1S())) { + int zeroFiveToOne = iec411LessSeventy.getZeroFiveToOne(); + iec411LessSeventy.setTenToTwenty(zeroFiveToOne++); + } + if (!"0".equals(iec411VO.getGreater1S())) { + int lessOne = iec411LessSeventy.getLessOne(); + iec411LessSeventy.setTenToTwenty(lessOne++); + } + } - //遍历集合中的参数 - IEC411CountParam iec411LessOne = new IEC411CountParam(); + /** + * ================第一张表结束====================== + */ - for (IEC411VO iec411VO : lessOneIEC411) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec411LessOne.getName())) { - iec411LessOne.setName(iec411VO.getName()); - } + DISDIPCountParam disdipEqualTen = new DISDIPCountParam(); - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec411VO.getTenTwentyMs())) { - int tenToTwenty = iec411LessOne.getTenToTwenty(); - iec411LessOne.setTenToTwenty(tenToTwenty++); - } - if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { - int twentyToHundred = iec411LessOne.getTwentyToHundred(); - iec411LessOne.setTenToTwenty(twentyToHundred++); - } - if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { - int zeroOneToZeroTwo = iec411LessOne.getZeroOneToZeroTwo(); - iec411LessOne.setTenToTwenty(zeroOneToZeroTwo++); - } - if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { - int zeroTwoToZeroFive = iec411LessOne.getZeroTwoToZeroFive(); - iec411LessOne.setTenToTwenty(zeroTwoToZeroFive++); - } - if (!"0".equals(iec411VO.getZeroPiontFive1S())) { - int zeroFiveToOne = iec411LessOne.getZeroFiveToOne(); - iec411LessOne.setTenToTwenty(zeroFiveToOne++); - } - if (!"0".equals(iec411VO.getGreater1S())) { - int lessOne = iec411LessOne.getLessOne(); - iec411LessOne.setTenToTwenty(lessOne++); - } + for (DISDIPVO disdipvo : equalTenDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualTen.getName())) { + disdipEqualTen.setName(disdipvo.getName()); } - //遍历集合中的参数 - IEC411CountParam iec411LessForty = new IEC411CountParam(); + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualTen.getTwenty(); + disdipEqualTen.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualTen.getOneHundredMS(); + disdipEqualTen.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualTen.getFiveHundredMS(); + disdipEqualTen.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualTen.getOne(); + disdipEqualTen.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualTen.getThree(); + disdipEqualTen.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualTen.getTwenty(); + disdipEqualTen.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualTen.getSixty(); + disdipEqualTen.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualTen.getOneHundredAndEighty(); + disdipEqualTen.setOneHundredAndEighty(oneHundredAndEighty++); + } + } - for (IEC411VO iec411VO : lessFortyIEC411) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec411LessForty.getName())) { - iec411LessForty.setName(iec411VO.getName()); - } + DISDIPCountParam disdipEqualForty = new DISDIPCountParam(); - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec411VO.getTenTwentyMs())) { - int tenToTwenty = iec411LessForty.getTenToTwenty(); - iec411LessForty.setTenToTwenty(tenToTwenty++); - } - if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { - int twentyToHundred = iec411LessForty.getTwentyToHundred(); - iec411LessForty.setTenToTwenty(twentyToHundred++); - } - if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { - int zeroOneToZeroTwo = iec411LessForty.getZeroOneToZeroTwo(); - iec411LessForty.setTenToTwenty(zeroOneToZeroTwo++); - } - if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { - int zeroTwoToZeroFive = iec411LessForty.getZeroTwoToZeroFive(); - iec411LessForty.setTenToTwenty(zeroTwoToZeroFive++); - } - if (!"0".equals(iec411VO.getZeroPiontFive1S())) { - int zeroFiveToOne = iec411LessForty.getZeroFiveToOne(); - iec411LessForty.setTenToTwenty(zeroFiveToOne++); - } - if (!"0".equals(iec411VO.getGreater1S())) { - int lessOne = iec411LessForty.getLessOne(); - iec411LessForty.setTenToTwenty(lessOne++); - } + for (DISDIPVO disdipvo : equalFortyDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualForty.getName())) { + disdipEqualForty.setName(disdipvo.getName()); } - //遍历集合中的参数 - IEC411CountParam iec411LessSeventy = new IEC411CountParam(); + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualForty.getTwenty(); + disdipEqualForty.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualForty.getOneHundredMS(); + disdipEqualForty.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualForty.getFiveHundredMS(); + disdipEqualForty.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualForty.getOne(); + disdipEqualForty.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualForty.getThree(); + disdipEqualForty.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualForty.getTwenty(); + disdipEqualForty.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualForty.getSixty(); + disdipEqualForty.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualForty.getOneHundredAndEighty(); + disdipEqualForty.setOneHundredAndEighty(oneHundredAndEighty++); + } + } - for (IEC411VO iec411VO : lessSeventyIEC411) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec411LessSeventy.getName())) { - iec411LessSeventy.setName(iec411VO.getName()); - } + DISDIPCountParam disdipEqualSeventy = new DISDIPCountParam(); - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec411VO.getTenTwentyMs())) { - int tenToTwenty = iec411LessSeventy.getTenToTwenty(); - iec411LessSeventy.setTenToTwenty(tenToTwenty++); - } - if (!"0".equals(iec411VO.getTwentyOneHundredMs())) { - int twentyToHundred = iec411LessSeventy.getTwentyToHundred(); - iec411LessSeventy.setTenToTwenty(twentyToHundred++); - } - if (!"0".equals(iec411VO.getZeroPiontOneTwoS())) { - int zeroOneToZeroTwo = iec411LessSeventy.getZeroOneToZeroTwo(); - iec411LessSeventy.setTenToTwenty(zeroOneToZeroTwo++); - } - if (!"0".equals(iec411VO.getZeroPiontTwoFiveS())) { - int zeroTwoToZeroFive = iec411LessSeventy.getZeroTwoToZeroFive(); - iec411LessSeventy.setTenToTwenty(zeroTwoToZeroFive++); - } - if (!"0".equals(iec411VO.getZeroPiontFive1S())) { - int zeroFiveToOne = iec411LessSeventy.getZeroFiveToOne(); - iec411LessSeventy.setTenToTwenty(zeroFiveToOne++); - } - if (!"0".equals(iec411VO.getGreater1S())) { - int lessOne = iec411LessSeventy.getLessOne(); - iec411LessSeventy.setTenToTwenty(lessOne++); - } + for (DISDIPVO disdipvo : equalSeventyDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualSeventy.getName())) { + disdipEqualSeventy.setName(disdipvo.getName()); } - /** - * ================第一张表结束====================== - */ + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualSeventy.getTwenty(); + disdipEqualSeventy.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualSeventy.getOneHundredMS(); + disdipEqualSeventy.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualSeventy.getFiveHundredMS(); + disdipEqualSeventy.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualSeventy.getOne(); + disdipEqualSeventy.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualSeventy.getThree(); + disdipEqualSeventy.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualSeventy.getTwenty(); + disdipEqualSeventy.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualSeventy.getSixty(); + disdipEqualSeventy.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualSeventy.getOneHundredAndEighty(); + disdipEqualSeventy.setOneHundredAndEighty(oneHundredAndEighty++); + } + } - DISDIPCountParam disdipEqualTen = new DISDIPCountParam(); + DISDIPCountParam disdipEqualEighty = new DISDIPCountParam(); - for (DISDIPVO disdipvo : equalTenDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualTen.getName())) { - disdipEqualTen.setName(disdipvo.getName()); - } - - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualTen.getTwenty(); - disdipEqualTen.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualTen.getOneHundredMS(); - disdipEqualTen.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualTen.getFiveHundredMS(); - disdipEqualTen.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualTen.getOne(); - disdipEqualTen.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualTen.getThree(); - disdipEqualTen.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualTen.getTwenty(); - disdipEqualTen.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualTen.getSixty(); - disdipEqualTen.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualTen.getOneHundredAndEighty(); - disdipEqualTen.setOneHundredAndEighty(oneHundredAndEighty++); - } + for (DISDIPVO disdipvo : equalEightyFiveDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualEighty.getName())) { + disdipEqualEighty.setName(disdipvo.getName()); } - DISDIPCountParam disdipEqualForty = new DISDIPCountParam(); + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualEighty.getTwenty(); + disdipEqualEighty.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualEighty.getOneHundredMS(); + disdipEqualEighty.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualEighty.getFiveHundredMS(); + disdipEqualEighty.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualEighty.getOne(); + disdipEqualEighty.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualEighty.getThree(); + disdipEqualEighty.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualEighty.getTwenty(); + disdipEqualEighty.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualEighty.getSixty(); + disdipEqualEighty.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualEighty.getOneHundredAndEighty(); + disdipEqualEighty.setOneHundredAndEighty(oneHundredAndEighty++); + } + } + DISDIPCountParam disdipEqualNinety = new DISDIPCountParam(); - for (DISDIPVO disdipvo : equalFortyDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualForty.getName())) { - disdipEqualForty.setName(disdipvo.getName()); - } - - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualForty.getTwenty(); - disdipEqualForty.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualForty.getOneHundredMS(); - disdipEqualForty.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualForty.getFiveHundredMS(); - disdipEqualForty.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualForty.getOne(); - disdipEqualForty.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualForty.getThree(); - disdipEqualForty.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualForty.getTwenty(); - disdipEqualForty.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualForty.getSixty(); - disdipEqualForty.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualForty.getOneHundredAndEighty(); - disdipEqualForty.setOneHundredAndEighty(oneHundredAndEighty++); - } + for (DISDIPVO disdipvo : equalNinetyDISDIP) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(disdipEqualNinety.getName())) { + disdipEqualNinety.setName(disdipvo.getName()); } - DISDIPCountParam disdipEqualSeventy = new DISDIPCountParam(); + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(disdipvo.getTwentyMs())) { + int twenty = disdipEqualNinety.getTwenty(); + disdipEqualNinety.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getOneHundredMs())) { + int oneHundredMS = disdipEqualNinety.getOneHundredMS(); + disdipEqualNinety.setOneHundredMS(oneHundredMS++); + } + if (!"0".equals(disdipvo.getFiveHundredMs())) { + int fiveHundredMS = disdipEqualNinety.getFiveHundredMS(); + disdipEqualNinety.setOneHundredMS(fiveHundredMS++); + } + if (!"0".equals(disdipvo.getOneS())) { + int one = disdipEqualNinety.getOne(); + disdipEqualNinety.setOne(one++); + } + if (!"0".equals(disdipvo.getThreeS())) { + int three = disdipEqualNinety.getThree(); + disdipEqualNinety.setOne(three++); + } + if (!"0".equals(disdipvo.getTwentyS())) { + int twenty = disdipEqualNinety.getTwenty(); + disdipEqualNinety.setTwenty(twenty++); + } + if (!"0".equals(disdipvo.getSixtyS())) { + int sixty = disdipEqualNinety.getSixty(); + disdipEqualNinety.setSixty(sixty++); + } + if (!"0".equals(disdipvo.getOneEightyS())) { + int oneHundredAndEighty = disdipEqualNinety.getOneHundredAndEighty(); + disdipEqualNinety.setOneHundredAndEighty(oneHundredAndEighty++); + } + } - for (DISDIPVO disdipvo : equalSeventyDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualSeventy.getName())) { - disdipEqualSeventy.setName(disdipvo.getName()); - } + /** + * ======================第二张表结束============================== + */ - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualSeventy.getTwenty(); - disdipEqualSeventy.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualSeventy.getOneHundredMS(); - disdipEqualSeventy.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualSeventy.getFiveHundredMS(); - disdipEqualSeventy.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualSeventy.getOne(); - disdipEqualSeventy.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualSeventy.getThree(); - disdipEqualSeventy.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualSeventy.getTwenty(); - disdipEqualSeventy.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualSeventy.getSixty(); - disdipEqualSeventy.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualSeventy.getOneHundredAndEighty(); - disdipEqualSeventy.setOneHundredAndEighty(oneHundredAndEighty++); + //创建计数对象 + IEC28CountParam iec28CountLessOne = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessOneIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessOne.getName())) { + iec28CountLessOne.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessOne.getZeroZeroTwoToZeroOne(); + iec28CountLessOne.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessOne.getZeroOneToZeroTwentyFive(); + iec28CountLessOne.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessOne.getZeroTwentyFiveToZeroFive(); + iec28CountLessOne.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessOne.getZeroFiveToOne(); + iec28CountLessOne.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessOne.getOneToThree(); + iec28CountLessOne.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessOne.getThreeToTwenty(); + iec28CountLessOne.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessOne.getTwentyToSixty(); + iec28CountLessOne.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessOne.getSixtyToOneHundredAndEighty(); + iec28CountLessOne.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessTen = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessTenIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessTen.getName())) { + iec28CountLessTen.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessTen.getZeroZeroTwoToZeroOne(); + iec28CountLessTen.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessTen.getZeroOneToZeroTwentyFive(); + iec28CountLessTen.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessTen.getZeroTwentyFiveToZeroFive(); + iec28CountLessTen.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessTen.getZeroFiveToOne(); + iec28CountLessTen.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessTen.getOneToThree(); + iec28CountLessTen.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessTen.getThreeToTwenty(); + iec28CountLessTen.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessTen.getTwentyToSixty(); + iec28CountLessTen.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessTen.getSixtyToOneHundredAndEighty(); + iec28CountLessTen.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessTwenty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessTwentyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessTwenty.getName())) { + iec28CountLessTwenty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessTwenty.getZeroZeroTwoToZeroOne(); + iec28CountLessTwenty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessTwenty.getZeroOneToZeroTwentyFive(); + iec28CountLessTwenty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessTwenty.getZeroTwentyFiveToZeroFive(); + iec28CountLessTwenty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessTwenty.getZeroFiveToOne(); + iec28CountLessTwenty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessTwenty.getOneToThree(); + iec28CountLessTwenty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessTwenty.getThreeToTwenty(); + iec28CountLessTwenty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessTwenty.getTwentyToSixty(); + iec28CountLessTwenty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessTwenty.getSixtyToOneHundredAndEighty(); + iec28CountLessTwenty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessThirty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessThirtyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessThirty.getName())) { + iec28CountLessThirty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessThirty.getZeroZeroTwoToZeroOne(); + iec28CountLessThirty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessThirty.getZeroOneToZeroTwentyFive(); + iec28CountLessThirty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessThirty.getZeroTwentyFiveToZeroFive(); + iec28CountLessThirty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessThirty.getZeroFiveToOne(); + iec28CountLessThirty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessThirty.getOneToThree(); + iec28CountLessThirty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessThirty.getThreeToTwenty(); + iec28CountLessThirty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessThirty.getTwentyToSixty(); + iec28CountLessThirty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessThirty.getSixtyToOneHundredAndEighty(); + iec28CountLessThirty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessForty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessFortyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessForty.getName())) { + iec28CountLessForty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessForty.getZeroZeroTwoToZeroOne(); + iec28CountLessForty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessForty.getZeroOneToZeroTwentyFive(); + iec28CountLessForty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessForty.getZeroTwentyFiveToZeroFive(); + iec28CountLessForty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessForty.getZeroFiveToOne(); + iec28CountLessForty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessForty.getOneToThree(); + iec28CountLessForty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessForty.getThreeToTwenty(); + iec28CountLessForty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessForty.getTwentyToSixty(); + iec28CountLessForty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessForty.getSixtyToOneHundredAndEighty(); + iec28CountLessForty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessFifty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessFiftyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessFifty.getName())) { + iec28CountLessFifty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessFifty.getZeroZeroTwoToZeroOne(); + iec28CountLessFifty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessFifty.getZeroOneToZeroTwentyFive(); + iec28CountLessFifty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessFifty.getZeroTwentyFiveToZeroFive(); + iec28CountLessFifty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessFifty.getZeroFiveToOne(); + iec28CountLessFifty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessFifty.getOneToThree(); + iec28CountLessFifty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessFifty.getThreeToTwenty(); + iec28CountLessFifty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessFifty.getTwentyToSixty(); + iec28CountLessFifty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessFifty.getSixtyToOneHundredAndEighty(); + iec28CountLessFifty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessSixty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessSixtyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessSixty.getName())) { + iec28CountLessSixty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessSixty.getZeroZeroTwoToZeroOne(); + iec28CountLessSixty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessSixty.getZeroOneToZeroTwentyFive(); + iec28CountLessSixty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessSixty.getZeroTwentyFiveToZeroFive(); + iec28CountLessSixty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessSixty.getZeroFiveToOne(); + iec28CountLessSixty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessSixty.getOneToThree(); + iec28CountLessSixty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessSixty.getThreeToTwenty(); + iec28CountLessSixty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessSixty.getTwentyToSixty(); + iec28CountLessSixty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessSixty.getSixtyToOneHundredAndEighty(); + iec28CountLessSixty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessSeventy = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessSeventyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessSeventy.getName())) { + iec28CountLessSeventy.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessSeventy.getZeroZeroTwoToZeroOne(); + iec28CountLessSeventy.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessSeventy.getZeroOneToZeroTwentyFive(); + iec28CountLessSeventy.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessSeventy.getZeroTwentyFiveToZeroFive(); + iec28CountLessSeventy.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessSeventy.getZeroFiveToOne(); + iec28CountLessSeventy.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessSeventy.getOneToThree(); + iec28CountLessSeventy.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessSeventy.getThreeToTwenty(); + iec28CountLessSeventy.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessSeventy.getTwentyToSixty(); + iec28CountLessSeventy.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessSeventy.getSixtyToOneHundredAndEighty(); + iec28CountLessSeventy.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessEighty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessEightyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessEighty.getName())) { + iec28CountLessEighty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessEighty.getZeroZeroTwoToZeroOne(); + iec28CountLessEighty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessEighty.getZeroOneToZeroTwentyFive(); + iec28CountLessEighty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessEighty.getZeroTwentyFiveToZeroFive(); + iec28CountLessEighty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessEighty.getZeroFiveToOne(); + iec28CountLessEighty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessEighty.getOneToThree(); + iec28CountLessEighty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessEighty.getThreeToTwenty(); + iec28CountLessEighty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessEighty.getTwentyToSixty(); + iec28CountLessEighty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessEighty.getSixtyToOneHundredAndEighty(); + iec28CountLessEighty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + //创建计数对象 + IEC28CountParam iec28CountLessNinety = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessNinetyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessNinety.getName())) { + iec28CountLessNinety.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessNinety.getZeroZeroTwoToZeroOne(); + iec28CountLessNinety.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessNinety.getZeroOneToZeroTwentyFive(); + iec28CountLessNinety.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessNinety.getZeroTwentyFiveToZeroFive(); + iec28CountLessNinety.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessNinety.getZeroFiveToOne(); + iec28CountLessNinety.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessNinety.getOneToThree(); + iec28CountLessNinety.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessNinety.getThreeToTwenty(); + iec28CountLessNinety.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessNinety.getTwentyToSixty(); + iec28CountLessNinety.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessNinety.getSixtyToOneHundredAndEighty(); + iec28CountLessNinety.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + //创建计数对象 + IEC28CountParam iec28CountLessHundredTwenty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredTwentyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredTwenty.getName())) { + iec28CountLessHundredTwenty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredTwenty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredTwenty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredTwenty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredTwenty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredTwenty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredTwenty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredTwenty.getZeroFiveToOne(); + iec28CountLessHundredTwenty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredTwenty.getOneToThree(); + iec28CountLessHundredTwenty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredTwenty.getThreeToTwenty(); + iec28CountLessHundredTwenty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredTwenty.getTwentyToSixty(); + iec28CountLessHundredTwenty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredTwenty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredTwenty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredThirty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredThirtyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredThirty.getName())) { + iec28CountLessHundredThirty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredThirty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredThirty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredThirty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredThirty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredThirty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredThirty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredThirty.getZeroFiveToOne(); + iec28CountLessHundredThirty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredThirty.getOneToThree(); + iec28CountLessHundredThirty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredThirty.getThreeToTwenty(); + iec28CountLessHundredThirty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredThirty.getTwentyToSixty(); + iec28CountLessHundredThirty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredThirty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredThirty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + //创建计数对象 + IEC28CountParam iec28CountLessHundredForty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredFortyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredForty.getName())) { + iec28CountLessHundredForty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredForty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredForty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredForty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredForty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredForty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredForty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredForty.getZeroFiveToOne(); + iec28CountLessHundredForty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredForty.getOneToThree(); + iec28CountLessHundredForty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredForty.getThreeToTwenty(); + iec28CountLessHundredForty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredForty.getTwentyToSixty(); + iec28CountLessHundredForty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredForty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredForty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredFifty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredFiftyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredFifty.getName())) { + iec28CountLessHundredFifty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredFifty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredFifty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredFifty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredFifty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredFifty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredFifty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredFifty.getZeroFiveToOne(); + iec28CountLessHundredFifty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredFifty.getOneToThree(); + iec28CountLessHundredFifty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredFifty.getThreeToTwenty(); + iec28CountLessHundredFifty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredFifty.getTwentyToSixty(); + iec28CountLessHundredFifty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredFifty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredFifty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredSixty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredSixtyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredSixty.getName())) { + iec28CountLessHundredSixty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredSixty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredSixty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredSixty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredSixty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredSixty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredSixty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredSixty.getZeroFiveToOne(); + iec28CountLessHundredSixty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredSixty.getOneToThree(); + iec28CountLessHundredSixty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredSixty.getThreeToTwenty(); + iec28CountLessHundredSixty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredSixty.getTwentyToSixty(); + iec28CountLessHundredSixty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredSixty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredSixty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredSeventy = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredSeventyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredSeventy.getName())) { + iec28CountLessHundredSeventy.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredSeventy.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredSeventy.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredSeventy.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredSeventy.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredSeventy.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredSeventy.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredSeventy.getZeroFiveToOne(); + iec28CountLessHundredSeventy.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredSeventy.getOneToThree(); + iec28CountLessHundredSeventy.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredSeventy.getThreeToTwenty(); + iec28CountLessHundredSeventy.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredSeventy.getTwentyToSixty(); + iec28CountLessHundredSeventy.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredSeventy.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredSeventy.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + + //创建计数对象 + IEC28CountParam iec28CountLessHundredEighty = new IEC28CountParam(); + + for (IEC28VO iec28VO : lessHundredEightyIEC28) { + //获取当前剩余电压名称,不为空就进行添加 + if (Objects.isNull(iec28CountLessHundredEighty.getName())) { + iec28CountLessHundredEighty.setName(iec28VO.getName()); + } + //如果参数不等于0对对象中的参数进行++ + if (!"0".equals(iec28VO.getQ())) { + int zeroZeroTwoToZeroOne = iec28CountLessHundredEighty.getZeroZeroTwoToZeroOne(); + iec28CountLessHundredEighty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); + } + if (!"0".equals(iec28VO.getW())) { + int zeroOneToZeroTwentyFive = iec28CountLessHundredEighty.getZeroOneToZeroTwentyFive(); + iec28CountLessHundredEighty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); + } + if (!"0".equals(iec28VO.getE())) { + int zeroTwentyFiveToZeroFive = iec28CountLessHundredEighty.getZeroTwentyFiveToZeroFive(); + iec28CountLessHundredEighty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); + } + if (!"0".equals(iec28VO.getR())) { + int zeroFiveToOne = iec28CountLessHundredEighty.getZeroFiveToOne(); + iec28CountLessHundredEighty.setZeroFiveToOne(zeroFiveToOne++); + } + if (!"0".equals(iec28VO.getT())) { + int oneToThree = iec28CountLessHundredEighty.getOneToThree(); + iec28CountLessHundredEighty.setOneToThree(oneToThree++); + } + if (!"0".equals(iec28VO.getY())) { + int threeToTwenty = iec28CountLessHundredEighty.getThreeToTwenty(); + iec28CountLessHundredEighty.setThreeToTwenty(threeToTwenty++); + } + if (!"0".equals(iec28VO.getU())) { + int twentyToSixty = iec28CountLessHundredEighty.getTwentyToSixty(); + iec28CountLessHundredEighty.setTwentyToSixty(twentyToSixty++); + } + if (!"0".equals(iec28VO.getI())) { + int sixtyToOneHundredAndEighty = iec28CountLessHundredEighty.getSixtyToOneHundredAndEighty(); + iec28CountLessHundredEighty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); + } + } + + /** + * =========================第三张表结束=============================== + */ + + + //汇总放入集合 + List iec411Result = new ArrayList<>(); + iec411Result.add(iec411LessOne); + iec411Result.add(iec411LessForty); + iec411Result.add(iec411LessSeventy); + + List disdipResult = new ArrayList<>(); + disdipResult.add(disdipEqualTen); + disdipResult.add(disdipEqualForty); + disdipResult.add(disdipEqualSeventy); + disdipResult.add(disdipEqualEighty); + disdipResult.add(disdipEqualNinety); + + List iec28Result = new ArrayList<>(); + iec28Result.add(iec28CountLessOne); + iec28Result.add(iec28CountLessTen); + iec28Result.add(iec28CountLessTwenty); + iec28Result.add(iec28CountLessThirty); + iec28Result.add(iec28CountLessForty); + iec28Result.add(iec28CountLessFifty); + iec28Result.add(iec28CountLessSixty); + iec28Result.add(iec28CountLessSeventy); + iec28Result.add(iec28CountLessEighty); + iec28Result.add(iec28CountLessNinety); + iec28Result.add(iec28CountLessHundredTwenty); + iec28Result.add(iec28CountLessHundredThirty); + iec28Result.add(iec28CountLessHundredForty); + iec28Result.add(iec28CountLessHundredFifty); + iec28Result.add(iec28CountLessHundredSixty); + iec28Result.add(iec28CountLessHundredSeventy); + iec28Result.add(iec28CountLessHundredEighty); + + + Map resultMap = new HashMap<>(); + + for (int i = 0; i < iec28Result.size(); i++) { + + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getSixtyToOneHundredAndEighty()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getOneToThree()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroFiveToOne()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroOneToZeroTwentyFive()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroTwentyFiveToZeroFive()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getThreeToTwenty()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getTwentyToSixty()); + resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroZeroTwoToZeroOne()); + } + + //todo 还要对集合中哪个次数最多挑出第一位 + Map linkMap = getSort(resultMap); + + //存放结果的集合 + List resultList = new ArrayList(); + + for (String s : linkMap.keySet()) { + resultList.add(s); + resultList.add(linkMap.get(s).toString()); + } + + //最多暂降事件名称 + for (int i = 0; i < iec28Result.size(); i++) { + if (iec28Result.get(i).getName().equals(resultList.get(0))) { + if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroZeroTwoToZeroOne()))) { + resultList.add("0.02~0.1"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroOneToZeroTwentyFive()))) { + resultList.add("0.1~0.25"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroTwentyFiveToZeroFive()))) { + resultList.add("0.25~0.5"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroFiveToOne()))) { + resultList.add("0.5~1"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getOneToThree()))) { + resultList.add("1~3"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getThreeToTwenty()))) { + resultList.add("3~20"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getTwentyToSixty()))) { + resultList.add("20~60"); + break; + } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getSixtyToOneHundredAndEighty()))) { + resultList.add("60~180"); + break; } } + } + //System.out.println(resultList); - DISDIPCountParam disdipEqualEighty = new DISDIPCountParam(); - for (DISDIPVO disdipvo : equalEightyFiveDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualEighty.getName())) { - disdipEqualEighty.setName(disdipvo.getName()); - } + //3.1密度密度表格 + if (areaReportParam.isDensityTable()) { + //创建表题计数 + int twoCount = 1; - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualEighty.getTwenty(); - disdipEqualEighty.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualEighty.getOneHundredMS(); - disdipEqualEighty.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualEighty.getFiveHundredMS(); - disdipEqualEighty.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualEighty.getOne(); - disdipEqualEighty.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualEighty.getThree(); - disdipEqualEighty.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualEighty.getTwenty(); - disdipEqualEighty.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualEighty.getSixty(); - disdipEqualEighty.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualEighty.getOneHundredAndEighty(); - disdipEqualEighty.setOneHundredAndEighty(oneHundredAndEighty++); - } - } - DISDIPCountParam disdipEqualNinety = new DISDIPCountParam(); + //同步给暂降密度图 + oneCount4 = oneCount; - for (DISDIPVO disdipvo : equalNinetyDISDIP) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(disdipEqualNinety.getName())) { - disdipEqualNinety.setName(disdipvo.getName()); - } + createTitle(doc, "4." + oneCount + " " + typeName + "密度", "标题 2", 200, 11); - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(disdipvo.getTwentyMs())) { - int twenty = disdipEqualNinety.getTwenty(); - disdipEqualNinety.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getOneHundredMs())) { - int oneHundredMS = disdipEqualNinety.getOneHundredMS(); - disdipEqualNinety.setOneHundredMS(oneHundredMS++); - } - if (!"0".equals(disdipvo.getFiveHundredMs())) { - int fiveHundredMS = disdipEqualNinety.getFiveHundredMS(); - disdipEqualNinety.setOneHundredMS(fiveHundredMS++); - } - if (!"0".equals(disdipvo.getOneS())) { - int one = disdipEqualNinety.getOne(); - disdipEqualNinety.setOne(one++); - } - if (!"0".equals(disdipvo.getThreeS())) { - int three = disdipEqualNinety.getThree(); - disdipEqualNinety.setOne(three++); - } - if (!"0".equals(disdipvo.getTwentyS())) { - int twenty = disdipEqualNinety.getTwenty(); - disdipEqualNinety.setTwenty(twenty++); - } - if (!"0".equals(disdipvo.getSixtyS())) { - int sixty = disdipEqualNinety.getSixty(); - disdipEqualNinety.setSixty(sixty++); - } - if (!"0".equals(disdipvo.getOneEightyS())) { - int oneHundredAndEighty = disdipEqualNinety.getOneHundredAndEighty(); - disdipEqualNinety.setOneHundredAndEighty(oneHundredAndEighty++); - } + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + typeName + "密度统计可以从幅值和持续时间两个维度直接地反映" + typeName + "事件发生情况,主要反应事件的发生次数," + + "中国电网在所选择的分析时间内" + typeName + "事件主要集中在幅值为" + resultList.get(0) + ",持续时间为" + resultList.get(2) + "[根据 IEC 61000-2-8:(公共电网电压" + typeName + "测量统计)算出" + typeName + "事件发生最多的区间],具体见表(图):"); + r12.setFontSize(11);//字体大小 + + + createTitle(doc, "4." + oneCount + "." + twoCount + " DISDIP表格:国际发配电联盟(UNIPEDE)", "标题 3", 400, 11); + + //第一张表 + XWPFTable monitorInfo = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "剩余电压", "20ms", "100ms", "500ms", "1s", "3s", "20s", "60s", "180s"); + + + //塞入数据 + for (int i = 0; i < disdipResult.size(); i++) { + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, disdipResult.get(i).getName(), String.valueOf(disdipResult.get(i).getTwentyMS()), + String.valueOf(disdipResult.get(i).getOneHundredMS()), String.valueOf(disdipResult.get(i).getFiveHundredMS()), String.valueOf(disdipResult.get(i).getOne()), String.valueOf(disdipResult.get(i).getThree()), + String.valueOf(disdipResult.get(i).getTwenty()), String.valueOf(disdipResult.get(i).getSixty()), String.valueOf(disdipResult.get(i).getOneHundredAndEighty())); } - /** - * ======================第二张表结束============================== - */ + twoCount++; - //创建计数对象 - IEC28CountParam iec28CountLessOne = new IEC28CountParam(); - for (IEC28VO iec28VO : lessOneIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessOne.getName())) { - iec28CountLessOne.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessOne.getZeroZeroTwoToZeroOne(); - iec28CountLessOne.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessOne.getZeroOneToZeroTwentyFive(); - iec28CountLessOne.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessOne.getZeroTwentyFiveToZeroFive(); - iec28CountLessOne.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessOne.getZeroFiveToOne(); - iec28CountLessOne.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessOne.getOneToThree(); - iec28CountLessOne.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessOne.getThreeToTwenty(); - iec28CountLessOne.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessOne.getTwentyToSixty(); - iec28CountLessOne.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessOne.getSixtyToOneHundredAndEighty(); - iec28CountLessOne.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } + createTitle(doc, "4." + oneCount + "." + twoCount + " IEC 61000-4-11:(用电终端的电压" + typeName + "抗度)", "标题 3", 400, 11); + + //第二张表 + XWPFTable monitorInfo1 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph1 = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, true, "剩余电压", "10~20ms", "20~100ms", "0.1~0.2s", "0.2~0.5s", "0.5~1s", ">1s"); + + + //塞入数据 + for (int i = 0; i < iec411Result.size(); i++) { + insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, false, iec411Result.get(i).getName(), String.valueOf(iec411Result.get(i).getTenToTwenty()), String.valueOf(iec411Result.get(i).getTwentyToHundred()), + String.valueOf(iec411Result.get(i).getZeroOneToZeroTwo()), String.valueOf(iec411Result.get(i).getZeroTwoToZeroFive()), String.valueOf(iec411Result.get(i).getZeroFiveToOne()), String.valueOf(iec411Result.get(i).getLessOne())); } - - //创建计数对象 - IEC28CountParam iec28CountLessTen = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessTenIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessTen.getName())) { - iec28CountLessTen.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessTen.getZeroZeroTwoToZeroOne(); - iec28CountLessTen.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessTen.getZeroOneToZeroTwentyFive(); - iec28CountLessTen.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessTen.getZeroTwentyFiveToZeroFive(); - iec28CountLessTen.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessTen.getZeroFiveToOne(); - iec28CountLessTen.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessTen.getOneToThree(); - iec28CountLessTen.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessTen.getThreeToTwenty(); - iec28CountLessTen.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessTen.getTwentyToSixty(); - iec28CountLessTen.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessTen.getSixtyToOneHundredAndEighty(); - iec28CountLessTen.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } + twoCount++; - //创建计数对象 - IEC28CountParam iec28CountLessTwenty = new IEC28CountParam(); + createTitle(doc, "4." + oneCount + "." + twoCount + " IEC 61000-2-8:(公共电网电压" + typeName + "测量统计)", "标题 3", 400, 11); - for (IEC28VO iec28VO : lessTwentyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessTwenty.getName())) { - iec28CountLessTwenty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessTwenty.getZeroZeroTwoToZeroOne(); - iec28CountLessTwenty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessTwenty.getZeroOneToZeroTwentyFive(); - iec28CountLessTwenty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessTwenty.getZeroTwentyFiveToZeroFive(); - iec28CountLessTwenty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessTwenty.getZeroFiveToOne(); - iec28CountLessTwenty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessTwenty.getOneToThree(); - iec28CountLessTwenty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessTwenty.getThreeToTwenty(); - iec28CountLessTwenty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessTwenty.getTwentyToSixty(); - iec28CountLessTwenty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessTwenty.getSixtyToOneHundredAndEighty(); - iec28CountLessTwenty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } + //第二张表 + XWPFTable monitorInfo2 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "剩余电压", "0.02~0.1s", "0.1~0.25s", "0.25~0.5s", "0.5~1s", "1~3s", "3~20s", "20~60s", "60~180s"); - //创建计数对象 - IEC28CountParam iec28CountLessThirty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessThirtyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessThirty.getName())) { - iec28CountLessThirty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessThirty.getZeroZeroTwoToZeroOne(); - iec28CountLessThirty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessThirty.getZeroOneToZeroTwentyFive(); - iec28CountLessThirty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessThirty.getZeroTwentyFiveToZeroFive(); - iec28CountLessThirty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessThirty.getZeroFiveToOne(); - iec28CountLessThirty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessThirty.getOneToThree(); - iec28CountLessThirty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessThirty.getThreeToTwenty(); - iec28CountLessThirty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessThirty.getTwentyToSixty(); - iec28CountLessThirty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessThirty.getSixtyToOneHundredAndEighty(); - iec28CountLessThirty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessForty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessFortyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessForty.getName())) { - iec28CountLessForty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessForty.getZeroZeroTwoToZeroOne(); - iec28CountLessForty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessForty.getZeroOneToZeroTwentyFive(); - iec28CountLessForty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessForty.getZeroTwentyFiveToZeroFive(); - iec28CountLessForty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessForty.getZeroFiveToOne(); - iec28CountLessForty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessForty.getOneToThree(); - iec28CountLessForty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessForty.getThreeToTwenty(); - iec28CountLessForty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessForty.getTwentyToSixty(); - iec28CountLessForty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessForty.getSixtyToOneHundredAndEighty(); - iec28CountLessForty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessFifty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessFiftyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessFifty.getName())) { - iec28CountLessFifty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessFifty.getZeroZeroTwoToZeroOne(); - iec28CountLessFifty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessFifty.getZeroOneToZeroTwentyFive(); - iec28CountLessFifty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessFifty.getZeroTwentyFiveToZeroFive(); - iec28CountLessFifty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessFifty.getZeroFiveToOne(); - iec28CountLessFifty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessFifty.getOneToThree(); - iec28CountLessFifty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessFifty.getThreeToTwenty(); - iec28CountLessFifty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessFifty.getTwentyToSixty(); - iec28CountLessFifty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessFifty.getSixtyToOneHundredAndEighty(); - iec28CountLessFifty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessSixty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessSixtyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessSixty.getName())) { - iec28CountLessSixty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessSixty.getZeroZeroTwoToZeroOne(); - iec28CountLessSixty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessSixty.getZeroOneToZeroTwentyFive(); - iec28CountLessSixty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessSixty.getZeroTwentyFiveToZeroFive(); - iec28CountLessSixty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessSixty.getZeroFiveToOne(); - iec28CountLessSixty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessSixty.getOneToThree(); - iec28CountLessSixty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessSixty.getThreeToTwenty(); - iec28CountLessSixty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessSixty.getTwentyToSixty(); - iec28CountLessSixty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessSixty.getSixtyToOneHundredAndEighty(); - iec28CountLessSixty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessSeventy = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessSeventyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessSeventy.getName())) { - iec28CountLessSeventy.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessSeventy.getZeroZeroTwoToZeroOne(); - iec28CountLessSeventy.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessSeventy.getZeroOneToZeroTwentyFive(); - iec28CountLessSeventy.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessSeventy.getZeroTwentyFiveToZeroFive(); - iec28CountLessSeventy.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessSeventy.getZeroFiveToOne(); - iec28CountLessSeventy.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessSeventy.getOneToThree(); - iec28CountLessSeventy.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessSeventy.getThreeToTwenty(); - iec28CountLessSeventy.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessSeventy.getTwentyToSixty(); - iec28CountLessSeventy.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessSeventy.getSixtyToOneHundredAndEighty(); - iec28CountLessSeventy.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessEighty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessEightyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessEighty.getName())) { - iec28CountLessEighty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessEighty.getZeroZeroTwoToZeroOne(); - iec28CountLessEighty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessEighty.getZeroOneToZeroTwentyFive(); - iec28CountLessEighty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessEighty.getZeroTwentyFiveToZeroFive(); - iec28CountLessEighty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessEighty.getZeroFiveToOne(); - iec28CountLessEighty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessEighty.getOneToThree(); - iec28CountLessEighty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessEighty.getThreeToTwenty(); - iec28CountLessEighty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessEighty.getTwentyToSixty(); - iec28CountLessEighty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessEighty.getSixtyToOneHundredAndEighty(); - iec28CountLessEighty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - //创建计数对象 - IEC28CountParam iec28CountLessNinety = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessNinetyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessNinety.getName())) { - iec28CountLessNinety.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessNinety.getZeroZeroTwoToZeroOne(); - iec28CountLessNinety.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessNinety.getZeroOneToZeroTwentyFive(); - iec28CountLessNinety.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessNinety.getZeroTwentyFiveToZeroFive(); - iec28CountLessNinety.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessNinety.getZeroFiveToOne(); - iec28CountLessNinety.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessNinety.getOneToThree(); - iec28CountLessNinety.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessNinety.getThreeToTwenty(); - iec28CountLessNinety.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessNinety.getTwentyToSixty(); - iec28CountLessNinety.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessNinety.getSixtyToOneHundredAndEighty(); - iec28CountLessNinety.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - //创建计数对象 - IEC28CountParam iec28CountLessHundredTwenty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredTwentyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredTwenty.getName())) { - iec28CountLessHundredTwenty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredTwenty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredTwenty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredTwenty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredTwenty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredTwenty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredTwenty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredTwenty.getZeroFiveToOne(); - iec28CountLessHundredTwenty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredTwenty.getOneToThree(); - iec28CountLessHundredTwenty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredTwenty.getThreeToTwenty(); - iec28CountLessHundredTwenty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredTwenty.getTwentyToSixty(); - iec28CountLessHundredTwenty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredTwenty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredTwenty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredThirty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredThirtyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredThirty.getName())) { - iec28CountLessHundredThirty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredThirty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredThirty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredThirty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredThirty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredThirty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredThirty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredThirty.getZeroFiveToOne(); - iec28CountLessHundredThirty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredThirty.getOneToThree(); - iec28CountLessHundredThirty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredThirty.getThreeToTwenty(); - iec28CountLessHundredThirty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredThirty.getTwentyToSixty(); - iec28CountLessHundredThirty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredThirty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredThirty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - //创建计数对象 - IEC28CountParam iec28CountLessHundredForty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredFortyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredForty.getName())) { - iec28CountLessHundredForty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredForty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredForty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredForty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredForty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredForty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredForty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredForty.getZeroFiveToOne(); - iec28CountLessHundredForty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredForty.getOneToThree(); - iec28CountLessHundredForty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredForty.getThreeToTwenty(); - iec28CountLessHundredForty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredForty.getTwentyToSixty(); - iec28CountLessHundredForty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredForty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredForty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredFifty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredFiftyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredFifty.getName())) { - iec28CountLessHundredFifty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredFifty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredFifty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredFifty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredFifty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredFifty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredFifty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredFifty.getZeroFiveToOne(); - iec28CountLessHundredFifty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredFifty.getOneToThree(); - iec28CountLessHundredFifty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredFifty.getThreeToTwenty(); - iec28CountLessHundredFifty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredFifty.getTwentyToSixty(); - iec28CountLessHundredFifty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredFifty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredFifty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredSixty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredSixtyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredSixty.getName())) { - iec28CountLessHundredSixty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredSixty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredSixty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredSixty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredSixty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredSixty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredSixty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredSixty.getZeroFiveToOne(); - iec28CountLessHundredSixty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredSixty.getOneToThree(); - iec28CountLessHundredSixty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredSixty.getThreeToTwenty(); - iec28CountLessHundredSixty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredSixty.getTwentyToSixty(); - iec28CountLessHundredSixty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredSixty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredSixty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredSeventy = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredSeventyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredSeventy.getName())) { - iec28CountLessHundredSeventy.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredSeventy.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredSeventy.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredSeventy.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredSeventy.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredSeventy.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredSeventy.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredSeventy.getZeroFiveToOne(); - iec28CountLessHundredSeventy.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredSeventy.getOneToThree(); - iec28CountLessHundredSeventy.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredSeventy.getThreeToTwenty(); - iec28CountLessHundredSeventy.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredSeventy.getTwentyToSixty(); - iec28CountLessHundredSeventy.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredSeventy.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredSeventy.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - - //创建计数对象 - IEC28CountParam iec28CountLessHundredEighty = new IEC28CountParam(); - - for (IEC28VO iec28VO : lessHundredEightyIEC28) { - //获取当前剩余电压名称,不为空就进行添加 - if (Objects.isNull(iec28CountLessHundredEighty.getName())) { - iec28CountLessHundredEighty.setName(iec28VO.getName()); - } - //如果参数不等于0对对象中的参数进行++ - if (!"0".equals(iec28VO.getQ())) { - int zeroZeroTwoToZeroOne = iec28CountLessHundredEighty.getZeroZeroTwoToZeroOne(); - iec28CountLessHundredEighty.setZeroZeroTwoToZeroOne(zeroZeroTwoToZeroOne++); - } - if (!"0".equals(iec28VO.getW())) { - int zeroOneToZeroTwentyFive = iec28CountLessHundredEighty.getZeroOneToZeroTwentyFive(); - iec28CountLessHundredEighty.setZeroOneToZeroTwentyFive(zeroOneToZeroTwentyFive++); - } - if (!"0".equals(iec28VO.getE())) { - int zeroTwentyFiveToZeroFive = iec28CountLessHundredEighty.getZeroTwentyFiveToZeroFive(); - iec28CountLessHundredEighty.setZeroTwentyFiveToZeroFive(zeroTwentyFiveToZeroFive++); - } - if (!"0".equals(iec28VO.getR())) { - int zeroFiveToOne = iec28CountLessHundredEighty.getZeroFiveToOne(); - iec28CountLessHundredEighty.setZeroFiveToOne(zeroFiveToOne++); - } - if (!"0".equals(iec28VO.getT())) { - int oneToThree = iec28CountLessHundredEighty.getOneToThree(); - iec28CountLessHundredEighty.setOneToThree(oneToThree++); - } - if (!"0".equals(iec28VO.getY())) { - int threeToTwenty = iec28CountLessHundredEighty.getThreeToTwenty(); - iec28CountLessHundredEighty.setThreeToTwenty(threeToTwenty++); - } - if (!"0".equals(iec28VO.getU())) { - int twentyToSixty = iec28CountLessHundredEighty.getTwentyToSixty(); - iec28CountLessHundredEighty.setTwentyToSixty(twentyToSixty++); - } - if (!"0".equals(iec28VO.getI())) { - int sixtyToOneHundredAndEighty = iec28CountLessHundredEighty.getSixtyToOneHundredAndEighty(); - iec28CountLessHundredEighty.setSixtyToOneHundredAndEighty(sixtyToOneHundredAndEighty++); - } - } - - /** - * =========================第三张表结束=============================== - */ - - - //汇总放入集合 - List iec411Result = new ArrayList<>(); - iec411Result.add(iec411LessOne); - iec411Result.add(iec411LessForty); - iec411Result.add(iec411LessSeventy); - - List disdipResult = new ArrayList<>(); - disdipResult.add(disdipEqualTen); - disdipResult.add(disdipEqualForty); - disdipResult.add(disdipEqualSeventy); - disdipResult.add(disdipEqualEighty); - disdipResult.add(disdipEqualNinety); - - List iec28Result = new ArrayList<>(); - iec28Result.add(iec28CountLessOne); - iec28Result.add(iec28CountLessTen); - iec28Result.add(iec28CountLessTwenty); - iec28Result.add(iec28CountLessThirty); - iec28Result.add(iec28CountLessForty); - iec28Result.add(iec28CountLessFifty); - iec28Result.add(iec28CountLessSixty); - iec28Result.add(iec28CountLessSeventy); - iec28Result.add(iec28CountLessEighty); - iec28Result.add(iec28CountLessNinety); - iec28Result.add(iec28CountLessHundredTwenty); - iec28Result.add(iec28CountLessHundredThirty); - iec28Result.add(iec28CountLessHundredForty); - iec28Result.add(iec28CountLessHundredFifty); - iec28Result.add(iec28CountLessHundredSixty); - iec28Result.add(iec28CountLessHundredSeventy); - iec28Result.add(iec28CountLessHundredEighty); - - - Map resultMap = new HashMap<>(); - + //塞入数据 for (int i = 0; i < iec28Result.size(); i++) { - - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getSixtyToOneHundredAndEighty()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getOneToThree()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroFiveToOne()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroOneToZeroTwentyFive()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroTwentyFiveToZeroFive()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getThreeToTwenty()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getTwentyToSixty()); - resultMap.put(iec28Result.get(i).getName(), iec28Result.get(i).getZeroZeroTwoToZeroOne()); + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, iec28Result.get(i).getName(), String.valueOf(iec28Result.get(i).getZeroZeroTwoToZeroOne()), String.valueOf(iec28Result.get(i).getZeroOneToZeroTwentyFive()), + String.valueOf(iec28Result.get(i).getZeroTwentyFiveToZeroFive()), String.valueOf(iec28Result.get(i).getZeroFiveToOne()), String.valueOf(iec28Result.get(i).getOneToThree()), String.valueOf(iec28Result.get(i).getThreeToTwenty()), + String.valueOf(iec28Result.get(i).getTwentyToSixty()), String.valueOf(iec28Result.get(i).getSixtyToOneHundredAndEighty())); } - //todo 还要对集合中哪个次数最多挑出第一位 - Map linkMap = getSort(resultMap); + //同步给暂降密度表格 + twoCount1 = twoCount; + //序号计数进行++ + oneCount++; + } - //存放结果的集合 - List resultList = new ArrayList(); + //3.2暂降密度图表 + if (areaReportParam.isDensityChart()) { - for (String s : linkMap.keySet()) { - resultList.add(s); - resultList.add(linkMap.get(s).toString()); - } - - //最多暂降事件名称 - for (int i = 0; i < iec28Result.size(); i++) { - if (iec28Result.get(i).getName().equals(resultList.get(0))) { - if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroZeroTwoToZeroOne()))) { - resultList.add("0.02~0.1"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroOneToZeroTwentyFive()))) { - resultList.add("0.1~0.25"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroTwentyFiveToZeroFive()))) { - resultList.add("0.25~0.5"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getZeroFiveToOne()))) { - resultList.add("0.5~1"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getOneToThree()))) { - resultList.add("1~3"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getThreeToTwenty()))) { - resultList.add("3~20"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getTwentyToSixty()))) { - resultList.add("20~60"); - break; - } else if (resultList.get(1).equals(String.valueOf(iec28Result.get(i).getSixtyToOneHundredAndEighty()))) { - resultList.add("60~180"); - break; - } - } - } - //System.out.println(resultList); - - - //3.1密度密度表格 + //如果暂降幅值被勾选,就不需要进行写段落 if (areaReportParam.isDensityTable()) { - //创建表题计数 + twoCount1++; + + //如果幅值图存在与幅值的序号保持同步 + createTitle(doc, "4." + oneCount4 + "." + twoCount1 + " " + typeName + "密度图", "标题 3", 400, 11); + + List eventDetails = BeanUtil.copyToList(info, EventDetail.class); + Integer[][] eventDensityData = eventReportService.getCoords(eventDetails); + String str = drawPicUtil.drawEventDensity(eventDensityData); + createPic(doc, str, "" + typeName + "密度图形"); + } else { int twoCount = 1; - - //同步给暂降密度图 - oneCount4 = oneCount; - createTitle(doc, "4." + oneCount + " " + typeName + "密度", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 @@ -7096,138 +7179,131 @@ public class ReportServiceImpl implements ReportService { r12.setFontSize(11);//字体大小 - createTitle(doc, "4." + oneCount + "." + twoCount + " DISDIP表格:国际发配电联盟(UNIPEDE)", "标题 3", 400, 11); - - //第一张表 - XWPFTable monitorInfo = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "剩余电压", "20ms", "100ms", "500ms", "1s", "3s", "20s", "60s", "180s"); + createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "密度图", "标题 3", 400, 11); - //塞入数据 - for (int i = 0; i < disdipResult.size(); i++) { - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, disdipResult.get(i).getName(), String.valueOf(disdipResult.get(i).getTwentyMS()), - String.valueOf(disdipResult.get(i).getOneHundredMS()), String.valueOf(disdipResult.get(i).getFiveHundredMS()), String.valueOf(disdipResult.get(i).getOne()), String.valueOf(disdipResult.get(i).getThree()), - String.valueOf(disdipResult.get(i).getTwenty()), String.valueOf(disdipResult.get(i).getSixty()), String.valueOf(disdipResult.get(i).getOneHundredAndEighty())); - } + //代码 + List eventDetails = BeanUtil.copyToList(info, EventDetail.class); + Integer[][] eventDensityData = eventReportService.getCoords(eventDetails); + String str = drawPicUtil.drawEventDensity(eventDensityData); + createPic(doc, str, "" + typeName + "密度图形"); - twoCount++; - - - createTitle(doc, "4." + oneCount + "." + twoCount + " IEC 61000-4-11:(用电终端的电压" + typeName + "抗度)", "标题 3", 400, 11); - - //第二张表 - XWPFTable monitorInfo1 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph1 = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, true, "剩余电压", "10~20ms", "20~100ms", "0.1~0.2s", "0.2~0.5s", "0.5~1s", ">1s"); - - - //塞入数据 - for (int i = 0; i < iec411Result.size(); i++) { - insertRow(doc, monitorInfo1, monitorInfoExcelParagraph1, false, iec411Result.get(i).getName(), String.valueOf(iec411Result.get(i).getTenToTwenty()), String.valueOf(iec411Result.get(i).getTwentyToHundred()), - String.valueOf(iec411Result.get(i).getZeroOneToZeroTwo()), String.valueOf(iec411Result.get(i).getZeroTwoToZeroFive()), String.valueOf(iec411Result.get(i).getZeroFiveToOne()), String.valueOf(iec411Result.get(i).getLessOne())); - } - - twoCount++; - - - createTitle(doc, "4." + oneCount + "." + twoCount + " IEC 61000-2-8:(公共电网电压" + typeName + "测量统计)", "标题 3", 400, 11); - - //第二张表 - XWPFTable monitorInfo2 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "剩余电压", "0.02~0.1s", "0.1~0.25s", "0.25~0.5s", "0.5~1s", "1~3s", "3~20s", "20~60s", "60~180s"); - - - //塞入数据 - for (int i = 0; i < iec28Result.size(); i++) { - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, iec28Result.get(i).getName(), String.valueOf(iec28Result.get(i).getZeroZeroTwoToZeroOne()), String.valueOf(iec28Result.get(i).getZeroOneToZeroTwentyFive()), - String.valueOf(iec28Result.get(i).getZeroTwentyFiveToZeroFive()), String.valueOf(iec28Result.get(i).getZeroFiveToOne()), String.valueOf(iec28Result.get(i).getOneToThree()), String.valueOf(iec28Result.get(i).getThreeToTwenty()), - String.valueOf(iec28Result.get(i).getTwentyToSixty()), String.valueOf(iec28Result.get(i).getSixtyToOneHundredAndEighty())); - } - - //同步给暂降密度表格 - twoCount1 = twoCount; //序号计数进行++ oneCount++; } + } + } - //3.2暂降密度图表 - if (areaReportParam.isDensityChart()) { + //4.itic图 + if (areaReportParam.isItic()) { + //itic图 - //如果暂降幅值被勾选,就不需要进行写段落 - if (areaReportParam.isDensityTable()) { - twoCount1++; + List detailList = eventDetailList; - //如果幅值图存在与幅值的序号保持同步 - createTitle(doc, "4." + oneCount4 + "." + twoCount1 + " " + typeName + "密度图", "标题 3", 400, 11); + List obs = new ArrayList<>(); + ArrayList> list = new ArrayList<>(); + for (EventDetailNew eventDetail : detailList) { + obs.add(new OB(Double.parseDouble(eventDetail.getDuration() / 1000 + "") + , Double.parseDouble(eventDetail.getFeatureAmplitude() * 100 + ""))); - List eventDetails = BeanUtil.copyToList(info, EventDetail.class); - Integer[][] eventDensityData = eventReportService.getCoords(eventDetails); - String str = drawPicUtil.drawEventDensity(eventDensityData); - createPic(doc, str, "" + typeName + "密度图形"); - } else { - int twoCount = 1; - createTitle(doc, "4." + oneCount + " " + typeName + "密度", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + typeName + "密度统计可以从幅值和持续时间两个维度直接地反映" + typeName + "事件发生情况,主要反应事件的发生次数," + - "中国电网在所选择的分析时间内" + typeName + "事件主要集中在幅值为" + resultList.get(0) + ",持续时间为" + resultList.get(2) + "[根据 IEC 61000-2-8:(公共电网电压" + typeName + "测量统计)算出" + typeName + "事件发生最多的区间],具体见表(图):"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "密度图", "标题 3", 400, 11); - - - //代码 - List eventDetails = BeanUtil.copyToList(info, EventDetail.class); - Integer[][] eventDensityData = eventReportService.getCoords(eventDetails); - String str = drawPicUtil.drawEventDensity(eventDensityData); - createPic(doc, str, "" + typeName + "密度图形"); - - //序号计数进行++ - oneCount++; - } - } + ArrayList doubles = new ArrayList<>(); + doubles.add(Double.parseDouble(eventDetail.getDuration() / 1000 + "")); + doubles.add(Double.parseDouble(String.valueOf(eventDetail.getFeatureAmplitude() * 100))); + list.add(doubles); } - //4.itic图 + List result = getITICArea(obs); + + /** + * =========================续写word文档============================================== + */ + //创建表题计数 + int twoCount = 1; + + oneCount3 = oneCount; + + createTitle(doc, "4." + oneCount3 + " " + typeName + "事件点图", "标题 2", 200, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + typeName + "事件点图统计分成ITIC曲线和F47曲线展示。"); + r12.setFontSize(11);//字体大小 + + + createTitle(doc, "4." + oneCount3 + "." + twoCount + " ITIC 曲线", "标题 3", 400, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r13 = p.createRun();//创建段落文本 + r13.setText(" ITIC曲线中可容忍" + typeName + "记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); + r13.setFontSize(11);//字体大小 + + + String itic = drawPicUtil.drawItic(list); + createPic(doc, itic, "ITIC曲线"); + + + twoCount5 = twoCount; + //序号计数进行++ + oneCount++; + + /** + * =======================================word结束========================================= + */ + + + } + + //5.f47图 + if (areaReportParam.isF47()) { + //f47图 + List detailList = eventDetailList; + + List obs = new ArrayList<>(); + + ArrayList> list = new ArrayList<>(); + for (EventDetailNew eventDetail : detailList) { + obs.add(new OB(Double.parseDouble(eventDetail.getDuration() / 1000 + ""), Double.parseDouble(eventDetail.getFeatureAmplitude() * 100 + ""))); + + ArrayList doubles = new ArrayList<>(); + doubles.add(Double.parseDouble(eventDetail.getDuration() / 1000 + "")); + doubles.add(Double.parseDouble(String.valueOf(eventDetail.getFeatureAmplitude() * 100))); + list.add(doubles); + } + + + List result = getF47Area(obs); + + /** + * =========================续写word文档============================================== + */ + if (areaReportParam.isItic()) { - //itic图 + twoCount5++; - List detailList = eventDetailList; + createTitle(doc, "4." + oneCount3 + "." + twoCount5 + " F47 曲线", "标题 3", 400, 11); - List obs = new ArrayList<>(); - ArrayList> list = new ArrayList<>(); - for (EventDetailNew eventDetail : detailList) { - obs.add(new OB(Double.parseDouble(eventDetail.getDuration() / 1000 + "") - , Double.parseDouble(eventDetail.getFeatureAmplitude() * 100 + ""))); + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r13 = p.createRun();//创建段落文本 + r13.setText(" F47曲线中可容忍" + typeName + "记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); + r13.setFontSize(11);//字体大小 - ArrayList doubles = new ArrayList<>(); - doubles.add(Double.parseDouble(eventDetail.getDuration() / 1000 + "")); - doubles.add(Double.parseDouble(String.valueOf(eventDetail.getFeatureAmplitude() * 100))); - list.add(doubles); - } - List result = getITICArea(obs); + String f47 = drawPicUtil.drawF47(list); + createPic(doc, f47, "SEMI F47曲线"); /** - * =========================续写word文档============================================== + * =======================================word结束========================================= */ + } else { //创建表题计数 int twoCount = 1; oneCount3 = oneCount; - createTitle(doc, "4." + oneCount3 + " " + typeName + "事件点图", "标题 2", 200, 11); + createTitle(doc, "4." + oneCount + " " + typeName + "事件点图", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); @@ -7236,204 +7312,259 @@ public class ReportServiceImpl implements ReportService { r12.setFontSize(11);//字体大小 - createTitle(doc, "4." + oneCount3 + "." + twoCount + " ITIC 曲线", "标题 3", 400, 11); + createTitle(doc, "4." + oneCount + "." + twoCount + " F47 曲线", "标题 3", 400, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); XWPFRun r13 = p.createRun();//创建段落文本 - r13.setText(" ITIC曲线中可容忍" + typeName + "记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); + r13.setText(" F47曲线中可容忍" + typeName + "降记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); r13.setFontSize(11);//字体大小 - - String itic = drawPicUtil.drawItic(list); - createPic(doc, itic, "ITIC曲线"); + String f47 = drawPicUtil.drawF47(list); + createPic(doc, f47, "SEMI F47曲线"); - twoCount5 = twoCount; //序号计数进行++ oneCount++; /** * =======================================word结束========================================= */ - - } - //5.f47图 - if (areaReportParam.isF47()) { - //f47图 - List detailList = eventDetailList; - List obs = new ArrayList<>(); + } - ArrayList> list = new ArrayList<>(); - for (EventDetailNew eventDetail : detailList) { - obs.add(new OB(Double.parseDouble(eventDetail.getDuration() / 1000 + ""), Double.parseDouble(eventDetail.getFeatureAmplitude() * 100 + ""))); + //6.暂降增幅 + if (areaReportParam.isSagAmplitude()) { + //暂降分布幅值 + List info = eventDetailList; - ArrayList doubles = new ArrayList<>(); - doubles.add(Double.parseDouble(eventDetail.getDuration() / 1000 + "")); - doubles.add(Double.parseDouble(String.valueOf(eventDetail.getFeatureAmplitude() * 100))); - list.add(doubles); + //将sql结果集放入,共用一个sql,减少查询时间 + AreaTableParam areaTableParam1 = new AreaTableParam(); + areaTableParam1.setStartTime(areaReportParam.getSearchBeginTime()); + areaTableParam1.setEndTime(areaReportParam.getSearchEndTime()); + areaTableParam1.setInfo(info); + ProbabilityVO probabilityDistributionArea = getProbabilityDistributionArea(areaTableParam1); + + + List eventvalue = probabilityDistributionArea.getEventvalue(); + + List amplitudeList = new ArrayList<>(); + + List xName = new ArrayList<>(); + xName.add("0"); + xName.add("10%"); + xName.add("20%"); + xName.add("30%"); + xName.add("40%"); + xName.add("50%"); + xName.add("60%"); + xName.add("70%"); + xName.add("80%"); + xName.add("90%"); + //将幅值绑定对应的x值,放入集合 + for (int i = 0; i < eventvalue.size(); i++) { + AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); + amplitudeCountParam.setXName(xName.get(i)); + amplitudeCountParam.setYValue(eventvalue.get(i)); + amplitudeList.add(amplitudeCountParam); + } + //存储幅值结果集合 + List amplitudeResult = new ArrayList<>(); + for (int i = 1; i < amplitudeList.size(); i++) { + if (!amplitudeList.get(i).getYValue().equals(amplitudeList.get(i - 1).getYValue())) { + amplitudeResult.add(amplitudeList.get(i - 1).getXName()); + amplitudeResult.add(amplitudeList.get(i).getXName()); + break; + } else if (amplitudeList.get(0).getYValue().equals(amplitudeList.get(amplitudeList.size() - 1).getYValue())) { + amplitudeResult.add(amplitudeList.get(0).getXName()); + amplitudeResult.add(amplitudeList.get(amplitudeList.size() - 1).getXName()); + break; } - - - List result = getF47Area(obs); - - /** - * =========================续写word文档============================================== - */ - - if (areaReportParam.isItic()) { - twoCount5++; - - createTitle(doc, "4." + oneCount3 + "." + twoCount5 + " F47 曲线", "标题 3", 400, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r13 = p.createRun();//创建段落文本 - r13.setText(" F47曲线中可容忍" + typeName + "记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); - r13.setFontSize(11);//字体大小 - - - String f47 = drawPicUtil.drawF47(list); - createPic(doc, f47, "SEMI F47曲线"); - - /** - * =======================================word结束========================================= - */ - } else { - //创建表题计数 - int twoCount = 1; - - oneCount3 = oneCount; - - createTitle(doc, "4." + oneCount + " " + typeName + "事件点图", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + typeName + "事件点图统计分成ITIC曲线和F47曲线展示。"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " F47 曲线", "标题 3", 400, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r13 = p.createRun();//创建段落文本 - r13.setText(" F47曲线中可容忍" + typeName + "降记录为:" + result.get(0) + "条;不可容忍" + typeName + "记录为:" + result.get(1) + "条,具体见下表(图):"); - r13.setFontSize(11);//字体大小 - - String f47 = drawPicUtil.drawF47(list); - createPic(doc, f47, "SEMI F47曲线"); - - - //序号计数进行++ - oneCount++; - - /** - * =======================================word结束========================================= - */ - } - - } - //6.暂降增幅 + + List eventvalue1 = probabilityDistributionArea.getSisttime(); + + List amplitudeList1 = new ArrayList<>(); + + List xName1 = new ArrayList<>(); + xName1.add("0.01"); + xName1.add("0.1"); + xName1.add("0.25"); + xName1.add("0.5"); + xName1.add("1"); + xName1.add("3"); + xName1.add("20"); + xName1.add("60"); + xName1.add("180"); + //将幅值绑定对应的x值,放入集合 + for (int i = 0; i < eventvalue1.size(); i++) { + AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); + amplitudeCountParam.setXName(xName1.get(i)); + amplitudeCountParam.setYValue(eventvalue1.get(i)); + amplitudeList1.add(amplitudeCountParam); + } + //存储幅值结果集合 + List amplitudeResult1 = new ArrayList<>(); + for (int i = 1; i < amplitudeList1.size(); i++) { + if (!amplitudeList1.get(i).getYValue().equals(amplitudeList1.get(i - 1).getYValue())) { + amplitudeResult1.add(amplitudeList1.get(i - 1).getXName()); + amplitudeResult1.add(amplitudeList1.get(i).getXName()); + break; + } else if (amplitudeList1.get(0).getYValue().equals(amplitudeList1.get(amplitudeList1.size() - 1).getYValue())) { + amplitudeResult1.add(amplitudeList1.get(0).getXName()); + amplitudeResult1.add(amplitudeList1.get(amplitudeList1.size() - 1).getXName()); + break; + } + } + + + /** + * =========================续写word文档============================================== + */ + //创建表题计数 + int twoCount = 1; + + oneCount2 = oneCount; + + createTitle(doc, "4." + oneCount2 + " " + typeName + "幅值概率分布图", "标题 2", 200, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + typeName + "概率分布图分成" + typeName + "幅值概率分布和持续时间概率分布图,中国电网在所选择的分析时间内" + typeName + "事件从幅值概率分布统计主要集中在幅值为" + amplitudeResult.get(0) + "~" + amplitudeResult.get(1) + "之间," + + "从持续时间统计主要集中在持续时间为" + amplitudeResult1.get(0) + "~" + amplitudeResult1.get(1) + "[持续时间排序,选择" + typeName + "记录发生最多的区域],如下表(图):"); + r12.setFontSize(11);//字体大小 + + + createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "幅值的概率分布函数", "标题 3", 400, 11); + + + List ybardata = probabilityDistributionArea.getPereventvalue(); + List ylinedata = probabilityDistributionArea.getEventvalue(); + String fz = drawPicUtil.drawEventAmplitude(ylinedata, ybardata); + createPic(doc, fz, "" + typeName + "幅值的概率分布函数"); + + + //序号计数进行++ + oneCount++; + + /** + * =======================================word结束========================================= + */ + + } + + //7.暂降持续时间 + if (areaReportParam.isDuration()) { + //持续时间概率分布 + AreaTableParam areaTableParam = new AreaTableParam(); + + + //创建结果集合 + List info = eventDetailList; + + //将sql结果集放入,共用一个sql,减少查询时间 + AreaTableParam areaTableParam1 = new AreaTableParam(); + areaTableParam1.setInfo(info); + ProbabilityVO probabilityDistributionArea = getProbabilityDistributionArea(areaTableParam1); + + + List eventvalue = probabilityDistributionArea.getEventvalue(); + + List amplitudeList = new ArrayList<>(); + + List xName = new ArrayList<>(); + xName.add("0"); + xName.add("10%"); + xName.add("20%"); + xName.add("30%"); + xName.add("40%"); + xName.add("50%"); + xName.add("60%"); + xName.add("70%"); + xName.add("80%"); + xName.add("90%"); + //将幅值绑定对应的x值,放入集合 + for (int i = 0; i < eventvalue.size(); i++) { + AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); + amplitudeCountParam.setXName(xName.get(i)); + amplitudeCountParam.setYValue(eventvalue.get(i)); + amplitudeList.add(amplitudeCountParam); + } + //存储幅值结果集合 + List amplitudeResult = new ArrayList<>(); + for (int i = 1; i < amplitudeList.size(); i++) { + if (!amplitudeList.get(i).getYValue().equals(amplitudeList.get(i - 1).getYValue())) { + amplitudeResult.add(amplitudeList.get(i - 1).getXName()); + amplitudeResult.add(amplitudeList.get(i).getXName()); + break; + } else if (amplitudeList.get(0).getYValue().equals(amplitudeList.get(amplitudeList.size() - 1).getYValue())) { + amplitudeResult.add(amplitudeList.get(0).getXName()); + amplitudeResult.add(amplitudeList.get(amplitudeList.size() - 1).getXName()); + break; + } + } + + + List eventvalue1 = probabilityDistributionArea.getSisttime(); + + List amplitudeList1 = new ArrayList<>(); + + List xName1 = new ArrayList<>(); + xName1.add("0.01"); + xName1.add("0.1"); + xName1.add("0.25"); + xName1.add("0.5"); + xName1.add("1"); + xName1.add("3"); + xName1.add("20"); + xName1.add("60"); + xName1.add("180"); + //将幅值绑定对应的x值,放入集合 + for (int i = 0; i < eventvalue1.size(); i++) { + AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); + amplitudeCountParam.setXName(xName1.get(i)); + amplitudeCountParam.setYValue(eventvalue1.get(i)); + amplitudeList1.add(amplitudeCountParam); + } + //存储幅值结果集合 + List amplitudeResult1 = new ArrayList<>(); + for (int i = 1; i < amplitudeList1.size(); i++) { + if (!amplitudeList1.get(i).getYValue().equals(amplitudeList1.get(i - 1).getYValue())) { + amplitudeResult1.add(amplitudeList1.get(i - 1).getXName()); + amplitudeResult1.add(amplitudeList1.get(i).getXName()); + break; + } else if (amplitudeList1.get(0).getYValue().equals(amplitudeList1.get(amplitudeList1.size() - 1).getYValue())) { + amplitudeResult1.add(amplitudeList1.get(0).getXName()); + amplitudeResult1.add(amplitudeList1.get(amplitudeList1.size() - 1).getXName()); + break; + } + } + /** + * =========================续写word文档============================================== + */ + + //创建表题计数 + int twoCount = 1; + + //如果暂降幅值被勾选,就不需要进行写段落 if (areaReportParam.isSagAmplitude()) { - //暂降分布幅值 - List info = eventDetailList; + twoCount++; - //将sql结果集放入,共用一个sql,减少查询时间 - AreaTableParam areaTableParam1 = new AreaTableParam(); - areaTableParam1.setStartTime(areaReportParam.getSearchBeginTime()); - areaTableParam1.setEndTime(areaReportParam.getSearchEndTime()); - areaTableParam1.setInfo(info); - ProbabilityVO probabilityDistributionArea = getProbabilityDistributionArea(areaTableParam1); + //如果幅值图存在与幅值的序号保持同步 + createTitle(doc, "4." + oneCount2 + "." + twoCount + " 时序时间的概率分函数", "标题 3", 400, 11); - List eventvalue = probabilityDistributionArea.getEventvalue(); - - List amplitudeList = new ArrayList<>(); - - List xName = new ArrayList<>(); - xName.add("0"); - xName.add("10%"); - xName.add("20%"); - xName.add("30%"); - xName.add("40%"); - xName.add("50%"); - xName.add("60%"); - xName.add("70%"); - xName.add("80%"); - xName.add("90%"); - //将幅值绑定对应的x值,放入集合 - for (int i = 0; i < eventvalue.size(); i++) { - AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); - amplitudeCountParam.setXName(xName.get(i)); - amplitudeCountParam.setYValue(eventvalue.get(i)); - amplitudeList.add(amplitudeCountParam); - } - //存储幅值结果集合 - List amplitudeResult = new ArrayList<>(); - for (int i = 1; i < amplitudeList.size(); i++) { - if (!amplitudeList.get(i).getYValue().equals(amplitudeList.get(i - 1).getYValue())) { - amplitudeResult.add(amplitudeList.get(i - 1).getXName()); - amplitudeResult.add(amplitudeList.get(i).getXName()); - break; - } else if (amplitudeList.get(0).getYValue().equals(amplitudeList.get(amplitudeList.size() - 1).getYValue())) { - amplitudeResult.add(amplitudeList.get(0).getXName()); - amplitudeResult.add(amplitudeList.get(amplitudeList.size() - 1).getXName()); - break; - } - } + List ybardata = probabilityDistributionArea.getPersisttime(); + List ylinedata = probabilityDistributionArea.getSisttime(); + String sj = drawPicUtil.drawPersistentTime(ylinedata, ybardata); + createPic(doc, sj, "持续时间的概率分布函数"); - List eventvalue1 = probabilityDistributionArea.getSisttime(); - - List amplitudeList1 = new ArrayList<>(); - - List xName1 = new ArrayList<>(); - xName1.add("0.01"); - xName1.add("0.1"); - xName1.add("0.25"); - xName1.add("0.5"); - xName1.add("1"); - xName1.add("3"); - xName1.add("20"); - xName1.add("60"); - xName1.add("180"); - //将幅值绑定对应的x值,放入集合 - for (int i = 0; i < eventvalue1.size(); i++) { - AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); - amplitudeCountParam.setXName(xName1.get(i)); - amplitudeCountParam.setYValue(eventvalue1.get(i)); - amplitudeList1.add(amplitudeCountParam); - } - //存储幅值结果集合 - List amplitudeResult1 = new ArrayList<>(); - for (int i = 1; i < amplitudeList1.size(); i++) { - if (!amplitudeList1.get(i).getYValue().equals(amplitudeList1.get(i - 1).getYValue())) { - amplitudeResult1.add(amplitudeList1.get(i - 1).getXName()); - amplitudeResult1.add(amplitudeList1.get(i).getXName()); - break; - } else if (amplitudeList1.get(0).getYValue().equals(amplitudeList1.get(amplitudeList1.size() - 1).getYValue())) { - amplitudeResult1.add(amplitudeList1.get(0).getXName()); - amplitudeResult1.add(amplitudeList1.get(amplitudeList1.size() - 1).getXName()); - break; - } - } - - - /** - * =========================续写word文档============================================== - */ - //创建表题计数 - int twoCount = 1; - - oneCount2 = oneCount; - + } else { createTitle(doc, "4." + oneCount2 + " " + typeName + "幅值概率分布图", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 @@ -7444,259 +7575,176 @@ public class ReportServiceImpl implements ReportService { r12.setFontSize(11);//字体大小 - createTitle(doc, "4." + oneCount + "." + twoCount + " " + typeName + "幅值的概率分布函数", "标题 3", 400, 11); + createTitle(doc, "4." + oneCount + "." + twoCount + " 时序时间的概率分函数", "标题 3", 400, 11); - List ybardata = probabilityDistributionArea.getPereventvalue(); - List ylinedata = probabilityDistributionArea.getEventvalue(); - String fz = drawPicUtil.drawEventAmplitude(ylinedata, ybardata); - createPic(doc, fz, "" + typeName + "幅值的概率分布函数"); + List ybardata = probabilityDistributionArea.getPersisttime(); + List ylinedata = probabilityDistributionArea.getSisttime(); + String sj = drawPicUtil.drawPersistentTime(ylinedata, ybardata); + createPic(doc, sj, "持续时间的概率分布函数"); //序号计数进行++ oneCount++; + } + /** + * =======================================word结束========================================= + */ + } - /** - * =======================================word结束========================================= - */ + //8.事件关联统计表格 + if (areaReportParam.isEventRelevanceCountTable()) { + //事件关联统计表格 + int resultCount = 0; + List resultList = new ArrayList<>(); + List eventList = eventDetailList.stream().filter(e -> StrUtil.isNotBlank(e.getEventassIndex())).collect(Collectors.toList()); + + if (CollectionUtil.isNotEmpty(eventList)) { + //记录条数 + resultCount = eventList.size(); + + List ids = eventList.stream().map(EventDetailNew::getEventassIndex).collect(Collectors.toList()); + List eventAssList = eventDetailMapper.ListEventass(ids); + + for (Eventass eventass : eventAssList) { + EventassCountParam eventassCountParam = new EventassCountParam(); + String dateTime = LocalDateTimeUtil.format(eventass.getTimeId(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")); + eventassCountParam.setAssTime(dateTime); + //获取时间 + eventassCountParam.setEventTime(dateTime); + eventassCountParam.setDescribe(eventass.getContentDes()); + resultList.add(eventassCountParam); + } } - //7.暂降持续时间 - if (areaReportParam.isDuration()) { - //持续时间概率分布 - AreaTableParam areaTableParam = new AreaTableParam(); + + createTitle(doc, "4." + oneCount + " 事件关联分析", "标题 2", 200, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + //归一化需要高级算法,先字符串代替 + r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条,归一化统计后共" + resultCount + "[此为归一化后的暂态事件结果]条,,具体如下图所示:"); + r12.setFontSize(11);//字体大小 + //第三张表 + XWPFTable monitorInfo2 = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "时间", "事件关联分析名称", "事件关联分析表述"); - //创建结果集合 - List info = eventDetailList; + //塞入数据 + for (int i = 0; i < resultList.size(); i++) { + insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, resultList.get(i).getAssTime(), resultList.get(i).getEventTime(), resultList.get(i).getDescribe()); + } + //序号计数进行++ + oneCount++; - //将sql结果集放入,共用一个sql,减少查询时间 - AreaTableParam areaTableParam1 = new AreaTableParam(); - areaTableParam1.setInfo(info); - ProbabilityVO probabilityDistributionArea = getProbabilityDistributionArea(areaTableParam1); + /** + * =======================================word结束========================================= + */ + } - List eventvalue = probabilityDistributionArea.getEventvalue(); + //9.暂降原因表和暂降原因图形生成 + if (areaReportParam.isEventReasonTable() || areaReportParam.isEventReasonChart()) { + //查询字典表 + List reasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData(); - List amplitudeList = new ArrayList<>(); + //新建map集合装入参数 + Map reasonMap = reasonList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); - List xName = new ArrayList<>(); - xName.add("0"); - xName.add("10%"); - xName.add("20%"); - xName.add("30%"); - xName.add("40%"); - xName.add("50%"); - xName.add("60%"); - xName.add("70%"); - xName.add("80%"); - xName.add("90%"); - //将幅值绑定对应的x值,放入集合 - for (int i = 0; i < eventvalue.size(); i++) { - AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); - amplitudeCountParam.setXName(xName.get(i)); - amplitudeCountParam.setYValue(eventvalue.get(i)); - amplitudeList.add(amplitudeCountParam); - } - //存储幅值结果集合 - List amplitudeResult = new ArrayList<>(); - for (int i = 1; i < amplitudeList.size(); i++) { - if (!amplitudeList.get(i).getYValue().equals(amplitudeList.get(i - 1).getYValue())) { - amplitudeResult.add(amplitudeList.get(i - 1).getXName()); - amplitudeResult.add(amplitudeList.get(i).getXName()); - break; - } else if (amplitudeList.get(0).getYValue().equals(amplitudeList.get(amplitudeList.size() - 1).getYValue())) { - amplitudeResult.add(amplitudeList.get(0).getXName()); - amplitudeResult.add(amplitudeList.get(amplitudeList.size() - 1).getXName()); - break; - } + //获得所有值 + Set typeSet = reasonMap.keySet(); + List listReason = new ArrayList<>(typeSet); + + //创建Map结果集合 + Map resultMap = new HashMap<>(); + + //优化数据(根据暂降原因,进行分组统计有多少条数据,key:暂降原因id,value:次数) + Map reasonMapCount = eventDetailList.stream().collect(Collectors.groupingBy(EventDetailNew::getAdvanceReason, Collectors.counting())); + //将数据重新整合为(key:暂降原因的名称,value:暂降原因测次数) + reasonMap.forEach((key, value) -> { + if (reasonMapCount.containsKey(key)) { + resultMap.put(value, Math.toIntExact(reasonMapCount.get(key))); + } else { + resultMap.put(value, 0); } + }); + //todo 还要对集合中哪个次数最多挑出第一位 + //获取entrySet + Map linkMap = getSort(resultMap); + //最多暂降事件名称 + Set topSet = linkMap.keySet(); + List topList = new ArrayList<>(topSet); - List eventvalue1 = probabilityDistributionArea.getSisttime(); - - List amplitudeList1 = new ArrayList<>(); - - List xName1 = new ArrayList<>(); - xName1.add("0.01"); - xName1.add("0.1"); - xName1.add("0.25"); - xName1.add("0.5"); - xName1.add("1"); - xName1.add("3"); - xName1.add("20"); - xName1.add("60"); - xName1.add("180"); - //将幅值绑定对应的x值,放入集合 - for (int i = 0; i < eventvalue1.size(); i++) { - AmplitudeCountParam amplitudeCountParam = new AmplitudeCountParam(); - amplitudeCountParam.setXName(xName1.get(i)); - amplitudeCountParam.setYValue(eventvalue1.get(i)); - amplitudeList1.add(amplitudeCountParam); - } - //存储幅值结果集合 - List amplitudeResult1 = new ArrayList<>(); - for (int i = 1; i < amplitudeList1.size(); i++) { - if (!amplitudeList1.get(i).getYValue().equals(amplitudeList1.get(i - 1).getYValue())) { - amplitudeResult1.add(amplitudeList1.get(i - 1).getXName()); - amplitudeResult1.add(amplitudeList1.get(i).getXName()); - break; - } else if (amplitudeList1.get(0).getYValue().equals(amplitudeList1.get(amplitudeList1.size() - 1).getYValue())) { - amplitudeResult1.add(amplitudeList1.get(0).getXName()); - amplitudeResult1.add(amplitudeList1.get(amplitudeList1.size() - 1).getXName()); - break; - } - } - /** - * =========================续写word文档============================================== - */ - + //暂降原因表格 + if (areaReportParam.isEventReasonTable()) { + //暂降原因表格 //创建表题计数 int twoCount = 1; - //如果暂降幅值被勾选,就不需要进行写段落 - if (areaReportParam.isSagAmplitude()) { - twoCount++; - - //如果幅值图存在与幅值的序号保持同步 - createTitle(doc, "4." + oneCount2 + "." + twoCount + " 时序时间的概率分函数", "标题 3", 400, 11); - - - List ybardata = probabilityDistributionArea.getPersisttime(); - List ylinedata = probabilityDistributionArea.getSisttime(); - String sj = drawPicUtil.drawPersistentTime(ylinedata, ybardata); - createPic(doc, sj, "持续时间的概率分布函数"); - - - } else { - createTitle(doc, "4." + oneCount2 + " " + typeName + "幅值概率分布图", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + typeName + "概率分布图分成" + typeName + "幅值概率分布和持续时间概率分布图,中国电网在所选择的分析时间内" + typeName + "事件从幅值概率分布统计主要集中在幅值为" + amplitudeResult.get(0) + "~" + amplitudeResult.get(1) + "之间," + - "从持续时间统计主要集中在持续时间为" + amplitudeResult1.get(0) + "~" + amplitudeResult1.get(1) + "[持续时间排序,选择" + typeName + "记录发生最多的区域],如下表(图):"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " 时序时间的概率分函数", "标题 3", 400, 11); - - - List ybardata = probabilityDistributionArea.getPersisttime(); - List ylinedata = probabilityDistributionArea.getSisttime(); - String sj = drawPicUtil.drawPersistentTime(ylinedata, ybardata); - createPic(doc, sj, "持续时间的概率分布函数"); - - - //序号计数进行++ - oneCount++; - } - /** - * =======================================word结束========================================= - */ - } - - //8.事件关联统计表格 - if (areaReportParam.isEventRelevanceCountTable()) { - //事件关联统计表格 - int resultCount = 0; - List resultList = new ArrayList<>(); - - List eventList = eventDetailList.stream().filter(e ->StrUtil.isNotBlank(e.getEventassIndex())).collect(Collectors.toList()); - - if (CollectionUtil.isNotEmpty(eventList)) { - //记录条数 - resultCount= eventList.size(); - - List ids = eventList.stream().map(EventDetailNew::getEventassIndex).collect(Collectors.toList()); - List eventAssList = eventDetailMapper.ListEventass(ids); - - for (Eventass eventass : eventAssList) { - EventassCountParam eventassCountParam = new EventassCountParam(); - String dateTime = LocalDateTimeUtil.format(eventass.getTimeId(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")); - eventassCountParam.setAssTime(dateTime); - //获取时间 - eventassCountParam.setEventTime(dateTime); - eventassCountParam.setDescribe(eventass.getContentDes()); - resultList.add(eventassCountParam); - } - } - - - createTitle(doc, "4." + oneCount + " 事件关联分析", "标题 2", 200, 11); + oneCount7 = oneCount; + createTitle(doc, "4." + oneCount + " 原因统计", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 p.setAlignment(ParagraphAlignment.BOTH); XWPFRun r12 = p.createRun();//创建段落文本 - //归一化需要高级算法,先字符串代替 - r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount+ "条,归一化统计后共" + resultCount + "[此为归一化后的暂态事件结果]条,,具体如下图所示:"); + r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态原因为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); r12.setFontSize(11);//字体大小 - //第三张表 - XWPFTable monitorInfo2 = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph2 = WordUtils.getCenterParagraph(doc); + createTitle(doc, "4." + oneCount + "." + twoCount + " 原因统计表格", "标题 3", 400, 11); + + //第一张表 + XWPFTable monitorInfo = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); // 表格第一行 - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, true, "时间", "事件关联分析名称", "事件关联分析表述"); - + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "暂态类型", "电压" + typeName + "次数"); //塞入数据 - for (int i = 0; i < resultList.size(); i++) { - insertRow(doc, monitorInfo2, monitorInfoExcelParagraph2, false, resultList.get(i).getAssTime(), resultList.get(i).getEventTime(), resultList.get(i).getDescribe()); + for (String name : resultMap.keySet()) { + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, name, resultMap.get(name).toString()); + } + + twoCount4 = twoCount; //序号计数进行++ oneCount++; - /** - * =======================================word结束========================================= - */ - } - //9.暂降原因表和暂降原因图形生成 - if (areaReportParam.isEventReasonTable() || areaReportParam.isEventReasonChart()) { - //查询字典表 - List reasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData(); - - //新建map集合装入参数 - Map reasonMap = reasonList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); - - //获得所有值 - Set typeSet = reasonMap.keySet(); - List listReason = new ArrayList<>(typeSet); - - //创建Map结果集合 - Map resultMap = new HashMap<>(); - - //优化数据(根据暂降原因,进行分组统计有多少条数据,key:暂降原因id,value:次数) - Map reasonMapCount = eventDetailList.stream().collect(Collectors.groupingBy(EventDetailNew::getAdvanceReason, Collectors.counting())); - //将数据重新整合为(key:暂降原因的名称,value:暂降原因测次数) - reasonMap.forEach((key, value) -> { - if (reasonMapCount.containsKey(key)) { - resultMap.put(value, Math.toIntExact(reasonMapCount.get(key))); - } else { - resultMap.put(value, 0); - } - }); - - //todo 还要对集合中哪个次数最多挑出第一位 - //获取entrySet - Map linkMap = getSort(resultMap); - //最多暂降事件名称 - Set topSet = linkMap.keySet(); - List topList = new ArrayList<>(topSet); - - //暂降原因表格 + //暂降原因图表 + if (areaReportParam.isEventReasonChart()) { if (areaReportParam.isEventReasonTable()) { - //暂降原因表格 + + createTitle(doc, "4." + oneCount7 + "." + twoCount4 + " 原因统计图", "标题 3", 400, 11); + + //创建x,y参数 + List xdata = new ArrayList<>(); + List> list = new ArrayList<>(); + Map map; + for (String name : resultMap.keySet()) { + xdata.add(name); + + map = new LinkedHashMap<>(); + map.put("value", resultMap.get(name)); + map.put("name", name); + list.add(map); + } + + String tr = drawPicUtil.drawReason(xdata, list); + createPic(doc, tr, "" + typeName + "原因图"); + } else { //创建表题计数 int twoCount = 1; - oneCount7 = oneCount; createTitle(doc, "4." + oneCount + " 原因统计", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 @@ -7706,125 +7754,122 @@ public class ReportServiceImpl implements ReportService { r12.setFontSize(11);//字体大小 - createTitle(doc, "4." + oneCount + "." + twoCount + " 原因统计表格", "标题 3", 400, 11); + createTitle(doc, "4." + oneCount + "." + twoCount + " 原因统计图", "标题 3", 400, 11); - //第一张表 - XWPFTable monitorInfo = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "暂态类型", "电压" + typeName + "次数"); - - //塞入数据 + //创建x,y参数 + List xdata = new ArrayList<>(); + List> list = new ArrayList<>(); + Map map; for (String name : resultMap.keySet()) { - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, name, resultMap.get(name).toString()); + xdata.add(name); + map = new LinkedHashMap<>(); + map.put("value", resultMap.get(name)); + map.put("name", name); + list.add(map); } - twoCount4 = twoCount; + String tr = drawPicUtil.drawReason(xdata, list); + createPic(doc, tr, "" + typeName + "原因图"); + //序号计数进行++ oneCount++; - - } - - //暂降原因图表 - if (areaReportParam.isEventReasonChart()) { - if (areaReportParam.isEventReasonTable()) { - - createTitle(doc, "4." + oneCount7 + "." + twoCount4 + " 原因统计图", "标题 3", 400, 11); - - //创建x,y参数 - List xdata = new ArrayList<>(); - List> list = new ArrayList<>(); - Map map; - for (String name : resultMap.keySet()) { - xdata.add(name); - - map = new LinkedHashMap<>(); - map.put("value", resultMap.get(name)); - map.put("name", name); - list.add(map); - } - - String tr = drawPicUtil.drawReason(xdata, list); - createPic(doc, tr, "" + typeName + "原因图"); - } else { - //创建表题计数 - int twoCount = 1; - - createTitle(doc, "4." + oneCount + " 原因统计", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态原因为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); - r12.setFontSize(11);//字体大小 - - - createTitle(doc, "4." + oneCount + "." + twoCount + " 原因统计图", "标题 3", 400, 11); - - //创建x,y参数 - List xdata = new ArrayList<>(); - List> list = new ArrayList<>(); - Map map; - for (String name : resultMap.keySet()) { - xdata.add(name); - - map = new LinkedHashMap<>(); - map.put("value", resultMap.get(name)); - map.put("name", name); - list.add(map); - } - - String tr = drawPicUtil.drawReason(xdata, list); - createPic(doc, tr, "" + typeName + "原因图"); - - //序号计数进行++ - oneCount++; - } } } + } - //10.暂降类型表格 和 暂降类型图表 - if (areaReportParam.isEventTypeTable() || areaReportParam.isEventTypeChart()) { + //10.暂降类型表格 和 暂降类型图表 + if (areaReportParam.isEventTypeTable() || areaReportParam.isEventTypeChart()) { - //查询字典表(暂降类型) - List typeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData(); - //新建map集合装入参数 - Map typeMap = typeList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); + //查询字典表(暂降类型) + List typeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData(); + //新建map集合装入参数 + Map typeMap = typeList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); - //获得所有值 - Set typeSet = typeMap.keySet(); - List listReason = new ArrayList<>(typeSet); + //获得所有值 + Set typeSet = typeMap.keySet(); + List listReason = new ArrayList<>(typeSet); - //创建Map结果集合 - Map resultMap = new HashMap<>(); + //创建Map结果集合 + Map resultMap = new HashMap<>(); - //优化数据(根据暂降类型,进行分组统计有多少条数据,key:暂降类型id,value:次数) - Map typeMapCount = eventDetailList.stream().collect(Collectors.groupingBy(EventDetailNew::getEventType, Collectors.counting())); - //将数据重新整合为(key:暂降类型的名称,value:暂降类型次数) - typeMap.forEach((key, value) -> { - if (typeMapCount.containsKey(key)) { - resultMap.put(value, Math.toIntExact(typeMapCount.get(key))); - } else { - resultMap.put(value, 0); - } - }); + //优化数据(根据暂降类型,进行分组统计有多少条数据,key:暂降类型id,value:次数) + Map typeMapCount = eventDetailList.stream().collect(Collectors.groupingBy(EventDetailNew::getEventType, Collectors.counting())); + //将数据重新整合为(key:暂降类型的名称,value:暂降类型次数) + typeMap.forEach((key, value) -> { + if (typeMapCount.containsKey(key)) { + resultMap.put(value, Math.toIntExact(typeMapCount.get(key))); + } else { + resultMap.put(value, 0); + } + }); - //todo 还要对集合中哪个次数最多挑出第一位 - //获取entrySet - Map linkMap = getSort(resultMap); - //最多暂降事件名称 - Set topSet = linkMap.keySet(); - List topList = new ArrayList<>(topSet); + //todo 还要对集合中哪个次数最多挑出第一位 + //获取entrySet + Map linkMap = getSort(resultMap); + //最多暂降事件名称 + Set topSet = linkMap.keySet(); + List topList = new ArrayList<>(topSet); - //暂降类型表格 + //暂降类型表格 + if (areaReportParam.isEventTypeTable()) { + //创建表题计数 + int twoCount = 1; + oneCount6 = oneCount; + + createTitle(doc, "4." + oneCount + " 类型统计", "标题 2", 200, 11); + + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态类型为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); + r12.setFontSize(11);//字体大小 + + + createTitle(doc, "4." + oneCount + "." + twoCount + " 类型统计表格", "标题 3", 400, 11); + + //第一张表 + XWPFTable monitorInfo = createTable(doc); + XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); + + // 表格第一行 + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "暂态类型", "电压" + typeName + "次数"); + + + //塞入数据 + for (String name : resultMap.keySet()) { + insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, name, resultMap.get(name).toString()); + } + + twoCount3 = twoCount; + //序号计数进行++ + oneCount++; + } + //暂降类型图形 + if (areaReportParam.isEventTypeChart()) { if (areaReportParam.isEventTypeTable()) { + twoCount3++; + createTitle(doc, "4." + oneCount6 + "." + twoCount3 + " 类型统计图", "标题 3", 400, 11); + //创建x,y参数 + List xdata = new ArrayList<>(); + List> reasonList = new ArrayList<>(); + Map map; + for (String name : resultMap.keySet()) { + xdata.add(name); + + map = new LinkedHashMap<>(); + map.put("value", resultMap.get(name)); + map.put("name", name); + reasonList.add(map); + } + + String tr = drawPicUtil.drawType(xdata, reasonList); + createPic(doc, tr, "" + typeName + "类型图"); + + } else { //创建表题计数 int twoCount = 1; - oneCount6 = oneCount; - createTitle(doc, "4." + oneCount + " 类型统计", "标题 2", 200, 11); p = doc.createParagraph();// 新建一个段落 @@ -7833,136 +7878,84 @@ public class ReportServiceImpl implements ReportService { r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态类型为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); r12.setFontSize(11);//字体大小 + createTitle(doc, "4." + oneCount + "." + twoCount + " 类型统计图", "标题 3", 400, 11); - createTitle(doc, "4." + oneCount + "." + twoCount + " 类型统计表格", "标题 3", 400, 11); - - //第一张表 - XWPFTable monitorInfo = createTable(doc); - XWPFParagraph monitorInfoExcelParagraph = WordUtils.getCenterParagraph(doc); - - // 表格第一行 - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, true, "暂态类型", "电压" + typeName + "次数"); - - - //塞入数据 + //创建x,y参数 + List xdata = new ArrayList<>(); + List> reasonList = new ArrayList<>(); + Map map; for (String name : resultMap.keySet()) { - insertRow(doc, monitorInfo, monitorInfoExcelParagraph, false, name, resultMap.get(name).toString()); + xdata.add(name); + + map = new LinkedHashMap<>(); + map.put("value", resultMap.get(name)); + map.put("name", name); + reasonList.add(map); } - twoCount3 = twoCount; + String tr = drawPicUtil.drawType(xdata, reasonList); + createPic(doc, tr, "" + typeName + "类型图"); + //序号计数进行++ oneCount++; } - //暂降类型图形 - if (areaReportParam.isEventTypeChart()) { - if (areaReportParam.isEventTypeTable()) { - twoCount3++; - createTitle(doc, "4." + oneCount6 + "." + twoCount3 + " 类型统计图", "标题 3", 400, 11); - //创建x,y参数 - List xdata = new ArrayList<>(); - List> reasonList = new ArrayList<>(); - Map map; - for (String name : resultMap.keySet()) { - xdata.add(name); - - map = new LinkedHashMap<>(); - map.put("value", resultMap.get(name)); - map.put("name", name); - reasonList.add(map); - } - - String tr = drawPicUtil.drawType(xdata, reasonList); - createPic(doc, tr, "" + typeName + "类型图"); - - } else { - //创建表题计数 - int twoCount = 1; - createTitle(doc, "4." + oneCount + " 类型统计", "标题 2", 200, 11); - - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网在所选择的分析时间内暂态事件主要的暂态类型为" + topList.get(0) + "[根据表格中的次数来进行分析],见下表(图):"); - r12.setFontSize(11);//字体大小 - - createTitle(doc, "4." + oneCount + "." + twoCount + " 类型统计图", "标题 3", 400, 11); - - //创建x,y参数 - List xdata = new ArrayList<>(); - List> reasonList = new ArrayList<>(); - Map map; - for (String name : resultMap.keySet()) { - xdata.add(name); - - map = new LinkedHashMap<>(); - map.put("value", resultMap.get(name)); - map.put("name", name); - reasonList.add(map); - } - - String tr = drawPicUtil.drawType(xdata, reasonList); - createPic(doc, tr, "" + typeName + "类型图"); - - //序号计数进行++ - oneCount++; - } - } - } - //11.暂降热力图 - if (areaReportParam.isThermodynamicChart()) { - //暂降热力图 - createTitle(doc, "4." + oneCount + " " + typeName + "热力图", "标题 2", 200, 11); + } - p = doc.createParagraph();// 新建一个段落 - p.setAlignment(ParagraphAlignment.BOTH); - XWPFRun r12 = p.createRun();//创建段落文本 - r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条,使用颜色将地图上按照" + typeName + "记录发生频率进行描绘,所形成的热力具体见下图:"); - r12.setFontSize(11);//字体大小 + //11.暂降热力图 + if (areaReportParam.isThermodynamicChart()) { + //暂降热力图 + createTitle(doc, "4." + oneCount + " " + typeName + "热力图", "标题 2", 200, 11); - //所有的表结果装入集合 - Map areaCount1 = new HashMap<>(); + p = doc.createParagraph();// 新建一个段落 + p.setAlignment(ParagraphAlignment.BOTH); + XWPFRun r12 = p.createRun();//创建段落文本 + r12.setText(" " + deptName + "电网在所选择的分析时间段内累计监测" + typeName + "记录" + eventCount + "条,使用颜色将地图上按照" + typeName + "记录发生频率进行描绘,所形成的热力具体见下图:"); + r12.setFontSize(11);//字体大小 - //进行遍历集合获得子区域名及其所有监测点id - //根据省级获取部门下面的信息图 - for (PmsGeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { + //所有的表结果装入集合 + Map areaCount1 = new HashMap<>(); - //当前子部门下所有id - List lineIndexes = generalDeviceDTO.getMonitorIdList(); + //进行遍历集合获得子区域名及其所有监测点id + //根据省级获取部门下面的信息图 + for (PmsGeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { + + //当前子部门下所有id + List lineIndexes = generalDeviceDTO.getMonitorIdList(); - //如果集合中有id将id进行拼接 - if (CollectionUtil.isNotEmpty(lineIndexes)) { - //数据统计 - Integer eventDetailCount = getEventDetailCount(areaReportParam, lineIndexes); - areaCount1.put(generalDeviceDTO.getName(), eventDetailCount); + //如果集合中有id将id进行拼接 + if (CollectionUtil.isNotEmpty(lineIndexes)) { + //数据统计 + Integer eventDetailCount = getEventDetailCount(areaReportParam, lineIndexes); + areaCount1.put(generalDeviceDTO.getName(), eventDetailCount); - } else { - //为空put 0 - areaCount1.put(generalDeviceDTO.getName(), 0); - } + } else { + //为空put 0 + areaCount1.put(generalDeviceDTO.getName(), 0); } - - - //转为List对象集合 - List areaCountList1 = new ArrayList<>(); - for (String s : areaCount1.keySet()) { - ReportCountParam reportCountParam = new ReportCountParam(); - reportCountParam.setName(s); - reportCountParam.setCount(areaCount1.get(s).toString()); - areaCountList1.add(reportCountParam); - } - //序号计数进行++ - oneCount++; } - //文件下载 - ServletOutputStream outputStream = response.getOutputStream(); - String fileName = URLEncoder.encode(deptName + "热力图.docx", "UTF-8"); - response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); - response.setContentType("application/octet-stream;charset=UTF-8"); - doc.write(outputStream); - outputStream.close(); + + + //转为List对象集合 + List areaCountList1 = new ArrayList<>(); + for (String s : areaCount1.keySet()) { + ReportCountParam reportCountParam = new ReportCountParam(); + reportCountParam.setName(s); + reportCountParam.setCount(areaCount1.get(s).toString()); + areaCountList1.add(reportCountParam); + } + //序号计数进行++ + oneCount++; + } + //文件下载 + ServletOutputStream outputStream = response.getOutputStream(); + String fileName = URLEncoder.encode(deptName + "热力图.docx", "UTF-8"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); + response.setContentType("application/octet-stream;charset=UTF-8"); + doc.write(outputStream); + outputStream.close(); } @Override @@ -8952,20 +8945,20 @@ public class ReportServiceImpl implements ReportService { * @param lineIds 监测点集合 * @return */ - private List getEventDetailListInfo(AreaReportParam areaReportParam, List lineIds,Integer type) { + private List getEventDetailListInfo(AreaReportParam areaReportParam, List lineIds, Integer type) { //获取事件类型(短时中断 电压暂降 电压暂升 扰动 其他) List dictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData(); List typeIds; - if(type==0){ - typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode()) + if (type == 0) { + typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode()) || DicDataEnum.SHORT_INTERRUPTIONS.getCode().equals(x.getCode()) || DicDataEnum.DISTURBANCE.getCode().equals(x.getCode()) || DicDataEnum.OTHER.getCode().equals(x.getCode()) || DicDataEnum.VOLTAGE_RISE.getCode().equals(x.getCode()) ) .map(DictData::getId).collect(Collectors.toList()); - }else{ - typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode())) + } else { + typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode())) .map(DictData::getId).collect(Collectors.toList()); } //数据暂降查询 diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EventTemplateController.java b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EventTemplateController.java index 7c851b627..69dbbcf9a 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EventTemplateController.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EventTemplateController.java @@ -1,5 +1,6 @@ package com.njcn.system.controller; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.constant.OperateType; @@ -22,6 +23,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -165,10 +167,13 @@ public class EventTemplateController extends BaseController{ @PostMapping("/selectReleation") @ApiOperation("根据模板id查询关系") @ApiImplicitParam(name = "id", value = "角色索引", required = true) - public HttpResult> selectRelation(@RequestParam @Validated String id) { + public HttpResult> selectRelation(@RequestParam(required = false,name = "id") String id) { String methodDescribe = getMethodDescribe("selectRelation"); LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, id); - List res = iEventTemplateService.selectRelation(id); + List res = new ArrayList<>(); + if (StrUtil.isNotBlank(id)) { + res.addAll(iEventTemplateService.selectRelation(id)) ; + } return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe); }