jiangping
2024-11-05 c9ef2687d3460da668d08d58dee6af468ed6693e
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -7,6 +7,7 @@
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;
@@ -1320,6 +1321,10 @@
        }
        return  null;
    }
    /**
     *获取月台组件配置的LED设备清单
     * @return
@@ -1422,6 +1427,103 @@
        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;
    }
    /**
     *获取监控点预览取流URL
     * @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,"海康获取监控点预览取流URL");
            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;
    }
    /**
     *查询消防传感器部件状态v2(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<PageSensorStatusResponse>>   pageSensorStatus(SensorStatusListRequest param){
        log.info("【海康分页查询消防传感器部件状态v2】================开始===="+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,"海康分页查询消防传感器部件状态v2");
            return  result;
        }catch (Exception e){
            log.error("【海康分页查询消防传感器部件状态v2】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *根据用户标识获取客户端TGC接口
     * @return
     */
@@ -1457,6 +1559,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);