From 799a4095f37b9f52b1294a709b418b3736144bd3 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 19 十二月 2025 18:41:25 +0800
Subject: [PATCH] 最新版本541200007最新版本541200007

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java |  423 +++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 394 insertions(+), 29 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
index 50a1a94..6aa7902 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -1,10 +1,13 @@
 package com.doumee.service.business.impl.hksync;
 
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.doumee.biz.system.SystemDictDataBiz;
 import com.doumee.config.DataSyncConfig;
+import com.doumee.core.erp.model.openapi.response.erp.ERPApiResponse;
+import com.doumee.core.erp.model.openapi.response.erp.ErpUserListResponse;
 import com.doumee.core.haikang.model.HKConstants;
 import com.doumee.core.haikang.model.param.BaseResponse;
 import com.doumee.core.haikang.model.param.request.*;
@@ -15,21 +18,22 @@
 import com.doumee.core.haikang.model.param.request.event.base.EventBaseRequest;
 import com.doumee.core.haikang.model.param.request.event.parks.*;
 import com.doumee.core.haikang.model.param.request.event.visit.*;
+import com.doumee.core.haikang.model.param.respose.AuthResultPageDetailResponse;
+import com.doumee.core.haikang.model.param.respose.AuthResultPageResponse;
 import com.doumee.core.haikang.service.HKService;
-import com.doumee.core.utils.Constants;
-import com.doumee.core.utils.DESUtil;
-import com.doumee.core.utils.DateUtil;
-import com.doumee.core.utils.Utils;
+import com.doumee.core.utils.*;
 import com.doumee.dao.business.*;
 import com.doumee.dao.business.dao.MemberMapper;
 import com.doumee.dao.business.join.VisitsJoinMapper;
 import com.doumee.dao.business.model.*;
 import com.doumee.dao.business.model.Member;
 import com.doumee.dao.web.reqeust.SavePlatformWarnEventDTO;
+import com.doumee.dao.web.response.platformReport.CarmeraListVO;
 import com.doumee.service.business.VisitsService;
 import com.doumee.service.business.impl.JkCabinetGridServiceImpl;
 import com.doumee.service.business.impl.PlatformWarnEventServiceImpl;
 import com.doumee.service.business.third.TmsService;
+import com.doumee.service.business.third.model.PageData;
 import com.doumee.service.business.third.model.request.TmsOrderInfoRequest;
 import com.doumee.service.business.third.model.response.TmsOrderInfoResponse;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
