|
|
|
@ -62,6 +62,32 @@ public class EhsRiskController extends BaseController
|
|
|
|
|
public void export(HttpServletResponse response, EhsRisk ehsRisk)
|
|
|
|
|
{
|
|
|
|
|
List<EhsRisk> 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<EhsRisk> util = new ExcelUtil<EhsRisk>(EhsRisk.class);
|
|
|
|
|
util.exportExcel(response, list, "风险信息数据", "风险信息数据");
|
|
|
|
|
}
|
|
|
|
|