فهرست منبع

无人机 修改三县两区

bihuisong 2 ماه پیش
والد
کامیت
7c49d23c3b

+ 11 - 20
src/main/java/com/sooka/sponest/monitor/uav/controller/CentermonitorTUavController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.monitor.uav.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
@@ -7,12 +9,10 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
-import com.ruoyi.system.api.domain.SysDept;
 import com.sooka.sponest.monitor.remoteapi.service.center.system.RemoteService;
 import com.sooka.sponest.monitor.uav.domain.CentermonitorTUav;
 import com.sooka.sponest.monitor.uav.service.ICentermonitorTUavService;
 import org.apache.http.HttpEntity;
-import org.apache.http.HttpHeaders;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.HttpGet;
@@ -27,20 +27,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.client.RestTemplate;
 
 import javax.annotation.Resource;
 import javax.net.ssl.SSLContext;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 无人机Controller
@@ -103,42 +97,39 @@ public class CentermonitorTUavController extends BaseController {
     }
 
     @GetMapping("/getSign")
-    public String getSign() {
+    public AjaxResult getSign() {
         try (CloseableHttpClient httpClient = createCustomHttpClient()) {
             R<String> requestResult = remoteService.uavSignUrl();
             if (requestResult == null || requestResult.getData() == null) {
                 log.error("获取的请求 URL 为空");
-                return "获取的请求 URL 为空";
+                return AjaxResult.error("获取的请求 URL 为空");
             }
-            String requestUrl = requestResult.getData();
+            String requestUrl = requestResult.getData() + "/etkqq/loginToken";
             // 使用 HttpGet 进行 GET 请求
-            HttpGet httpGet = new HttpGet(String.valueOf(requestUrl));
+            HttpGet httpGet = new HttpGet(requestUrl);
             // 发送请求
             HttpResponse response = httpClient.execute(httpGet);
             int statusCode = response.getStatusLine().getStatusCode();
             if (statusCode == 200) {
                 HttpEntity responseEntity = response.getEntity();
                 if (responseEntity != null) {
-                    return EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
+                    JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
+                    String returnUrl = requestUrl + "/tower/pub/zgtt?sign=" + json.get("data").toString();
+                    return AjaxResult.success("操作成功",returnUrl);
                 } else {
                     log.error("响应实体为空");
-                    return "响应实体为空";
+                    return AjaxResult.error("响应实体为空");
                 }
             } else {
                 log.error("请求失败,状态码: {}", statusCode);
-                return "请求失败,状态码: " + statusCode;
             }
-        } catch (IOException e) {
-            log.error("请求发生 IO 异常", e);
-            return "请求发生 IO 异常: " + e.getClass().getSimpleName();
         } catch (Exception e) {
             log.error("发生未知异常", e);
-            return "发生未知异常: " + e.getClass().getSimpleName();
         }
+        return AjaxResult.error("请求失败");
     }
 
 
-
     /**
      * 工厂方法:创建自定义配置的 HttpClient
      *

+ 56 - 70
src/main/resources/mapper/monitor/camera/CentermonitorTCameraMapper.xml

@@ -1011,16 +1011,14 @@
         SELECT a.qx,
                (
                    CASE
-                       WHEN a.qx = '双辽市' THEN
-                           369
-                       WHEN a.qx = '伊通县' THEN
-                           370
-                       WHEN a.qx = '梨树县' THEN
-                           371
-                       WHEN a.qx = '铁东区' THEN
-                           372
-                       WHEN a.qx = '铁西区' THEN
-                           373
+                       WHEN a.qx = '敖勒召其镇' THEN
+                           314391
+                       WHEN a.qx = '城川镇' THEN
+                           314392
+                       WHEN a.qx = '昂素镇 ' THEN
+                           314393
+                       WHEN a.qx = '上海庙镇' THEN
+                           314394
                        END
                    )                       deptId,
                IFNULL(a.camera_online, 0)  camera_online,
@@ -1038,21 +1036,18 @@
                                     c.working_status,
                                     (
                                         CASE
-                                            WHEN find_in_set(369, cd.ancestors) > 0
-                                                OR cd.dept_id = 369 THEN
-                                                '双辽市'
-                                            WHEN find_in_set(370, cd.ancestors) > 0
-                                                OR cd.dept_id = 370 THEN
-                                                '伊通县'
-                                            WHEN find_in_set(371, cd.ancestors) > 0
-                                                OR cd.dept_id = 371 THEN
-                                                '梨树县'
-                                            WHEN find_in_set(372, cd.ancestors) > 0
-                                                OR cd.dept_id = 372 THEN
-                                                '铁东区'
-                                            WHEN find_in_set(373, cd.ancestors) > 0
-                                                OR cd.dept_id = 373 THEN
-                                                '铁西区'
+                                            WHEN find_in_set(314391, cd.ancestors) > 0
+                                                OR cd.dept_id = 314391 THEN
+                                                '敖勒召其镇'
+                                            WHEN find_in_set(314392, cd.ancestors) > 0
+                                                OR cd.dept_id = 314392 THEN
+                                                '城川镇'
+                                            WHEN find_in_set(314393, cd.ancestors) > 0
+                                                OR cd.dept_id = 314393 THEN
+                                                '昂素镇'
+                                            WHEN find_in_set(314394, cd.ancestors) > 0
+                                                OR cd.dept_id = 314394 THEN
+                                                '上海庙镇'
                                             ELSE
                                                 '0'
                                             END
@@ -1075,21 +1070,18 @@
                                                   c.working_status,
                                                   (
                                                       CASE
-                                                          WHEN find_in_set(369, cd.ancestors) > 0
-                                                              OR cd.dept_id = 369 THEN
-                                                              '双辽市'
-                                                          WHEN find_in_set(370, cd.ancestors) > 0
-                                                              OR cd.dept_id = 370 THEN
-                                                              '伊通县'
-                                                          WHEN find_in_set(371, cd.ancestors) > 0
-                                                              OR cd.dept_id = 371 THEN
-                                                              '梨树县'
-                                                          WHEN find_in_set(372, cd.ancestors) > 0
-                                                              OR cd.dept_id = 372 THEN
-                                                              '铁东区'
-                                                          WHEN find_in_set(373, cd.ancestors) > 0
-                                                              OR cd.dept_id = 373 THEN
-                                                              '铁西区'
+                                                          WHEN find_in_set(314391, cd.ancestors) > 0
+                                                              OR cd.dept_id = 314391 THEN
+                                                              '敖勒召其镇'
+                                                          WHEN find_in_set(314392, cd.ancestors) > 0
+                                                              OR cd.dept_id = 314392 THEN
+                                                              '城川镇'
+                                                          WHEN find_in_set(314393, cd.ancestors) > 0
+                                                              OR cd.dept_id = 314393 THEN
+                                                              '昂素镇'
+                                                          WHEN find_in_set(314394, cd.ancestors) > 0
+                                                              OR cd.dept_id = 314394 THEN
+                                                              '上海庙镇'
                                                           ELSE
                                                               '0'
                                                           END
@@ -1120,21 +1112,18 @@
                                     c.working_status,
                                     (
                                         CASE
-                                            WHEN find_in_set(369, cd.ancestors) > 0
-                                                OR cd.dept_id = 369 THEN
-                                                '双辽市'
-                                            WHEN find_in_set(370, cd.ancestors) > 0
-                                                OR cd.dept_id = 370 THEN
-                                                '伊通县'
-                                            WHEN find_in_set(371, cd.ancestors) > 0
-                                                OR cd.dept_id = 371 THEN
-                                                '梨树县'
-                                            WHEN find_in_set(372, cd.ancestors) > 0
-                                                OR cd.dept_id = 372 THEN
-                                                '铁东区'
-                                            WHEN find_in_set(373, cd.ancestors) > 0
-                                                OR cd.dept_id = 373 THEN
-                                                '铁西区'
+                                            WHEN find_in_set(314391, cd.ancestors) > 0
+                                                OR cd.dept_id = 314391 THEN
+                                                '敖勒召其镇'
+                                            WHEN find_in_set(314392, cd.ancestors) > 0
+                                                OR cd.dept_id = 314392 THEN
+                                                '城川镇'
+                                            WHEN find_in_set(314393, cd.ancestors) > 0
+                                                OR cd.dept_id = 314393 THEN
+                                                '昂素镇'
+                                            WHEN find_in_set(314394, cd.ancestors) > 0
+                                                OR cd.dept_id = 314394 THEN
+                                                '上海庙镇'
                                             ELSE
                                                 '0'
                                             END
@@ -1152,21 +1141,18 @@
                                                   c.working_status,
                                                   (
                                                       CASE
-                                                          WHEN find_in_set(369, cd.ancestors) > 0
-                                                              OR cd.dept_id = 369 THEN
-                                                              '双辽市'
-                                                          WHEN find_in_set(370, cd.ancestors) > 0
-                                                              OR cd.dept_id = 370 THEN
-                                                              '伊通县'
-                                                          WHEN find_in_set(371, cd.ancestors) > 0
-                                                              OR cd.dept_id = 371 THEN
-                                                              '梨树县'
-                                                          WHEN find_in_set(372, cd.ancestors) > 0
-                                                              OR cd.dept_id = 372 THEN
-                                                              '铁东区'
-                                                          WHEN find_in_set(373, cd.ancestors) > 0
-                                                              OR cd.dept_id = 373 THEN
-                                                              '铁西区'
+                                                          WHEN find_in_set(314391, cd.ancestors) > 0
+                                                              OR cd.dept_id = 314391 THEN
+                                                              '敖勒召其镇'
+                                                          WHEN find_in_set(314392, cd.ancestors) > 0
+                                                              OR cd.dept_id = 314392 THEN
+                                                              '城川镇'
+                                                          WHEN find_in_set(314393, cd.ancestors) > 0
+                                                              OR cd.dept_id = 314393 THEN
+                                                              '昂素镇'
+                                                          WHEN find_in_set(314394, cd.ancestors) > 0
+                                                              OR cd.dept_id = 314394 THEN
+                                                              '上海庙镇'
                                                           ELSE
                                                               '0'
                                                           END

+ 4 - 5
src/main/resources/mapper/monitor/dahua/CenternonitorTDahuaOperateLogMapper.xml

@@ -228,11 +228,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
     <select id="selectOperateLogCountByDeptId" resultType="java.util.LinkedHashMap">
         SELECT
-        count( b.dept_id = 369 OR FIND_IN_SET( 369, b.ancestors ) OR NULL ) '双辽市',
-        count( b.dept_id = 370 OR FIND_IN_SET( 370, b.ancestors ) OR NULL ) '伊通县',
-        count( b.dept_id = 371 OR FIND_IN_SET( 371, b.ancestors ) OR NULL ) '梨树县',
-        count( b.dept_id = 372 OR FIND_IN_SET( 372, b.ancestors ) OR NULL ) '铁东区',
-        count( b.dept_id = 373 OR FIND_IN_SET( 373, b.ancestors ) OR NULL ) '铁西区',
+        count( b.dept_id = 314391 OR FIND_IN_SET( 314391, b.ancestors ) OR NULL ) '敖勒召其镇',
+        count( b.dept_id = 314392 OR FIND_IN_SET( 314392, b.ancestors ) OR NULL ) '城川镇',
+        count( b.dept_id = 314393 OR FIND_IN_SET( 314393, b.ancestors ) OR NULL ) '昂素镇',
+        count( b.dept_id = 314394 OR FIND_IN_SET( 314394, b.ancestors ) OR NULL ) '上海庙镇',
         <if test="list.size() > 0">
             ,
             <foreach collection="list" item="item" separator=",">