kangwei : 隐患排查统计接口
正在显示
8 个修改的文件
包含
91 行增加
和
5 行删除
... | @@ -13,6 +13,7 @@ import com.skua.modules.safe.service.IDangerInspectionItemService; | ... | @@ -13,6 +13,7 @@ import com.skua.modules.safe.service.IDangerInspectionItemService; |
13 | import com.skua.modules.safe.service.IDangerInspectionRecordService; | 13 | import com.skua.modules.safe.service.IDangerInspectionRecordService; |
14 | import com.skua.modules.safe.vo.DangerInspectionRecordVO; | 14 | import com.skua.modules.safe.vo.DangerInspectionRecordVO; |
15 | import com.skua.modules.safe.vo.DangerLevelManageVO; | 15 | import com.skua.modules.safe.vo.DangerLevelManageVO; |
16 | import com.skua.modules.safe.vo.InspectionRecordStatisticsVO; | ||
16 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
17 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
18 | import lombok.extern.slf4j.Slf4j; | 19 | import lombok.extern.slf4j.Slf4j; |
... | @@ -67,6 +68,15 @@ public class APPDangerInspectionRecordController { | ... | @@ -67,6 +68,15 @@ public class APPDangerInspectionRecordController { |
67 | if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){ | 68 | if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){ |
68 | queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ; | 69 | queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ; |
69 | } | 70 | } |
71 | if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerName())){ | ||
72 | queryWrapper.like("danger_name", dangerInspectionRecord.getDangerName() ) ; | ||
73 | } | ||
74 | if(StringUtils.isNotBlank(dangerInspectionRecord.getStatus())){ | ||
75 | queryWrapper.eq("status", dangerInspectionRecord.getStatus() ) ; | ||
76 | } | ||
77 | if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){ | ||
78 | queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ; | ||
79 | } | ||
70 | // queryWrapper.eq("report_user", BaseContextHandler.getUserId()); | 80 | // queryWrapper.eq("report_user", BaseContextHandler.getUserId()); |
71 | IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); | 81 | IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); |
72 | result.setSuccess(true); | 82 | result.setSuccess(true); |
... | @@ -98,6 +108,18 @@ public class APPDangerInspectionRecordController { | ... | @@ -98,6 +108,18 @@ public class APPDangerInspectionRecordController { |
98 | } | 108 | } |
99 | return result; | 109 | return result; |
100 | } | 110 | } |
101 | |||
102 | //Statistics | 111 | //Statistics |
112 | |||
113 | |||
114 | |||
115 | @AutoLog(value = "隐患排查记录:根据风险点统计记录") | ||
116 | @ApiOperation(value="隐患排查记录:根据风险点统计记录", notes="隐患排查记录:根据风险点统计记录") | ||
117 | @GetMapping(value = "/statistics") | ||
118 | public Result<InspectionRecordStatisticsVO> statistics(@RequestParam(name="dangerId") String dangerId) { | ||
119 | Result<InspectionRecordStatisticsVO> result = new Result<InspectionRecordStatisticsVO>(); | ||
120 | InspectionRecordStatisticsVO statisticsVO = inspectionRecordService.queryByStatistics(dangerId); | ||
121 | result.setResult(statisticsVO); | ||
122 | result.setSuccess(true); | ||
123 | return result; | ||
124 | } | ||
103 | } | 125 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -3,6 +3,7 @@ package com.skua.modules.safe.mapper; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.safe.mapper; |
3 | import java.util.List; | 3 | import java.util.List; |
4 | 4 | ||
5 | import com.skua.modules.safe.vo.DangerLevelManageVO; | 5 | import com.skua.modules.safe.vo.DangerLevelManageVO; |
6 | import com.skua.modules.safe.vo.InspectionRecordStatisticsVO; | ||
6 | import org.apache.ibatis.annotations.Param; | 7 | import org.apache.ibatis.annotations.Param; |
7 | import com.skua.modules.safe.entity.DangerInspectionRecord; | 8 | import com.skua.modules.safe.entity.DangerInspectionRecord; |
8 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 9 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
... | @@ -24,4 +25,11 @@ public interface DangerInspectionRecordMapper extends BaseMapper<DangerInspectio | ... | @@ -24,4 +25,11 @@ public interface DangerInspectionRecordMapper extends BaseMapper<DangerInspectio |
24 | * @return | 25 | * @return |
25 | */ | 26 | */ |
26 | public DangerLevelManageVO queryDangerLevelAndInspectionRecord(@Param("inspectionRecordId") String inspectionRecordId); | 27 | public DangerLevelManageVO queryDangerLevelAndInspectionRecord(@Param("inspectionRecordId") String inspectionRecordId); |
28 | |||
29 | /*** | ||
30 | * 根据风险点统计记录 | ||
31 | * @param dangerId | ||
32 | * @return | ||
33 | */ | ||
34 | public InspectionRecordStatisticsVO queryByStatistics(@Param("dangerId") String dangerId); | ||
27 | } | 35 | } | ... | ... |
... | @@ -12,4 +12,13 @@ | ... | @@ -12,4 +12,13 @@ |
12 | 12 | ||
13 | where ir.id = #{inspectionRecordId} | 13 | where ir.id = #{inspectionRecordId} |
14 | </select> | 14 | </select> |
15 | |||
16 | <!-- 根据风险点统计记录 --> | ||
17 | <select id="queryByStatistics" resultType="com.skua.modules.safe.vo.InspectionRecordStatisticsVO"> | ||
18 | select | ||
19 | (select count(1) from danger_inspection_record t1 where t1.danger_id =#{dangerId}) as 'total_num', | ||
20 | (select count(1) from danger_inspection_record t2 where t2.status = 1 and t2.danger_id =#{dangerId}) as 'un_complete_num', | ||
21 | (select count(1) from danger_inspection_record t3 where t3.status = 2 and t3.danger_id =#{dangerId}) as 'complete_num' | ||
22 | from dual | ||
23 | </select> | ||
15 | </mapper> | 24 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -5,6 +5,7 @@ import com.skua.modules.safe.entity.DangerInspectionRecord; | ... | @@ -5,6 +5,7 @@ import com.skua.modules.safe.entity.DangerInspectionRecord; |
5 | import com.baomidou.mybatisplus.extension.service.IService; | 5 | import com.baomidou.mybatisplus.extension.service.IService; |
6 | import com.skua.modules.safe.entity.DangerLevelManage; | 6 | import com.skua.modules.safe.entity.DangerLevelManage; |
7 | import com.skua.modules.safe.vo.DangerLevelManageVO; | 7 | import com.skua.modules.safe.vo.DangerLevelManageVO; |
8 | import com.skua.modules.safe.vo.InspectionRecordStatisticsVO; | ||
8 | 9 | ||
9 | import java.util.List; | 10 | import java.util.List; |
10 | 11 | ||
... | @@ -53,4 +54,11 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio | ... | @@ -53,4 +54,11 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio |
53 | * @return | 54 | * @return |
54 | */ | 55 | */ |
55 | public DangerLevelManageVO queryListByRecordId(String inspectionRecordId); | 56 | public DangerLevelManageVO queryListByRecordId(String inspectionRecordId); |
57 | |||
58 | /*** | ||
59 | * 根据风险点统计记录 | ||
60 | * @param dangerId | ||
61 | * @return | ||
62 | */ | ||
63 | public InspectionRecordStatisticsVO queryByStatistics(String dangerId); | ||
56 | } | 64 | } | ... | ... |
... | @@ -7,6 +7,7 @@ import com.skua.modules.safe.entity.*; | ... | @@ -7,6 +7,7 @@ import com.skua.modules.safe.entity.*; |
7 | import com.skua.modules.safe.mapper.*; | 7 | import com.skua.modules.safe.mapper.*; |
8 | import com.skua.modules.safe.service.IDangerInspectionRecordService; | 8 | import com.skua.modules.safe.service.IDangerInspectionRecordService; |
9 | import com.skua.modules.safe.vo.DangerLevelManageVO; | 9 | import com.skua.modules.safe.vo.DangerLevelManageVO; |
10 | import com.skua.modules.safe.vo.InspectionRecordStatisticsVO; | ||
10 | import org.springframework.beans.BeanUtils; | 11 | import org.springframework.beans.BeanUtils; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
... | @@ -259,5 +260,12 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -259,5 +260,12 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
259 | return dangerLevelManageVO; | 260 | return dangerLevelManageVO; |
260 | } | 261 | } |
261 | 262 | ||
262 | 263 | /*** | |
264 | * 根据风险点统计记录 | ||
265 | * @param dangerId | ||
266 | * @return | ||
267 | */ | ||
268 | public InspectionRecordStatisticsVO queryByStatistics(String dangerId){ | ||
269 | return this.baseMapper.queryByStatistics(dangerId); | ||
270 | } | ||
263 | } | 271 | } | ... | ... |
... | @@ -27,9 +27,18 @@ public class DangerInspectionRecordVO { | ... | @@ -27,9 +27,18 @@ public class DangerInspectionRecordVO { |
27 | @ApiModelProperty(value = "风险等级编号") | 27 | @ApiModelProperty(value = "风险等级编号") |
28 | private String dangerId; | 28 | private String dangerId; |
29 | 29 | ||
30 | |||
30 | @ApiModelProperty(value = "巡检记录编号") | 31 | @ApiModelProperty(value = "巡检记录编号") |
31 | private String inspectionRecord; | 32 | private String inspectionRecord; |
32 | 33 | ||
34 | |||
35 | @Excel(name = "风险等级名称", width = 15) | ||
36 | @ApiModelProperty(value = "风险等级名称") | ||
37 | private String dangerName; | ||
38 | |||
39 | @ApiModelProperty(value = "巡检状态(1:开始,2:结束)") | ||
40 | private String status; | ||
41 | |||
33 | @TableField(exist=false) | 42 | @TableField(exist=false) |
34 | @ApiModelProperty(value = "条件:开始时间") | 43 | @ApiModelProperty(value = "条件:开始时间") |
35 | private String startTime; | 44 | private String startTime; | ... | ... |
1 | package com.skua.modules.safe.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModel; | ||
4 | import io.swagger.annotations.ApiModelProperty; | ||
5 | import lombok.Data; | ||
6 | import org.jeecgframework.poi.excel.annotation.Excel; | ||
7 | |||
8 | /** | ||
9 | * @auther kangwei | ||
10 | * @create 2024-09-25-18:03 | ||
11 | */ | ||
12 | @Data | ||
13 | @ApiModel(value="InspectionRecord 隐患排查统计对象", description="隐患排查统计对象") | ||
14 | public class InspectionRecordStatisticsVO { | ||
15 | |||
16 | @ApiModelProperty(value = "全部数据") | ||
17 | private Integer totalNum; | ||
18 | |||
19 | @ApiModelProperty(value = "未完成数量") | ||
20 | private Integer unCompleteNum;//未处理数量 | ||
21 | |||
22 | @ApiModelProperty(value = "完成数量") | ||
23 | private Integer completeNum;//已经处理数据 | ||
24 | |||
25 | } |
... | @@ -91,7 +91,6 @@ public class EquipmentSparepartSuppliesController { | ... | @@ -91,7 +91,6 @@ public class EquipmentSparepartSuppliesController { |
91 | * @author 开发者姓名, 开发时间 | 91 | * @author 开发者姓名, 开发时间 |
92 | * @Description: TODO(这里描述这个方法的需求变更情况) | 92 | * @Description: TODO(这里描述这个方法的需求变更情况) |
93 | */ | 93 | */ |
94 | |||
95 | @AutoLog(value = "物料信息表-分页列表查询") | 94 | @AutoLog(value = "物料信息表-分页列表查询") |
96 | @ApiOperation(value = "物料信息表-分页列表查询", notes = "物料信息表-分页列表查询") | 95 | @ApiOperation(value = "物料信息表-分页列表查询", notes = "物料信息表-分页列表查询") |
97 | @GetMapping(value = "/list") | 96 | @GetMapping(value = "/list") |
... | @@ -214,11 +213,9 @@ public class EquipmentSparepartSuppliesController { | ... | @@ -214,11 +213,9 @@ public class EquipmentSparepartSuppliesController { |
214 | } | 213 | } |
215 | supplies.setStorageNum(BigDecimal.valueOf(totalSum)); | 214 | supplies.setStorageNum(BigDecimal.valueOf(totalSum)); |
216 | } | 215 | } |
217 | |||
218 | } | 216 | } |
219 | return equipmentSparepartSuppliesVOS; | 217 | return equipmentSparepartSuppliesVOS; |
220 | } | 218 | } |
221 | |||
222 | /** | 219 | /** |
223 | * <pre> | 220 | * <pre> |
224 | * 添加 | 221 | * 添加 | ... | ... |
-
请 注册 或 登录 后发表评论