From 47ccf3eef077536994ff3614bee10374a3150e05 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 07 十二月 2023 10:58:50 +0800
Subject: [PATCH] 海康接口对接开发

---
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkInResultRequest.java |    9 +
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java                                  |   10 +
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkDataRequest.java     |   34 +++++
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkRlsRequest.java      |   13 ++
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushInfoRequest.java     |   18 +++
 server/dmvisit_service/src/main/java/com/doumee/service/business/impl/InterfaceLogServiceImpl.java                   |    3 
 server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java             |   22 +++
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventDeviceDataRequest.java   |   37 ++++++
 server/dmvisit_service/src/main/java/com/doumee/config/SpringContextUtil.java                                        |   33 +++++
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java                                      |   48 +++++++
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/ExtEventCustomerNumInfo.java  |   13 ++
 server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java                                            |    1 
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventVisitDataRequest.java    |   28 ++++
 server/dmvisit_service/src/main/java/com/doumee/dao/business/model/InterfaceLog.java                                 |    3 
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkPicRequest.java      |   11 +
 server/dmvisit_admin/src/main/java/com/doumee/api/business/HkSyncController.java                                     |    8 +
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushParamRequest.java    |   17 ++
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/ExtEventIdentityCardInfo.java |   18 +++
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushRequest.java         |   13 ++
 19 files changed, 331 insertions(+), 8 deletions(-)

diff --git a/server/dmvisit_admin/src/main/java/com/doumee/api/business/HkSyncController.java b/server/dmvisit_admin/src/main/java/com/doumee/api/business/HkSyncController.java
index fb68d05..fafb7f7 100644
--- a/server/dmvisit_admin/src/main/java/com/doumee/api/business/HkSyncController.java
+++ b/server/dmvisit_admin/src/main/java/com/doumee/api/business/HkSyncController.java
@@ -65,4 +65,12 @@
         String result = hkSyncPrivilegeService.syncHkParks(param);
         return ApiResponse.success(result);
     }
+    @PreventRepeat
+    @ApiOperation("銆愭捣搴枫�戜簨浠惰闃呮帹閫佸鎺ュ鐞嗘帴鍙�")
+    @PostMapping("/push")
+//    @RequiresPermissions("business:hksync:privilege")
+    public ApiResponse push(@RequestBody ParkListRequest param) {
+        String result = hkSyncPrivilegeService.syncHkParks(param);
+        return ApiResponse.success(result);
+    }
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/config/SpringContextUtil.java b/server/dmvisit_service/src/main/java/com/doumee/config/SpringContextUtil.java
new file mode 100644
index 0000000..4577f53
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/config/SpringContextUtil.java
@@ -0,0 +1,33 @@
+package com.doumee.config;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SpringContextUtil implements ApplicationContextAware {
+
+	private static ApplicationContext applicationContext;
+
+	@Override
+	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+		this.applicationContext = applicationContext;
+	}
+
+	public static ApplicationContext getApplicationContext() {
+		return applicationContext;
+	}
+
+	public static Object getBean(String name) {
+		return getApplicationContext().getBean(name);
+	}
+
+	public static <T> T getBean(Class<T> clazz) {
+		return getApplicationContext().getBean(clazz);
+	}
+
+	public static <T> T getBean(String name, Class<T> clazz) {
+		return getApplicationContext().getBean(name, clazz);
+	}
+}
\ No newline at end of file
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
index 3ed969a..c9177c5 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
@@ -1,10 +1,17 @@
 package com.doumee.core.haikang.model;
 
 import com.alibaba.fastjson.JSONObject;
+import com.doumee.config.SpringContextUtil;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.model.InterfaceLog;
+import com.doumee.service.business.InterfaceLogService;
 import com.hikvision.artemis.sdk.ArtemisHttpUtil;
+import com.hikvision.artemis.sdk.config.ArtemisConfig;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
+import org.apache.tomcat.util.bcel.Const;
+import org.yaml.snakeyaml.scanner.Constant;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -19,10 +26,24 @@
 
 //	private static final Logger logger = LoggerFactory.getLogger(HKUtil.class);
 
