liukangdong
2024-10-31 103b6919cb294533920dc9508e855ffca51f71e5
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -1,7 +1,10 @@
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;
@@ -10,6 +13,7 @@
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;
@@ -21,6 +25,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Slf4j
public class HKService {
@@ -1320,6 +1325,10 @@
        }
        return  null;
    }
    /**
     *获取月台组件配置的LED设备清单
     * @return
@@ -1457,6 +1466,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);