| | |
| | | package com.doumee.core.haikang.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | 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.HKTools; |
| | | import com.doumee.core.haikang.model.param.BaseListPageResponse; |
| | |
| | | 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.utils.HttpsUtil; |
| | | import com.hikvision.artemis.sdk.config.ArtemisConfig; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Slf4j |
| | | public class HKService { |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | *获取月台组件配置的LED设备清单 |
| | | * @return |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static BaseResponse sendSmsByHk(Map<String,Object> param,String url){ |
| | | log.info("【海康发送短信】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | TypeReference typeReference = |
| | | new TypeReference<BaseResponse>(){}; |
| | | String res = HttpsUtil.postJson(url, JSONObject.toJSONString(param)); |
| | | BaseResponse 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<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; |
| | | } |
| | | |
| | | |
| | | private static void logResult(BaseResponse res,String name) { |
| | | if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){ |
| | | log.info("【"+name+"】================成功====\n"+res); |