Explorar o código

【情报二期】数据域服务 - 线索布控逻辑微调

peifj hai 2 meses
pai
achega
83447e9a73

+ 0 - 13
src/main/java/com/hhwy/qbeqsjy/controller/CtrlController.java

@@ -3,14 +3,12 @@ package com.hhwy.qbeqsjy.controller;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.hhwy.qbeqsjy.common.Constants;
 import com.hhwy.qbeqsjy.common.Constants;
-import com.hhwy.qbeqsjy.dao.CtrlDao;
 import com.hhwy.qbeqsjy.domain.AjaxResult;
 import com.hhwy.qbeqsjy.domain.AjaxResult;
 import com.hhwy.qbeqsjy.dto.CtrlDTO;
 import com.hhwy.qbeqsjy.dto.CtrlDTO;
 import com.hhwy.qbeqsjy.service.CtrlService;
 import com.hhwy.qbeqsjy.service.CtrlService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Collections;
@@ -25,16 +23,6 @@ public class CtrlController {
 
 
     @Autowired
     @Autowired
     private CtrlService ctrlService;
     private CtrlService ctrlService;
-    @Autowired
-    private JdbcTemplate gaussDBJdbcTemplate;
-
-
-    @GetMapping("/test")
-    public AjaxResult test(){
-        log.info("测试接口");
-        log.info(gaussDBJdbcTemplate.queryForList("select * from t_user").toString());
-        return AjaxResult.success("test......");
-    }
 
 
 
 
     /**
     /**
@@ -45,7 +33,6 @@ public class CtrlController {
      * 请求参数:
      * 请求参数:
      * {
      * {
      *     "taskId":"59275350793392128",
      *     "taskId":"59275350793392128",
-     *     "taskName":"",
      *     "endCtrlTime":"2025-03-20 00:00:00",
      *     "endCtrlTime":"2025-03-20 00:00:00",
      *     "resourceIdList":["aaaa","bbbb","cccc"],
      *     "resourceIdList":["aaaa","bbbb","cccc"],
      *     "areaIdList":["dddd","eeee"],
      *     "areaIdList":["dddd","eeee"],

+ 5 - 9
src/main/java/com/hhwy/qbeqsjy/kafka/service/ConsumeService.java

@@ -94,18 +94,14 @@ public class ConsumeService implements ApplicationListener<ContextRefreshedEvent
                 for (ConsumerRecord<Integer, String> record : records) {
                 for (ConsumerRecord<Integer, String> record : records) {
                     JSONObject message = JSONObject.parseObject(record.value());
                     JSONObject message = JSONObject.parseObject(record.value());
                     JSONObject uniCtrl = message.getJSONObject("UNICTRL");
                     JSONObject uniCtrl = message.getJSONObject("UNICTRL");
-                    String rwbh = "59616388210888704";
-                    String clueType = "D201005";
-                    String clue = "18920718758";
-//                    String clueId = uniCtrl.getString("U_CLUEID");
-//                    String[] clueIdStrArr = clueId.split("_");
-//                    String rwbh = clueIdStrArr[Constants.NUM_1];
-//                    String clueType = clueIdStrArr[Constants.NUM_2];
-//                    String clue = clueIdStrArr[Constants.NUM_3];
+                    String clueId = uniCtrl.getString("U_CLUEID");
+                    String[] clueIdStrArr = clueId.split("_");
+                    String rwbh = clueIdStrArr[Constants.NUM_1];
+                    String clueType = clueIdStrArr[Constants.NUM_2];
+                    String clue = clueIdStrArr[Constants.NUM_3];
                     String resourceId = uniCtrl.getString("U_RESID");
                     String resourceId = uniCtrl.getString("U_RESID");
                     // 每张布控资源表对应的命中数据JSON对象
                     // 每张布控资源表对应的命中数据JSON对象
                     JSONObject oriField = message.getJSONObject("ORIFIELD");
                     JSONObject oriField = message.getJSONObject("ORIFIELD");
-//                    String yjxxsm = oriField.toJSONString();
                     log.info(oriField.toJSONString());
                     log.info(oriField.toJSONString());
                     StringBuilder yjxxsm = new StringBuilder();
                     StringBuilder yjxxsm = new StringBuilder();
                     // 预警时间
                     // 预警时间

+ 5 - 2
src/main/java/com/hhwy/qbeqsjy/service/CtrlService.java

@@ -2,6 +2,7 @@ package com.hhwy.qbeqsjy.service;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.JSON;
 import com.hhwy.qbeqsjy.common.*;
 import com.hhwy.qbeqsjy.common.*;
 import com.hhwy.qbeqsjy.dao.CtrlDao;
 import com.hhwy.qbeqsjy.dao.CtrlDao;
 import com.hhwy.qbeqsjy.domain.AjaxResult;
 import com.hhwy.qbeqsjy.domain.AjaxResult;
@@ -85,7 +86,7 @@ public class CtrlService {
                         if(code == 500){
                         if(code == 500){
                             // 记录布控失败的线索信息,等待当前任务布控操作执行结束后再批量入库,后续通过设置定时任务按照记录的布控失败线索信息继续实施布控
                             // 记录布控失败的线索信息,等待当前任务布控操作执行结束后再批量入库,后续通过设置定时任务按照记录的布控失败线索信息继续实施布控
                             // 存在操作延迟,但保证数据最终一致性
                             // 存在操作延迟,但保证数据最终一致性
-                            Object[] errorData = new Object[]{taskId, clue, clueType, endCtrlTime, resourceIdList, areaIdList, createTime};
+                            Object[] errorData = new Object[]{taskId, clue, clueType, endCtrlTime, JSON.toJSONString(resourceIdList), JSON.toJSONString(areaIdList), createTime};
                             ctrlErrorList.add(errorData);
                             ctrlErrorList.add(errorData);
                         } else {
                         } else {
                             JSONObject data = (JSONObject) result.get("data");
                             JSONObject data = (JSONObject) result.get("data");
@@ -348,7 +349,9 @@ public class CtrlService {
         params.put("to_sys", JSONArray.parseArray(toSys));
         params.put("to_sys", JSONArray.parseArray(toSys));
         params.put("sysuserid", sysUserId);
         params.put("sysuserid", sysUserId);
         params.put("serv_ver", servVer);
         params.put("serv_ver", servVer);
-        params.put("resid_list", resourceIdList.toArray(new String[resourceIdList.size()]));
+//        params.put("resid_list", resourceIdList.toArray(new String[resourceIdList.size()]));
+        // 测试时仅布控AUTH协议表
+        params.put("resid_list", new String[]{"134B102"});
         params.put("property_type", clueType);
         params.put("property_type", clueType);
         params.put("property_value", clue);
         params.put("property_value", clue);
         if(StringUtils.isNotBlank(endCtrlTime)){
         if(StringUtils.isNotBlank(endCtrlTime)){

+ 6 - 4
src/main/resources/application.properties

@@ -40,9 +40,9 @@ serv.ver=2.1
 # \u8B66\u5458ID
 # \u8B66\u5458ID
 sysuserid=fenghuo
 sysuserid=fenghuo
 # \u3010\u7EDF\u4E00\u5E03\u63A7\u3011\u4E0B\u53D1\u5E03\u63A7\u63A5\u53E3url
 # \u3010\u7EDF\u4E00\u5E03\u63A7\u3011\u4E0B\u53D1\u5E03\u63A7\u63A5\u53E3url
-uniCtrl.add.url=http://130.0.46.141:8090/lokiRest/uniCtrl/monitor/add
+uniCtrl.add.url=http://130.0.46.141:8090/lokiRest/unictrl/monitor/add
 # \u3010\u7EDF\u4E00\u5E03\u63A7\u3011\u505C\u6B62\u5E03\u63A7\u63A5\u53E3url
 # \u3010\u7EDF\u4E00\u5E03\u63A7\u3011\u505C\u6B62\u5E03\u63A7\u63A5\u53E3url
-uniCtrl.del.url=http://130.0.46.141:8090/lokiRest/uniCtrl/monitor/del
+uniCtrl.del.url=http://130.0.46.141:8090/lokiRest/unictrl/monitor/del
 # \u3010\u7EDF\u4E00\u5E03\u63A7\u3011\u5E03\u63A7\u7ED3\u679C\u67E5\u8BE2\u63A5\u53E3url
 # \u3010\u7EDF\u4E00\u5E03\u63A7\u3011\u5E03\u63A7\u7ED3\u679C\u67E5\u8BE2\u63A5\u53E3url
 uniCtrl.query.url=http://130.0.46.141:8090/lokiRest/unictrl/query/status
 uniCtrl.query.url=http://130.0.46.141:8090/lokiRest/unictrl/query/status
 # \u70FD\u706B\u7ECF\u7EAC\u5EA6\u8F6C\u5730\u5740\u4FE1\u606F\u63A5\u53E3url\uFF08\u767E\u5EA6\u5750\u6807\u7CFB\uFF09
 # \u70FD\u706B\u7ECF\u7EAC\u5EA6\u8F6C\u5730\u5740\u4FE1\u606F\u63A5\u53E3url\uFF08\u767E\u5EA6\u5750\u6807\u7CFB\uFF09
@@ -73,8 +73,10 @@ multi.thread.enabled=false
 # \u6267\u884C\u4EFB\u52A1\u7684\u7EBF\u7A0B\u6570\u91CF - \u5F53[multi.thread.enabled=true]\u65F6\u8BE5\u914D\u7F6E\u751F\u6548\uFF0C\u5426\u5219\u65E0\u6548
 # \u6267\u884C\u4EFB\u52A1\u7684\u7EBF\u7A0B\u6570\u91CF - \u5F53[multi.thread.enabled=true]\u65F6\u8BE5\u914D\u7F6E\u751F\u6548\uFF0C\u5426\u5219\u65E0\u6548
 thread.num=5
 thread.num=5
 # \u4EE5.txt\u6587\u4EF6\u8BB0\u5F55\u5E03/\u505C\u63A7\u5931\u8D25\u7EBF\u7D22\u6570\u636E\u8F93\u51FA\u8DEF\u5F84
 # \u4EE5.txt\u6587\u4EF6\u8BB0\u5F55\u5E03/\u505C\u63A7\u5931\u8D25\u7EBF\u7D22\u6570\u636E\u8F93\u51FA\u8DEF\u5F84
-ctrl.txt.output.path=/home/qbeqsjy/ctrl_error/
-stop.ctrl.txt.output.path=/home/qbeqsjy/stop_ctrl_error/
+#ctrl.txt.output.path=/home/QBEQSJY/ctrl_error/
+#stop.ctrl.txt.output.path=/home/QBEQSJY/stop_ctrl_error/
+ctrl.txt.output.path=C:\\Users\\Administrator\\Desktop\\pfj\\qbeqsjy\\ctrl_error\\
+stop.ctrl.txt.output.path=C:\\Users\\Administrator\\Desktop\\pfj\\qbeqsjy\\stop_ctrl_error\\
 # \u9884\u8B66\u6570\u636E\u67E5\u8BE2\u4E00\u6B21\u6700\u5927\u8FD4\u56DE\u6570\u636E\u6761\u6570\uFF0C\u9ED8\u8BA41000\u6761
 # \u9884\u8B66\u6570\u636E\u67E5\u8BE2\u4E00\u6B21\u6700\u5927\u8FD4\u56DE\u6570\u636E\u6761\u6570\uFF0C\u9ED8\u8BA41000\u6761
 query.max.count=1000
 query.max.count=1000