@@ -37,12 +41,14 @@
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.*;
+import java.util.Date;
 import java.util.stream.Collectors;
 
 /**
@@ -156,8 +162,9 @@
             }
             if(delRetentionLis.size()>0){
                 //鍏堝垹闄ゅ師鏈夌殑鍦ㄥ満浜哄憳(鍐呴儴浜哄憳锛�
+                //@ApiModelProperty(value = "绫诲瀷 0鍔冲姟璁垮 1鏅�氳瀹� 2鍐呴儴鍛樺伐 3杞﹁締淇℃伅 4鐩稿叧鏂逛汉鍛� 5璐ц繍鍙告満  ")
                 retentionMapper.delete(new UpdateWrapper<Retention>().lambda()
-//                        .eq(Retention::getType,Constants.memberType.internal)
+                        .ne(Retention::getType,Constants.THREE)
                         .in(Retention::getMemberId,delRetentionLis));
             }
             if(retentionList.size()>0){
@@ -480,12 +487,13 @@
             //闂ㄧ浜嬩欢闆嗗悎
             List<EventBaseInfoRequest> events  = param.getParams().getEvents();
             for(EventBaseInfoRequest request : events){
+                if( request.getEventType() == null){
+                    continue;
+                }
                 Warning warning = warningMapper.selectOne(new QueryWrapper<Warning>().lambda()
                         .eq(Warning::getIsdeleted,Constants.ZERO)
-                        .eq(Warning::getCode, request.getSrcType()).last("limit 1"));
-
+                        .eq(Warning::getCode, request.getEventType()).last("limit 1"));
                 Constants.WarningConfig warningConfig = Constants.WarningConfig.getConfig(request.getEventType());
-                
                 if(Objects.nonNull(warning)){
                     WarningEvent warningEvent = new WarningEvent();
                     warningEvent.setCreateDate(new Date());
@@ -497,26 +505,29 @@
                     warningEvent.setEventId(request.getEventId());
                     warningEvent.setEventType(request.getEventType().toString());
                     warningEvent.setHappenTime(request.getHappenTime());
-                    warningEvent.setJsonContent(request.getData().toJSONString());
+                    if(Objects.nonNull(request.getData())){
+                        warningEvent.setJsonContent(JSONObject.toJSONString(request));
+                    }
                     warningEvent.setSrcIndex(request.getSrcIndex());
                     warningEvent.setSrcType(request.getSrcType());
                     warningEvent.setSrcName(request.getSrcName());
+                    warningEvent.setWarningId(warning.getId());
+                    warningEvent.setDeviceId(request.getSrcIndex());
+                    warningEvent.setRegion(this.getRegionsName(warningEvent.getSrcIndex(),warning.getType()));
                     warningEventMapper.insert(warningEvent);
 
                     if(Objects.nonNull(warningConfig)){
-                        List<Integer> ruleIdList =  impl.processWarnFront(warningConfig);
-
+                        List<WarningEvent> warningEventList = new ArrayList<>();//鏃堕棿闂撮殧鍐呯殑鍏ㄩ儴浜嬩欢璁板綍
+                        List<Integer> ruleIdList =  impl.processWarnFrontWithEvent(warningConfig,warningEventList);
                         Boolean falg = true;
                         if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ruleIdList)){
-                            for (Integer ruleId:ruleIdList) {
+                            Set<Integer> ruleIdSet = new HashSet<>(ruleIdList);
+                            for (Integer ruleId:ruleIdSet) {
                                 WarningRule warningRule = warningRuleMapper.selectById(ruleId);
                                 if (Objects.isNull(warningRule)) {
                                     break;
                                 }
                                 List<Member> memberList = impl.getWarningRuleMemberList(warningRule);
-                                if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(memberList)) {
-                                    break;
-                                }
                                 try {
                                     WarningPush warningPush = new WarningPush();
                                     warningPush.setCreateDate(new Date());
@@ -527,18 +538,15 @@
                                     warningPush.setContent(content);
                                     warningPush.setStatus(Constants.ZERO);
                                     warningPush.setPushType(Constants.ZERO);
-                                    //TODO 鏍规嵁鍏蜂綋鏁版嵁瀵规瘮鑾峰彇
-                                    warningPush.setRegion( "鏈煡浣嶇疆");
-                                    warningPush.setMemberIds(
-                                            StringUtils.join(memberList.stream().map(i -> i.getId()).collect(Collectors.toList()), ",")
-                                    );
-                                    warningPush.setMemberIds(
-                                            StringUtils.join(memberList.stream().map(i -> i.getId()).collect(Collectors.toList()), ",")
-                                    );
-                                    warningPush.setMemberNames(StringUtils.join(memberList.stream().map(i -> i.getName()).collect(Collectors.toList()), ",")
-                                    );
-
-                                    if(Constants.equalsInteger(warningRule.getMemberNotice(),Constants.ONE)){
+                                    warningPush.setRegion( warningEvent.getRegion());
+                                    if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(memberList)) {
+                                        warningPush.setMemberIds(
+                                                StringUtils.join(memberList.stream().map(i -> i.getId()).collect(Collectors.toList()), ",")
+                                        );
+                                        warningPush.setMemberNames(StringUtils.join(memberList.stream().map(i -> i.getName()).collect(Collectors.toList()), ",")
+                                        );
+                                    }
+                                     if(Constants.equalsInteger(warningRule.getMemberNotice(),Constants.ONE)){
                                         //            Boolean noticeFlag = dingTalk.workInfoOANotice(Long.valueOf(systemDictDataBiz.queryByCode(Constants.DD_TALK,Constants.AGENT_ID).getCode()),
                                         //                    StringUtils.join(memberList.stream().filter(i->StringUtils.isNotBlank(i.getDdId())).map(i->i.getDdId()).collect(Collectors.toList()),","),
                                         //                dingTalk.getAlarmNoticeMsg(warningPush.getRegion(),DateUtil.getCurrDateTime(),warningConfig.getInfo()));
@@ -546,7 +554,10 @@
                                     }
                                     impl.sendDeviceNotice(warningRule);
                                     warningPushMapper.insert(warningPush);
-
+                                    if(Constants.equalsInteger( request.getEventType(),Constants.WarningConfig.AF_RYLG.getKey())){
+                                        //濡傛灉鏄汉鍛樼宀椾簨浠�
+                                        dealNoticeTelecomEvent(param,request,warningEventList);
+                                    }
                                 }catch (Exception e){
                                     falg = false;
                                     warningEvent.setStatus(Constants.TWO);
@@ -569,10 +580,364 @@
         }
         saveInterfaceLog(param,"/business/hksync/push/notice",result,true);
         return  null;
-
     }
 
     /**
+     * 閫氱煡鐢典俊鎺ュ彛锛堢宀椾簨浠讹級
+     * @param list
+     */
+    private void dealNoticeTelecomEvent(EventBaseRequest param,EventBaseInfoRequest request ,List<WarningEvent> list) {
+        try {
+            log.error("========閫氱煡鍏朵粬涓夋柟鍦板潃绂诲矖浜嬩欢寮�濮�:"+list.size());
+            Thread t1=new Thread(new Runnable() {
+                @Override
+                public void run() {
+                    //瀹氬埗key
+                   param.getParams().setEvents(new ArrayList<>());
+                   int key = Constants.WarningConfig.AF_RYLG_CUSTOM.getKey();
+                    List<EventBaseInfoRequest> noticeList = new ArrayList<>();
+                    TypeReference typeReference =
+                            new TypeReference<EventBaseInfoRequest>(){};
+                    request.setEventType(key);//鏇存崲浜嬩欢绫诲瀷
+                    noticeList.add(request);
+                    for(WarningEvent c : list){
+                        if(StringUtils.equals( c.getEventType(),Constants.WarningConfig.AF_RYLG.getKey()+"")) {
+                            if(StringUtils.isNotBlank(c.getJsonContent())){
+                                EventBaseInfoRequest infoRequest =JSONObject.parseObject(c.getJsonContent(),typeReference.getType());
+                                noticeList.add(infoRequest);
+                            }
+                        }
+                    }
+                    for(EventBaseInfoRequest t : noticeList){
+                        if(t.getData() == null){
+                            t.setData(new JSONObject());
+                        }
+                        JSONObject at = t.getData().getJSONObject("AIOPResultData");
+                        if(at == null){
+                            at = new JSONObject();
+                            t.getData().put("AIOPResultData",at);
+                        }
+                        if(StringUtils.isBlank(at.getString("imageUrl"))){
+                            t.getData().getJSONObject("AIOPResultData").put("imageUrl","");
+                        }
+                        if(StringUtils.isBlank(at.getString("imageUrl"))){
+                            t.getData().getJSONObject("AIOPResultData").put("imageUrl","");
+                        }
+                        if(StringUtils.equals(t.getEventId(),request.getEventId())){
+                            continue;
+                        }
+                       request.setSrcIndex(StringUtils.defaultString(request.getSrcIndex(),"")+","+StringUtils.defaultString(t.getSrcIndex(),""));
+                       request.setSrcName(StringUtils.defaultString(request.getSrcName(),"")+","+StringUtils.defaultString(t.getSrcName(),""));
+                       request.getData().getJSONObject("AIOPResultData").put("imageUrl",StringUtils.defaultString( request.getData().getJSONObject("AIOPResultData").getString("imageUrl"),"")
+                               +","+StringUtils.defaultString( t.getData().getJSONObject("AIOPResultData").getString("imageUrl"),""));
+                    }
+                    param.getParams().getEvents().add(request);
+                    String thirdpath =systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_PUSH_THIRD_URL).getCode();
+                    if(StringUtils.isNotBlank(thirdpath)){
+                        String[] ss = thirdpath.split(";");
+                        for(String s : ss){
+                            String response =   HttpsUtil.postJson(s,JSONObject.toJSONString(param));
+                            log.error("========閫氱煡鍏朵粬涓夋柟鍦板潃绂诲矖浜嬩欢宸叉帹閫侊紝缁撴灉:"+response);
+                        }
+                    }
+                }
+            });
+            t1.start();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) {
+                //瀹氬埗key
+                EventBaseRequest param =  JSONObject.parseObject( "{\n" +
+                        "    \"method\": \"OnEventNotify\",\n" +
+                        "    \"params\": {\n" +
+                        "        \"ability\": \"event_ai_open_platform\",\n" +
+                        "        \"events\": [\n" +
+                        "            {\n" +
+                        "                \"data\": {\n" +
+                        "                    \"AIOPResultData\": {\n" +
+                        "                        \"height\": \"1440\",\n" +
+                        "                        \"imageUrl\": \"http://10.49.39.17:6120/pic?8dc0=1c00=2b-0ipf1ao620d404*-o7=5221*5l3=2062023786t6=910p*==217**=s153*4b4d47e2970d391*6-17odf2-l20a2300=df*&iTk=MmQwODU4YjM4YmMxM2RmMzlhYmRiMDNhMTRhZjEzMGIxZmUzYjdmYTgxMjY3ZjkxMDI2OWE1ZWIwY2ZiNDI5MDp7ImFrIjoiMjU4NjgyODIifQ==\",\n" +
+                        "                        \"nodeId\": 4,\n" +
+                        "                        \"rect\": null,\n" +
+                        "                        \"ruleId\": 1,\n" +
+                        "                        \"ruleName\": [\n" +
+                        "                            \"鏂板瑙勫垯\"\n" +
+                        "                        ],\n" +
+                        "                        \"targetAttrs\": {\n" +
+                        "                            \"IACPicUp\": \"@1766038022325@1766038022331@2@\",\n" +
+                        "                            \"aimmsModelId\": \"H930_MODEL_IPS_COORDINATION\",\n" +
+                        "                            \"cameraIndexCode\": \"34a23fe1367b4e138e4ccde4c0b51038\",\n" +
+                        "                            \"deviceIndexCode\": \"e330681016434de6975ed9400f834986\",\n" +
+                        "                            \"imageServerCode\": \"0803dbe0-c007-4dcf-abef-424da37d58f9\",\n" +
+                        "                            \"picServerIndexCode\": \"0803dbe0-c007-4dcf-abef-424da37d58f9\",\n" +
+                        "                            \"recognitionSign\": 1\n" +
+                        "                        },\n" +
+                        "                        \"taskID\": \"50230c815af14c54bbc3c6891fab0113\",\n" +
+                        "                        \"taskType\": \"AIOP_Video\",\n" +
+                        "                        \"triggerType\": 1073758209,\n" +
+                        "                        \"unionTargets\": {\n" +
+                        "                            \"childTargets\": [\n" +
+                        "\n" +
+                        "                            ],\n" +
+                        "                            \"confidence\": 0,\n" +
+                        "                            \"id\": 0,\n" +
+                        "                            \"region\": {\n" +
+                        "                                \"rect\": {\n" +
+                        "                                    \"h\": \"0.980469\",\n" +
+                        "                                    \"w\": \"0.980469\",\n" +
+                        "                                    \"x\": \"0.007812\",\n" +
+                        "                                    \"y\": \"0.007812\"\n" +
+                        "                                }\n" +
+                        "                            },\n" +
+                        "                            \"type\": 0\n" +
+                        "                        },\n" +
+                        "                        \"url\": null,\n" +
+                        "                        \"width\": \"2560\"\n" +
+                        "                    },\n" +
+                        "                    \"aiopMsgType\": 2,\n" +
+                        "                    \"channelID\": 5,\n" +
+                        "                    \"channelName\": \"娑堥槻鎺у埗瀹",\n" +
+                        "                    \"dataProcInterval\": \"14\",\n" +
+                        "                    \"dataType\": \"AIOPDetection\",\n" +
+                        "                    \"dateTime\": \"2025-12-18T14:07:00.000+08:00\",\n" +
+                        "                    \"eventDescription\": \"AI Open Platform Video Detection\",\n" +
+                        "                    \"eventType\": \"AIOPResultData\",\n" +
+                        "                    \"ipAddress\": \"192.168.15.224\",\n" +
+                        "                    \"picUploadInterval\": \"6\",\n" +
+                        "                    \"portNo\": 8000,\n" +
+                        "                    \"presetIndex\": 0,\n" +
+                        "                    \"recvTime\": \"2025-12-18T14:07:02.320+08:00\",\n" +
+                        "                    \"sendTime\": \"2025-12-18T14:07:02.334+08:00\",\n" +
+                        "                    \"targetAttrs\": {\n" +
+                        "                        \"IACPicUp\": \"@1766038022325@1766038022331@2@\",\n" +
+                        "                        \"cameraIndexCode\": \"34a23fe1367b4e138e4ccde4c0b51038\",\n" +
+                        "                        \"deviceIndexCode\": \"e330681016434de6975ed9400f834986\",\n" +
+                        "                        \"imageServerCode\": \"0803dbe0-c007-4dcf-abef-424da37d58f9\",\n" +
+                        "                        \"picServerIndexCode\": \"0803dbe0-c007-4dcf-abef-424da37d58f9\",\n" +
+                        "                        \"recognitionSign\": 1\n" +
+                        "                    },\n" +
+                        "                    \"taskID\": \"50230c815af14c54bbc3c6891fab0113\",\n" +
+                        "                    \"url\": \"http://10.49.39.17:6120/pic?8dc0=1c00=2b-0ipf1ao620d404*-o7=5221*5l3=2062023786t6=910p*==217**=s153*4b4d47e2970d391*6-17odf2-l20a2300=df*&iTk=MmQwODU4YjM4YmMxM2RmMzlhYmRiMDNhMTRhZjEzMGIxZmUzYjdmYTgxMjY3ZjkxMDI2OWE1ZWIwY2ZiNDI5MDp7ImFrIjoiMjU4NjgyODIifQ==\"\n" +
+                        "                },\n" +
+                        "                \"eventId\": \"20C92544-6F9B-B74C-963B-93C6C6BB6FCF\",\n" +
+                        "                \"eventType\": 422000001,\n" +
+                        "                \"happenTime\": \"2025-12-18T14:07:00.000+08:00\",\n" +
+                        "                \"srcIndex\": \"34a23fe1367b4e138e4ccde4c0b51038\",\n" +
+                        "                \"srcName\": \"娑堥槻鎺у埗瀹",\n" +
+                        "                \"srcParentIndex\": \"e330681016434de6975ed9400f834986\",\n" +
+                        "                \"srcType\": \"camera\",\n" +
+                        "                \"status\": 0,\n" +
+                        "                \"timeout\": 0\n" +
+                        "            } \n" +
+                        "        ],\n" +
+                        "        \"quids\": [\n" +
+                        "            \"admin\"\n" +
+                        "        ],\n" +
+                        "        \"sendTime\": \"2025-12-18T14:07:02.335+08:00\"\n" +
+                        "    }\n" +
+                        "}", EventBaseRequest.class);
+                EventBaseInfoRequest request = param.getParams().getEvents().get(0);
+                List<WarningEvent> list = new ArrayList<>();
+                WarningEvent request1 = new WarningEvent();
+                BeanUtils.copyProperties(request,request1);
+                request1.setSrcName("鎴块棿1");
+                request1.setEventType(request.getEventType().toString());
+                request1.setSrcIndex("2");
+                request1.setJsonContent("{\n" +
+                        "                \"data\": {\n" +
+                        "                    \"AIOPResultData\": {\n" +
+                        "                        \"height\": \"1440\",\n" +
+                        "                        \"imageUrl\": \"http://10.49.39.17:6120/pic?2.png\",\n" +
+                        "                        \"nodeId\": 4,\n" +
+                        "                        \"rect\": null,\n" +
+                        "                        \"ruleId\": 1,\n" +
+                        "                        \"ruleName\": [\n" +
+                        "                            \"鏂板瑙勫垯\"\n" +
+                        "                        ],\n" +
+                        "                        \"targetAttrs\": {\n" +
+                        "                            \"IACPicUp\": \"@1766038022325@1766038022331@2@\",\n" +
+                        "                            \"aimmsModelId\": \"H930_MODEL_IPS_COORDINATION\",\n" +
+                        "                            \"cameraIndexCode\": \"34a23fe1367b4e138e4ccde4c0b51038\",\n" +
+                        "                            \"deviceIndexCode\": \"e330681016434de6975ed9400f834986\",\n" +
+                        "                            \"imageServerCode\": \"0803dbe0-c007-4dcf-abef-424da37d58f9\",\n" +
+                        "                            \"picServerIndexCode\": \"0803dbe0-c007-4dcf-abef-424da37d58f9\",\n" +
+                        "                            \"recognitionSign\": 1\n" +
+                        "                        },\n" +
+                        "                        \"taskID\": \"50230c815af14c54bbc3c6891fab0113\",\n" +
+                        "                        \"taskType\": \"AIOP_Video\",\n" +
+                        "                        \"triggerType\": 1073758209,\n" +
+                        "                        \"unionTargets\": {\n" +
+                        "                            \"childTargets\": [\n" +
+                        "\n" +
+                        "                            ],\n" +
+                        "                            \"confidence\": 0,\n" +
+                        "                            \"id\": 0,\n" +
+                        "                            \"region\": {\n" +
+                        "                                \"rect\": {\n" +
+                        "                                    \"h\": \"0.980469\",\n" +
+                        "                                    \"w\": \"0.980469\",\n" +
+                        "                                    \"x\": \"0.007812\",\n" +
+                        "                                    \"y\": \"0.007812\"\n" +
+                        "                                }\n" +
+                        "                            },\n" +
+                        "                            \"type\": 0\n" +
+                        "                        },\n" +
+                        "                        \"url\": null,\n" +
+                        "                        \"width\": \"2560\"\n" +
+                        "                    },\n" +
+                        "                    \"aiopMsgType\": 2,\n" +
+                        "                    \"channelID\": 5,\n" +
+                        "                    \"channelName\": \"娑堥槻鎺у埗瀹",\n" +
+                        "                    \"dataProcInterval\": \"14\",\n" +
+                        "                    \"dataType\": \"AIOPDetection\",\n" +
+                        "                    \"dateTime\": \"2025-12-18T14:07:00.000+08:00\",\n" +
+                        "                    \"eventDescription\": \"AI Open Platform Video Detection\",\n" +
+                        "                    \"eventType\": \"AIOPResultData\",\n" +
+                        "                    \"ipAddress\": \"192.168.15.224\",\n" +
+                        "                    \"picUploadInterval\": \"6\",\n" +
+                        "                    \"portNo\": 8000,\n" +
+                        "                    \"presetIndex\": 0,\n" +
+                        "                    \"recvTime\": \"2025-12-18T14:07:02.320+08:00\",\n" +
+                        "                    \"sendTime\": \"2025-12-18T14:07:02.334+08:00\",\n" +
+                        "                    \"targetAttrs\": {\n" +
+                        "                        \"IACPicUp\": \"@1766038022325@1766038022331@2@\",\n" +
+                        "                        \"cameraIndexCode\": \"34a23fe1367b4e138e4ccde4c0b51038\",\n" +
+                        "                        \"deviceIndexCode\": \"e330681016434de6975ed9400f834986\",\n" +
+                        "                        \"imageServerCode\": \"0803dbe0-c007-4dcf-abef-424da37d58f9\",\n" +
+                        "                        \"picServerIndexCode\": \"0803dbe0-c007-4dcf-abef-424da37d58f9\",\n" +
+                        "                        \"recognitionSign\": 1\n" +
+                        "                    },\n" +
+                        "                    \"taskID\": \"50230c815af14c54bbc3c6891fab0113\",\n" +
+                        "                    \"url\": \"http://10.49.39.17:6120/pic?8dc0=1c00=2b-0ipf1ao620d404*-o7=5221*5l3=2062023786t6=910p*==217**=s153*4b4d47e2970d391*6-17odf2-l20a2300=df*&iTk=MmQwODU4YjM4YmMxM2RmMzlhYmRiMDNhMTRhZjEzMGIxZmUzYjdmYTgxMjY3ZjkxMDI2OWE1ZWIwY2ZiNDI5MDp7ImFrIjoiMjU4NjgyODIifQ==\"\n" +
+                        "                },\n" +
+                        "                \"eventId\": \"20C92544-6F9B-B7-93C6C6BB6FCF\",\n" +
+                        "                \"eventType\": 422000001,\n" +
+                        "                \"happenTime\": \"2025-12-18T14:07:00.000+08:00\",\n" +
+                        "                \"srcIndex\": \"34a23fe1367b4e138e4ccde4c0b51038\",\n" +
+                        "                \"srcName\": \"娑堥槻鎺у埗瀹�2\",\n" +
+                        "                \"srcParentIndex\": \"2\",\n" +
+                        "                \"srcType\": \"camera\",\n" +
+                        "                \"status\": 0,\n" +
+                        "                \"timeout\": 0\n" +
+                        "            }");
+                 list.add(request1);
+                request1 = new WarningEvent();
+                BeanUtils.copyProperties(request,request1);
+                request1.setEventType(request.getEventType().toString());
+                request1.setSrcName("鎴块棿2");
+                request1.setSrcIndex("3");
+                list.add(request1);
+                param.getParams().setEvents(new ArrayList<>());
+                int key = Constants.WarningConfig.AF_RYLG_CUSTOM.getKey();
+                List<EventBaseInfoRequest> noticeList = new ArrayList<>();
+                TypeReference typeReference =
+                        new TypeReference<EventBaseInfoRequest>(){};
+                request.setEventType(key);//鏇存崲浜嬩欢绫诲瀷
+                noticeList.add(request);
+                for(WarningEvent c : list){
+                    if(StringUtils.equals( c.getEventType(),Constants.WarningConfig.AF_RYLG.getKey()+"")) {
+                        if(StringUtils.isNotBlank(c.getJsonContent())){
+                            EventBaseInfoRequest infoRequest =JSONObject.parseObject(c.getJsonContent(),typeReference.getType());
+                            noticeList.add(infoRequest);
+                        }
+                    }
+                }
+                for(EventBaseInfoRequest t : noticeList){
+                    if(t.getData() == null){
+                        t.setData(new JSONObject());
+                    }
+                    JSONObject at = t.getData().getJSONObject("AIOPResultData");
+                    if(at == null){
+                        at = new JSONObject();
+                        t.getData().put("AIOPResultData",at);
+                    }
+                    if(StringUtils.isBlank(at.getString("imageUrl"))){
+                        t.getData().getJSONObject("AIOPResultData").put("imageUrl","");
+                    }
+                    if(StringUtils.isBlank(at.getString("imageUrl"))){
+                        t.getData().getJSONObject("AIOPResultData").put("imageUrl","");
+                    }
+                    if(StringUtils.equals(t.getEventId(),request.getEventId())){
+                        continue;
+                    }
+                    request.setSrcIndex(StringUtils.defaultString(request.getSrcIndex(),"")+","+StringUtils.defaultString(t.getSrcIndex(),""));
+                    request.setSrcName(StringUtils.defaultString(request.getSrcName(),"")+","+StringUtils.defaultString(t.getSrcName(),""));
+                    request.getData().getJSONObject("AIOPResultData").put("imageUrl",StringUtils.defaultString( request.getData().getJSONObject("AIOPResultData").getString("imageUrl"),"")
+                            +","+StringUtils.defaultString( t.getData().getJSONObject("AIOPResultData").getString("imageUrl"),""));
+                }
+                param.getParams().getEvents().add(request);
+                String thirdpath ="http://www.doumee.com";
+                if(StringUtils.isNotBlank(thirdpath)){
+                    String[] ss = thirdpath.split(";");
+                    for(String s : ss){
+                        String t =JSONObject.toJSONString(param);
+                        log.error("========閫氱煡鍏朵粬涓夋柟鍦板潃绂诲矖浜嬩欢宸叉帹閫侊紝缁撴灉:"+t );
+                        String response =   HttpsUtil.postJson(s,JSONObject.toJSONString(param));
+//                        log.error("========閫氱煡鍏朵粬涓夋柟鍦板潃绂诲矖浜嬩欢宸叉帹閫侊紝缁撴灉:"+response);
+                    }
+                }
+            }
+
+    @Autowired
+    private RedisTemplate<String,Object> stringRedisTemplate;
+
+    public String getRegionsName(String srcIndex,Integer warningType){
+        log.error("銆愬尮閰嶈澶囦笌鍖哄煙鍏崇郴淇℃伅銆�========寮�濮�=======锛�"+srcIndex);
+        String regionName = "鏈煡鍖哄煙";
+        if(StringUtils.isBlank(srcIndex)){
+            return regionName;
+        }
+        try{
+            if(Constants.equalsInteger(warningType,Constants.ZERO)){
+                List<CarmeraListVO> carmeraListVOList = (List<CarmeraListVO>) stringRedisTemplate.opsForValue().get(Constants.RedisKeys.HK_CAMERAS);//鎵�鏈夌洃鎺х偣鏁版嵁
+                if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(carmeraListVOList)){
+                    if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(carmeraListVOList)){
+                        for (CarmeraListVO c:carmeraListVOList) {
+                            if(c.getIndexCode().equals(srcIndex)){
+                                log.error("銆愮洃鎺у尯鍩熷尮閰嶇粨鏋溿��===============锛�"+c.getRegionName());
+                                return c.getRegionName();
+                            }
+                        }
+                    }
+                }
+            }else{
+                List<CarmeraListVO>  fireDeviceListVOList = (List<CarmeraListVO>) stringRedisTemplate.opsForValue().get(Constants.RedisKeys.HK_FIRE_DEVICE);//鎵�鏈夋秷闃茶澶囨暟鎹�
+                List<CarmeraListVO>  sensorListVOList = (List<CarmeraListVO>) stringRedisTemplate.opsForValue().get(Constants.RedisKeys.HK_SENSOR);//鎵�鏈変紶鎰熷櫒
+                if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(fireDeviceListVOList)){
+                    if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(fireDeviceListVOList)){
+                        for (CarmeraListVO c:fireDeviceListVOList) {
+                            if(c.getIndexCode().equals(srcIndex)){
+                                log.error("銆愭秷闃插尯鍩熷尮閰嶇粨鏋溿��===============锛�"+c.getRegionName());
+                                return c.getRegionName();
+                            }
+                        }
+                    }
+                }
+
+                if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(sensorListVOList)){
+                    if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(sensorListVOList)){
+                        for (CarmeraListVO c:sensorListVOList) {
+                            if(c.getIndexCode().equals(srcIndex)){
+                                log.error("銆愪紶鎰熷櫒鍖哄煙鍖归厤缁撴灉銆�==============锛�"+c.getRegionName());
+                                return c.getRegionName();
+                            }
+                        }
+                    }
+                }
+            }
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        log.error("銆愬尮閰嶈澶囦笌鍖哄煙鍏崇郴淇℃伅銆�========缁撴潫=======锛�"+srcIndex);
+        return regionName;
+    }
+
+
+    /**
      * 娴峰悍璁垮浜嬩欢鎺ㄩ��
      * @param param
      * @param response

--
Gitblit v1.9.3