海康接口调用方法类


import org.springblade.modules.hk.requestDto.ExpressionsVideo;
import java.util.ArrayList;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.Client;
import com.hikvision.artemis.sdk.Request;
import com.hikvision.artemis.sdk.Response;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.hikvision.artemis.sdk.constant.Constants;
import com.hikvision.artemis.sdk.enums.Method;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpResponse;
import org.springblade.common.utils.DateUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.modules.hk.requestDto.*;
import org.springframework.stereotype.Component;

import java.util.*;

/**
 * @author wscyz
 * @version 1.0.0
 * @PackageName com.location.project.utils
 * @ClassName HKutils.java
 * @Description pushData
 * @createTime 2022年07月18日 16:03:00
 */
@Component
@Slf4j
public class HKutils {

	/**
	 * 能力开放平台的网站路径
	 * TODO 路径不用修改,就是/artemis
	 */
	private static final String ARTEMIS_PATH = "/artemis";
// 平台门户/nginx的IP和端口(必须使用https协议,https端口默认为443)
	private static final String host = "xxx:4433";
	private static final String appKey = "xxxx";
	private static final String appSecret = "xxxxx";

//	{
//		"cameraIndexCode": "929516337e79455aa0a7bdf31a8219ef",
//			"pageNo": 1,
//			"pageSize": 1000
//	}
	/**
	 * 功能描述: 获取海康视频流
	 *
	 * @param: [pageNo, startTime, endTime]
	 * @return: java.lang.String
	 * @auther: wscyz String host, String appKey, String appSecret,
	 **/
	public String callPostStringApi_video_url(String cameraIndexCode,String host, String appKey, String appSecret){
		final String getCamsApi = ARTEMIS_PATH +"/api/video/v2/cameras/previewURLs";
		Map<String, String> path = new HashMap<String, String>(2) {
			{
				put("https://", getCamsApi);//根据现场环境部署确认是http还是https
			}
		};
		JSONObject jsonBody = new JSONObject();
		jsonBody.put("cameraIndexCode", cameraIndexCode);
		jsonBody.put("streamType", 2);
		jsonBody.put("protocol", "rtsp");
		jsonBody.put("transmode", 1);
		String body = jsonBody.toJSONString();

		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, body, null, null,"application/json",null);
			JSONObject jsonObject = JSON.parseObject(result);
			String code = jsonObject.getString("code");
			if("0".equals(code)){
				return jsonObject.getJSONObject("data").getString("url");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	/**
	 * 功能描述: 获取海康视频流
	 *
	 * @param: [pageNo, startTime, endTime]
	 * @return: java.lang.String
	 * @auther: wscyz String host, String appKey, String appSecret,
	 **/
	public String callPostStringApi_video_history_url(
			String cameraIndexCode,
			String host,
			String appKey,
			String appSecret,
			String beginTime,//"2022-07-22T09:58:58.000+08:00"
			String endTime//"2022-07-22T10:00:00.000+08:00"
	){
		final String getCamsApi = ARTEMIS_PATH +"/api/video/v2/cameras/playbackURLs";
		Map<String, String> path = new HashMap<String, String>(2) {
			{
				put("https://", getCamsApi);//根据现场环境部署确认是http还是https
			}
		};

		JSONObject jsonBody = new JSONObject();
		jsonBody.put("cameraIndexCode", cameraIndexCode);
		jsonBody.put("protocol", "rtsp");
		jsonBody.put("transmode", 1);
		jsonBody.put("lockType", 0);
		jsonBody.put("beginTime", beginTime);
		jsonBody.put("endTime", endTime);
		String body = jsonBody.toJSONString();

		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, body, null, null,"application/json",null);
			JSONObject jsonObject = JSON.parseObject(result);
			String code = jsonObject.getString("code");
			if("0".equals(code)){
				return jsonObject.getJSONObject("data").getString("url");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}


	//按事件类型订阅事件
	public static String eventSubscriptionByEventTypes(EventSubscriptionByEventTypesRequest eventSubscriptionByEventTypesRequest){
		String eventSubscriptionByEventTypesDataApi = ARTEMIS_PATH +"/api/eventService/v1/eventSubscriptionByEventTypes";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",eventSubscriptionByEventTypesDataApi);
			}
		};
		String body=JSON.toJSONString(eventSubscriptionByEventTypesRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	//查询事件订阅信息
	public static String eventSubscriptionView(EventSubscriptionViewRequest eventSubscriptionViewRequest){
		String eventSubscriptionViewDataApi = ARTEMIS_PATH +"/api/eventService/v1/eventSubscriptionView";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",eventSubscriptionViewDataApi);
			}
		};
		String body=JSON.toJSONString(eventSubscriptionViewRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	//按事件类型取消订阅
	public String eventUnSubscriptionByEventTypes(EventUnSubscriptionByEventTypesRequest eventUnSubscriptionByEventTypesRequest ){
		String eventUnSubscriptionByEventTypesDataApi = ARTEMIS_PATH +"/api/eventService/v1/eventUnSubscriptionByEventTypes";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",eventUnSubscriptionByEventTypesDataApi);
			}
		};
		String body=JSON.toJSONString(eventUnSubscriptionByEventTypesRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	//获取联动事件列表
	public static String search(String host, String appKey, String appSecret, SearchRequest searchRequest){
		String searchDataApi = ARTEMIS_PATH +"/api/els/v1/events/search";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	public void searchAll(String host, String appKey, String appSecret, SearchRequest searchRequest, List<HkDataList> resultArr){
		String resultStr = search(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);

		HkResultDataDto hkResultDataDto =JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAll(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}


	//获取卡口信息
	public static String searchKk(String host, String appKey, String appSecret, SearchRequestKk searchRequest){
		String searchDataApi = ARTEMIS_PATH +"/api/mpc/v2/illegal/events/search";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public static void searchAllKk(String host, String appKey, String appSecret, SearchRequestKk searchRequest, List<HkKkDataList> resultArr){
		String resultStr = searchKk(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);

		HkResultDataDto hkResultDataDto =JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAllKk(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}




	//获取卡口照片
	public String getImage(String host, String appKey, String appSecret, ImageRequest searchRequest){
		String searchDataApi = ARTEMIS_PATH +"/api/mpc/v1/events/image";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body =JSONUtil.toJsonStr(searchRequest);
		String httpSchema = (String)path.keySet().toArray()[0];
		if (httpSchema != null && !StringUtils.isEmpty(httpSchema)) {
			String redirectUrl="";
			try {
				Map headers = new HashMap();
				headers.put("Accept", "*/*");
				headers.put("Content-Type", "application/json");
				Request request = new Request(Method.POST_STRING, httpSchema + artemisConfig.getHost(), (String)path.get(httpSchema), artemisConfig.getAppKey(), artemisConfig.getAppSecret(), Constants.DEFAULT_TIMEOUT);
				request.setHeaders(headers);
				request.setStringBody(body);
				Response response = Client.execute(request);
				redirectUrl = response.getHeader("Location");
			} catch (Exception var11) {
                log.error("the Artemis PostString Request is failed[doPostStringArtemis]", var11);
			}
			//閲嶅畾鍚戝悗鐨剈rl
			return redirectUrl;
		} else {
			throw new RuntimeException("http鍜宧ttps鍙傛暟閿欒httpSchema: " + httpSchema);
		}
	}


	//摄像头在线情况<安防>
	public  String getVideoStatus(String host, String appKey, String appSecret, videoStatusRequest searchRequest){
		String searchDataApi = ARTEMIS_PATH +"/api/nms/v1/online/camera/get";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
			result =  new String(result.getBytes(), "UTF-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public  void searchAllVideoStatus(String host, String appKey, String appSecret, videoStatusRequest searchRequest, List<HkVideoStatusDataList> resultArr){
		String resultStr = getVideoStatus(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);

		HkResultDataDto hkResultDataDto = JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAllVideoStatus(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}


	//编码摄像头在线情况<安防>
	public static String getBMVideoStatus(String host, String appKey, String appSecret, videoStatusRequest searchRequest){
		String searchDataApi = ARTEMIS_PATH +"/api/nms/v1/online/encode_device/get";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
			result =  new String(result.getBytes(), "UTF-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public static void searchAllBMVideoStatus(String host, String appKey, String appSecret, videoStatusRequest searchRequest, List<HkVideoStatusDataList> resultArr){
		String resultStr = getBMVideoStatus(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);

		HkResultDataDto hkResultDataDto = JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAllBMVideoStatus(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}

	//获取卡口抓拍
	public String searchKkZp(String host, String appKey, String appSecret, VehicleRecordRequest searchRequest){
		String searchDataApi = ARTEMIS_PATH +"/api/mpc/v1/events/vehicleRecord";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
			result =  new String(result.getBytes(), "UTF-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public  void searchAllKkZp(String host, String appKey, String appSecret, VehicleRecordRequest searchRequest, List<HkKkZpDataList> resultArr){
		String resultStr = searchKkZp(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);

		HkResultDataDto hkResultDataDto =JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAllKkZp(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}



	public static   String searchVideosStatic(String host, String appKey, String appSecret, SearchRequestVideo searchRequest){

		String searchDataApi = ARTEMIS_PATH +"/api/resource/v2/camera/search";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
			result =  new String(result.getBytes(), "UTF-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public static   String searchVideosStaticForZNYY(String host, String appKey, String appSecret, SearchRequestVideo searchRequest){

		String searchDataApi = ARTEMIS_PATH +"/api/resource/v1/cameras";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
			result =  new String(result.getBytes(), "UTF-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public static   String searchVideosTreeStaticForZNYY(String host, String appKey, String appSecret){

		String searchDataApi = ARTEMIS_PATH +"/api/resource/v1/unit/getAllTreeCode";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,null,null,null,"application/json");
			result =  new String(result.getBytes(), "UTF-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public static   String searchVideosAreaStaticForZNYY(String host, String appKey, String appSecret,SearchRequestVideo searchRequest){

		String searchDataApi = ARTEMIS_PATH +"/api/resource/v1/regions";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
			result =  new String(result.getBytes(), "UTF-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	/**
	 * 功能描述: 获取安防平台摄像头
	 *
	 * @param: [host, appKey, appSecret, searchRequest]
	 * @return: java.lang.String
	 * @auther: WSche
	 **/
	public  String searchVideos(String host, String appKey, String appSecret, SearchRequestVideo searchRequest){

		String searchDataApi = ARTEMIS_PATH +"/api/resource/v2/camera/search";
		ArtemisConfig artemisConfig = new ArtemisConfig(host, appKey, appSecret);
		Map<String,String> path = new HashMap<String,String>(2){
			{
				put("https://",searchDataApi);
			}
		};
		String body=JSON.toJSONString(searchRequest);
		String result = null;
		try {
			result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
			result =  new String(result.getBytes(), "UTF-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public void searchAllVideos(String host, String appKey, String appSecret, SearchRequestVideo searchRequest, JSONArray resultArr){
		String resultStr = searchVideos(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);
		HkResultDataDto hkResultDataDto =JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAllVideos(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}
	public static void searchAllVideosStatic(String host, String appKey, String appSecret, SearchRequestVideo searchRequest, JSONArray resultArr){
		String resultStr = searchVideosStatic(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);
		HkResultDataDto hkResultDataDto =JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAllVideosStatic(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}
	/**
	 * 功能描述: 获取城管摄像头
	 *
	 * @param: [host, appKey, appSecret, searchRequest, resultArr]
	 * @return: void
	 * @auther: WSche
	 **/
	public static void searchAllVideosForZNYY(String host, String appKey, String appSecret, SearchRequestVideo searchRequest, JSONArray resultArr){
		String resultStr = searchVideosStaticForZNYY(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);
		HkResultDataDto hkResultDataDto =JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAllVideosForZNYYStatic(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}
	public static void searchAllVideosForZNYYStatic(String host, String appKey, String appSecret, SearchRequestVideo searchRequest, JSONArray resultArr){
		String resultStr = searchVideosStaticForZNYY(host,appKey,appSecret,searchRequest);
		cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resultStr);
		HkResultDataDto hkResultDataDto =JSONUtil.toBean(jsonObject, HkResultDataDto.class);
		String code = hkResultDataDto.getCode();
		if("0".equals(code)){
			HkPageDataDto hkPageDataDto = hkResultDataDto.getData();
			resultArr.addAll(hkPageDataDto.getList());
			if(hkPageDataDto.getPageNo() * hkPageDataDto.getPageSize() < hkPageDataDto.getTotal()){
				searchRequest.setPageNo(searchRequest.getPageNo() + 1);
				searchAllVideosForZNYYStatic(host,appKey,appSecret,searchRequest,resultArr);
			}
		}
	}


	public String getCarType(String carType){
		String  result = "";
		switch (carType){
			case ("threeWheelVehicle"):
				return "三轮车";
			case ("van"):
				return "面包车";
			case ("mediumBus"):
				return "中型客车";
			case ("truck"):
				return "货车";
			case ("SUVMPV"):
				return "SUVMPV";
			case ("pedestrian"):
				return "行人";
			case ("largeBus"):
				return "大型客车";
			case ("twoWheelVehicle"):
				return "二轮车";
			case ("buggy"):
				return "小货车";
			case ("vehicle"):
				return "轿车";
			default:
				return "未知";
		}
	}
	public String getPlateType(String PlateType){
		String  result = "";
		switch (PlateType){
			case("tempEntry"): return "临时入境车";
			case("civilAviation"): return "民航车牌类型";
			case("upDownMilitay"): return "上下军车";
			case("newEnergy"): return "新能源车牌";
			case("04NewMilitay"): return  "04式新军车";
			case("trailer"): return "挂车";
			case("green1325FarmVehicle"): return  "绿色1325农用车";
			case("yellow1225FarmVehicle"): return  "黄色1225农用车";
			case("92TypeCivil"): return  "92式民用车";
			case("oneLineArm"): return  "一行结构的新武警车";
			case("hongKongMacao"): return "港澳入出车";
			case("arm"): return "警车";
			case("leftRightMilitay"): return "左右军车";
			case("twoLineArm"): return  "两行结构的新武警车";
			case("yellowTwoLine"): return "黄色双行尾牌";
			case("consulate"): return "领馆汽车";
			case("02TypePersonalized"): return  "02式个性化车";
			case("tempTravl"): return "临时行驶车";
			case("motorola"): return "摩托车";
			case("embassy"): return "使馆车";
			case("coach"): return "教练车";
			case("92TypeArm"): return  "92式武警车";
			default:
				return "未知";
		}
	}



	public static void main(String[] args) {
		
	}

}

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值