代码提交

This commit is contained in:
wr
2023-06-06 16:41:15 +08:00
parent 7c36dd2a0b
commit 2f4d0be940
4 changed files with 383 additions and 2 deletions

View File

@@ -69,4 +69,10 @@ public interface EventReportService {
*/
StatisticVO getStatistic(List<EventDetail> info,List<DictData> reasonData,List<DictData>typeData);
/**
* 获取密度点图
* @param info
* @return
*/
List<CoordsVO> getCoords(List<EventDetail> info);
}

View File

@@ -1002,6 +1002,226 @@ public class EventReportServiceImpl implements EventReportService {
return result;
}
@Override
public List<CoordsVO> getCoords(List<EventDetail> info) {
List<CoordsVO> result = new ArrayList<>();
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 9; j++) {
result.add(new CoordsVO(i, j, 0));
}
}
for (int i = 0; i < info.size(); i++) {
Integer index = null;
CoordsVO dto = new CoordsVO();
if (info.get(i).getFeatureAmplitude() >= 0 && info.get(i).getFeatureAmplitude() <= 0.1) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 0;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 1;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 2;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 3;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 4;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 5;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 6;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 7;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 8;
}
} else if (info.get(i).getFeatureAmplitude() > 0.1 && info.get(i).getFeatureAmplitude() <= 0.2) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 9;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 10;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 11;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 12;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 13;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 14;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 15;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 16;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 17;
}
} else if (info.get(i).getFeatureAmplitude() > 0.2 && info.get(i).getFeatureAmplitude() <= 0.3) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 18;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 19;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 20;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 21;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 22;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 23;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 24;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 25;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 26;
}
} else if (info.get(i).getFeatureAmplitude() > 0.3 && info.get(i).getFeatureAmplitude() <= 0.4) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 27;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 28;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 29;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 30;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 31;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 32;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 33;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 34;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 35;
}
} else if (info.get(i).getFeatureAmplitude() > 0.4 && info.get(i).getFeatureAmplitude() <= 0.5) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 36;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 37;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 38;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 39;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 40;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 41;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 42;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 43;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 44;
}
} else if (info.get(i).getFeatureAmplitude() > 0.5 && info.get(i).getFeatureAmplitude() <= 0.6) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 45;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 46;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 47;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 48;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 49;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 50;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 51;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 52;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 53;
}
} else if (info.get(i).getFeatureAmplitude() > 0.6 && info.get(i).getFeatureAmplitude() <= 0.7) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 54;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 55;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 56;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 57;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 58;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 59;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 60;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 61;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 62;
}
} else if (info.get(i).getFeatureAmplitude() > 0.7 && info.get(i).getFeatureAmplitude() <= 0.8) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 63;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 64;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 65;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 66;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 67;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 68;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 69;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 70;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 71;
}
} else if (info.get(i).getFeatureAmplitude() > 0.8 && info.get(i).getFeatureAmplitude() <= 0.9) {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 72;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 73;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 74;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 75;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 76;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 77;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 78;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 79;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 80;
}
} else {
if (info.get(i).getDuration() / 1000 > 0 && info.get(i).getDuration() / 1000 <= 0.020) {
index = 81;
} else if (info.get(i).getDuration() / 1000 <= 0.040 && info.get(i).getDuration() / 1000 > 0.020) {
index = 82;
} else if (info.get(i).getDuration() / 1000 <= 0.060 && info.get(i).getDuration() / 1000 > 0.040) {
index = 83;
} else if (info.get(i).getDuration() / 1000 <= 0.080 && info.get(i).getDuration() / 1000 > 0.060) {
index = 84;
} else if (info.get(i).getDuration() / 1000 <= 0.120 && info.get(i).getDuration() / 1000 > 0.080) {
index = 85;
} else if (info.get(i).getDuration() / 1000 > 0.120 && info.get(i).getDuration() / 1000 < 0.200) {
index = 86;
} else if (info.get(i).getDuration() / 1000 >= 0.200 && info.get(i).getDuration() / 1000 < 0.400) {
index = 87;
} else if (info.get(i).getDuration() / 1000 >= 0.400 && info.get(i).getDuration() / 1000 < 0.600) {
index = 88;
} else if (info.get(i).getDuration() / 1000 >= 0.600 && info.get(i).getDuration() / 1000 <= 1.200) {
index = 89;
}
}
if (Objects.nonNull(index)) {
CoordsVO coordsVO = result.get(index);
coordsVO.setZ(coordsVO.getZ() + 1);
}
}
return result;
}
/**
* @return
* @author xxy

View File

@@ -1829,12 +1829,12 @@ public class ReportServiceImpl implements ReportService {
createTitle(doc, "4." + i + " 暂降事件列表", "标题 2", 200, 15);
XWPFTable table = createTable(doc);
XWPFParagraph centerParagraph = WordUtils.getCenterParagraph(doc);
insertRow(doc, table, centerParagraph, true, "序号", "暂降发生时刻", "暂降值(%)", "持续时间(s)", "暂降类型", "暂降原因", "严重度");
insertRow(doc, table, centerParagraph, true, "序号", "暂降发生时刻", "暂降值(%)", "持续时间(s)", "暂降类型", "暂降原因", "严重度");
for (int j = 0; j < plot.size(); j++) {
EventDetail eventDetail = plot.get(j);
String s = eventDetail.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
insertRow(doc, table, centerParagraph, false, j + 1 + "", s, eventDetail.getFeatureAmplitude()*100 + "", eventDetail.getDuration() + "", eventDetail.getAdvanceType(), eventDetail.getAdvanceReason(), eventDetail.getSeverity() + "");
insertRow(doc, table, centerParagraph, false, j + 1 + "", s, BigDecimal.valueOf(eventDetail.getFeatureAmplitude()*100).setScale(2, RoundingMode.HALF_UP).toString(), eventDetail.getDuration() + "", eventDetail.getAdvanceType(), eventDetail.getAdvanceReason(), eventDetail.getSeverity() + "");
}
i++;
}
@@ -1866,6 +1866,12 @@ public class ReportServiceImpl implements ReportService {
int two = 1;
if (exportParam.isMdtx()) {
createTitle(doc, "4." + i + "." + two + " 暂降密度点图", "标题 3", 400, 15);
List<CoordsVO> coords = eventReportService.getCoords(info);
Integer[][] a=new Integer[87][];
HashMap<String, Object> map = new HashMap<>();
map.put("data", JSONArray.fromObject(coords).toString());
String str = getStr("bar10.ftl", map);
createPic(doc, str, "暂降密度图");
two++;
}
if (exportParam.isMdbg()) {