doum
11 小时以前 799a4095f37b9f52b1294a709b418b3736144bd3
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);
                        Boolean falg = false;
                        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,44 +538,38 @@
                                    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()), ",")
                                    );
                                    // todo 暂时关闭 钉钉通知
                                    //            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(),content));
                                    //            warningPush.setStatus(noticeFlag?Constants.ONE:Constants.TWO);
                                    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()));
//                                  warningPush.setStatus(noticeFlag?Constants.ONE:Constants.TWO);
                                    }
                                    impl.sendDeviceNotice(warningRule);
                                    warningPushMapper.insert(warningPush);
                                    falg = true;
                                    if(Constants.equalsInteger( request.getEventType(),Constants.WarningConfig.AF_RYLG.getKey())){
                                        //如果是人员离岗事件
                                        dealNoticeTelecomEvent(param,request,warningEventList);
                                    }
                                }catch (Exception e){
                                    falg = false;
                                    warningEvent.setStatus(Constants.TWO);
                                    warningEventMapper.updateById(warningEvent);
                                }
                            }
                        }
                        if(falg){
                        if(!falg){
                            warningEvent.setStatus(Constants.ONE);
                            warningEventMapper.updateById(warningEvent);
                        }
                    }
                }
            }
@@ -575,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