Sfoglia il codice sorgente

Merge remote-tracking branch 'remotes/origin/dev-2.15.0' into dev

ZeroLiYi 1 anno fa
parent
commit
c4863363d9

+ 73 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/visualization/modular/grainOilReserve/controller/MonitorAIController.java

@@ -0,0 +1,73 @@
1
+package com.unis.visualization.modular.grainOilReserve.controller;
2
+
3
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
4
+import com.github.xiaoymin.knife4j.annotations.ApiSupport;
5
+import com.unis.common.pojo.CommonResult;
6
+import com.unis.reserveLayout.modular.dataSystemInfo.param.DataPageParam;
7
+import com.unis.visualization.modular.grainOilReserve.service.MonitorAIService;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.validation.annotation.Validated;
11
+import org.springframework.web.bind.annotation.GetMapping;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import javax.annotation.Resource;
15
+import java.util.List;
16
+import java.util.Map;
17
+
18
+/**
19
+ * 可视化-粮油储备控制器
20
+ *
21
+ * @author TS
22
+ * @date  2024/06/18 11:08
23
+ */
24
+@Api(tags = "可视化-摄像头视频监控")
25
+@ApiSupport(author = "UNIS_TEAM", order = 1)
26
+@RestController
27
+@Validated
28
+public class MonitorAIController {
29
+
30
+    @Resource
31
+    private MonitorAIService monitorAIService;
32
+
33
+
34
+    /**
35
+     * 视频AI分析预警-摄像头总数
36
+     *
37
+     * @author ZeroLiYi
38
+     * @date  2024/06/20 11:37
39
+     */
40
+    @ApiOperationSupport(order = 1)
41
+    @ApiOperation("监控在线情况统计 - 摄像头总数")
42
+    @GetMapping("/monitorAI/selectMonitorCount")
43
+    public CommonResult<Integer> selectMonitorCount() {
44
+        return CommonResult.data(monitorAIService.selectMonitorCount());
45
+    }
46
+
47
+    /**
48
+     * 视频AI分析预警-故障摄像头
49
+     *
50
+     * @author ZeroLiYi
51
+     * @date  2024/06/20 11:37
52
+     */
53
+    @ApiOperationSupport(order = 1)
54
+    @ApiOperation("监控在线情况统计 - 故障摄像头")
55
+    @GetMapping("/monitorAI/selectFaultMonitorCount")
56
+    public CommonResult<Integer> selectFaultMonitorCount() {
57
+        return CommonResult.data(monitorAIService.selectFaultMonitorCount());
58
+    }
59
+    /**
60
+     * 视频AI分析预警-使用占比
61
+     *
62
+     * @author ZeroLiYi
63
+     * @date  2024/06/20 11:37
64
+     */
65
+    @ApiOperationSupport(order = 1)
66
+    @ApiOperation("监控在线情况统计 - 使用占比")
67
+    @GetMapping("/monitorAI/selectMonitorProportion")
68
+    public CommonResult<Integer> selectMonitorProportion() {
69
+        return CommonResult.data(monitorAIService.selectMonitorProportion());
70
+    }
71
+
72
+
73
+}

+ 13 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/visualization/modular/grainOilReserve/mapper/MonitorAIMapper.java

@@ -0,0 +1,13 @@
1
+package com.unis.visualization.modular.grainOilReserve.mapper;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+public interface MonitorAIMapper {
7
+     Integer selectMonitorCount();
8
+
9
+
10
+     Integer selectFaultMonitorCount();
11
+
12
+     Integer selectMonitorProportion();
13
+}

+ 19 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/visualization/modular/grainOilReserve/mapper/mapping/MonitorAIMapper.xml

@@ -0,0 +1,19 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.unis.visualization.modular.grainOilReserve.mapper.MonitorAIMapper">
4
+
5
+    <select id="selectMonitorCount" resultType="java.lang.Integer">
6
+        SELECT COUNT(id) AS totalCameras
7
+        FROM monitor_camera where isremove=1
8
+    </select>
9
+    <select id="selectFaultMonitorCount" resultType="java.lang.Integer">
10
+        SELECT COUNT(id) AS faultyCameras
11
+        FROM monitor_camera
12
+        WHERE isremove=1 and status IN (0, 2)
13
+
14
+    </select>
15
+    <select id="selectMonitorProportion" resultType="java.lang.Integer">
16
+        SELECT COUNT(id) AS total_cameras
17
+        FROM monitor_camera where isremove=1 and `status`=1
18
+    </select>
19
+</mapper>