-
 	public static void main(String[] args) throws ParseException {
 
 	}
+	private static void saveInterfaceLog(String s, String result,Map<String, String> path) {
+		InterfaceLogService bean = SpringContextUtil.getBean(InterfaceLogService.class);
+		if(bean !=null){
+			InterfaceLog hkMonitoryLogDO=new InterfaceLog();
+			hkMonitoryLogDO.setType(0);
+			hkMonitoryLogDO.setCreateDate(new Date());
+			hkMonitoryLogDO.setIsdeleted(0);
+			hkMonitoryLogDO.setRequest(s);
+			hkMonitoryLogDO.setRemark(result);
+			hkMonitoryLogDO.setName(path.get(HKConstants.https));
+			hkMonitoryLogDO.setUrl(HKConstants.https + ArtemisConfig.host+path.get(HKConstants.https));
+			bean.create(hkMonitoryLogDO);
+		}
+	}
+
 	private static Map<String, String> getPath(String str) {
 		final String getCamsApi = HKConstants.ARTEMIS_PATH  + str;
 		Map<String, String> path = new HashMap<String, String>(2) {
@@ -40,8 +61,10 @@
 	public static String getRootOrg() {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.rootOrg);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, "", null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog("",result,path);
 		return  result;
 	}
+
 
 	/**
 	 * 鏇存柊缁勭粐淇℃伅
@@ -51,6 +74,7 @@
 	public static String editOrg(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.editOrg);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 
@@ -62,6 +86,7 @@
 	public static String addBatchOrg(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.addBatchOrg);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -72,6 +97,7 @@
 	public static String delOrg(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.delBatchOrg);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 
@@ -83,6 +109,7 @@
 	public static String addUser(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.addUser);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 
@@ -95,6 +122,7 @@
 	public static String addBatchUser(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.addBatchUser);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 
@@ -106,6 +134,7 @@
 	public static String delBatchUser(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.delBatchUser);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 
@@ -117,6 +146,7 @@
 	public static String editUser(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.editUser);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -127,6 +157,7 @@
 	public static String addFace(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.addFace);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -137,6 +168,7 @@
 	public static String editFace(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.editFace);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -147,6 +179,7 @@
 	public static String delFace(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.delFace);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -157,6 +190,7 @@
 	public static String parkList(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.getParkList);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -167,6 +201,7 @@
 	public static String entranceList(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.getEntranceList);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -177,6 +212,7 @@
 	public static String parkAddition(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.parkAddition);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -187,6 +223,7 @@
 	public static String parkDeletion(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.parkDeletion);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -197,6 +234,7 @@
 	public static String carChargeAddtion(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.carChargeAddtion);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -207,6 +245,7 @@
 	public static String carChargeDeletion(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.carChargeDeletion);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 
@@ -237,6 +276,7 @@
 	public static String acsDeviceList(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.acsDeviceList);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -247,6 +287,7 @@
 	public static String acsDeviceTimeRangeList(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.acsDeviceList);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -257,6 +298,7 @@
 	public static String visitAppiontment(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.visitAppiontment);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -267,6 +309,7 @@
 	public static String visitAppiontmentMDJ(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.visitAppiontmentMDJ);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 
@@ -278,6 +321,7 @@
 	public static String visitCancel(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.visitCancel);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -288,6 +332,7 @@
 	public static String privilegeGroup(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.privilegeGroup);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 	/**
@@ -298,6 +343,7 @@
 	public static String eventSub(String body) {
 		Map<String, String> path = getPath(HKConstants.InterfacePath.eventSub);
 		String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+		saveInterfaceLog(body,result,path);
 		return  result;
 	}
 
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventDeviceDataRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventDeviceDataRequest.java
new file mode 100644
index 0000000..3936f43
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventDeviceDataRequest.java
@@ -0,0 +1,37 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class EventDeviceDataRequest<T> {
+
+    private ExtEventIdentityCardInfo ExtEventIdentityCardInfo;//	浜哄憳韬唤璇佷俊鎭�	鍚�	涓嶉檺
+    private ExtEventIdentityCardInfo  ExtEventCustomerNumInfo;//		閫氶亾浜嬩欢淇℃伅	鍚�	涓嶉檺
+    private Integer  ExtAccessChannel	;//Number	浜哄憳閫氶亾鍙�	鍚�	32
+    private Integer  ExtEventAlarmInID;//	Number	鎶ヨ杈撳叆/闃插尯閫氶亾	鍚�	32
+    private Integer   ExtEventAlarmOutID	;//Number	鎶ヨ杈撳嚭閫氶亾	鍚�	32
+    private String   ExtEventCardNo;//String	鍗″彿	鍚�	32
+    private Integer   ExtEventCaseID	;//Number	浜嬩欢杈撳叆閫氶亾	鍚�	32
+    private Integer ExtEventCode;//	Number	浜嬩欢绫诲瀷浠g爜	鍚�	32	鍙傝闄勫綍D.2.1.1 闂ㄧ浜嬩欢绫诲瀷
+    private Integer   ExtEventDoorID;//	Number	闂ㄧ紪鍙�	鍚�	32
+    private String   ExtEventIDCardPictureURL;//	String	韬唤璇佸浘鐗嘦RL	鍚�	200
+    private Integer   ExtEventInOut;//	Number	杩涘嚭鏂瑰悜	鍚�	32	杩涘嚭绫诲瀷1锛氳繘0锛氬嚭-1:鏈煡    瑕佹眰锛氳繘闂ㄨ鍗″櫒鎷ㄧ爜璁剧疆涓�1锛屽嚭闂ㄨ鍗″櫒鎷ㄧ爜璁剧疆涓�2
+    private Integer  ExtEventLocalControllerID;//	Number	灏卞湴鎺у埗鍣╥d	鍚�	32	灏卞湴鎺у埗鍣ㄧ紪鍙�,0-闂ㄧ涓绘満,1-255浠h〃灏卞湴鎺у埗鍣�
+    private Integer   ExtEventMainDevID;//	Number	涓昏澶囨嫧鐮�	鍚�	32
+    private String    ExtEventPersonNo;//	String	浜哄憳缂栧彿	鍚�	32	浠ヤ汉涓轰腑蹇冭澶囦細涓婃姤
+    private String    ExtEventPictureURL;//	String	鍥剧墖鐨剈rl	鍚�	32
+    private Integer   ExtEventReaderID;//	Number	璇诲崱鍣╥d	鍚�	32
+    private Integer     ExtEventReaderKind;//	Number	璇诲崱鍣ㄧ被鍒�	鍚�	32	0-鏃犳晥1-IC璇诲崱鍣�2-韬唤璇佽鍗″櫒3-浜岀淮鐮佽鍗″櫒4-鎸囩汗澶�
+    private Integer ExtEventReportChannel;//	Number	鎶ュ憡涓婁紶閫氶亾	鍚�	32	1-甯冮槻涓婁紶2-涓績缁�1涓婁紶3-涓績缁�2涓婁紶0-鏃犳晥
+    private Integer ExtEventRoleID;//	Number	缇ょ粍缂栧彿	鍚�	32
+    private Integer  ExtEventSubDevID;//	Number	鍒嗘帶鍒跺櫒纭欢ID	鍚�	32
+    private Integer    ExtEventSwipNum;//	Number	鍒峰崱娆℃暟	鍚�	32
+    private Integer ExtEventType;//	Number	浜嬩欢绫诲瀷	鍚�	32	浜嬩欢绫诲瀷锛屽鏅�氶棬绂佷簨浠朵负0,韬唤璇佷俊鎭簨浠朵负1锛屽娴侀噺缁熻涓�2
+    private Integer   ExtEventVerifyID;//	Number	澶氶噸璁よ瘉搴忓彿	鍚�	32
+    private Integer   ExtEventWhiteListNo;//	Number	鐧藉悕鍗曞崟鍙�	鍚�	32	1-8锛屼负0鏃犳晥
+    private String   ExtReceiveTime;//	String	浜嬩欢涓婃姤椹卞姩鐨勬椂闂�	鏄�	32	鐢ㄤ簬缁熻浜嬩欢涓婃姤寤舵椂锛孶nix鏃堕棿鎴筹紝绮剧‘鍒板井绉掞紝渚嬶細 "1558576265810000"浠h〃 2019/5/23 9:51:5.000
+    private Integer    Seq;//	Number	浜嬩欢娴佹按鍙�	鏄�	32	浜嬩欢娴佹按鍙凤紝涓�0鏃犳晥
+    private String     UserType;//	Number 鐢ㄦ埛绫诲瀷	鍚�	32	浜哄憳绫诲瀷锛�0 鏈煡锛�1 鏅�氾紝2 鏉ュ锛�3 榛戝悕鍗曪紝4 绠$悊鍛�
+    private String    svrIndexCode	;//String	鍥剧墖鏈嶅姟鍣ㄥ敮涓�缂栫爜	鍚�	32
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkDataRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkDataRequest.java
new file mode 100644
index 0000000..7d87dd8
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkDataRequest.java
@@ -0,0 +1,34 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class EventParkDataRequest {
+    private Integer    alarmCar	;//	Number	鏄惁榛戝悕鍗曟爣璇嗭紙1-榛戝悕鍗� 0-闈為粦鍚嶅崟锛�	鍚�
+    private String    cardNo	;//	String	鍗″彿	鍚�	16
+    private Integer      eventCmd;//		Number	浜嬩欢鍙�	鏄�		1:鍘嬬嚎浜嬩欢2:涓婁紶鍥剧墖3:鍏ュ満4:鍑哄満5:杞︾墝鐭6:鍥剧墖閲嶄紶
+    private String       eventIndex;//		String	浜嬩欢缂栧彿	鏄�	64
+    private String      gateIndex;//		String	鍑哄叆鍙g紪鍙�	鏄�	64
+    private String     gateName;//		String	鍑哄叆鍙e悕绉�	鏄�	64
+    private Integer      inoutType;//		Number	杩涘嚭鍦虹被鍨嬶紝0锛氳繘鍦猴紝1锛氬嚭鍦�	鏄�
+    private Integer      mainLogo;//		Number	杞﹁締涓诲搧鐗�	鍚�
+    private String     parkIndex	;//	String	鍋滆溅搴撶紪鍙�	鏄�	64
+    private String      parkName	;//	String	鍋滆溅搴撳悕绉�	鏄�	64
+    private EventParkPicRequest  picUrl	;//Object		鍚�
+    private String     svrIndex;//	String	鍥剧墖鏈嶅姟鍣ㄧ紪鍙�	鍚�	32
+    private Integer      plateBelieve	;//Number	杞︾墝缃俊搴�	鏄�	鍙栧�艰寖鍥达細0鈥�100
+    private Integer     plateColor	;//Number	杞︾墝棰滆壊	鏄�	鍙傝闄勫綍A.15 杞︾墝棰滆壊
+    private String      plateNo	;//String	杞︾墝鍙�	鏄�	32
+    private Integer      plateType;//	Number	杞︾墝绫诲瀷	鏄�	鍙傝闄勫綍A.14 杞︾墝绫诲瀷
+    private String      roadwayIndex;//	String	杞﹂亾缂栧彿	鏄�	64
+    private String     roadwayName;//	String	杞﹂亾鍚嶇О	鏄�	64
+    private Integer       roadwayType;//	Number	杞﹂亾绫诲瀷	鏄�	1锛氬叆鍦鸿溅閬� 2锛氬嚭鍦轰笉鏀惰垂杞﹂亾 3锛氬嚭鍦虹即璐硅溅閬� 4锛氫腑澶即璐硅溅閬�
+    private Integer       subLogo;//	Number	杞﹁締瀛愬搧鐗�	鍚�
+    private Integer      subModel;//	Number	瀛愬搧鐗屽勾娆�	鍚�
+    private String        time;//	String	鏃堕棿	鏄�	64	ISO鏍煎紡
+    private Integer      vehicleClass;//	Number	杞﹁締灞炴��	鏄�
+    private Integer     vehicleColor;//	Number	杞﹁締棰滆壊	鏄�
+    private Integer     vehicleType;//	Number	杞﹁締绫诲瀷	鏄�
+   private EventParkInResultRequest inResult;	//Object	鏀捐缁撴灉鏁版嵁
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkInResultRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkInResultRequest.java
new file mode 100644
index 0000000..55abab9
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkInResultRequest.java
@@ -0,0 +1,9 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class EventParkInResultRequest {
+    private EventParkRlsRequest    rlsResult	;//	鏀捐缁撴灉鏁版嵁	鏄�
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkPicRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkPicRequest.java
new file mode 100644
index 0000000..3c73c71
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkPicRequest.java
@@ -0,0 +1,11 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class EventParkPicRequest {
+
+    private String    platePicUrl;//	String	杞︾墝鍥剧墖	鍚�	256
+    private String    vehiclePicUrl;//	String	杞﹁締鍥剧墖	鍚�	256
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkRlsRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkRlsRequest.java
new file mode 100644
index 0000000..b7e9e1a
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventParkRlsRequest.java
@@ -0,0 +1,13 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class EventParkRlsRequest {
+    private Integer   releaseAuth	;//	Number	鏀捐鏉冮檺	鏄�	64	鍙傝闄勫綍A.65 鏀捐鏉冮檺
+    private Integer releaseReason	;//	Number	鏀捐鍘熷洜	鏄�	64	鍙傝鍙傝闄勫綍A.67 鏀捐鍘熷洜
+    private Integer releaseResult	;//	Number	鏀捐缁撴灉	鏄�	64	鍙傝闄勫綍A.66 鏀捐缁撴灉
+    private Integer releaseResultEx		;//Number	鏂颁綋绯绘斁琛岀粨鏋�	鏄�	64	鍙傝闄勫綍A.68 鏂颁綋绯绘斁琛岀粨鏋�
+    private Integer releaseWay	;//	Number	鏀捐鏂瑰紡	鏄�	64	鍙傝闄勫綍A.69 鏀捐鏂瑰紡
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushInfoRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushInfoRequest.java
new file mode 100644
index 0000000..92f2d36
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushInfoRequest.java
@@ -0,0 +1,18 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class EventPushInfoRequest {
+
+    private String  eventId;//	String	浜嬩欢鍞竴鏍囪瘑	鏄�	64
+    private String  srcIndex;//	String	浜嬩欢婧愮紪鍙凤紝鐗╃悊璁惧鏄祫婧愮紪鍙�	鏄�	64
+    private String  srcType;//	String	浜嬩欢婧愮被鍨�	鏄�	16
+    private Integer  eventType	;//Number	浜嬩欢绫诲瀷	鏄�
+    private String  srcName;//	String	浜嬩欢婧愬悕绉�	鍚�	64
+    private Integer   status	;//Number	浜嬩欢鐘舵��	鏄�		0-鐬椂1-寮�濮�2-鍋滄3-浜嬩欢鑴夊啿4-浜嬩欢鑱斿姩缁撴灉鏇存柊5-寮傛鍥剧墖涓婁紶
+    private Integer  timeout	;//Number	鑴夊啿瓒呮椂鏃堕棿	鏄�		鍗曚綅锛氱
+    private String  happenTime	;//String	浜嬩欢鍙戠敓鏃堕棿锛堣澶囨椂闂达級	鏄�	64
+    private String   srcParentIndex	;//String	浜嬩欢鍙戠敓鐨勪簨浠舵簮鐖惰澶囩紪鍙�	鍚�	64
+    private EventDeviceDataRequest data;
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushParamRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushParamRequest.java
new file mode 100644
index 0000000..4b168fc
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushParamRequest.java
@@ -0,0 +1,17 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class EventPushParamRequest {
+
+
+    private String   sendTime;//	P	String	浜嬩欢浠庢帴鏀惰�咃紙绋嬪簭澶勭悊鍚庯級鍙戝嚭鐨勬椂闂�	鏄�	32	浜嬩欢鍙戦�佹椂闂�
+    private String    ability;//	P	String	浜嬩欢绫诲埆	鏄�	64	鏍囪瘑鍋滆溅鍦轰簨浠�
+    private String[] uids;//	String[]	鐢ㄦ埛id	鍚�	涓嶉檺
+    private String[] clients	;//String[]	缁勪欢鏍囪瘑	鍚�	涓嶉檺
+    private List<EventPushInfoRequest> events;//	P	Events[]	浜嬩欢淇℃伅	鏄�	涓嶉檺
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushRequest.java
new file mode 100644
index 0000000..1e32ff7
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventPushRequest.java
@@ -0,0 +1,13 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class EventPushRequest {
+
+//    private String  parkIndexCodes	;//	string	False	鍋滆溅搴撳敮涓�鏍囪瘑闆嗗悎  澶氫釜鍊间娇鐢ㄨ嫳鏂囬�楀彿鍒嗛殧锛屼笉瓒呰繃1000涓�
+
+    private String   method	;//	String	鏂规硶鍚嶏紝鐢ㄤ簬鏍囪瘑鎶ユ枃鐢ㄩ��	鏄�	16	浜嬩欢鍥哄畾OnEventNotify
+    private EventPushParamRequest   params	;//	Params	浜嬩欢鍙傛暟淇℃伅	鏄�	涓嶉檺	鍏蜂綋鍙傛暟淇℃伅
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventVisitDataRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventVisitDataRequest.java
new file mode 100644
index 0000000..d0f751f
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/EventVisitDataRequest.java
@@ -0,0 +1,28 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class EventVisitDataRequest {
+    private String   visitorId	;//String	璁垮id	鏄�	64	瀵瑰簲璁垮鏉ヨ璁板綍涓殑orderId瀛楁
+    private String   personName;//	String	濮撳悕	鏄�	32
+    private Integer  sex;//	Number	鎬у埆	鏄�		1-鐢�2-濂�
+    private Integer  idType;//	Number	璇佷欢绫诲瀷	鍚�		111锛氳韩浠借瘉
+    private String   idNo;//	String	璇佷欢鍙风爜	鍚�	64
+    private String   beVisitedPersonName;//	String	琚闂汉濮撳悕	鏄�	64
+    private String   beVisitedPersonOrg	;//String	琚闂汉鎵�灞炵粍缁�	鏄�	64
+    private String   visitorWorkUint;//	String	鏉ヨ鍗曚綅	鍚�	64
+    private String   visitorCode;//	String	璁垮楠岃瘉鐮�	鍚�	64
+    private String   purpose;//	String	鏉ヨ浜嬬敱	鍚�	64
+    private String   signOrg;//	String	璇佷欢绛惧彂鏈哄叧	鍚�	64
+    private String   startTime	;//String	鏉ヨ鏃堕棿	鍚�		ISO8601鏍煎紡锛歽yyy-MM-ddTHH:mm:ss+褰撳墠鏃跺尯    渚嬪鍖椾含鏃堕棿锛� 2018-07-26T15:00:00+08:00
+    private String   endTime;//	String	绂诲紑鏃堕棿	鍚�		ISO8601鏍煎紡锛歽yyy-MM-ddTHH:mm:ss+褰撳墠鏃跺尯    渚嬪鍖椾含鏃堕棿锛� 2018-07-26T15:00:00+08:00
+    private String   phone;//	String	鎵嬫満鍙风爜	鏄�	64
+    private String   carNo;//	String	杞︾墝鍙�	鍚�
+    private String   photoUrl;//	String	鐓х墖uri	鍚�
+    private String   captureUrl;//	String	鎶撴媿鍥剧墖uri	鍚�
+    private String   svrIndexCode;//	String	鍥剧墖瀛樺偍鏈嶅姟鍣ㄥ敮涓�鏍囪瘑	鍚�
+    private String   beVisitedPersonId;//	String	琚闂汉Id	鏄�
+    private String   beVisitedPersonOrgId;//	String	琚闂汉鎵�灞炵粍缁嘔d	鏄�
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/ExtEventCustomerNumInfo.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/ExtEventCustomerNumInfo.java
new file mode 100644
index 0000000..0a92924
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/ExtEventCustomerNumInfo.java
@@ -0,0 +1,13 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class ExtEventCustomerNumInfo<T> {
+
+    private Integer  AccessChannel;//	Number	閫氶亾鍙�	鍚�	32
+    private Integer  EntryTimes	;//Number	杩涗汉鏁�	鍚�	32
+    private Integer  ExitTimes	;//Number	鍑轰汉鏁�	鍚�	32
+    private Integer  TotalTimes	;//Number	鎬婚�氳浜烘暟	鍚�	32
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/ExtEventIdentityCardInfo.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/ExtEventIdentityCardInfo.java
new file mode 100644
index 0000000..a23e527
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/event/ExtEventIdentityCardInfo.java
@@ -0,0 +1,18 @@
+package com.doumee.core.haikang.model.param.request.event;
+
+import lombok.Data;
+
+@Data
+public class ExtEventIdentityCardInfo {
+    private  String Address;//	String	浣忓潃	鍚�	512
+    private  String  Birth;//	String	鍑虹敓鏃ユ湡	鍚�	32	渚嬶細 鈥�1999-6-30鈥�
+    private  String  EndDate;//	String	鏈夋晥鏃ユ湡缁撴潫鏃堕棿	鍚�	32	渚嬶細 鈥�2028-10-12鈥�
+    private  String   IdNum	;//String	韬唤璇乮d	鍚�	32
+    private  String   IssuingAuthority;//	String	绛惧彂鏈哄叧	鍚�	32
+    private  String   Name;//	String	濮撳悕	鍚�	32
+    private Integer Nation	;//Number		鍚�	32	0-鏈煡
+    private Integer   Sex;//	Number	鎬у埆	鍚�	32	鎬у埆0-鏈煡1-鐢�2-濂�
+    private  String  StartDate;//	String	鏈夋晥鏃ユ湡寮�濮嬫椂闂�	鍚�	32	渚嬶細 鈥�2018-10-12鈥�
+    private Integer TermOfValidity;//	Number	鏄惁闀挎湡鏈夋晥	鍚�	32	0-鍚︼紙鏈夋晥鎴鏃ユ湡鏈夋晥锛�            1-鏄紙鏈夋晥鎴鏃ユ湡鏃犳晥锛�
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
index 0ccc401..d0f68a9 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -9,6 +9,8 @@
 import com.doumee.core.haikang.model.HKTools;
 import com.doumee.core.haikang.model.param.BaseRequst;
 import com.doumee.core.haikang.model.param.BaseResponse;
+import com.doumee.dao.business.model.InterfaceLog;
+import com.doumee.service.business.InterfaceLogService;
 import com.hikvision.artemis.sdk.config.ArtemisConfig;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -21,9 +23,9 @@
 import com.alibaba.fastjson.TypeReference;
 
 import java.io.InputStream;
+import java.util.Date;
 import java.util.List;
 
-//@Service
 @Slf4j
 public class HKService {
     private Logger logger = LoggerFactory.getLogger(HKService.class);
@@ -44,7 +46,6 @@
             log.error("銆愭捣搴疯幏鍙栨牴缁勭粐銆�================澶辫触====锛歕n"+ e.getMessage());
         }
         return  null;
-
     }
     /**
      * 淇敼缁勭粐鏁版嵁
@@ -431,8 +432,9 @@
      */
     public  static  BaseResponse   eventSub(EventSubRequest param){
         log.error("銆愭捣搴蜂簨浠惰闃呫��================寮�濮�===="+JSONObject.toJSONString(param));
+        String res = null;
         try {
-            String res = HKTools.eventSub(JSONObject.toJSONString(param));
+            res = HKTools.eventSub(JSONObject.toJSONString(param));
             TypeReference typeReference =
                     new TypeReference< BaseResponse >(){};
             BaseResponse   result = JSONObject.parseObject(res, typeReference.getType());
@@ -440,6 +442,8 @@
             return  result;
         }catch (Exception e){
             log.error("銆愭捣搴蜂簨浠惰闃呫��================澶辫触====锛歕n"+ e.getMessage());
+        }finally {
+           // saveInterfaceLog(param,res);
         }
         return  null;
     }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java b/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
index 697fc13..6ad128e 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -20,6 +20,7 @@
     public static final String HK_APPSECRET ="HK_APPSECRET" ;
     public static final String HK_HTTPS ="HK_HTTPS" ;
     public static final String HK_PUSH_URL = "HK_PUSH_URL";
+    public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ;
 
     /**
      * mq tag
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/InterfaceLog.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/InterfaceLog.java
index 76925a7..92f9d32 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/InterfaceLog.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/InterfaceLog.java
@@ -61,8 +61,7 @@
 
     @ApiModelProperty(value = "鍦板潃淇℃伅")
     @ExcelColumn(name="鍦板潃淇℃伅")
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    private Date url;
+    private String url;
 
     @ApiModelProperty(value = "璇锋眰鍙傛暟")
     @ExcelColumn(name="璇锋眰鍙傛暟")
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/InterfaceLogServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/InterfaceLogServiceImpl.java
index 91667f8..3339db5 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/InterfaceLogServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/InterfaceLogServiceImpl.java
@@ -119,8 +119,7 @@
             queryWrapper.lambda().eq(InterfaceLog::getName, pageWrap.getModel().getName());
         }
         if (pageWrap.getModel().getUrl() != null) {
-            queryWrapper.lambda().ge(InterfaceLog::getUrl, Utils.Date.getStart(pageWrap.getModel().getUrl()));
-            queryWrapper.lambda().le(InterfaceLog::getUrl, Utils.Date.getEnd(pageWrap.getModel().getUrl()));
+            queryWrapper.lambda().like(InterfaceLog::getUrl, pageWrap.getModel().getUrl());
         }
         if (pageWrap.getModel().getRequest() != null) {
             queryWrapper.lambda().eq(InterfaceLog::getRequest, pageWrap.getModel().getRequest());
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java
index 9d7aed7..e1db654 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java
@@ -8,12 +8,14 @@
 import com.doumee.core.haikang.model.param.BaseResponse;
 import com.doumee.core.haikang.model.param.request.EventSubRequest;
 import com.doumee.core.haikang.model.param.request.PrivilegeGroupRequest;
+import com.doumee.core.haikang.model.param.respose.OrgListResponse;
 import com.doumee.core.haikang.model.param.respose.PrivilegeGroupInfoResponse;
 import com.doumee.core.haikang.model.param.respose.PrivilegeGroupListResponse;
 import com.doumee.core.haikang.service.HKService;
 import com.doumee.core.utils.Constants;
 import com.doumee.dao.business.DeviceRoleMapper;
 import com.doumee.dao.business.model.DeviceRole;
+import com.doumee.dao.system.model.SystemDictData;
 import com.hikvision.artemis.sdk.config.ArtemisConfig;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,8 +45,28 @@
         HKConstants.https = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HTTPS).getCode();
         //寮�濮嬭闃呴棬绂佷簨浠躲�佽瀹簨浠躲�佸拰鍋滆溅鍦轰簨浠�
         startHkEventSub();
+        //鑾峰彇鏍圭粍缁囩紪鐮�
+        getRootOrgCode();
         return  0;
     }
+    /**
+     *    鑾峰彇鏍圭粍缁囩紪鐮�
+     */
+    private void getRootOrgCode() {
+        SystemDictData org =  systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_ROOTORG_CODE);
+        if(org!=null){
+            String rootOrgId =org.getCode();
+            if(StringUtils.isBlank(rootOrgId)){
+                BaseResponse<OrgListResponse> res = HKService.getRootOrg(null);
+                if(res !=null && res.getData()!=null && StringUtils.isNotBlank(res.getData().getOrgIndexCode())){
+                    org.setCode(res.getData().getOrgIndexCode());
+                    org.setUpdateTime(new Date());
+                    systemDictDataBiz.updateById( org);
+                }
+            }
+        }
+
+    }
 
     /**
      * 璁㈤槄闂ㄧ浜嬩欢銆佽瀹簨浠躲�佸拰鍋滆溅鍦轰簨浠�

--
Gitblit v1.9.3