|
@ -171,81 +171,57 @@ public class WordController { |
|
|
DateTimeFormatter parseFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME; |
|
|
DateTimeFormatter parseFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME; |
|
|
|
|
|
|
|
|
data.forEach(dataItem ->{ |
|
|
data.forEach(dataItem ->{ |
|
|
if (UniversalEnum.STAKE_NUM_K60.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
setTableFonts(table.getRow(UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.CHANG_QING_DISTRICT.getValue()); |
|
|
if (weatherList != null && weatherList.size() > 0){ |
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
|
|
|
weatherList = weatherList.stream() |
|
|
weatherList = weatherList.stream() |
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
|
|
|
//第一行 格式化时间
|
|
|
if (UniversalEnum.STAKE_NUM_K60.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
LocalDateTime localDateTime = LocalDateTime.parse(weatherList.get(i).get("weatherTime").toString(), parseFormatter); |
|
|
setTableFonts(table.getRow(UniversalEnum.ONE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.CHANG_QING_DISTRICT.getValue()); |
|
|
DateTimeFormatter formatFormatter = DateTimeFormatter.ofPattern("dd日HH时"); |
|
|
|
|
|
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()),localDateTime.format(formatFormatter)); |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
setTableFonts(table.getRow(UniversalEnum.ONE.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
//第一行 格式化时间
|
|
|
} |
|
|
LocalDateTime localDateTime = LocalDateTime.parse(weatherList.get(i).get("weatherTime").toString(), parseFormatter); |
|
|
} else if (UniversalEnum.STAKE_NUM_K105.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
DateTimeFormatter formatFormatter = DateTimeFormatter.ofPattern("dd日HH时"); |
|
|
setTableFonts(table.getRow(UniversalEnum.TWO.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.PING_YIN_COUNTY.getValue()); |
|
|
setTableFonts(table.getRow(UniversalEnum.ZERO.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()),localDateTime.format(formatFormatter)); |
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
setTableFonts(table.getRow(UniversalEnum.ONE.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
weatherList = weatherList.stream() |
|
|
} |
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
} else if (UniversalEnum.STAKE_NUM_K105.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
.collect(Collectors.toList()); |
|
|
setTableFonts(table.getRow(UniversalEnum.TWO.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.PING_YIN_COUNTY.getValue()); |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
setTableFonts(table.getRow(UniversalEnum.TWO.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
setTableFonts(table.getRow(UniversalEnum.TWO.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
} |
|
|
} |
|
|
} else if (UniversalEnum.STAKE_NUM_K145.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
} else if (UniversalEnum.STAKE_NUM_K145.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
setTableFonts(table.getRow(UniversalEnum.THREE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.DONG_PING_COUNTY.getValue()); |
|
|
setTableFonts(table.getRow(UniversalEnum.THREE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.DONG_PING_COUNTY.getValue()); |
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
weatherList = weatherList.stream() |
|
|
setTableFonts(table.getRow(UniversalEnum.THREE.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
} |
|
|
.collect(Collectors.toList()); |
|
|
} else if (UniversalEnum.STAKE_NUM_K165.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
setTableFonts(table.getRow(UniversalEnum.FOUR.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.WEN_SHANG_COUNTY.getValue()); |
|
|
setTableFonts(table.getRow(UniversalEnum.THREE.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
} |
|
|
setTableFonts(table.getRow(UniversalEnum.FOUR.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
} else if (UniversalEnum.STAKE_NUM_K165.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
} |
|
|
setTableFonts(table.getRow(UniversalEnum.FOUR.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.WEN_SHANG_COUNTY.getValue()); |
|
|
} else if (UniversalEnum.STAKE_NUM_K175.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
setTableFonts(table.getRow(UniversalEnum.FIVE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.LIANG_SHAN_COUNTY.getValue()); |
|
|
weatherList = weatherList.stream() |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
setTableFonts(table.getRow(UniversalEnum.FIVE.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
.collect(Collectors.toList()); |
|
|
} |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
} else if (UniversalEnum.STAKE_NUM_K190.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
setTableFonts(table.getRow(UniversalEnum.FOUR.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
setTableFonts(table.getRow(UniversalEnum.SIX.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.JIA_XIANG_COUNTY.getValue()); |
|
|
} |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
} else if (UniversalEnum.STAKE_NUM_K175.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
setTableFonts(table.getRow(UniversalEnum.SIX.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
setTableFonts(table.getRow(UniversalEnum.FIVE.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.LIANG_SHAN_COUNTY.getValue()); |
|
|
} |
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
} else if (UniversalEnum.STAKE_NUM_K200.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
weatherList = weatherList.stream() |
|
|
setTableFonts(table.getRow(UniversalEnum.SEVEN.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.JUYE_COUNTY.getValue()); |
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
.collect(Collectors.toList()); |
|
|
setTableFonts(table.getRow(UniversalEnum.SEVEN.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
} |
|
|
setTableFonts(table.getRow(UniversalEnum.FIVE.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
} else if (UniversalEnum.STAKE_NUM_K205.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
} |
|
|
setTableFonts(table.getRow(UniversalEnum.EIGHT.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.YUN_CHENG_COUNTY.getValue()); |
|
|
} else if (UniversalEnum.STAKE_NUM_K190.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
setTableFonts(table.getRow(UniversalEnum.SIX.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.JIA_XIANG_COUNTY.getValue()); |
|
|
setTableFonts(table.getRow(UniversalEnum.EIGHT.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
} |
|
|
weatherList = weatherList.stream() |
|
|
|
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
|
|
|
setTableFonts(table.getRow(UniversalEnum.SIX.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (UniversalEnum.STAKE_NUM_K200.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
|
|
|
setTableFonts(table.getRow(UniversalEnum.SEVEN.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.JUYE_COUNTY.getValue()); |
|
|
|
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
|
|
|
weatherList = weatherList.stream() |
|
|
|
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
|
|
|
setTableFonts(table.getRow(UniversalEnum.SEVEN.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (UniversalEnum.STAKE_NUM_K205.getValue().equals(dataItem.get("stakeNum"))){ |
|
|
|
|
|
setTableFonts(table.getRow(UniversalEnum.EIGHT.getNumber()).getCell(UniversalEnum.ZERO.getNumber()), UniversalEnum.YUN_CHENG_COUNTY.getValue()); |
|
|
|
|
|
List<Map<String,Object>> weatherList = (List<Map<String,Object>>) dataItem.get("forecastList"); |
|
|
|
|
|
weatherList = weatherList.stream() |
|
|
|
|
|
.sorted(Comparator.comparing(map -> LocalDateTime.parse(map.get("weatherTime").toString(), parseFormatter))) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < weatherList.size(); i++) { |
|
|
|
|
|
setTableFonts(table.getRow(UniversalEnum.EIGHT.getNumber()).getCell(i+UniversalEnum.ONE.getNumber()), weatherList.get(i).get("weatherDescription").toString()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|