From de64b6758d486eee7cd112853fb0a9cc3af5cf42 Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期三, 06 十二月 2023 09:21:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java |  440 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 440 insertions(+), 0 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
new file mode 100644
index 0000000..4e57687
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -0,0 +1,440 @@
+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.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 lombok.extern.slf4j.Slf4j;
+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("銆愭捣搴疯幏鍙栨牴缁勭粐銆�================寮�濮�====");
+        try {
+            String res = HKTools.getRootOrg ();
+            TypeReference typeReference =
+                    new TypeReference< BaseResponse<OrgListResponse>>(){};
+            BaseResponse<OrgListResponse> result = JSONObject.parseObject(res, typeReference.getType());
+            log.error("銆愭捣搴疯幏鍙栨牴缁勭粐銆�================鎴愬姛====\n"+res);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴疯幏鍙栨牴缁勭粐銆�================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+
+    }
+    /**
+     * 淇敼缁勭粐鏁版嵁
+     * @return
+     */
+    public  BaseResponse editOrg(OrgEditRequest param){
+        log.error("銆愭捣搴蜂慨鏀圭粍缁囥��================寮�濮�===="+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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴蜂慨鏀圭粍缁囥��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鎵归噺鏂板缁勭粐鏁版嵁
+     * @return
+     */
+    public  BaseResponse<OrgOrUserAddResponse>  addBatchOrg(List<OrgAddRequest> param){
+        log.error("銆愭捣搴锋柊澧炵粍缁囥��================寮�濮�===="+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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴锋柊澧炵粍缁囥��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鎵归噺鍒犻櫎缁勭粐鏁版嵁
+     * @return
+     */
+    public  BaseResponse   delBatchOrg(OrgDelRequest param){
+        log.error("銆愭捣搴峰垹闄ょ粍缁囥��================寮�濮�===="+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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴峰垹闄ょ粍缁囥��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鏂板浜哄憳淇℃伅锛堟敮鎸佷汉鑴告暟鎹級
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴锋柊澧炰汉鍛樸��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *淇敼浜哄憳淇℃伅锛堜笉鏀寔浜鸿劯鏁版嵁锛�
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴蜂慨鏀逛汉鍛樸��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鎵归噺鏂板浜哄憳淇℃伅(鏃犱汉鑴革級
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴锋壒閲忔柊澧炰汉鍛樸��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鎵归噺鍒犻櫎浜哄憳淇℃伅
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴锋壒閲忔柊澧炰汉鍛樸��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *娣诲姞浜鸿劯淇℃伅
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴锋坊鍔犱汉鑴镐俊鎭��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *缂栬緫浜鸿劯淇℃伅
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴风紪杈戜汉鑴镐俊鎭��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鍒犻櫎浜鸿劯淇℃伅
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴峰垹闄や汉鑴镐俊鎭��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     * 鑾峰彇娴峰悍浜鸿劯璁块棶鍦板潃
+     * @return
+     */
+    public static InputStream getFaceInputStream(FacePictureRequest param) {
+        log.error("銆愭捣搴蜂汉鑴歌闂浘鐗囨祦銆�================寮�濮�===="+JSONObject.toJSONString(param));
+        try {
+            InputStream res = HKTools.getFaceInputStream(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));
+        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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴疯幏鍙栬溅搴撳垪琛ㄦ暟鎹��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鑾峰彇杞﹀簱鍒楄〃鏁版嵁锛堝叏閲忥級
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴疯幏鍙栬溅搴撳垪琛ㄦ暟鎹��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鍥哄畾杞﹁締鍏呭�硷紙鍖呮湡锛�
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴峰浐瀹氳溅杈嗗厖鍊笺��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *鍥哄畾杞﹁締鍙栨秷鍖呮湡
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴峰浐瀹氳溅杈嗗彇娑堝寘鏈熴��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *杞︿綅棰勭害
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴疯溅浣嶉绾︺��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *杞︿綅鍙栨秷棰勭害
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴疯溅浣嶅彇娑堥绾︺��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *璁垮棰勭害
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴疯瀹㈤绾︺��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *璁垮鍏嶇櫥璁伴绾�
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴疯瀹㈠厤鐧昏棰勭害銆�================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *璁垮鏉冮檺缁勫垪琛ㄦ煡璇紙鍒嗛〉锛�
+     * @return
+     */
+    public  BaseResponse<PrivilegeGroupResponse>   privilegeGroup(PrivilegeGroupRequest param){
+        log.error("銆愭捣搴疯瀹㈡潈闄愮粍鍒楄〃鏌ヨ銆�================寮�濮�===="+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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴疯瀹㈡潈闄愮粍鍒楄〃鏌ヨ銆�================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+    /**
+     *闂ㄧ璁惧鏌ヨ锛堝垎椤碉級
+     * @return
+     */
+    public  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);
+            return  result;
+        }catch (Exception e){
+            log.error("銆愭捣搴烽棬绂佽澶囨煡璇€��================澶辫触====锛歕n"+ e.getMessage());
+        }
+        return  null;
+    }
+
+}
+

--
Gitblit v1.9.3