|
|
@ -128,15 +128,18 @@ public class WordController { |
|
|
|
|
|
|
|
PoiUtil.createHeading2(doc,"天气情况统计"); |
|
|
|
|
|
|
|
AjaxResult ajaxResult = weatherForecastController.hourlyWeather(); |
|
|
|
if (ajaxResult.get("code").equals(200)) { |
|
|
|
|
|
|
|
Map<String,List<Map<String,Object>>> data = (Map<String, List<Map<String,Object>>>) ajaxResult.get("data"); |
|
|
|
if (data != null && data.size() != 0){ |
|
|
|
|
|
|
|
XWPFTable table = doc.createTable(9, 25); |
|
|
|
//列宽自动分割
|
|
|
|
CTTblWidth infoTableWidth = table.getCTTbl().addNewTblPr().addNewTblW(); |
|
|
|
infoTableWidth.setType(STTblWidth.DXA); |
|
|
|
infoTableWidth.setW(BigInteger.valueOf(9072)); |
|
|
|
|
|
|
|
AjaxResult ajaxResult = weatherForecastController.hourlyWeather(); |
|
|
|
if (ajaxResult.get("code").equals(200)) { |
|
|
|
Map<String,List<Map<String,Object>>> data = (Map<String, List<Map<String,Object>>>) ajaxResult.get("data"); |
|
|
|
data.keySet().forEach(key ->{ |
|
|
|
if ("hourlyWeather1".equals(key)){ |
|
|
|
setTableFonts(table.getRow(1).getCell(0), "长清区"); |
|
|
@ -190,6 +193,10 @@ public class WordController { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
addDescription(doc,"暂无数据"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//换行
|
|
|
|