| | |
| | | import com.estate.expert.admin.stat.report.render.AbstractInfoTablePolicy; |
| | | import com.estate.expert.admin.stat.report.render.CheckInfoTablePolicy; |
| | | import com.estate.expert.admin.stat.report.render.CustomPictureRenderPolicy; |
| | | import com.estate.expert.admin.stat.report.render.DeviceGroupTablePolicy; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | */ |
| | | private ConfigureBuilder initConfig(Map<String, Boolean> viewConfig){ |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.bind("data.设备分组信息", new LoopRowTableRenderPolicy()); |
| | | builder.bind("data.设备信息", new LoopRowTableRenderPolicy()); |
| | | builder.bind("data.设备分组信息", new DeviceGroupTablePolicy()); |
| | | builder.bind("data.评估结果.隐患等级分布.分项", new LoopRowTableRenderPolicy()); |
| | | builder.bind("分项评估", new CheckInfoTablePolicy()); |
| | | |
| | |
| | | var evalResult = data.getJSONObject("评估结果"); |
| | | var checkCategories = evalResult.getJSONArray("检查项"); |
| | | if(checkCategories == null) return; |
| | | var safetyCategories = new JSONArray(); |
| | | for (var c : checkCategories){ |
| | | var co = (JSONObject)c; |
| | | var name = co.getString("名称"); |
| | | if(name != null && name.contains("安全")) |
| | | safetyCategories.add(co); |
| | | var pieChart = buildPieChart(co); |
| | | if(pieChart!=null) |
| | | co.put("问题分布饼图", pieChart); |
| | |
| | | if(barChart!=null) |
| | | co.put("问题分布直方图", barChart); |
| | | } |
| | | if(safetyCategories.isEmpty() && !checkCategories.isEmpty()) |
| | | safetyCategories.add(checkCategories.get(0)); |
| | | evalResult.put("安全检查项", safetyCategories); |
| | | // 新版模板的“隐患分布情况”使用此字段,需覆盖安全检查和管理行为。 |
| | | evalResult.put("安全检查项", checkCategories); |
| | | } |
| | | |
| | | /** |