private HashMap<String, Object> getData(Map<String, Object> reportData, Long enterpriseId) {
return new HashMap<String, Object>() {{
JSONObject json = enterpriseOperatingVisibleLightIndexService.getEnterpriseOperatingVisibleLightIndexByEnterpriseId(enterpriseId);
// 表格
// put("rows", row(json));
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;
}