From 7c54e8233ccad83697a84317a4b8194d85d7fd42 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 14 十一月 2024 18:19:16 +0800
Subject: [PATCH] 最新版本541200007
---
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java | 286 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 267 insertions(+), 19 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
index e9f749e..a47eb2e 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -1,6 +1,5 @@
package com.doumee.core.haikang.service;
-import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.doumee.core.haikang.model.HKConstants;
@@ -8,17 +7,15 @@
import com.doumee.core.haikang.model.param.BaseListPageResponse;
import com.doumee.core.haikang.model.param.BaseRequst;
import com.doumee.core.haikang.model.param.BaseResponse;
+import com.doumee.core.haikang.model.param.BaseListPageRequest;
import com.doumee.core.haikang.model.param.request.*;
import com.doumee.core.haikang.model.param.respose.*;
import com.doumee.core.utils.Constants;
+import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import oshi.hardware.Sensors;
-import sun.management.Sensor;
import java.io.InputStream;
import java.lang.reflect.Field;
@@ -235,6 +232,8 @@
*/
public static InputStream getFaceInputStream(FacePictureRequest param) {
log.info("銆愭捣搴蜂汉鑴歌闂浘鐗囨祦銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ log.error("********************ArtemisConfig.host***********************************"+ ArtemisConfig.host);
+ log.error("********************ArtemisConfig.key********************************"+ArtemisConfig.appKey);
try {
InputStream res = HKTools.getFaceInputStream(JSONObject.toJSONString(param));
log.error("銆愭捣搴蜂汉鑴歌闂浘鐗囨祦銆�================鎴愬姛====\n");
@@ -904,17 +903,35 @@
*鏍规嵁閰嶇疆寰俊鍏紬鍙风紪鍙锋煡璇㈠井淇″叕浼楀彿淇℃伅
* @return
*/
- public static BaseResponse<BaseListPageResponse<WxConfigInfoResponse>> getWxConfig(WxConfigInfoRequest param){
+ public static BaseResponse< WxConfigInfoResponse> getWxConfig(WxConfigInfoRequest param){
log.info("銆愭捣搴锋牴鎹厤缃井淇″叕浼楀彿缂栧彿鏌ヨ寰俊鍏紬鍙蜂俊鎭��================寮�濮�===="+JSONObject.toJSONString(param));
try {
String res = HKTools.getWxConfig(toMap(param));
TypeReference typeReference =
- new TypeReference<BaseResponse<BaseListPageResponse<WxConfigInfoResponse>>>(){};
- BaseResponse<BaseListPageResponse<WxConfigInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ new TypeReference<BaseResponse<WxConfigInfoResponse>>(){};
+ BaseResponse<WxConfigInfoResponse> result = JSONObject.parseObject(res, typeReference.getType());
logResult(result,"娴峰悍鏍规嵁閰嶇疆寰俊鍏紬鍙风紪鍙锋煡璇㈠井淇″叕浼楀彿淇℃伅");
return result;
}catch (Exception e){
log.error("銆愭捣搴锋牴鎹厤缃井淇″叕浼楀彿缂栧彿鏌ヨ寰俊鍏紬鍙蜂俊鎭��================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *鍒嗛〉鑾峰彇寰呭姙鍒楄〃
+ * @return
+ */
+ public static BaseResponse<BaseListPageResponse<GetTodoListResponse>> getTodoListPage(GetTodoListRequest param){
+ log.info("銆愭捣搴峰垎椤佃幏鍙栧緟鍔炲垪琛ㄣ��================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.getTodoListPage(toMap(param));
+ TypeReference typeReference =
+ new TypeReference<BaseResponse<BaseListPageResponse<GetTodoListResponse>>>(){};
+ BaseResponse<BaseListPageResponse<GetTodoListResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鍒嗛〉鑾峰彇寰呭姙鍒楄〃");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰垎椤佃幏鍙栧緟鍔炲垪琛ㄣ��================澶辫触====锛歕n"+ e.getMessage());
}
return null;
}
@@ -971,6 +988,24 @@
return result;
}catch (Exception e){
log.error("銆愭捣搴锋煡璇㈡秷闃蹭紶鎰熷櫒鍒楄〃銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *鍒嗛〉鏌ヨ璁惧涓嬬殑鎵�鏈夋姤璀﹁褰�
+ * @return
+ */
+ public static BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>> findDeviceAlarmPage(FindDeviceAlarmListRequest param){
+ log.info("銆愭捣搴峰垎椤垫煡璇㈣澶囦笅鐨勬墍鏈夋姤璀﹁褰曘��================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.findDeviceAlarmPage(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference<BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>>>(){};
+ BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鍒嗛〉鏌ヨ璁惧涓嬬殑鎵�鏈夋姤璀﹁褰�");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰垎椤垫煡璇㈣澶囦笅鐨勬墍鏈夋姤璀﹁褰曘��================澶辫触====锛歕n"+ e.getMessage());
}
return null;
}
@@ -1051,13 +1086,15 @@
* @return
*/
public static String getMenuUrl(Integer type,String token){
- String menuId = HKConstants.MenuPageId.zhaf;
+ String menuId = HKConstants.MenuPageId.afzx;
if(Constants.equalsInteger(type,Constants.ONE)){
- menuId = HKConstants.MenuPageId.wyhq;
+ menuId = HKConstants.MenuPageId.xkzx;
}else if(Constants.equalsInteger(type,Constants.TWO)){
- menuId = HKConstants.MenuPageId.xzbg;
+ menuId = HKConstants.MenuPageId.ngzx;
}else if(Constants.equalsInteger(type,Constants.THREE)){
- menuId = HKConstants.MenuPageId.yyzx;
+ menuId = HKConstants.MenuPageId.jsc;
+ }else if(Constants.equalsInteger(type,Constants.FOUR)){
+ menuId = HKConstants.MenuPageId.kqgzt;
}
log.info("銆愭捣搴疯幏鍙栧伐浣滃彴鑿滃崟鍏嶅瘑鐧婚檰璋冩暣鍦板潃銆�================寮�濮�====menuId:"+menuId+"==token:"+token);
try {
@@ -1195,20 +1232,20 @@
return null;
}
/**
- *澧為噺杞﹁締鏌ヨ锛堝垎椤碉級
+ *浜鸿劯璇勫垎
* @return
*/
- public static BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>> facePictureCheck(TimeRangeListRequest param){
- log.info("銆愭捣搴峰閲忎汉鍛樻煡璇€��================寮�濮�===="+JSONObject.toJSONString(param));
+ public static BaseResponse<FacePictureCheckResponse> facePictureCheck(FacePictureCheckRequest param){
+ log.info("銆愪汉鑴歌瘎鍒嗐��================寮�濮�===="+JSONObject.toJSONString(param));
try {
String res = HKTools.facePictureCheck(JSONObject.toJSONString(param));
TypeReference typeReference =
- new TypeReference< BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>> >(){};
- BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType());
- logResult(result,"娴峰悍澧為噺浜哄憳鏌ヨ");
+ new TypeReference<BaseResponse<FacePictureCheckResponse>>(){};
+ BaseResponse<FacePictureCheckResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"浜鸿劯璇勫垎");
return result;
}catch (Exception e){
- log.error("銆愭捣搴峰閲忎汉鍛樻煡璇€��================澶辫触====锛歕n"+ e.getMessage());
+ log.error("銆愪汉鑴歌瘎鍒嗐��================澶辫触====锛歕n"+ e.getMessage());
}
return null;
}
@@ -1284,6 +1321,10 @@
}
return null;
}
+
+
+
+
/**
*鑾峰彇鏈堝彴缁勪欢閰嶇疆鐨凩ED璁惧娓呭崟
* @return
@@ -1386,6 +1427,175 @@
return null;
}
/**
+ *鍒嗛〉鑾峰彇鍖哄煙鍒楄〃锛堝垎椤碉級
+ * @return
+ */
+ public static BaseResponse<BaseListPageResponse<PageRegionInfoResponse>> pageRegions(BaseListPageRequest param){
+ log.info("銆愭捣搴峰垎椤佃幏鍙栧尯鍩熷垪琛ㄣ��================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ Map<String ,String> header = new HashMap<>();
+// header.put("userId",param.getUserId());
+ String res = HKTools.pageRegions(header,JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<BaseListPageResponse<PageRegionInfoResponse>> >(){};
+ BaseResponse<BaseListPageResponse<PageRegionInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鍒嗛〉鑾峰彇鍖哄煙鍒楄〃");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰垎椤佃幏鍙栧尯鍩熷垪琛ㄣ��================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *鑾峰彇鐩戞帶鐐归瑙堝彇娴乁RL
+ * @return
+ */
+ public static BaseResponse<CamerasPreviewURLsResponse> cameraPreviewURLs(CameraPreviewURLsRequest param){
+ log.info("銆愭捣搴疯幏鍙栫洃鎺х偣棰勮鍙栨祦URL銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ Map<String ,String> header = new HashMap<>();
+// header.put("userId",param.getUserId());
+// header.put("domainId ",param.getDomainId());
+ String res = HKTools.cameraPreviewURLs(header,JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<CamerasPreviewURLsResponse> >(){};
+ BaseResponse<CamerasPreviewURLsResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鑾峰彇鐩戞帶鐐归瑙堝彇娴乁RL");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴疯幏鍙栫洃鎺х偣棰勮鍙栨祦URL銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *鍒嗛〉鑾峰彇鐩戞帶鐐硅祫婧愶紙鍒嗛〉锛�
+ * @return
+ */
+ public static BaseResponse<BaseListPageResponse<PageCameraInfoResponse>> pageCameras(BaseListPageRequest param){
+ log.info("銆愭捣搴峰垎椤佃幏鍙栫洃鎺х偣璧勬簮銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ Map<String ,String> header = new HashMap<>();
+ header.put("userId",param.getUserId());
+ String res = HKTools.pageCameras(header,JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<BaseListPageResponse<PageCameraInfoResponse>> >(){};
+ BaseResponse<BaseListPageResponse<PageCameraInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+// logResult(result,"娴峰悍鍒嗛〉鑾峰彇鐩戞帶鐐硅祫婧�");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰垎椤佃幏鍙栫洃鎺х偣璧勬簮銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *鑾峰彇娑堥槻浼犳劅鍣ㄥ垪琛紙鍒嗛〉锛�
+ * @return
+ */
+ public static BaseResponse<BaseListPageResponse<PageFireChannelInfoResponse>> pageFireChannel(BaseListPageRequest param){
+ log.info("銆愭捣搴峰垎椤佃幏鍙栨秷闃蹭紶鎰熷櫒鍒楄〃銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.pageFireChannel(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<BaseListPageResponse<PageFireChannelInfoResponse>> >(){};
+ BaseResponse<BaseListPageResponse<PageFireChannelInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鍒嗛〉鑾峰彇娑堥槻浼犳劅鍣ㄥ垪琛�");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰垎椤佃幏鍙栨秷闃蹭紶鎰熷櫒鍒楄〃銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *鏌ヨ娑堥槻浼犳劅鍣ㄩ儴浠剁姸鎬乿2锛堝垎椤碉級
+ * @return
+ */
+ public static BaseResponse<BaseListPageResponse<PageSensorStatusResponse>> pageSensorStatus(SensorStatusListRequest param){
+ log.info("銆愭捣搴峰垎椤垫煡璇㈡秷闃蹭紶鎰熷櫒閮ㄤ欢鐘舵�乿2銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.pageSensorStatus(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<BaseListPageResponse<PageSensorStatusResponse>> >(){};
+ BaseResponse<BaseListPageResponse<PageSensorStatusResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鍒嗛〉鏌ヨ娑堥槻浼犳劅鍣ㄩ儴浠剁姸鎬乿2");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰垎椤垫煡璇㈡秷闃蹭紶鎰熷櫒閮ㄤ欢鐘舵�乿2銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *瀹夐槻鐪嬫澘-浠婃棩鍛婅浜嬩欢-鏍规嵁eventType瀛楁3
+ * @return
+ */
+ public static BaseResponse<BaseListPageResponse<RuleEventSearchDataResponse>> ruleEventSearch(RuleEventSearchRequest param){
+ log.info("銆愭捣搴峰畨闃茬湅鏉�-浠婃棩鍛婅浜嬩欢-鏍规嵁eventType瀛楁3銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.ruleEventSearch(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<BaseListPageResponse<RuleEventSearchDataResponse>> >(){};
+ BaseResponse<BaseListPageResponse<RuleEventSearchDataResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍瀹夐槻鐪嬫澘-浠婃棩鍛婅浜嬩欢-鏍规嵁eventType瀛楁3");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰畨闃茬湅鏉�-浠婃棩鍛婅浜嬩欢-鏍规嵁eventType瀛楁3銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *缁熻缁熷畨闃茬湅鏉�--鍥尯瀹炴椂杞︽暟閲�4
+ * @return
+ */
+ public static BaseResponse<ParkingStatisticResponse> getParkingStatistics(){
+ log.info("銆愭捣搴峰畨闃茬湅鏉�--鍥尯瀹炴椂杞︽暟閲�4銆�================寮�濮�====");
+ try {
+ String res = HKTools.getParkingStatistics();
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<ParkingStatisticResponse>>(){};
+ BaseResponse<ParkingStatisticResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍瀹夐槻鐪嬫澘--鍥尯瀹炴椂杞︽暟閲�4");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰畨闃茬湅鏉�--鍥尯瀹炴椂杞︽暟閲�4銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *缁熻鍥尯鎬讳綋鐨勫畨闃茶澶囨暟閲忥紝鍦ㄧ嚎鏁般�佸湪绾跨巼銆佺绾挎暟銆佺绾跨巼
+ * @return
+ */
+ public static BaseResponse<List<SecureDevStatusTotalResponse>> getSecureDevStatusTotal(SecureDevStatusTotalRequest param){
+ log.info("銆愭捣搴风粺璁″洯鍖烘�讳綋鐨勫畨闃茶澶囨暟閲忥紝鍦ㄧ嚎鏁般�佸湪绾跨巼銆佺绾挎暟銆佺绾跨巼銆�================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.getSecureDevStatusTotal(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<List<SecureDevStatusTotalResponse>> >(){};
+ BaseResponse<List<SecureDevStatusTotalResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍缁熻鍥尯鎬讳綋鐨勫畨闃茶澶囨暟閲忥紝鍦ㄧ嚎鏁般�佸湪绾跨巼銆佺绾挎暟銆佺绾跨巼");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴风粺璁″洯鍖烘�讳綋鐨勫畨闃茶澶囨暟閲忥紝鍦ㄧ嚎鏁般�佸湪绾跨巼銆佺绾挎暟銆佺绾跨巼銆�================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
+ *瀹夐槻鐪嬫澘-鍥尯瀹夐槻璁惧-鍚勭被鍨嬭澶囩姸鎬佹暟鎹垪琛�
+ * @return
+ */
+ public static BaseResponse<List<SecureDevStatusListResponse>> getSecureDevStatusList(SecureDevStatusTotalRequest param){
+ log.info("銆愭捣搴峰畨闃茬湅鏉�-鍥尯瀹夐槻璁惧-鍚勭被鍨嬭澶囩姸鎬佹暟鎹垪琛ㄣ��================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.getSecureDevStatusList(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<List<SecureDevStatusListResponse>> >(){};
+ BaseResponse<List<SecureDevStatusListResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍瀹夐槻鐪嬫澘-鍥尯瀹夐槻璁惧-鍚勭被鍨嬭澶囩姸鎬佹暟鎹垪琛�");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴峰畨闃茬湅鏉�-鍥尯瀹夐槻璁惧-鍚勭被鍨嬭澶囩姸鎬佹暟鎹垪琛ㄣ��================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
+ /**
*鏍规嵁鐢ㄦ埛鏍囪瘑鑾峰彇瀹㈡埛绔疶GC鎺ュ彛
* @return
*/
@@ -1421,6 +1631,44 @@
}
return null;
}
+
+
+
+
+ public static BaseResponse<MenuDataResponse> getMenuConfig(Map<String,String> param){
+ log.info("銆愯幏鍙栬彍鍗曞姛鑳介厤缃」銆�================寮�濮�===="+ JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.getHkMenu(param);
+ TypeReference typeReference =
+ new TypeReference<BaseResponse<MenuDataResponse>>(){};
+ BaseResponse<MenuDataResponse> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"鑾峰彇鑿滃崟鍔熻兘閰嶇疆椤�");
+ return result;
+ }catch (Exception e){
+ log.error("銆愯幏鍙栬彍鍗曞姛鑳介厤缃」銆�================澶辫触====锛歕n"+ e.getMessage());
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+
+ public static BaseResponse sendSms(Map<String,Object> param){
+ log.info("銆愬彂閫佺煭淇′俊鎭��================寮�濮�===="+ JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.sendSms(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());
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+
private static void logResult(BaseResponse res,String name) {
if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){
log.info("銆�"+name+"銆�================鎴愬姛====\n"+res);
--
Gitblit v1.9.3