From 4f6565cb9cca05981abdeb85dfc023a28c892e42 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期三, 05 十一月 2025 16:42:45 +0800
Subject: [PATCH] 钥匙柜信息处理

---
 server/visits/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java
index b7f4fef..748fa8d 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java
@@ -1,5 +1,6 @@
 package com.doumee.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.doumee.biz.system.SystemDictDataBiz;
 import com.doumee.core.haikang.model.HKConstants;
 import com.doumee.core.haikang.model.HKTools;
@@ -8,9 +9,12 @@
 import com.doumee.core.haikang.model.param.respose.OrgInfoResponse;
 import com.doumee.core.haikang.service.HKService;
 import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.WarningMapper;
+import com.doumee.dao.business.model.Warning;
 import com.doumee.dao.system.model.SystemDictData;
 import com.doumee.service.business.InterfaceLogService;
 import com.doumee.service.business.impl.hksync.HkSyncBaseServiceImpl;
+import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
 import com.hikvision.artemis.sdk.config.ArtemisConfig;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,6 +22,8 @@
 
 import javax.annotation.PostConstruct;
 import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 娴峰悍浜嬩欢璁㈤槄琛⊿ervice瀹炵幇
@@ -31,13 +37,25 @@
     private SystemDictDataBiz systemDictDataBiz;
     @Autowired
     private InterfaceLogService interfaceLogService;
+    @Autowired
+    private WarningMapper warningMapper;
 
     @PostConstruct
     public  int  initHkConfig(){
         //鑾峰彇鏍圭粍缁囩紪鐮�
+        initHkParamConfig();
         getRootOrgCode();
         //寮�濮嬭闃呴棬绂佷簨浠躲�佽瀹簨浠躲�佸拰鍋滆溅鍦轰簨浠�
         startHkEventSub();
+        return  0;
+    }
+
+    public  int  initHkParamConfig(){
+        ArtemisConfig.host = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HOST).getCode();
+        ArtemisConfig.appKey = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPKEY).getCode();
+        ArtemisConfig.appSecret = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPSECRET).getCode();
+        HKConstants.https = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HTTPS).getCode();
+        HKTools.interfaceLogService=interfaceLogService;
         return  0;
     }
     /**
@@ -89,6 +107,41 @@
         HKService.cancelEventSub(param);//鍏堝彇娑�
         HKService.eventSub(param);//闂ㄧ浜嬩欢
 
+        param.setEventDest(path+"/visitIccm");
+        param.setEventTypes(new Integer[]{HKConstants.EventTypes.VISIT_SIGN_ICCM_IN.getKey()
+                ,HKConstants.EventTypes.VISIT_SIGN_ICCM_PASS.getKey()
+                ,HKConstants.EventTypes.VISIT_SIGN_ICCM_OUT.getKey()});
+        HKService.cancelEventSub(param);//鍏堝彇娑�
+        HKService.eventSub(param);//璁垮浜嬩欢
+
+        param.setEventDest(path+"/platform/workstatus");
+        param.setEventTypes(new Integer[]{HKConstants.EventTypes.PLATFORM_WORKSTATUS.getKey()});
+        HKService.cancelEventSub(param);//鍏堝彇娑�
+//        HKService.eventSub(param);//鏈堝彴宸ヤ綔鐘舵�佷簨浠�
+
+        try{
+            List<Warning> warningList = warningMapper.selectList(new QueryWrapper<Warning>().lambda()
+                    .eq(Warning::getIsdeleted,Constants.ZERO)
+                    .eq(Warning::getStatus,Constants.ONE)
+                    .in(Warning::getType,Constants.ZERO,Constants.ONE)
+                    .isNotNull(Warning::getCode)
+            );
+            if(CollectionUtils.isNotEmpty(warningList)){
+                List<String> codeList = warningList.stream().map(i->i.getCode()).collect(Collectors.toList());
+                if(CollectionUtils.isNotEmpty(codeList)){
+                    param.setEventDest(path+"/notice");
+                    param.setEventTypes(codeList.stream().map(i->Integer.valueOf(i)).toArray(Integer[]::new));
+                    HKService.cancelEventSub(param);//鍏堝彇娑�
+                    HKService.eventSub(param);//瀹夐槻浜嬩欢
+                }
+            }
+        }catch (Exception e){
+
+        }
+
+
+
+
     }
     /**
      * 鍙栨秷璁㈤槄闂ㄧ浜嬩欢銆佽瀹簨浠躲�佸拰鍋滆溅鍦轰簨浠�

--
Gitblit v1.9.3