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); } } 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); } } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
@@ -20,7 +20,9 @@ * æ¥å£å°åéå */ public interface InterfacePath{ String doorEvents = "/api/acs/v2/door/events";//é¨ç¦äºä»¶æ¥è¯¢ // String doorEvents = "/api/acs/v2/door/events";//é¨ç¦äºä»¶æ¥è¯¢ // String visitEvents = "/api/visitor/v1/event/turnover/search";//访客äºä»¶æ¥è¯¢ // String parkEvents = "/api/pms/v1/crossRecords/page";//å车åºäºä»¶æ¥è¯¢ String rootOrg = "/api/resource/v1/org/rootOrg";//è·åè·ç»ç» String addBatchOrg = "/api/resource/v1/org/batch/add";//æ¹éæ°å¢ç»ç» String delBatchOrg = "/api/resource/v1/org/batch/delete";//æ¹éå é¤ç»ç» @@ -45,11 +47,65 @@ String visitCancel= "/api/visitor/v1/appointment/cancel";//åæ¶è®¿å®¢é¢çº¦ String facePicture= "/api/resource/v1/person/picture";//æåç¨æ·äººè¸ç §ç String privilegeGroup= "/api/visitor/v1/privilege/group";//æ¥è¯¢è®¿å®¢æéç» String eventSub= "/api/eventService/v1/eventSubscriptionByEventTypes";//äºä»¶è®¢é } /** * é¡è²æä¸¾ */ public enum EventTypes { PARK_LINE_IN(771760130, "å ¥åºå线äºä»¶" ), PARK_PASS_IN(771760131, "å ¥åºæ¾è¡äºä»¶" ), PARK_LINE_OUT(771760133, "åºåºå线äºä»¶" ), PARK_PASS_OUT(771760134, "åºåºæ¾è¡äºä»¶" ), VISIT_SIGN_IN(1392513025, "访客ç»è®°" ), VISIT_SIGN_OUT(1392513026, "访客ç¾ç¦»" ), DOOR_FACE_AUTH_FAIL(197163, "人è¸è®¤è¯å¤±è´¥" ), DOOR_FACE_AUTH_SUCCESS(196893, "人è¸è®¤è¯éè¿" ) ; // æååé private String name; private int key; // æé æ¹æ³ EventTypes(int key, String name ) { this.name = name; this.key = key; } // æ®éæ¹æ³ public static String getName(int index) { for (Constants.UserType c : Constants.UserType.values()) { if (c.getKey() == index) { return c.getName(); } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public void setKey(int key) { this.key = key; } } /** * é¡è²æä¸¾ */ public enum Colors { SYSTEM(0, "ç³»ç»ç¨æ·" ) 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,18 @@ 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; } /** * äºä»¶è®¢é * @param body * @return */ 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; } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/EventSubRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class EventSubRequest { private String name ;//string False åç§°ï¼æ¨¡ç³æç´¢ï¼æå¤§é¿åº¦32ï¼è¥å å«ä¸æï¼æå¤§é¿åº¦æä¸è¶ è¿æç §æå®ç¼ç çåèé¿åº¦ï¼å³getBytes(âutf-8â).length private Integer[] eventTypes;// number[] True äºä»¶ç±»å,详è§éå½D private String eventDest;// string True æå®äºä»¶æ¥æ¶çå°åï¼éç¨restfulåè°æ¨¡å¼ï¼æ¯æhttpåhttpsï¼æ ·å¼å¦ä¸ï¼http://ip:port/eventRcvæè https://ip:port/eventRcvä¸è¶ è¿1024个å符äºä»¶æ¥æ¶å°åç±åºç¨æ¹è´è´£ææå®çè§èæä¾ï¼äºä»¶æ¥æ¶æ¥å£ä¸éè¦è®¤è¯ä¸æ¹å®¢æ·æ¶å°æ¶æ¯ï¼è¯·æ³¨æç«å³è¿åHTTP/1.1 200 OKï¼ å¦åå ä¸ºæ¥æ¶å¤ªæ ¢ï¼å¯¼è´äºä»¶ç§¯å private Integer[] subType;// number False 订é ç±»åï¼0-订é åå§äºä»¶ï¼1-èå¨äºä»¶ï¼2-åå§äºä»¶åèå¨äºä»¶ï¼ä¸å¡«ä½¿ç¨é»è®¤å¼0 private Integer[] eventLvl;// number[] False äºä»¶ç级ï¼0-æªé ç½®ï¼1-ä½ï¼2-ä¸ï¼3-é« æ¤å¤äºä»¶ççº§æ¯æå¨äºä»¶èå¨ä¸é ç½®çç级订é ç±»å为0æ¶ï¼æ¤åæ°æ æï¼ä½¿ç¨é»è®¤å¼0å¨è®¢é ç±»å为1æ¶ï¼ä¸å¡«ä½¿ç¨é»è®¤å¼[1,2,3] å¨è®¢é ç±»å为2æ¶ï¼ä¸å¡«ä½¿ç¨é»è®¤å¼[0,1,2,3]æ°ç»å¤§å°ä¸è¶ è¿32ï¼äºä»¶ç级大å°ä¸è¶ è¿31 } 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 äºä»¶ç±»å代ç å¦ 32 åè§éå½D.2.1.1 é¨ç¦äºä»¶ç±»å private Integer ExtEventDoorID;// Number é¨ç¼å· å¦ 32 private String ExtEventIDCardPictureURL;// String 身份è¯å¾çURL å¦ 200 private Integer ExtEventInOut;// Number è¿åºæ¹å å¦ 32 è¿åºç±»å1ï¼è¿0ï¼åº-1:æªç¥ è¦æ±ï¼è¿é¨è¯»å¡å¨æ¨ç 设置为1ï¼åºé¨è¯»å¡å¨æ¨ç 设置为2 private Integer ExtEventLocalControllerID;// Number 就尿§å¶å¨id å¦ 32 就尿§å¶å¨ç¼å·,0-é¨ç¦ä¸»æº,1-255ä»£è¡¨å°±å°æ§å¶å¨ private Integer ExtEventMainDevID;// Number ä¸»è®¾å¤æ¨ç å¦ 32 private String ExtEventPersonNo;// String 人åç¼å· å¦ 32 以人为ä¸å¿è®¾å¤ä¼ä¸æ¥ private String ExtEventPictureURL;// String å¾ççurl å¦ 32 private Integer ExtEventReaderID;// Number 读å¡å¨id å¦ 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 ç¨äºç»è®¡äºä»¶ä¸æ¥å»¶æ¶ï¼Unixæ¶é´æ³ï¼ç²¾ç¡®å°å¾®ç§ï¼ä¾ï¼ "1558576265810000"代表 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 } 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 åºå ¥å£ç¼å· æ¯ 64 private String gateName;// String åºå ¥å£åç§° æ¯ 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 æ¾è¡ç»ææ°æ® } 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 ;// æ¾è¡ç»ææ°æ® æ¯ } 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 } 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 æ¾è¡æ¹å¼ } 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; } 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[] äºä»¶ä¿¡æ¯ æ¯ ä¸é } 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 äºä»¶åæ°ä¿¡æ¯ æ¯ ä¸é å ·ä½åæ°ä¿¡æ¯ } 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æ ¼å¼ï¼yyyy-MM-ddTHH:mm:ss+å½åæ¶åº ä¾å¦å京æ¶é´ï¼ 2018-07-26T15:00:00+08:00 private String endTime;// String ç¦»å¼æ¶é´ å¦ ISO8601æ ¼å¼ï¼yyyy-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 被访é®äººæå±ç»ç»Id æ¯ } 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 } 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 身份è¯id å¦ 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-æ¯ï¼æææªæ¢æ¥ææ æï¼ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -9,8 +9,11 @@ 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; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -20,47 +23,35 @@ 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); @Autowired private SystemDictDataBiz systemDictDataBiz; @PostConstruct public int initHkConfig(){ 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(); return 0; } /** * è·åæ ¹ç»ç»æ°æ® * @return */ public BaseResponse<OrgListResponse> getRootOrg(BaseRequst param){ public static BaseResponse<OrgListResponse> getRootOrg(BaseRequst param){ log.error("ãæµ·åº·è·åæ ¹ç»ç»ã================å¼å§===="); try { String res = HKTools.getRootOrg (); TypeReference typeReference = new TypeReference< BaseResponse<OrgListResponse>>(){}; BaseResponse<OrgListResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è·åæ ¹ç»ç»ã================æå====\n"+res); logResult(result,"海康è·åæ ¹ç»ç»"); return result; }catch (Exception e){ log.error("ãæµ·åº·è·åæ ¹ç»ç»ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** * ä¿®æ¹ç»ç»æ°æ® * @return */ public BaseResponse editOrg(OrgEditRequest param){ public static BaseResponse editOrg(OrgEditRequest param){ log.error("ãæµ·åº·ä¿®æ¹ç»ç»ã================å¼å§===="+JSONObject.toJSONString(param)); try { @@ -68,7 +59,7 @@ TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·ä¿®æ¹ç»ç»ã================æå====\n"+res); logResult(result,"海康修æ¹ç»ç»"); return result; }catch (Exception e){ log.error("ãæµ·åº·ä¿®æ¹ç»ç»ã================失败====ï¼\n"+ e.getMessage()); @@ -79,7 +70,7 @@ *æ¹éæ°å¢ç»ç»æ°æ® * @return */ public BaseResponse<OrgOrUserAddResponse> addBatchOrg(List<OrgAddRequest> param){ public static BaseResponse<OrgOrUserAddResponse> addBatchOrg(List<OrgAddRequest> param){ log.error("ãæµ·åº·æ°å¢ç»ç»ã================å¼å§===="+JSONObject.toJSONString(param)); try { @@ -87,7 +78,7 @@ TypeReference typeReference = new TypeReference< BaseResponse<OrgOrUserAddResponse>>(){}; BaseResponse<OrgOrUserAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ°å¢ç»ç»ã================æå====\n"+res); logResult(result,"海康æ°å¢ç»ç»"); return result; }catch (Exception e){ log.error("ãæµ·åº·æ°å¢ç»ç»ã================失败====ï¼\n"+ e.getMessage()); @@ -98,7 +89,7 @@ *æ¹éå é¤ç»ç»æ°æ® * @return */ public BaseResponse delBatchOrg(OrgDelRequest param){ public static BaseResponse delBatchOrg(OrgDelRequest param){ log.error("ãæµ·åº·å é¤ç»ç»ã================å¼å§===="+JSONObject.toJSONString(param)); try { @@ -106,7 +97,7 @@ TypeReference typeReference = new TypeReference< BaseResponse >(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·å é¤ç»ç»ã================æå====\n"+res); logResult(result,"海康å é¤ç»ç»"); return result; }catch (Exception e){ log.error("ãæµ·åº·å é¤ç»ç»ã================失败====ï¼\n"+ e.getMessage()); @@ -117,14 +108,14 @@ *æ°å¢äººåä¿¡æ¯ï¼æ¯æäººè¸æ°æ®ï¼ * @return */ public BaseResponse<UserAddResponse> addUser(UserAddRequest param){ public static BaseResponse<UserAddResponse> addUser(UserAddRequest param){ log.error("ãæµ·åº·æ°å¢äººåã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.addUser(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<UserAddResponse>>(){}; BaseResponse<UserAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ°å¢äººåã================æå====\n"+res); logResult(result,"海康æ°å¢äººå"); return result; }catch (Exception e){ log.error("ãæµ·åº·æ°å¢äººåã================失败====ï¼\n"+ e.getMessage()); @@ -135,14 +126,14 @@ *ä¿®æ¹äººåä¿¡æ¯ï¼ä¸æ¯æäººè¸æ°æ®ï¼ * @return */ public BaseResponse editUser(UserAddRequest param){ public static BaseResponse editUser(UserAddRequest param){ log.error("ãæµ·åº·ä¿®æ¹äººåã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.editUser(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<UserAddResponse>>(){}; BaseResponse<UserAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·ä¿®æ¹äººåã================æå====\n"+res); logResult(result,"海康修æ¹äººå"); return result; }catch (Exception e){ log.error("ãæµ·åº·ä¿®æ¹äººåã================失败====ï¼\n"+ e.getMessage()); @@ -153,14 +144,14 @@ *æ¹éæ°å¢äººåä¿¡æ¯(æ 人è¸ï¼ * @return */ public BaseResponse<OrgOrUserAddResponse> addBatchUser(List<UserAddRequest> param){ public static BaseResponse<OrgOrUserAddResponse> addBatchUser(List<UserAddRequest> param){ log.error("ãæµ·åº·æ¹éæ°å¢äººåã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.addBatchUser(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<OrgOrUserAddResponse>>(){}; BaseResponse<OrgOrUserAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ¹éæ°å¢äººåã================æå====\n"+res); logResult(result,"海康æ¹éæ°å¢äººå"); return result; }catch (Exception e){ log.error("ãæµ·åº·æ¹éæ°å¢äººåã================失败====ï¼\n"+ e.getMessage()); @@ -171,14 +162,14 @@ *æ¹éå é¤äººåä¿¡æ¯ * @return */ public BaseResponse<OrgOrUserAddFailureResponse> delBatchUser(List<UserAddRequest> param){ public static BaseResponse<OrgOrUserAddFailureResponse> delBatchUser(List<UserAddRequest> param){ log.error("ãæµ·åº·æ¹éæ°å¢äººåã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.delBatchUser(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<OrgOrUserAddFailureResponse>>(){}; BaseResponse<OrgOrUserAddFailureResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ¹éæ°å¢äººåã================æå====\n"+res); logResult(result,"海康æ¹éæ°å¢äººå"); return result; }catch (Exception e){ log.error("ãæµ·åº·æ¹éæ°å¢äººåã================失败====ï¼\n"+ e.getMessage()); @@ -189,14 +180,14 @@ *æ·»å 人è¸ä¿¡æ¯ * @return */ public BaseResponse<FaceAddOrEditesponse> addFace(List<FaceAddRequest> param){ public static BaseResponse<FaceAddOrEditesponse> addFace(List<FaceAddRequest> param){ log.error("ãæµ·åº·æ·»å 人è¸ä¿¡æ¯ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.addFace(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; BaseResponse<FaceAddOrEditesponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ·»å 人è¸ä¿¡æ¯ã================æå====\n"+res); logResult(result,"海康添å 人è¸ä¿¡æ¯"); return result; }catch (Exception e){ log.error("ãæµ·åº·æ·»å 人è¸ä¿¡æ¯ã================失败====ï¼\n"+ e.getMessage()); @@ -207,14 +198,14 @@ *ç¼è¾äººè¸ä¿¡æ¯ * @return */ public BaseResponse<FaceAddOrEditesponse> editFace(List<FaceEditRequest> param){ public static BaseResponse<FaceAddOrEditesponse> editFace(List<FaceEditRequest> param){ log.error("ãæµ·åº·ç¼è¾äººè¸ä¿¡æ¯ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.editFace(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; BaseResponse<FaceAddOrEditesponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·ç¼è¾äººè¸ä¿¡æ¯ã================æå====\n"+res); logResult(result,"海康ç¼è¾äººè¸ä¿¡æ¯"); return result; }catch (Exception e){ log.error("ãæµ·åº·ç¼è¾äººè¸ä¿¡æ¯ã================失败====ï¼\n"+ e.getMessage()); @@ -225,14 +216,14 @@ *å é¤äººè¸ä¿¡æ¯ * @return */ public BaseResponse delFace(List<FaceEditRequest> param){ public static BaseResponse delFace(List<FaceEditRequest> param){ log.error("ãæµ·åº·å é¤äººè¸ä¿¡æ¯ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.editFace(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·å é¤äººè¸ä¿¡æ¯ã================æå====\n"+res); logResult(result,"海康å é¤äººè¸ä¿¡æ¯"); return result; }catch (Exception e){ log.error("ãæµ·åº·å é¤äººè¸ä¿¡æ¯ã================失败====ï¼\n"+ e.getMessage()); @@ -259,14 +250,14 @@ *è·å车åºåè¡¨æ°æ®ï¼å ¨éï¼ * @return */ public BaseResponse<List<ParkListResponse>> parkList(ParkListRequest param){ public static BaseResponse<List<ParkListResponse>> parkList(ParkListRequest param){ log.error("ãæµ·è·å车åºåè¡¨æ°æ®ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.parkList(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<List<ParkListResponse>>>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è·å车åºåè¡¨æ°æ®ã================æå====\n"+res); logResult(result,"海康è·å车åºåè¡¨æ°æ®"); return result; }catch (Exception e){ log.error("ãæµ·åº·è·å车åºåè¡¨æ°æ®ã================失败====ï¼\n"+ e.getMessage()); @@ -277,14 +268,14 @@ *è·å车åºåè¡¨æ°æ®ï¼å ¨éï¼ * @return */ public BaseResponse<List<EntranceListResponse>> entranceList(EntranceListRequest param){ public static BaseResponse<List<EntranceListResponse>> entranceList(EntranceListRequest param){ log.error("ãæµ·è·å车åºåè¡¨æ°æ®ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.entranceList(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<List<EntranceListResponse>>>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è·å车åºåè¡¨æ°æ®ã================æå====\n"+res); logResult(result,"海康è·å车åºåè¡¨æ°æ®"); return result; }catch (Exception e){ log.error("ãæµ·åº·è·å车åºåè¡¨æ°æ®ã================失败====ï¼\n"+ e.getMessage()); @@ -295,14 +286,14 @@ *åºå®è½¦è¾å å¼ï¼å æï¼ * @return */ public BaseResponse carChargeAddtion(CarChargeAddRequest param){ public static BaseResponse carChargeAddtion(CarChargeAddRequest param){ log.error("ãæµ·åº·åºå®è½¦è¾å å¼ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.carChargeAddtion(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·åºå®è½¦è¾å å¼ã================æå====\n"+res); logResult(result,"海康åºå®è½¦è¾å å¼"); return result; }catch (Exception e){ log.error("ãæµ·åº·åºå®è½¦è¾å å¼ã================失败====ï¼\n"+ e.getMessage()); @@ -313,14 +304,14 @@ *åºå®è½¦è¾åæ¶å æ * @return */ public BaseResponse carChargeDeletion(CarChargeDelRequest param){ public static BaseResponse carChargeDeletion(CarChargeDelRequest param){ log.error("ãæµ·åº·åºå®è½¦è¾åæ¶å æã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.carChargeDeletion(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·åºå®è½¦è¾åæ¶å æã================æå====\n"+res); logResult(result,"海康åºå®è½¦è¾åæ¶å æ"); return result; }catch (Exception e){ log.error("ãæµ·åº·åºå®è½¦è¾åæ¶å æã================失败====ï¼\n"+ e.getMessage()); @@ -331,14 +322,14 @@ *车ä½é¢çº¦ * @return */ public BaseResponse<ParkReservationAddResponse> parkReservationAddition(ParkReservationAddRequest param){ public static BaseResponse<ParkReservationAddResponse> parkReservationAddition(ParkReservationAddRequest param){ log.error("ãæµ·åº·è½¦ä½é¢çº¦ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.parkAddition(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<ParkReservationAddResponse>>(){}; BaseResponse<ParkReservationAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è½¦ä½é¢çº¦ã================æå====\n"+res); logResult(result,"海康车ä½é¢çº¦"); return result; }catch (Exception e){ log.error("ãæµ·åº·è½¦ä½é¢çº¦ã================失败====ï¼\n"+ e.getMessage()); @@ -349,14 +340,14 @@ *车ä½åæ¶é¢çº¦ * @return */ public BaseResponse parkReservationDeletion(ParkReservationDelRequest param){ public static BaseResponse parkReservationDeletion(ParkReservationDelRequest param){ log.error("ãæµ·åº·è½¦ä½åæ¶é¢çº¦ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.carChargeDeletion(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è½¦ä½åæ¶é¢çº¦ã================æå====\n"+res); logResult(result,"海康车ä½åæ¶é¢çº¦"); return result; }catch (Exception e){ log.error("ãæµ·åº·è½¦ä½åæ¶é¢çº¦ã================失败====ï¼\n"+ e.getMessage()); @@ -367,14 +358,14 @@ *访客é¢çº¦ * @return */ public BaseResponse<VisitAppointmentResponse> visitAppiontment(VisitAppointmentRequest param){ public static BaseResponse<VisitAppointmentResponse> visitAppiontment(VisitAppointmentRequest param){ log.error("ãæµ·åº·è®¿å®¢é¢çº¦ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.visitAppiontment(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<VisitAppointmentResponse>>(){}; BaseResponse<VisitAppointmentResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è®¿å®¢é¢çº¦ã================æå====\n"+res); logResult(result,"海康访客é¢çº¦"); return result; }catch (Exception e){ log.error("ãæµ·åº·è®¿å®¢é¢çº¦ã================失败====ï¼\n"+ e.getMessage()); @@ -385,14 +376,14 @@ *访客å ç»è®°é¢çº¦ * @return */ public BaseResponse<VisitAppointmentVistorResponse> visitAppiontmentMDJ(VisitAppointmentMDJRequest param){ public static BaseResponse<VisitAppointmentVistorResponse> visitAppiontmentMDJ(VisitAppointmentMDJRequest param){ log.error("ãæµ·åº·è®¿å®¢å ç»è®°é¢çº¦ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.visitAppiontmentMDJ(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<VisitAppointmentVistorResponse> >(){}; BaseResponse<VisitAppointmentVistorResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è®¿å®¢å ç»è®°é¢çº¦ã================æå====\n"+res); logResult(result,"海康访客å ç»è®°é¢çº¦"); return result; }catch (Exception e){ log.error("ãæµ·åº·è®¿å®¢å ç»è®°é¢çº¦ã================失败====ï¼\n"+ e.getMessage()); @@ -403,14 +394,14 @@ *访客æéç»å表æ¥è¯¢ï¼åé¡µï¼ * @return */ public BaseResponse<PrivilegeGroupListResponse> privilegeGroup(PrivilegeGroupRequest param){ public static BaseResponse<PrivilegeGroupListResponse> privilegeGroup(PrivilegeGroupRequest param){ log.error("ãæµ·åº·è®¿å®¢æéç»å表æ¥è¯¢ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.privilegeGroup(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<PrivilegeGroupListResponse> >(){}; BaseResponse<PrivilegeGroupListResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è®¿å®¢æéç»å表æ¥è¯¢ã================æå====\n"+res); logResult(result,"海康访客æéç»å表æ¥è¯¢"); return result; }catch (Exception e){ log.error("ãæµ·åº·è®¿å®¢æéç»å表æ¥è¯¢ã================失败====ï¼\n"+ e.getMessage()); @@ -421,20 +412,49 @@ *é¨ç¦è®¾å¤æ¥è¯¢ï¼åé¡µï¼ * @return */ public BaseResponse<AcsDeviceListResponse> acsDeviceList(AcsDeviceListRequest param){ public static BaseResponse<AcsDeviceListResponse> acsDeviceList(AcsDeviceListRequest param){ log.error("ãæµ·åº·é¨ç¦è®¾å¤æ¥è¯¢ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.acsDeviceList(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<AcsDeviceListResponse> >(){}; BaseResponse<AcsDeviceListResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·é¨ç¦è®¾å¤æ¥è¯¢ã================æå====\n"+res); logResult(result,"海康é¨ç¦è®¾å¤æ¥è¯¢"); return result; }catch (Exception e){ log.error("ãæµ·åº·é¨ç¦è®¾å¤æ¥è¯¢ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *äºä»¶è®¢é * @return */ public static BaseResponse eventSub(EventSubRequest param){ log.error("ãæµ·åº·äºä»¶è®¢é ã================å¼å§===="+JSONObject.toJSONString(param)); String res = null; try { res = HKTools.eventSub(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse >(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); logResult(result,"海康äºä»¶è®¢é "); return result; }catch (Exception e){ log.error("ãæµ·åº·äºä»¶è®¢é ã================失败====ï¼\n"+ e.getMessage()); }finally { // saveInterfaceLog(param,res); } return null; } private static void logResult(BaseResponse res,String name) { if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){ log.info("ã"+name+"ã================æå====\n"+res); }else{ log.error("ã"+name+"ã================失败====ï¼\n"+ res); } } } server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -19,6 +19,8 @@ public static final String HK_APPKEY ="HK_APPKEY" ; 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 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="请æ±åæ°") server/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
@@ -40,8 +40,6 @@ @Autowired private DeviceMapper deviceMapper; @Autowired private HKService hkService; @Override public Integer create(Device device) { 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()); server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncBaseServiceImpl.java
@@ -1,10 +1,12 @@ package com.doumee.service.business.impl.hksync; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; import com.doumee.core.haikang.model.HKConstants; import com.doumee.core.haikang.model.param.BaseResponse; import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; import com.doumee.core.haikang.model.param.request.EventSubRequest; import com.doumee.core.haikang.model.param.request.ParkListRequest; import com.doumee.core.haikang.model.param.request.PrivilegeGroupRequest; import com.doumee.core.haikang.model.param.respose.AcsDeviceInfoResponse; @@ -18,10 +20,12 @@ import com.doumee.dao.business.model.Device; import com.doumee.dao.business.model.Parks; import com.doumee.service.business.HkSyncService; import com.hikvision.artemis.sdk.config.ArtemisConfig; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -33,9 +37,6 @@ */ @Service public class HkSyncBaseServiceImpl implements HkSyncService { @Autowired public HKService hkService; /** * åæ¥æµ·åº·åè½¦åºæ°æ® server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncDeviceServiceImpl.java
@@ -58,7 +58,7 @@ param = new AcsDeviceListRequest(); param.setPageNo(curPage); param.setPageSize(10000); BaseResponse<AcsDeviceListResponse> response = hkService.acsDeviceList(param); BaseResponse<AcsDeviceListResponse> response = HKService.acsDeviceList(param); if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼æµ·åº·åæ¥æ°æ®å¤±è´¥~"); } server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,87 @@ package com.doumee.service.business.impl.hksync; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; import com.doumee.core.haikang.model.HKConstants; 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; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * 海康äºä»¶è®¢é 表Serviceå®ç° * @author æ±è¹è¹ * @date 2023/11/30 15:33 */ @Service public class HkSyncEventServiceImpl extends HkSyncBaseServiceImpl { @Autowired private SystemDictDataBiz systemDictDataBiz; @PostConstruct public int initHkConfig(){ 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(); //å¼å§è®¢é é¨ç¦äºä»¶ã访客äºä»¶ãåå车åºäºä»¶ 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); } } } } /** * 订é é¨ç¦äºä»¶ã访客äºä»¶ãåå车åºäºä»¶ */ public void startHkEventSub(){ EventSubRequest param = new EventSubRequest(); param.setEventDest(systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_PUSH_URL).getCode()); param.setEventTypes(new Integer[]{HKConstants.EventTypes.PARK_LINE_IN.getKey() ,HKConstants.EventTypes.PARK_LINE_OUT.getKey() ,HKConstants.EventTypes.PARK_PASS_IN.getKey() ,HKConstants.EventTypes.PARK_PASS_OUT.getKey() ,HKConstants.EventTypes.VISIT_SIGN_OUT.getKey() ,HKConstants.EventTypes.VISIT_SIGN_OUT.getKey() ,HKConstants.EventTypes.DOOR_FACE_AUTH_SUCCESS.getKey()}); HKService.eventSub(param); } } server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncParkServiceImpl.java
@@ -51,7 +51,7 @@ List<Parks> allList = parksMapper.selectList(null); //å页éåå¾ªç¯æ¥è¯¢ææé¨ç¦è®¾å¤æ°æ® param = new ParkListRequest(); BaseResponse<List<ParkListResponse>> response = hkService.parkList(param); BaseResponse<List<ParkListResponse>> response = HKService.parkList(param); if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼æµ·åº·åæ¥æ°æ®å¤±è´¥~"); } server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPrivilegeServiceImpl.java
@@ -6,13 +6,11 @@ import com.doumee.core.haikang.model.HKConstants; import com.doumee.core.haikang.model.param.BaseResponse; import com.doumee.core.haikang.model.param.request.PrivilegeGroupRequest; import com.doumee.core.haikang.model.param.respose.AcsDeviceInfoResponse; 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.core.utils.DateUtil; import com.doumee.dao.business.DeviceRoleMapper; import com.doumee.dao.business.model.Device; import com.doumee.dao.business.model.DeviceRole; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -58,7 +56,7 @@ param = new PrivilegeGroupRequest(); param.setPageNo(curPage); param.setPageSize(10000); BaseResponse<PrivilegeGroupListResponse> response = hkService.privilegeGroup(param); BaseResponse<PrivilegeGroupListResponse> response = HKService.privilegeGroup(param); if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼æµ·åº·åæ¥æ°æ®å¤±è´¥~"); }