|
|
@ -737,6 +737,7 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
public void exportAccidentModelAnalysis(XWPFDocument doc, DcSdhsEventQuery dcSdhsEventQuery) { |
|
|
|
// 初始化一个空的结果映射
|
|
|
|
Map<String, Map<String, Integer>> result = accidentModelAnalysis(dcSdhsEventQuery); |
|
|
|
if (result != null && result.size() != UniversalEnum.ZERO.getNumber()) { |
|
|
|
|
|
|
|
// 计算最大车辆类型数量
|
|
|
|
int maxVehicleTypes = 5; |
|
|
@ -839,7 +840,7 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
// 换行
|
|
|
|
createLineBreak(doc); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -944,7 +945,9 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
String hourString = String.format("%02d", hour); |
|
|
|
hourlyCounts.merge(hourString, 0L, Long::sum); |
|
|
|
} |
|
|
|
return hourlyCounts; |
|
|
|
Map<String, Long> hourlyCountsTreeMap = new TreeMap<>(hourlyCounts); |
|
|
|
|
|
|
|
return hourlyCountsTreeMap; |
|
|
|
} else if (dcSdhsEventQuery.getType().equals("1")) { |
|
|
|
// 将查询开始时间和结束时间转换为 LocalDateTime
|
|
|
|
LocalDateTime queryStart = dcSdhsEventQuery.getStartTime().toInstant().atZone(zoneId).toLocalDateTime(); |
|
|
@ -972,7 +975,9 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
String dateString = date.format(formatter); |
|
|
|
dailyCounts.merge(dateString, 0L, Long::sum); |
|
|
|
} |
|
|
|
return dailyCounts; |
|
|
|
// 将键值对放入TreeMap中,TreeMap会自动按键排序
|
|
|
|
Map<String, Long> dailyCountsTreeMap = new TreeMap<>(dailyCounts); |
|
|
|
return dailyCountsTreeMap; |
|
|
|
} else { |
|
|
|
// 将查询开始时间和结束时间转换为 LocalDateTime
|
|
|
|
LocalDateTime queryStart = dcSdhsEventQuery.getStartTime().toInstant().atZone(zoneId).toLocalDateTime(); |
|
|
@ -1000,7 +1005,9 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
monthlyCounts.merge(monthString, 0L, Long::sum); |
|
|
|
currentMonth = currentMonth.plusMonths(1); |
|
|
|
} |
|
|
|
return monthlyCounts; |
|
|
|
// 将键值对放入TreeMap中,TreeMap会自动按键排序
|
|
|
|
Map<String, Long> monthlyCountsTreeMap = new TreeMap<>(monthlyCounts); |
|
|
|
return monthlyCountsTreeMap; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -1074,6 +1081,7 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
name = "wordTemplate/accidentTimeMonthAnalysis.docx"; |
|
|
|
|
|
|
|
} |
|
|
|
if (currentYearData != null && currentYearData.size() != UniversalEnum.ZERO.getNumber()) { |
|
|
|
|
|
|
|
|
|
|
|
// 创建表格
|
|
|
@ -1185,7 +1193,7 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
//换行
|
|
|
|
createLineBreak(doc); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1871,6 +1879,9 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
List<DcTollStationStatisticsDataMap> exit = map.get("exit"); |
|
|
|
int rows = entrance.size(); |
|
|
|
String name = "wordTemplate/tollGateEntrance.docx"; |
|
|
|
if (map != null && map.size() != UniversalEnum.ZERO.getNumber()) { |
|
|
|
|
|
|
|
PoiUtil.createHeading2(doc, "收费站出入口车流量"); |
|
|
|
|
|
|
|
// 创建表格
|
|
|
|
XWPFTable table = doc.createTable(rows + 1, 3); |
|
|
@ -1961,7 +1972,7 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
} |
|
|
|
//换行
|
|
|
|
createLineBreak(doc); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
@ -1977,6 +1988,7 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
List<TrafficFlowStatisticsMap> exit = map.get("jinanDirection"); |
|
|
|
int rows = entrance.size(); |
|
|
|
String name = "wordTemplate/frameDataAnalysis.docx"; |
|
|
|
if (map != null && map.size() != UniversalEnum.ZERO.getNumber()) { |
|
|
|
|
|
|
|
// 创建表格
|
|
|
|
XWPFTable table = doc.createTable(rows+1, 3); |
|
|
@ -2068,7 +2080,7 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
} |
|
|
|
//换行
|
|
|
|
createLineBreak(doc); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|