+ 13 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/visualization/modular/grainOilReserve/service/MonitorAIService.java

@@ -0,0 +1,13 @@
1
+package com.unis.visualization.modular.grainOilReserve.service;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+public interface MonitorAIService {
7
+
8
+    Integer selectMonitorCount();
9
+
10
+    Integer selectFaultMonitorCount();
11
+
12
+    Integer selectMonitorProportion();
13
+}

+ 33 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/visualization/modular/grainOilReserve/service/impl/MonitorAIServiceImpl.java

@@ -0,0 +1,33 @@
1
+package com.unis.visualization.modular.grainOilReserve.service.impl;
2
+
3
+import com.unis.visualization.modular.grainOilReserve.mapper.MonitorAIMapper;
4
+import com.unis.visualization.modular.grainOilReserve.service.MonitorAIService;
5
+import org.springframework.stereotype.Service;
6
+
7
+import javax.annotation.Resource;
8
+import java.util.List;
9
+import java.util.Map;
10
+
11
+@Service
12
+public class MonitorAIServiceImpl implements MonitorAIService {
13
+    @Resource
14
+    private MonitorAIMapper monitorAIMapper;
15
+
16
+    @Override
17
+    public Integer selectMonitorCount() {
18
+        return monitorAIMapper.selectMonitorCount();
19
+    }
20
+
21
+    @Override
22
+    public Integer selectFaultMonitorCount() {
23
+        return monitorAIMapper.selectFaultMonitorCount();
24
+    }
25
+
26
+    @Override
27
+    public Integer selectMonitorProportion() {
28
+        Integer sum = monitorAIMapper.selectMonitorCount();
29
+       Integer sy = monitorAIMapper.selectMonitorProportion();
30
+       Integer proportion =sy/sum *100;
31
+        return proportion;
32
+    }
33
+}

+ 13 - 13
unis-plugin/unis-plugin-biz/src/main/java/com/unis/visualization/modular/grainSituationDetection/mapper/mapping/GrainSituationDetectionMapper.xml

@@ -9,22 +9,22 @@
9 9
             a.longitude,
10 10
             a.latitude,
11 11
             b.temp_max,
12
-                            b.temp_min,
13
-                            b.temp_avg,
14
-                            ROUND(IFNULL(SUM(kcsl),0.0)/1000/10000,2) as kcsl
12
+            b.temp_min,
13
+            b.temp_avg,
14
+            ROUND(IFNULL(SUM(kcsl),0.0)/1000/10000,2) as kcsl
15 15
             FROM
16 16
             depot_qh.org_info a
17 17
             LEFT JOIN
18
-                            (SELECT org_id,temp_max,temp_min,temp_avg
19
-                                FROM (
20
-                                        SELECT org_id,temp_max,temp_min,temp_avg,
21
-                                                     ROW_NUMBER() OVER (PARTITION BY org_id ORDER BY gather_time DESC) AS rn
22
-                                        FROM depot_qh.t_lq_data
23
-                                ) t
24
-                                WHERE rn = 1
25
-                            )
26
-                             b on a.org_id = b.org_id
27
-                            LEFT JOIN depot_qh.data_kcgl_kcsw_default c on a.org_id = c.UnitID
18
+            (SELECT org_id,temp_max,temp_min,temp_avg
19
+                FROM (
20
+                        SELECT org_id,temp_max,temp_min,temp_avg,
21
+                                     ROW_NUMBER() OVER (PARTITION BY org_id ORDER BY gather_time DESC) AS rn
22
+                        FROM depot_qh.t_lq_data
23
+                ) t
24
+                WHERE rn = 1
25
+            )
26
+             b on a.org_id = b.org_id
27
+            LEFT JOIN depot_qh.data_kcgl_kcsw_default c on a.org_id = c.UnitID
28 28
             where a.org_id != '9'
29 29
             GROUP BY a.org_id
30 30
             ORDER BY a.org_id