From 2e64c232ab6b51b2cecf1ee96e1e9b709234f326 Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期六, 21 八月 2021 16:35:14 +0800 Subject: [PATCH] 随手拍改版接口开发 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSwPatrolRecordApi.java | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 222 insertions(+), 11 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSwPatrolRecordApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSwPatrolRecordApi.java index fc4e642..c3016ed 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSwPatrolRecordApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSwPatrolRecordApi.java @@ -1,16 +1,22 @@ package com.panzhihua.service_community.api; -import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; -import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordDTO; +import com.panzhihua.common.model.dtos.community.*; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.ComSwPatrolRecordStatisticsVO; +import com.panzhihua.common.model.vos.community.ComSwRotaExcelVO; +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.ComSwRotaService; +import com.panzhihua.service_community.service.ComSwSafetyWorkRecordService; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -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.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.Date; +import java.util.List; /** * @auther txb @@ -23,17 +29,222 @@ public class ComSwPatrolRecordApi { @Resource - private ComSwPatrolRecordService comMngPopulationService; + private ComSwPatrolRecordService comSwPatrolRecordService; + + @Resource + private ComSwSafetyWorkRecordService comSwSafetyWorkRecordService; + + @Resource + private ComSwDangerReportService comSwDangerReportService; + + @Resource + private ComSwRotaService comSwRotaService; /** * 分页查询巡查记录 - * @param comSwPatrolRecordDTO 查询参数 - * @return 分页集合 + * @param comSwPatrolRecordPageDTO 查询参数 + * @return 巡查记录分页集合 */ @PostMapping("/page") - public R pagePatrolRecord(@RequestBody ComSwPatrolRecordDTO comSwPatrolRecordDTO){ - return comMngPopulationService.pagePatrolRecord(comSwPatrolRecordDTO); + public R pagePatrolRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ + return comSwPatrolRecordService.pagePatrolRecord(comSwPatrolRecordPageDTO); } + /** + * 新增巡查记录 + * @param comSwPatrolRecordAddDTO 新增参数 + * @return 新增结果 + */ + @PostMapping("/addPatrolRecord") + @Transactional(rollbackFor = Exception.class) + public R addPatrolRecord(@RequestBody ComSwPatrolRecordAddDTO comSwPatrolRecordAddDTO){ + return comSwPatrolRecordService.addPatrolRecord(comSwPatrolRecordAddDTO); + } + + /** + * 根据巡查记录id查询详情 + * + * @param patrolRecordId 巡查记录id + * @return 巡查记录详情查询结果 + */ + @GetMapping("/detail") + public R detailPatrolRecord(@RequestParam(value = "patrolRecordId") Long patrolRecordId) { + return comSwPatrolRecordService.detailPatrolRecord(patrolRecordId); + } + + /** + * 巡查记录统计接口 + * + * @return 统计结果 + */ + @GetMapping("/statistics") + public R patrolRecordStatistics(@RequestParam(value = "communityId") Long communityId) { + return comSwPatrolRecordService.patrolRecordStatistics(communityId); + } + + /** + * 分页查询安全工作记录 + * @param comSwPatrolRecordPageDTO 查询参数 + * @return 安全工作记录分页集合 + */ + @PostMapping("/safetyWorkRecord/page") + public R pageSafetyWorkRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ + return comSwSafetyWorkRecordService.pageSafetyWorkRecord(comSwPatrolRecordPageDTO); + } + + /** + * 根据安全工作记录id查询详情 + * + * @param safetyWorkRecordId 安全工作记录 + * @return 安全工作记录详情查询结果 + */ + @GetMapping("/safetyWorkRecord/detail") + public R detailSafetyWorkRecord(@RequestParam(value = "safetyWorkRecordId") Long safetyWorkRecordId, @RequestParam(value = "communityId", required = false) Long communityId) { + return comSwSafetyWorkRecordService.detailSafetyWorkRecord(safetyWorkRecordId, communityId); + } + + /** + * 根据巡查记录id查询安全工作记录详情 + * + * @param patrolRecordId 巡查记录id + * @return 安全工作记录详情查询结果 + */ + @GetMapping("/safetyWorkRecord/detailByPrId") + public R detailSafetyWorkRecordByPrId(@RequestParam(value = "patrolRecordId") Long patrolRecordId, @RequestParam(value = "communityId", required = false) Long communityId) { + return comSwSafetyWorkRecordService.detailSafetyWorkRecordByPrId(patrolRecordId, communityId); + } + + /** + * 分页查询隐患报告 + * @param comSwPatrolRecordPageDTO 查询参数 + * @return 隐患报告分页集合 + */ + @PostMapping("/dangerReport/page") + public R pageDangerReport(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ + return comSwDangerReportService.pageDangerReport(comSwPatrolRecordPageDTO); + } + + /** + * 根据隐患报告id查询详情 + * + * @param dangerReportId 隐患报告id + * @return 隐患报告详情查询结果 + */ + @GetMapping("/dangerReport/detail") + public R detailDangerReport(@RequestParam(value = "dangerReportId") Long dangerReportId) { + return comSwDangerReportService.detailDangerReport(dangerReportId); + } + + /** + * 根据巡查记录id查询隐患报告详情 + * + * @param patrolRecordId 巡查记录id + * @return 隐患报告详情查询结果 + */ + @GetMapping("/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); + } + + /** + * 分页查询值班表 + * @param comSwRotaPageDTO 查询参数 + * @return 值班表分页集合 + */ + @PostMapping("/rota/page") + public R pageRota(@RequestBody ComSwRotaPageDTO comSwRotaPageDTO){ + return comSwRotaService.pageRota(comSwRotaPageDTO); + } + + /** + * 根据id查询值班表 + * @param rotaId 值班表id + * @return 值班表详情 + */ + @GetMapping("/rota/detail") + public R detailRota(@RequestParam("rotaId") Long rotaId){ + return comSwRotaService.detailRota(rotaId); + } + + /** + * 新增值班表 + * @param comSwRotaSaveDTOs 新增参数 + * @return 新增结果 + */ + @PostMapping("/rota/add") + public R addRota(@RequestBody List<ComSwRotaSaveDTO> comSwRotaSaveDTOs){ + return comSwRotaService.addRota(comSwRotaSaveDTOs); + } + + /** + * 批量删除值班表 + * @param rotaIds 值班ids + * @return 删除结果 + */ + @PostMapping("/rota/delete") + public R deleteRota(@RequestBody List<Long> rotaIds){ + return comSwRotaService.deleteRota(rotaIds); + } + + /** + * 根据日期查询值班人员 + * @return 查询结果 + */ + @GetMapping("/rota/getRotaPersonByDate") + public R getRotaPersonByDate(@RequestParam(value = "rotaDate") String rotaDate){ + return comSwRotaService.getRotaPersonByDate(rotaDate); + } + + /** + * 根据日期查询值班领导 + * @return 查询结果 + */ + @GetMapping("/rota/getRotaLeaderByDate") + public R getRotaLeaderByDate(@RequestParam(value = "rotaDate") String rotaDate){ + return comSwRotaService.getRotaLeaderByDate(rotaDate); + } + + /** + * 批量导入值班表 + * + * @param list 值班表集合 + */ + @PostMapping("/rota/import") + public R listSaveSwRotaExcelVO(@RequestBody List<ComSwRotaExcelVO> list, @RequestParam("communityId") Long communityId){ + return comSwRotaService.listSaveSwRotaExcelVO(list, communityId); + } } -- Gitblit v1.7.1