{{column}}观测指标 |
[month] |
结论 |
|
LoopColumnTableRenderPolicy policyCol = new LoopColumnTableRenderPolicy();
Configure config = Configure.builder().bind("column", policyCol).build();
XWPFTemplate template = XWPFTemplate.compile(wordTemplate, config).render(
getData(reportData, associateId)
);
private HashMap<String, Object> getData(Map<String, Object> reportData, Long enterpriseId) {
return new HashMap<String, Object>() {{
JSONObject json = enterpriseOperatingVisibleLightIndexService.getEnterpriseOperatingVisibleLightIndexByEnterpriseId(enterpriseId);
put("column", column(json));
}};
}
private List<Column> column(JSONObject json) {
List<Column> list = new ArrayList<>();
JSONArray heads = (JSONArray) json.get("head");
for (Object j : heads) {
Column column = new Column();
JSONObject _j = (JSONObject) j;
column.month = StringUtils.toString(_j.get("reportDate"));
list.add(column);
}
return list;
}
private List<Row> row(JSONObject json) {
List<Row> list = new ArrayList<>();
JSONArray heads = (JSONArray) json.get("head");
for (Object j : heads) {
Row row = new Row();
JSONObject _j = (JSONObject) j;
row.title = StringUtils.toString(_j.get("titleText"));
list.add(row);
}
return list;
}
class Row {
String title;
}
class Column {
String month;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。