From b0ea50dd24a7ed5ada38dc6c8209f78fc09f0441 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 21 六月 2024 17:45:33 +0800
Subject: [PATCH] 修复bug

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

diff --git a/server/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java b/server/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java
index 4e2cf2b..b7f4fef 100644
--- a/server/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java
+++ b/server/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java
@@ -5,7 +5,7 @@
 import com.doumee.core.haikang.model.HKTools;
 import com.doumee.core.haikang.model.param.BaseResponse;
 import com.doumee.core.haikang.model.param.request.EventSubRequest;
-import com.doumee.core.haikang.model.param.respose.OrgListResponse;
+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.system.model.SystemDictData;
@@ -34,13 +34,6 @@
 
     @PostConstruct
     public  int  initHkConfig(){
-        if(StringUtils.isBlank( ArtemisConfig.host )){
-            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;
         //鑾峰彇鏍圭粍缁囩紪鐮�
         getRootOrgCode();
         //寮�濮嬭闃呴棬绂佷簨浠躲�佽瀹簨浠躲�佸拰鍋滆溅鍦轰簨浠�
@@ -56,7 +49,7 @@
             SystemDictData orgName =  systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_ROOTORG_NAME);
             String rootOrgId =org.getCode();
             if(StringUtils.isBlank(rootOrgId)){
-                BaseResponse<OrgListResponse> res = HKService.getRootOrg(null);
+                BaseResponse<OrgInfoResponse> res = HKService.getRootOrg(null);
                 if(res !=null && res.getData()!=null && StringUtils.isNotBlank(res.getData().getOrgIndexCode())){
                     org.setCode(res.getData().getOrgIndexCode());
                     org.setUpdateTime(new Date());
@@ -74,6 +67,7 @@
      * 璁㈤槄闂ㄧ浜嬩欢銆佽瀹簨浠躲�佸拰鍋滆溅鍦轰簨浠�
      */
     public void startHkEventSub(){
+        cancelEventSub();
         EventSubRequest param = new EventSubRequest();
         String path =systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_PUSH_URL).getCode();
         param.setEventDest(path+"/parks");
@@ -81,15 +75,18 @@
                 ,HKConstants.EventTypes.PARK_LINE_OUT.getKey()
                 ,HKConstants.EventTypes.PARK_PASS_IN.getKey()
                 ,HKConstants.EventTypes.PARK_PASS_OUT.getKey() });
+        HKService.cancelEventSub(param);////鍏堝彇娑�
         HKService.eventSub(param);//鍋滆溅鍦轰簨浠�
 
         param.setEventDest(path+"/visit");
-        param.setEventTypes(new Integer[]{HKConstants.EventTypes.VISIT_SIGN_OUT.getKey()
+        param.setEventTypes(new Integer[]{HKConstants.EventTypes.VISIT_SIGN_IN.getKey()
                 ,HKConstants.EventTypes.VISIT_SIGN_OUT.getKey()});
+        HKService.cancelEventSub(param);//鍏堝彇娑�
         HKService.eventSub(param);//璁垮浜嬩欢
 
         param.setEventDest(path+"/acs");
         param.setEventTypes(new Integer[]{HKConstants.EventTypes.DOOR_FACE_AUTH_FAIL.getKey(),HKConstants.EventTypes.DOOR_FACE_AUTH_SUCCESS.getKey()});
+        HKService.cancelEventSub(param);//鍏堝彇娑�
         HKService.eventSub(param);//闂ㄧ浜嬩欢
 
     }
@@ -103,8 +100,11 @@
                 ,HKConstants.EventTypes.PARK_LINE_OUT.getKey()
                 ,HKConstants.EventTypes.PARK_PASS_IN.getKey()
                 ,HKConstants.EventTypes.PARK_PASS_OUT.getKey()
+                ,HKConstants.EventTypes.VISIT_SIGN_IN.getKey()
                 ,HKConstants.EventTypes.VISIT_SIGN_OUT.getKey(),
                 HKConstants.EventTypes.DOOR_FACE_AUTH_SUCCESS.getKey()});
+        String path =systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_PUSH_URL).getCode();
+        param.setEventDest(path);
         HKService.cancelEventSub(param);//鍋滆溅鍦轰簨浠�
 
     }

--
Gitblit v1.9.3