From 72b4263800a376a998455d4ef11ed2321282a1e9 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 22 十二月 2023 17:21:30 +0800
Subject: [PATCH] 海康接口对接开发
---
server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java | 443 +++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 349 insertions(+), 94 deletions(-)
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 4e57687..ea9dc00 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
@@ -1,74 +1,55 @@
package com.doumee.core.haikang.service;
import com.alibaba.fastjson.JSONObject;
-import com.doumee.biz.system.SystemDictDataBiz;
-import com.doumee.core.haikang.model.param.request.*;
-import com.doumee.core.haikang.model.param.respose.*;
-import com.doumee.core.utils.Constants;
+import com.alibaba.fastjson.TypeReference;
import com.doumee.core.haikang.model.HKConstants;
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.hikvision.artemis.sdk.config.ArtemisConfig;
+import com.doumee.core.haikang.model.param.request.*;
+import com.doumee.core.haikang.model.param.respose.*;
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;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import com.alibaba.fastjson.TypeReference;
import java.io.InputStream;
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){
- log.error("銆愭捣搴疯幏鍙栨牴缁勭粐銆�================寮�濮�====");
+ public static BaseResponse<OrgListResponse> getRootOrg(BaseRequst param){
+ log.info("銆愭捣搴疯幏鍙栨牴缁勭粐銆�================寮�濮�====");
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){
- log.error("銆愭捣搴蜂慨鏀圭粍缁囥��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse editOrg(OrgEditRequest param){
+ log.info("銆愭捣搴蜂慨鏀圭粍缁囥��================寮�濮�===="+JSONObject.toJSONString(param));
try {
String res = HKTools.editOrg(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());
@@ -79,15 +60,14 @@
*鎵归噺鏂板缁勭粐鏁版嵁
* @return
*/
- public BaseResponse<OrgOrUserAddResponse> addBatchOrg(List<OrgAddRequest> param){
- log.error("銆愭捣搴锋柊澧炵粍缁囥��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<OrgOrUserAddResponse> addBatchOrg(List<OrgAddRequest> param){
+ log.info("銆愭捣搴锋柊澧炵粍缁囥��================寮�濮�===="+JSONObject.toJSONString(param));
try {
-
String res = HKTools.addBatchOrg(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());
@@ -98,15 +78,15 @@
*鎵归噺鍒犻櫎缁勭粐鏁版嵁
* @return
*/
- public BaseResponse delBatchOrg(OrgDelRequest param){
- log.error("銆愭捣搴峰垹闄ょ粍缁囥��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<List<OrgUpdateFailureResponse>> delBatchOrg(OrgDelRequest param){
+ log.info("銆愭捣搴峰垹闄ょ粍缁囥��================寮�濮�===="+JSONObject.toJSONString(param));
try {
String res = HKTools.delOrg(JSONObject.toJSONString(param));
TypeReference typeReference =
new TypeReference< BaseResponse >(){};
- BaseResponse result = JSONObject.parseObject(res, typeReference.getType());
- log.error("銆愭捣搴峰垹闄ょ粍缁囥��================鎴愬姛====\n"+res);
+ BaseResponse<List<OrgUpdateFailureResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鍒犻櫎缁勭粐");
return result;
}catch (Exception e){
log.error("銆愭捣搴峰垹闄ょ粍缁囥��================澶辫触====锛歕n"+ e.getMessage());
@@ -117,14 +97,14 @@
*鏂板浜哄憳淇℃伅锛堟敮鎸佷汉鑴告暟鎹級
* @return
*/
- public BaseResponse<UserAddResponse> addUser(UserAddRequest param){
- log.error("銆愭捣搴锋柊澧炰汉鍛樸��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<UserAddResponse> addUser(UserAddRequest param){
+ log.info("銆愭捣搴锋柊澧炰汉鍛樸��================寮�濮�===="+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 +115,14 @@
*淇敼浜哄憳淇℃伅锛堜笉鏀寔浜鸿劯鏁版嵁锛�
* @return
*/
- public BaseResponse editUser(UserAddRequest param){
- log.error("銆愭捣搴蜂慨鏀逛汉鍛樸��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse editUser(UserAddRequest param){
+ log.info("銆愭捣搴蜂慨鏀逛汉鍛樸��================寮�濮�===="+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 +133,14 @@
*鎵归噺鏂板浜哄憳淇℃伅(鏃犱汉鑴革級
* @return
*/
- public BaseResponse<OrgOrUserAddResponse> addBatchUser(List<UserAddRequest> param){
- log.error("銆愭捣搴锋壒閲忔柊澧炰汉鍛樸��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<OrgOrUserAddResponse> addBatchUser(List<UserAddRequest> param){
+ log.info("銆愭捣搴锋壒閲忔柊澧炰汉鍛樸��================寮�濮�===="+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 +151,14 @@
*鎵归噺鍒犻櫎浜哄憳淇℃伅
* @return
*/
- public BaseResponse<OrgOrUserAddFailureResponse> delBatchUser(List<UserAddRequest> param){
- log.error("銆愭捣搴锋壒閲忔柊澧炰汉鍛樸��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<List<UserDelResponse>> delBatchUser(UserDelRequest param){
+ log.info("銆愭捣搴锋壒閲忔柊澧炰汉鍛樸��================寮�濮�===="+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);
+ BaseResponse<List<UserDelResponse >> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鎵归噺鏂板浜哄憳");
return result;
}catch (Exception e){
log.error("銆愭捣搴锋壒閲忔柊澧炰汉鍛樸��================澶辫触====锛歕n"+ e.getMessage());
@@ -189,14 +169,14 @@
*娣诲姞浜鸿劯淇℃伅
* @return
*/
- public BaseResponse<FaceAddOrEditesponse> addFace(List<FaceAddRequest> param){
- log.error("銆愭捣搴锋坊鍔犱汉鑴镐俊鎭��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<FaceAddOrEditesponse> addFace( FaceAddRequest param){
+ log.info("銆愭捣搴锋坊鍔犱汉鑴镐俊鎭��================寮�濮�===="+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 +187,14 @@
*缂栬緫浜鸿劯淇℃伅
* @return
*/
- public BaseResponse<FaceAddOrEditesponse> editFace(List<FaceEditRequest> param){
- log.error("銆愭捣搴风紪杈戜汉鑴镐俊鎭��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<FaceAddOrEditesponse> editFace( FaceEditRequest param){
+ log.info("銆愭捣搴风紪杈戜汉鑴镐俊鎭��================寮�濮�===="+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 +205,14 @@
*鍒犻櫎浜鸿劯淇℃伅
* @return
*/
- public BaseResponse delFace(List<FaceEditRequest> param){
- log.error("銆愭捣搴峰垹闄や汉鑴镐俊鎭��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse delFace(List<FaceEditRequest> param){
+ log.info("銆愭捣搴峰垹闄や汉鑴镐俊鎭��================寮�濮�===="+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());
@@ -244,7 +224,7 @@
* @return
*/
public static InputStream getFaceInputStream(FacePictureRequest param) {
- log.error("銆愭捣搴蜂汉鑴歌闂浘鐗囨祦銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ log.info("銆愭捣搴蜂汉鑴歌闂浘鐗囨祦銆�================寮�濮�===="+JSONObject.toJSONString(param));
try {
InputStream res = HKTools.getFaceInputStream(JSONObject.toJSONString(param));
log.error("銆愭捣搴蜂汉鑴歌闂浘鐗囨祦銆�================鎴愬姛====\n");
@@ -254,19 +234,64 @@
}
return null;
}
+ /**
+ * 鑾峰彇璁垮璁板綍涓殑鍥剧墖
+ * @return
+ */
+ public static InputStream getVisitPicture(VisitPictureRequest param) {
+ log.info("銆愭捣搴疯瀹㈠浘鐗囨祦銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ InputStream res = HKTools.getVisitPicture(JSONObject.toJSONString(param));
+ log.error("銆愭捣搴疯瀹㈠浘鐗囨祦銆�================鎴愬姛====\n");
+ return res;
+ }catch (Exception e){
+ log.error("銆愭捣搴疯瀹㈠浘鐗囨祦銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ * 鑾峰彇闂ㄧ浜嬩欢鐨勫浘鐗�
+ * @return
+ */
+ public static InputStream getDevicePicture(DevicePictureRequest param) {
+ log.info("銆愭捣搴烽棬绂佷簨浠跺浘鐗囨祦銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ InputStream res = HKTools.getDevicePicture(JSONObject.toJSONString(param));
+ log.error("銆愭捣搴烽棬绂佷簨浠跺浘鐗囨祦銆�================鎴愬姛====\n");
+ return res;
+ }catch (Exception e){
+ log.error("銆愭捣搴烽棬绂佷簨浠跺浘鐗囨祦銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ * 鏌ヨ杞﹁締鎶撴媿鍥剧墖
+ * @return
+ */
+ public static InputStream getCarPicture(CarPictureRequest param) {
+ log.info("銆愭捣搴疯溅杈嗘姄鎷嶅浘鐗囧浘鐗囨祦銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ InputStream res = HKTools.getCarPicture(JSONObject.toJSONString(param));
+ log.error("銆愭捣搴疯溅杈嗘姄鎷嶅浘鐗囧浘鐗囨祦銆�================鎴愬姛====\n");
+ return res;
+ }catch (Exception e){
+ log.error("銆愭捣搴疯溅杈嗘姄鎷嶅浘鐗囧浘鐗囨祦銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
/**
*鑾峰彇杞﹀簱鍒楄〃鏁版嵁锛堝叏閲忥級
* @return
*/
- public BaseResponse<List<ParkListResponse>> parkList(ParkListRequest param){
- log.error("銆愭捣鑾峰彇杞﹀簱鍒楄〃鏁版嵁銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<List<ParkListResponse>> parkList(ParkListRequest param){
+ log.info("銆愭捣搴疯幏鍙栬溅搴撳垪琛ㄦ暟鎹��================寮�濮�===="+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 +302,14 @@
*鑾峰彇杞﹀簱鍒楄〃鏁版嵁锛堝叏閲忥級
* @return
*/
- public BaseResponse<List<EntranceListResponse>> entranceList(EntranceListRequest param){
- log.error("銆愭捣鑾峰彇杞﹀簱鍒楄〃鏁版嵁銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<List<EntranceListResponse>> entranceList(EntranceListRequest param){
+ log.info("銆愭捣鑾峰彇杞﹀簱鍒楄〃鏁版嵁銆�================寮�濮�===="+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 +320,14 @@
*鍥哄畾杞﹁締鍏呭�硷紙鍖呮湡锛�
* @return
*/
- public BaseResponse carChargeAddtion(CarChargeAddRequest param){
- log.error("銆愭捣搴峰浐瀹氳溅杈嗗厖鍊笺��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse carChargeAddtion(CarChargeAddRequest param){
+ log.info("銆愭捣搴峰浐瀹氳溅杈嗗厖鍊笺��================寮�濮�===="+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 +338,14 @@
*鍥哄畾杞﹁締鍙栨秷鍖呮湡
* @return
*/
- public BaseResponse carChargeDeletion(CarChargeDelRequest param){
- log.error("銆愭捣搴峰浐瀹氳溅杈嗗彇娑堝寘鏈熴��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse carChargeDeletion(CarChargeDelRequest param){
+ log.info("銆愭捣搴峰浐瀹氳溅杈嗗彇娑堝寘鏈熴��================寮�濮�===="+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 +356,14 @@
*杞︿綅棰勭害
* @return
*/
- public BaseResponse<ParkReservationAddResponse> parkReservationAddition(ParkReservationAddRequest param){
- log.error("銆愭捣搴疯溅浣嶉绾︺��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<ParkReservationAddResponse> parkReservationAddition(ParkReservationAddRequest param){
+ log.info("銆愭捣搴疯溅浣嶉绾︺��================寮�濮�===="+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 +374,14 @@
*杞︿綅鍙栨秷棰勭害
* @return
*/
- public BaseResponse parkReservationDeletion(ParkReservationDelRequest param){
- log.error("銆愭捣搴疯溅浣嶅彇娑堥绾︺��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse parkReservationDeletion(ParkReservationDelRequest param){
+ log.info("銆愭捣搴疯溅浣嶅彇娑堥绾︺��================寮�濮�===="+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 +392,14 @@
*璁垮棰勭害
* @return
*/
- public BaseResponse<VisitAppointmentResponse> visitAppiontment(VisitAppointmentRequest param){
- log.error("銆愭捣搴疯瀹㈤绾︺��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<VisitAppointmentResponse> visitAppiontment(VisitAppointmentRequest param){
+ log.info("銆愭捣搴疯瀹㈤绾︺��================寮�濮�===="+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());
@@ -382,17 +407,53 @@
return null;
}
/**
+ *璁垮棰勭害鍙栨秷
+ * @return
+ */
+ public static BaseResponse cancelVisitAppiontment(VisitAppointmentCancelRequest param){
+ log.info("銆愭捣搴疯瀹㈤绾﹀彇娑堛��================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.visitCancel(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());
+ }
+ return null;
+ }
+ /**
+ *璁垮棰勭害绛剧
+ * @return
+ */
+ public static BaseResponse outVisitAppiontment(VisitAppointmentOutRequest param){
+ log.info("銆愭捣搴疯瀹㈤绾︾绂汇��================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.visitOut(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());
+ }
+ return null;
+ }
+ /**
*璁垮鍏嶇櫥璁伴绾�
* @return
*/
- public BaseResponse<VisitAppointmentVistorResponse> visitAppiontmentMDJ(VisitAppointmentMDJRequest param){
- log.error("銆愭捣搴疯瀹㈠厤鐧昏棰勭害銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<VisitAppointmentMDJResponse> visitAppiontmentMDJ(VisitAppointmentMDJRequest param){
+ log.info("銆愭捣搴疯瀹㈠厤鐧昏棰勭害銆�================寮�濮�===="+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);
+ new TypeReference< BaseResponse<VisitAppointmentMDJResponse> >(){};
+ BaseResponse<VisitAppointmentMDJResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍璁垮鍏嶇櫥璁伴绾�");
return result;
}catch (Exception e){
log.error("銆愭捣搴疯瀹㈠厤鐧昏棰勭害銆�================澶辫触====锛歕n"+ e.getMessage());
@@ -403,14 +464,14 @@
*璁垮鏉冮檺缁勫垪琛ㄦ煡璇紙鍒嗛〉锛�
* @return
*/
- public BaseResponse<PrivilegeGroupResponse> privilegeGroup(PrivilegeGroupRequest param){
- log.error("銆愭捣搴疯瀹㈡潈闄愮粍鍒楄〃鏌ヨ銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<PrivilegeGroupListResponse> privilegeGroup(PrivilegeGroupRequest param){
+ log.info("銆愭捣搴疯瀹㈡潈闄愮粍鍒楄〃鏌ヨ銆�================寮�濮�===="+JSONObject.toJSONString(param));
try {
String res = HKTools.privilegeGroup(JSONObject.toJSONString(param));
TypeReference typeReference =
- new TypeReference< BaseResponse<PrivilegeGroupResponse> >(){};
- BaseResponse<PrivilegeGroupResponse> result = JSONObject.parseObject(res, typeReference.getType());
- log.error("銆愭捣搴疯瀹㈡潈闄愮粍鍒楄〃鏌ヨ銆�================鎴愬姛====\n"+res);
+ new TypeReference< BaseResponse<PrivilegeGroupListResponse> >(){};
+ BaseResponse<PrivilegeGroupListResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍璁垮鏉冮檺缁勫垪琛ㄦ煡璇�");
return result;
}catch (Exception e){
log.error("銆愭捣搴疯瀹㈡潈闄愮粍鍒楄〃鏌ヨ銆�================澶辫触====锛歕n"+ e.getMessage());
@@ -418,23 +479,217 @@
return null;
}
/**
+ *娴峰悍闂ㄧ鐐规煡璇紙鍒嗛〉锛�
+ * @return
+ */
+ public static BaseResponse<DoorsListResponse> doorSearch(DoorsListRequest param){
+ log.info("銆愭捣搴烽棬绂佺偣鏌ヨ銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.doorSearch(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<DoorsListResponse> >(){};
+ BaseResponse<DoorsListResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍闂ㄧ鐐规煡璇�");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴烽棬绂佺偣鏌ヨ銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
*闂ㄧ璁惧鏌ヨ锛堝垎椤碉級
* @return
*/
- public BaseResponse<AcsDeviceListResponse> acsDeviceList(AcsDeviceListRequest param){
- log.error("銆愭捣搴烽棬绂佽澶囨煡璇€��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<AcsDeviceListResponse> acsDeviceList(AcsDeviceListRequest param){
+ log.info("銆愭捣搴烽棬绂佽澶囨煡璇€��================寮�濮�===="+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.info("銆愭捣搴蜂簨浠惰闃呫��================寮�濮�===="+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;
+ }
+ /**
+ *浜嬩欢璁㈤槄
+ * @return
+ */
+ public static BaseResponse cancelEventSub(EventSubRequest param){
+ log.info("銆愭捣搴峰彇娑堜簨浠惰闃呫��================寮�濮�===="+JSONObject.toJSONString(param));
+ String res = null;
+ try {
+ res = HKTools.cancelEventSub(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;
+ }
+ /**
+ *娴峰悍鍒涘缓涓�鍗¢�氫笅杞戒换鍔�
+ * @return
+ */
+ public static BaseResponse<TaskAdditionResponse> taskAddition(TaskAdditionRequest param){
+ log.info("銆愭捣搴峰垱寤轰竴鍗¢�氫笅杞戒换鍔°��================寮�濮�===="+JSONObject.toJSONString(param));
+ String res = null;
+ try {
+ res = HKTools.taskAddition(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<TaskAdditionResponse>>(){};
+ BaseResponse<TaskAdditionResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鍒涘缓涓�鍗¢�氫笅杞戒换鍔�");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰垱寤轰竴鍗¢�氫笅杞戒换鍔°��================澶辫触====锛歕n"+ e.getMessage());
+ }finally {
+ // saveInterfaceLog(param,res);
+ }
+ return null;
+ }
+ /**
+ *娴峰悍涓�鍗¢�氫换鍔℃坊鍔犳暟鎹�
+ * @return
+ */
+ public static BaseResponse taskDataAddition(TaskDataAdditionRequest param){
+ log.info("銆愭捣搴蜂竴鍗¢�氫换鍔℃坊鍔犳暟鎹��================寮�濮�===="+JSONObject.toJSONString(param));
+ String res = null;
+ try {
+ res = HKTools.taskDataAddition(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;
+ }
+ /**
+ *娴峰悍涓�鍗¢�氫换鍔¤繘搴︽煡璇�
+ * @return
+ */
+ public static BaseResponse<TaskProgressNumResponse> taskProgressNum(TaskProgressRequest param){
+ log.info("銆愭捣搴蜂竴鍗¢�氫换鍔¤繘搴︽煡璇€��================寮�濮�===="+JSONObject.toJSONString(param));
+ String res = null;
+ try {
+ res = HKTools.taskProgressNum(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<TaskProgressNumResponse> >(){};
+ BaseResponse<TaskProgressNumResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍涓�鍗¢�氫换鍔¤繘搴︽煡璇�");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴蜂竴鍗¢�氫换鍔¤繘搴︽煡璇€��================澶辫触====锛歕n"+ e.getMessage());
+ }finally {
+ // saveInterfaceLog(param,res);
+ }
+ return null;
+ }
+ /**
+ *娴峰悍涓�鍗¢�氳澶囬�氶亾鐨勪汉鍛樻潈闄愪笅杞借鎯呮�绘暟v2
+ * @return
+ */
+ public static BaseResponse<TaskProgressResponse> taskProgress(TaskProgressRequest param){
+ log.info("銆愭捣搴蜂竴鍗¢�氳澶囬�氶亾鐨勪汉鍛樻潈闄愪笅杞借鎯呮�绘暟銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ String res = null;
+ try {
+ res = HKTools.taskProgress(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<TaskProgressResponse> >(){};
+ BaseResponse<TaskProgressResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍涓�鍗¢�氳澶囬�氶亾鐨勪汉鍛樻潈闄愪笅杞借鎯呮�绘暟");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴蜂竴鍗¢�氳澶囬�氶亾鐨勪汉鍛樻潈闄愪笅杞借鎯呮�绘暟銆�================澶辫触====锛歕n"+ e.getMessage());
+ }finally {
+ // saveInterfaceLog(param,res);
+ }
+ return null;
+ }
+ /**
+ *娴峰悍鏌ヨ鏉冮檺鏉$洰鍒楄〃
+ * @return
+ */
+ public static BaseResponse<AuthItemListResponse> authItemList(AuthItemListRequest param){
+ log.info("銆愭捣搴锋煡璇㈡潈闄愭潯鐩垪琛ㄣ��================寮�濮�===="+JSONObject.toJSONString(param));
+ String res = null;
+ try {
+ res = HKTools.authItemList(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<AuthItemListResponse> >(){};
+ BaseResponse<AuthItemListResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鏌ヨ鏉冮檺鏉$洰鍒楄〃");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴锋煡璇㈡潈闄愭潯鐩垪琛ㄣ��================澶辫触====锛歕n"+ e.getMessage());
+ }finally {
+ // saveInterfaceLog(param,res);
+ }
+ return null;
+ }
+ /**
+ *娴峰悍涓�鍗¢�氫换鍔″紑濮嬫墽琛�
+ * @return
+ */
+ public static BaseResponse taskStart(TaskProgressRequest param){
+ log.info("銆愭捣搴蜂竴鍗¢�氫换鍔″紑濮嬫墽琛屻��================寮�濮�===="+JSONObject.toJSONString(param));
+ String res = null;
+ try {
+ res = HKTools.taskStart(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);
+ }
+ }
}
--
Gitblit v1.9.3