From def7307397a6f670bf446ffbc86f303ae6daa098 Mon Sep 17 00:00:00 2001 From: 15036302109 Date: Wed, 10 Jul 2024 15:26:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=8E=E9=99=A9=E7=AE=A1=E7=90=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=AF=BC=E5=87=BAbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/ehs/EhsRiskController.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsRiskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsRiskController.java index 989ec6c..cf23418 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsRiskController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsRiskController.java @@ -62,6 +62,32 @@ public class EhsRiskController extends BaseController public void export(HttpServletResponse response, EhsRisk ehsRisk) { List list = ehsRiskService.selectEhsRiskList(ehsRisk); + if (list != null && list.size() > 0) { + list.stream().forEach(item -> { + String riskLocation = item.getRiskLocation(); + String peopleQuantity = item.getPeopleQuantity(); + String riskLocationStr = ""; + String peopleQuantityStr = ""; + if (riskLocation != null) { + String[] riskLocationArr = riskLocation.split(";"); + StringBuilder sb = new StringBuilder(riskLocationArr[0]); + sb.append("(社区)"); + sb.append(riskLocationArr[1]); + sb.append("(位置)"); + riskLocationStr = sb.toString(); + } + if (peopleQuantity != null) { + String[] peopleQuantityArr = peopleQuantity.split(";"); + StringBuilder sb = new StringBuilder(peopleQuantityArr[0]); + sb.append("(户)"); + sb.append(peopleQuantityArr[1]); + sb.append("(人)"); + peopleQuantityStr = sb.toString(); + } + item.setRiskLocationStr(riskLocationStr); + item.setPeopleQuantityStr(peopleQuantityStr); + }); + } ExcelUtil util = new ExcelUtil(EhsRisk.class); util.exportExcel(response, list, "风险信息数据", "风险信息数据"); }