| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComSwDangerReportHandleDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwDangerReportRectifyDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordAddDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordPageDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.ComSwSafetyWorkRecordDAO; |
| | | import com.panzhihua.service_community.service.ComSwDangerReportService; |
| | | import com.panzhihua.service_community.service.ComSwPatrolRecordService; |
| | | import com.panzhihua.service_community.service.ComSwSafetyWorkRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther txb |
| | |
| | | @Resource |
| | | private ComSwPatrolRecordService comSwPatrolRecordService; |
| | | |
| | | @Resource |
| | | private ComSwSafetyWorkRecordService comSwSafetyWorkRecordService; |
| | | |
| | | @Resource |
| | | private ComSwDangerReportService comSwDangerReportService; |
| | | |
| | | /** |
| | | * 分页查询巡查记录 |
| | | * @param comSwPatrolRecordPageDTO 查询参数 |
| | | * @return 分页集合 |
| | | * @return 巡查记录分页集合 |
| | | */ |
| | | @PostMapping("/page") |
| | | public R pagePatrolRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ |
| | |
| | | return comSwPatrolRecordService.addPatrolRecord(comSwPatrolRecordAddDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据巡查记录id查询详情 |
| | | * |
| | | * @param patrolRecordId 巡查记录id |
| | | * @return 巡查记录详情查询结果 |
| | | */ |
| | | @PostMapping("/detail") |
| | | public R detailPatrolRecord(@RequestParam(value = "patrolRecordId") Long patrolRecordId) { |
| | | return comSwPatrolRecordService.detailPatrolRecord(patrolRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询安全工作记录 |
| | | * @param comSwPatrolRecordPageDTO 查询参数 |
| | | * @return 安全工作记录分页集合 |
| | | */ |
| | | @PostMapping("/safetyWorkRecord/page") |
| | | public R pageSafetyWorkRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ |
| | | return comSwSafetyWorkRecordService.pageSafetyWorkRecord(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据安全工作记录id查询详情 |
| | | * |
| | | * @param safetyWorkRecordId 安全工作记录 |
| | | * @return 安全工作记录详情查询结果 |
| | | */ |
| | | @PostMapping("/safetyWorkRecord/detail") |
| | | public R detailSafetyWorkRecord(@RequestParam(value = "safetyWorkRecordId") Long safetyWorkRecordId) { |
| | | return comSwSafetyWorkRecordService.detailSafetyWorkRecord(safetyWorkRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 根据巡查记录id查询安全工作记录详情 |
| | | * |
| | | * @param patrolRecordId 巡查记录id |
| | | * @return 安全工作记录详情查询结果 |
| | | */ |
| | | @PostMapping("/safetyWorkRecord/detailByPrId") |
| | | public R detailSafetyWorkRecordByPrId(@RequestParam(value = "patrolRecordId") Long patrolRecordId) { |
| | | return comSwSafetyWorkRecordService.detailSafetyWorkRecordByPrId(patrolRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询隐患报告 |
| | | * @param comSwPatrolRecordPageDTO 查询参数 |
| | | * @return 隐患报告分页集合 |
| | | */ |
| | | @PostMapping("/dangerReport/page") |
| | | public R pageDangerReport(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ |
| | | return comSwDangerReportService.pageDangerReport(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据隐患报告id查询详情 |
| | | * |
| | | * @param dangerReportId 隐患报告id |
| | | * @return 隐患报告详情查询结果 |
| | | */ |
| | | @PostMapping("/dangerReport/detail") |
| | | public R detailDangerReport(@RequestParam(value = "dangerReportId") Long dangerReportId) { |
| | | return comSwDangerReportService.detailDangerReport(dangerReportId); |
| | | } |
| | | |
| | | /** |
| | | * 根据巡查记录id查询隐患报告详情 |
| | | * |
| | | * @param patrolRecordId 巡查记录id |
| | | * @return 隐患报告详情查询结果 |
| | | */ |
| | | @PostMapping("/dangerReport/detailByPrId") |
| | | public R detailDangerReportByPrId(@RequestParam(value = "patrolRecordId") Long patrolRecordId) { |
| | | return comSwDangerReportService.detailDangerReportByPrId(patrolRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 处理隐患报告 |
| | | * |
| | | * @param comSwDangerReportHandleDTO 隐患报告处理参数 |
| | | * @return 处理结果 |
| | | */ |
| | | @PostMapping("/dangerReport/handle") |
| | | public R handleDangerReport(@RequestBody ComSwDangerReportHandleDTO comSwDangerReportHandleDTO){ |
| | | return comSwDangerReportService.handleDangerReport(comSwDangerReportHandleDTO); |
| | | } |
| | | |
| | | /** |
| | | * 整改隐患报告 |
| | | * |
| | | * @param comSwDangerReportRectifyDTO 隐患报告整改参数 |
| | | * @return 整改结果 |
| | | */ |
| | | @PostMapping("/dangerReport/rectify") |
| | | public R rectifyDangerReport(@RequestBody ComSwDangerReportRectifyDTO comSwDangerReportRectifyDTO){ |
| | | return comSwDangerReportService.rectifyDangerReport(comSwDangerReportRectifyDTO); |
| | | } |
| | | |
| | | /** |
| | | * 隐患报告台账导出 |
| | | * |
| | | * @param dangerReportIds |
| | | * @return |
| | | */ |
| | | @PostMapping("/dangerReport/export") |
| | | public R exportDangerReport(@RequestBody List<Long> dangerReportIds){ |
| | | return comSwDangerReportService.exportDangerReport(dangerReportIds); |
| | | } |
| | | |
| | | } |
| | | |