From 179c4d64313c9b7572778da4aaaf6c6584fe457d Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 20 五月 2025 23:48:08 +0800 Subject: [PATCH] 修改文件上传类型限制 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSwPatrolRecordApi.java | 228 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 188 insertions(+), 40 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 5b366ee..3e74c46 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,20 +1,21 @@ 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 java.util.List; + +import javax.annotation.Resource; + import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import java.util.List; +import com.panzhihua.common.model.dtos.community.*; +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.ComSwRotaExcelVO; +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 lombok.extern.slf4j.Slf4j; /** * @auther txb @@ -35,87 +36,153 @@ @Resource private ComSwDangerReportService comSwDangerReportService; + @Resource + private ComSwRotaService comSwRotaService; + /** * 分页查询巡查记录 - * @param comSwPatrolRecordPageDTO 查询参数 + * + * @param comSwPatrolRecordPageDTO + * 查询参数 * @return 巡查记录分页集合 */ @PostMapping("/page") - public R pagePatrolRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ + public R pagePatrolRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { return comSwPatrolRecordService.pagePatrolRecord(comSwPatrolRecordPageDTO); } /** * 新增巡查记录 - * @param comSwPatrolRecordAddDTO 新增参数 + * + * @param comSwPatrolRecordAddDTO + * 新增参数 * @return 新增结果 */ @PostMapping("/addPatrolRecord") @Transactional(rollbackFor = Exception.class) - public R addPatrolRecord(@RequestBody ComSwPatrolRecordAddDTO comSwPatrolRecordAddDTO){ + public R addPatrolRecord(@RequestBody ComSwPatrolRecordAddDTO comSwPatrolRecordAddDTO) { return comSwPatrolRecordService.addPatrolRecord(comSwPatrolRecordAddDTO); + } + + /** + * 编辑巡查记录 editPatrolRecord 编辑巡查记录 + * @param comSwPatrolRecordEditDTO 编辑巡查记录参数 + * @return R 编辑结果 + * @author txb + * @date 2021/9/08 17:03 + */ + @PostMapping("/edit") + @Transactional(rollbackFor = Exception.class) + public R editPatrolRecord(@RequestBody ComSwPatrolRecordEditDTO comSwPatrolRecordEditDTO) { + return comSwPatrolRecordService.editPatrolRecord(comSwPatrolRecordEditDTO); } /** * 根据巡查记录id查询详情 * - * @param patrolRecordId 巡查记录id + * @param patrolRecordId + * 巡查记录id * @return 巡查记录详情查询结果 */ - @PostMapping("/detail") + @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 查询参数 + * + * @param comSwPatrolRecordPageDTO + * 查询参数 * @return 安全工作记录分页集合 */ @PostMapping("/safetyWorkRecord/page") - public R pageSafetyWorkRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ + public R pageSafetyWorkRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { return comSwSafetyWorkRecordService.pageSafetyWorkRecord(comSwPatrolRecordPageDTO); + } + + /** + * 编辑安全工作记录 editSafetyWork 编辑安全工作记录 + * @param comSwSafetyWorkEditDTO 编辑安全工作记录参数 + * @return R 编辑结果 + * @author txb + * @date 2021/9/08 17:03 + */ + @PostMapping("/safetyWorkRecord/edit") + @Transactional(rollbackFor = Exception.class) + public R editSafetyWork(@RequestBody ComSwSafetyWorkEditDTO comSwSafetyWorkEditDTO) { + return comSwSafetyWorkRecordService.editSafetyWork(comSwSafetyWorkEditDTO); } /** * 根据安全工作记录id查询详情 * - * @param safetyWorkRecordId 安全工作记录 + * @param safetyWorkRecordId + * 安全工作记录 * @return 安全工作记录详情查询结果 */ - @PostMapping("/safetyWorkRecord/detail") - public R detailSafetyWorkRecord(@RequestParam(value = "safetyWorkRecordId") Long safetyWorkRecordId) { - return comSwSafetyWorkRecordService.detailSafetyWorkRecord(safetyWorkRecordId); + @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 + * @param patrolRecordId + * 巡查记录id * @return 安全工作记录详情查询结果 */ - @PostMapping("/safetyWorkRecord/detailByPrId") - public R detailSafetyWorkRecordByPrId(@RequestParam(value = "patrolRecordId") Long patrolRecordId) { - return comSwSafetyWorkRecordService.detailSafetyWorkRecordByPrId(patrolRecordId); + @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 查询参数 + * + * @param comSwPatrolRecordPageDTO + * 查询参数 * @return 隐患报告分页集合 */ @PostMapping("/dangerReport/page") - public R pageDangerReport(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO){ + public R pageDangerReport(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { return comSwDangerReportService.pageDangerReport(comSwPatrolRecordPageDTO); + } + + /** + * 编辑隐患报告 editDangerReport 编辑隐患报告 + * @param comSwDangerReportEditDTO 编辑隐患报告参数 + * @return R 编辑结果 + * @author txb + * @date 2021/9/08 17:03 + */ + @PostMapping("/dangerReport/edit") + @Transactional(rollbackFor = Exception.class) + public R editDangerReport(@RequestBody ComSwDangerReportEditDTO comSwDangerReportEditDTO) { + return comSwDangerReportService.editDangerReport(comSwDangerReportEditDTO); } /** * 根据隐患报告id查询详情 * - * @param dangerReportId 隐患报告id + * @param dangerReportId + * 隐患报告id * @return 隐患报告详情查询结果 */ - @PostMapping("/dangerReport/detail") + @GetMapping("/dangerReport/detail") public R detailDangerReport(@RequestParam(value = "dangerReportId") Long dangerReportId) { return comSwDangerReportService.detailDangerReport(dangerReportId); } @@ -123,10 +190,11 @@ /** * 根据巡查记录id查询隐患报告详情 * - * @param patrolRecordId 巡查记录id + * @param patrolRecordId + * 巡查记录id * @return 隐患报告详情查询结果 */ - @PostMapping("/dangerReport/detailByPrId") + @GetMapping("/dangerReport/detailByPrId") public R detailDangerReportByPrId(@RequestParam(value = "patrolRecordId") Long patrolRecordId) { return comSwDangerReportService.detailDangerReportByPrId(patrolRecordId); } @@ -134,22 +202,24 @@ /** * 处理隐患报告 * - * @param comSwDangerReportHandleDTO 隐患报告处理参数 + * @param comSwDangerReportHandleDTO + * 隐患报告处理参数 * @return 处理结果 */ @PostMapping("/dangerReport/handle") - public R handleDangerReport(@RequestBody ComSwDangerReportHandleDTO comSwDangerReportHandleDTO){ + public R handleDangerReport(@RequestBody ComSwDangerReportHandleDTO comSwDangerReportHandleDTO) { return comSwDangerReportService.handleDangerReport(comSwDangerReportHandleDTO); } /** * 整改隐患报告 * - * @param comSwDangerReportRectifyDTO 隐患报告整改参数 + * @param comSwDangerReportRectifyDTO + * 隐患报告整改参数 * @return 整改结果 */ @PostMapping("/dangerReport/rectify") - public R rectifyDangerReport(@RequestBody ComSwDangerReportRectifyDTO comSwDangerReportRectifyDTO){ + public R rectifyDangerReport(@RequestBody ComSwDangerReportRectifyDTO comSwDangerReportRectifyDTO) { return comSwDangerReportService.rectifyDangerReport(comSwDangerReportRectifyDTO); } @@ -160,9 +230,87 @@ * @return */ @PostMapping("/dangerReport/export") - public R exportDangerReport(@RequestBody List<Long> dangerReportIds){ + 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,@RequestParam("communityId")Long communityId) { + return comSwRotaService.getRotaPersonByDate(rotaDate,communityId); + } + + /** + * 根据日期查询值班领导 + * + * @return 查询结果 + */ + @GetMapping("/rota/getRotaLeaderByDate") + public R getRotaLeaderByDate(@RequestParam(value = "rotaDate") String rotaDate,@RequestParam("communityId")Long communityId) { + return comSwRotaService.getRotaLeaderByDate(rotaDate,communityId); + } + + /** + * 批量导入值班表 + * + * @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