| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | |
| | |
| | | private String dangerType; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ExcelProperty(value = "状态", index = 3) |
| | | private String status; |
| | | |
| | | /** |
| | | * 风险等级 |
| | | */ |
| | | @ExcelProperty(value = "风险等级", index = 3) |
| | | @ExcelProperty(value = "风险等级", index = 4) |
| | | private String dangerLevel; |
| | | |
| | | /** |
| | | * 巡查人员 |
| | | */ |
| | | @ExcelProperty(value = "巡查人员", index = 4) |
| | | private String personName; |
| | | @ExcelProperty(value = "巡查人员", index = 5) |
| | | private String ppersonName; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话", index = 5) |
| | | private String personPhone; |
| | | @ExcelProperty(value = "联系电话", index = 6) |
| | | private String ppersonPhone; |
| | | |
| | | /** |
| | | * 填报时间 |
| | | */ |
| | | @ExcelProperty(value = "填报时间", index = 7) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ExcelProperty(value = "备注", index = 6) |
| | | @ExcelProperty(value = "备注", index = 8) |
| | | private String remark; |
| | | |
| | | /** |
| | | * 整改人员 |
| | | */ |
| | | @ExcelProperty(value = "整改人员", index = 9) |
| | | private String dpersonName; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话", index = 10) |
| | | private String dpersonPhone; |
| | | |
| | | /** |
| | | * 整改时间 |
| | | */ |
| | | @ExcelProperty(value = "整改时间", index = 11) |
| | | private Date rectifyTime; |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "导出台账-隐患报告") |
| | | @PostMapping("/danger/export") |
| | | public R exportComMngCar(@RequestBody List<Long> dangerReportIds) { |
| | | public R exportDangerReportBook(@RequestBody List<Long> dangerReportIds) { |
| | | String url = excelUrl; |
| | | String name = "隐患报告台账导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | |
| | | @Override |
| | | public R exportDangerReport(List<Long> dangerReportIds) { |
| | | List<ComSwDangerReportExcelVO> list = comSwDangerReportDAO.exportDangerReport(dangerReportIds); |
| | | // list.forEach(comSwDangerReportExcelVO -> { |
| | | // List<String> patrolUserIds = Arrays.asList(comSwDangerReportExcelVO.getPatrolPerson().split(",")); |
| | | // List<String> patrolPhones = new ArrayList<>(); |
| | | // for (String userId : patrolUserIds) { |
| | | // LoginUserInfoVO loginUserInfoVO = userService.getUserInfoByUserId(userId).getData(); |
| | | // patrolPhones.add(loginUserInfoVO.getPhone()); |
| | | // } |
| | | // comSwDangerReportExcelVO.setPatrolPersonPhone(StringUtils.join(patrolPhones,",")); |
| | | // }); |
| | | list.forEach(comSwDangerReportExcelVO -> { |
| | | // 整改人员id查询整改人员的名字和电话 |
| | | StringBuilder dangerNameString = new StringBuilder(); |
| | | StringBuilder dangerPhoneString = new StringBuilder(); |
| | | if (StringUtils.isNotEmpty(comSwDangerReportExcelVO.getDpersonName())) { |
| | | String[] dangerIds = comSwDangerReportExcelVO.getDpersonName().split(","); |
| | | for (int i = 0; i < dangerIds.length; i++) { |
| | | Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]); |
| | | if (person != null) { |
| | | if (i != 0) { |
| | | dangerNameString.append(","); |
| | | dangerPhoneString.append(","); |
| | | } |
| | | dangerNameString.append(person.get("name")); |
| | | dangerPhoneString.append(person.get("phone")); |
| | | } |
| | | } |
| | | comSwDangerReportExcelVO.setDpersonName(dangerNameString.toString()); |
| | | comSwDangerReportExcelVO.setDpersonPhone(dangerPhoneString.toString()); |
| | | } |
| | | }); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="exportDangerReport" resultType="com.panzhihua.common.model.vos.community.ComSwDangerReportExcelVO" parameterType="java.util.List"> |
| | | SELECT |
| | | cspr.person_name AS personName, |
| | | cspr.person_phone AS personPhone, |
| | | cspr.person_name AS ppersonName, |
| | | cspr.person_phone AS ppersonPhone, |
| | | cspr.address, |
| | | csdr.remark, |
| | | csdr.dager_description AS dagerDescription, |
| | |
| | | when '3' then '疫情隐患' |
| | | end |
| | | AS dangerType, |
| | | case csdr.status |
| | | when '1' then '待处理' |
| | | when '2' then '待整改' |
| | | when '3' then '已整改' |
| | | end |
| | | AS status, |
| | | case csdr.danger_level |
| | | when '1' then '红色预警' |
| | | when '2' then '橙色预警' |
| | | when '3' then '黄色预警' |
| | | when '4' then '蓝色预警' |
| | | end |
| | | AS dangerLevel |
| | | AS dangerLevel, |
| | | cspr.create_at AS createAt, |
| | | csdr.rectify_person AS dpersonName, |
| | | csdr.rectify_time AS rectifyTime |
| | | FROM |
| | | com_sw_danger_report as csdr |
| | | left join com_sw_patrol_record_report as csprr on csprr.report_id = csdr.id |