Pārlūkot izejas kodu

修改业务类

wwh 2 gadi atpakaļ
vecāks
revīzija
d2f1ff7b15
15 mainītis faili ar 1126 papildinājumiem un 139 dzēšanām
  1. 203 88
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/ClientAllEventServiceImpl.java
  2. 6 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/constant/Constant.java
  3. 133 49
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/controller/ClientAllEventControllerTest.java
  4. 82 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Cn/ClientAllEventRecordRequestCn.java
  5. 78 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Cn/ClientAllEventRequestCn.java
  6. 65 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Cn/ClientEventFaceRequestCn.java
  7. 63 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Cn/ClientEventgetCarRequestCn.java
  8. 82 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Hn/ClientAllEventRecordRequestHn.java
  9. 78 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Hn/ClientAllEventRequestHn.java
  10. 65 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Hn/ClientEventFaceRequestHn.java
  11. 63 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Hn/ClientEventgetCarRequestHn.java
  12. 3 2
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/ClientAllEventRecordRequestSg.java
  13. 76 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Sg/ClientAllEventRequestSg.java
  14. 64 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Sg/ClientEventFaceRequestSg.java
  15. 65 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Sg/ClientEventgetCarRequestSg.java

+ 203 - 88
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/ClientAllEventServiceImpl.java

@@ -15,6 +15,18 @@ import com.huimv.video.dhicc.service.IClientAllEventService;
 import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
 import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
 import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
+import com.huimv.video.dhicc.test.request.event.Cn.ClientAllEventRecordRequestCn;
+import com.huimv.video.dhicc.test.request.event.Cn.ClientAllEventRequestCn;
+import com.huimv.video.dhicc.test.request.event.Cn.ClientEventFaceRequestCn;
+import com.huimv.video.dhicc.test.request.event.Cn.ClientEventgetCarRequestCn;
+import com.huimv.video.dhicc.test.request.event.Hn.ClientAllEventRecordRequestHn;
+import com.huimv.video.dhicc.test.request.event.Hn.ClientAllEventRequestHn;
+import com.huimv.video.dhicc.test.request.event.Hn.ClientEventFaceRequestHn;
+import com.huimv.video.dhicc.test.request.event.Hn.ClientEventgetCarRequestHn;
+import com.huimv.video.dhicc.test.request.event.Sg.ClientAllEventRecordRequestSg;
+import com.huimv.video.dhicc.test.request.event.Sg.ClientAllEventRequestSg;
+import com.huimv.video.dhicc.test.request.event.Sg.ClientEventFaceRequestSg;
+import com.huimv.video.dhicc.test.request.event.Sg.ClientEventgetCarRequestSg;
 import com.huimv.video.dhicc.util.GetResponse;
 import lombok.extern.slf4j.Slf4j;
 import net.sf.json.JSONObject;
@@ -159,7 +171,7 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
     //车辆闸机事件
     private R getCarAutoGate(HttpServletRequest request, Map<String, Object> paramsMap) throws ClientException {
         Integer farmId = (int) paramsMap.get("farmId");
-        GeneralResponse grObj = getCarRecord(request, farmId);
+        Object grObj = getCarRecord(request, farmId);
         com.alibaba.fastjson.JSONObject grJo = JSON.parseObject(com.alibaba.fastjson.JSONObject.toJSONString(grObj));
         com.alibaba.fastjson.JSONObject resultJo = grJo.getJSONObject("result");
         com.alibaba.fastjson.JSONObject dataJo = resultJo.getJSONObject("data");
@@ -179,28 +191,37 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
     }
 
     //查询车辆通行记录 by Yangdi
-    public GeneralResponse getCarRecord(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException {
-        if (farmId != 1) {
-            //返回为空数据
-            return new GeneralResponse();
-        }
+    public Object getCarRecord(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException {
         System.out.println(request.getRequestURL());
         System.out.println(request.getQueryString());
         String queryString = request.getQueryString();
-        String URL = "/evo-apigw/ipms/carcapture/find/conditions?";  //获取事件URL    post请求
-        IClient iClient = new DefaultClient();
-        System.out.println("开始执行");
-        String newUrl = URL + queryString;
-        System.out.println(newUrl);
-        //这种已经在配置文件里面安排了账号ip以及密码    现在变了
-        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
-        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
-        System.out.println("执行结束");
-        return generalResponse;
+        Object action = null;
+        if (farmId == 1) {
+            System.out.println("shuguang");
+            ClientEventgetCarRequestSg requestSg = new ClientEventgetCarRequestSg(oauthConfigBaseInfo);
+            requestSg.setUrls(queryString);
+            Object action1 = requestSg.doAction();
+            action = action1;
+        }
+        if (farmId == 22) {
+            System.out.println("haining");
+            ClientEventgetCarRequestHn requestHn = new ClientEventgetCarRequestHn(oauthConfigBaseInfo02);
+            requestHn.setUrls(queryString);
+            Object action1 = requestHn.doAction();
+            action = action1;
+        }
+        if (farmId == 21) {
+            System.out.println("cangnan");
+            ClientEventgetCarRequestCn requestCn = new ClientEventgetCarRequestCn(oauthConfigBaseInfo03);
+            requestCn.setUrls(queryString);
+            Object action1 = requestCn.doAction();
+            action = action1;
+        }
+        return action;
     }
 
     //返回所有的事件 的集合  包括死猪和洗消和大门 --分页参数 by Yangdi
-    public GeneralResponse getEventList(Map<String, Object> params1, String[] nodeCodeListIn) throws ClientException {
+    public Object getEventList(Map<String, Object> params1, String[] nodeCodeListIn) throws ClientException {
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Calendar c = Calendar.getInstance();
         Date date = new Date();
@@ -214,30 +235,64 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
         Date d = c.getTime();
         String formatD = format.format(d);
         Map<String, Object> params = new HashMap<>();
-        params.put("alarmStartDateString", formatA);
-        params.put("alarmEndDateString", formatD);
-        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
-            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
-            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        Object action = null;
+        Integer farmId = (Integer) params1.get("farmId");
+        if (farmId == 1) {
+            System.out.println("shuguang");
+            ClientAllEventRecordRequestSg requestSg = new ClientAllEventRecordRequestSg(oauthConfigBaseInfo);
+            requestSg.setAlarmType(303);
+            requestSg.setDbType(0);
+            requestSg.setDeviceCategory(1);
+            requestSg.setPageNum((Integer) params1.get("pageNum"));
+            requestSg.setPageSize((Integer) params1.get("pageSize"));
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestSg.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestSg.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestSg.setAlarmStartDateString(formatA);
+                requestSg.setAlarmEndDateString(formatD);
+            }
+            Object action1 = requestSg.doAction();
+            action = action1;
         }
-        params.put("pageNum", (Integer) params1.get("pageNum"));
-        params.put("pageSize", (Integer) params1.get("pageSize"));
-        params.put("alarmType", 303);
-        params.put("dbType", 0);
-        params.put("deviceCategory", 1);
-//        String[] nodeCodeList = CommonConstant.AllChannle;
-        params.put("nodeCodeList", nodeCodeListIn);
-        // String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page"; //获取事件URL    post请求
-        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
-        IClient iClient = new DefaultClient();
-        String NewUrl = URL;
-        //这种已经在配置文件里面安排了账号ip以及密码
-        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
-        System.out.println(NewUrl);
-        generalRequest.header("Content-Type", " application/json");
-        generalRequest.body(JSON.toJSONString(params));
-        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
-        return generalResponse;
+        if (farmId == 22) {
+            System.out.println("haining");
+            ClientAllEventRecordRequestHn requestHn = new ClientAllEventRecordRequestHn(oauthConfigBaseInfo02);
+            requestHn.setAlarmType(303);
+            requestHn.setDbType(0);
+            requestHn.setDeviceCategory(1);
+            requestHn.setPageNum((Integer) params1.get("pageNum"));
+            requestHn.setPageSize((Integer) params1.get("pageSize"));
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestHn.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestHn.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestHn.setAlarmStartDateString(formatA);
+                requestHn.setAlarmEndDateString(formatD);
+            }
+            Object action1 = requestHn.doAction();
+            action = action1;
+        }
+        if (farmId == 21) {
+            System.out.println("cangnan");
+            ClientAllEventRecordRequestCn requestCn = new ClientAllEventRecordRequestCn(oauthConfigBaseInfo03);
+            requestCn.setAlarmType(303);
+            requestCn.setDbType(0);
+            requestCn.setDeviceCategory(1);
+            requestCn.setPageNum((Integer) params1.get("pageNum"));
+            requestCn.setPageSize((Integer) params1.get("pageSize"));
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestCn.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestCn.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestCn.setAlarmStartDateString(formatA);
+                requestCn.setAlarmEndDateString(formatD);
+            }
+            Object action1 = requestCn.doAction();
+            action = action1;
+
+        }
+        return action;
     }
 
     //计算次数 by Yangdi
@@ -255,35 +310,61 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
         Date d = c.getTime();
         String formatD = format.format(d);
         Map<String, Object> params = new HashMap<>();
-        params.put("alarmStartDateString", formatA);
-        params.put("alarmEndDateString", formatD);
-        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
-            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
-            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+
+        JSONObject jsonObject1 = null;
+        Integer farmId = (Integer) params1.get("farmId");
+        if (farmId == 1) {
+            System.out.println("shuguang");
+            ClientAllEventRequestSg requestSg = new ClientAllEventRequestSg(oauthConfigBaseInfo);
+            requestSg.setAlarmType(303);
+            requestSg.setDbType(0);
+            requestSg.setDeviceCategory(1);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestSg.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestSg.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestSg.setAlarmStartDateString(formatA);
+                requestSg.setAlarmEndDateString(formatD);
+            }
+            Object action1 = requestSg.doAction();
+            JSONObject jsonObject = JSONObject.fromObject(action1);
+            jsonObject1 = jsonObject;
+        }
+        if (farmId == 22) {
+            System.out.println("haining");
+            ClientAllEventRequestHn requestHn = new ClientAllEventRequestHn(oauthConfigBaseInfo02);
+            requestHn.setAlarmType(303);
+            requestHn.setDbType(0);
+            requestHn.setDeviceCategory(1);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestHn.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestHn.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestHn.setAlarmStartDateString(formatA);
+                requestHn.setAlarmEndDateString(formatD);
+            }
+            Object action1 = requestHn.doAction();
+            JSONObject jsonObject = JSONObject.fromObject(action1);
+            jsonObject1 = jsonObject;
+        }
+        if (farmId == 21) {
+            System.out.println("cangnan");
+            ClientAllEventRequestCn requestCn = new ClientAllEventRequestCn(oauthConfigBaseInfo03);
+            requestCn.setAlarmType(303);
+            requestCn.setDbType(0);
+            requestCn.setDeviceCategory(1);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestCn.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestCn.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestCn.setAlarmStartDateString(formatA);
+                requestCn.setAlarmEndDateString(formatD);
+            }
+            Object action1 = requestCn.doAction();
+            JSONObject jsonObject = JSONObject.fromObject(action1);
+            jsonObject1 = jsonObject;
+
         }
-        params.put("alarmType", 303);
-        params.put("dbType", 0);
-        params.put("deviceCategory", 1);
-//        String[] nodeCodeList = CommonConstant.AllChannle;
-        params.put("nodeCodeList", nodeCodeListIn);
-        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
-        IClient iClient = new DefaultClient();
-        String NewUrl = URL;
-        System.out.println("开始执行");
-        //这种已经在配置文件里面安排了账号ip以及密码
-        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
-        System.out.println(NewUrl);
-        generalRequest.header("Content-Type", " application/json");
-        System.out.println(JSON.toJSONString(params));
-        //里面是
-        generalRequest.body(JSON.toJSONString(params));
-        //发起请求处理应答
-        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
-        System.out.println("执行结束");
-        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
-        Object data = jsonObject.get("data");
-        JSONObject jsonObject1 = JSONObject.fromObject(data);
-        System.out.println(jsonObject1);
         return jsonObject1.get("value").toString();
     }
 
@@ -291,10 +372,6 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
     public R getAccidentRecord(Map<String, Object> params1) throws ClientException {
         System.out.println("## params1>>" + params1);
         Integer farmId = (int) params1.get("farmId");
-        if (farmId != 1) {
-            //返回为空数据
-            return null;
-        }
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Calendar c = Calendar.getInstance();
         Date date = new Date();
@@ -307,23 +384,61 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
         c.set(Calendar.HOUR, +24);
         Date d = c.getTime();
         String formatD = format.format(d);
-        if (!StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
-            params1.put("alarmStartDateString", formatA);
-            params1.put("alarmEndDateString", formatD);
+        String value = String.valueOf((new Date()).getTime());
+        Object action = null;
+        if (farmId == 1) {
+            System.out.println("shuguang");
+            ClientEventFaceRequestSg requestSg = new ClientEventFaceRequestSg(oauthConfigBaseInfo);
+            requestSg.setContainDomain("1");
+            requestSg.setOpenType("61");
+            if (!StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestSg.setAlarmStartDateString(formatA);
+                requestSg.setAlarmEndDateString(formatD);
+            } else {
+                requestSg.setAlarmStartDateString(value);
+            }
+            Object action1 = requestSg.doAction();
+            action = action1;
+            GetResponse getResponse = new GetResponse();
+            //TODO
+            return R.ok("请求成功").put("data", action).put("total", getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"), (String) params1.get("endSwingTime"), 0, null, oauthConfigBaseInfo));
+        } else if (farmId == 22) {
+            System.out.println("haining");
+            ClientEventFaceRequestHn requestHn = new ClientEventFaceRequestHn(oauthConfigBaseInfo02);
+            requestHn.setContainDomain("1");
+            requestHn.setOpenType("61");
+            if (!StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestHn.setAlarmStartDateString(formatA);
+                requestHn.setAlarmEndDateString(formatD);
+            } else {
+                requestHn.setAlarmStartDateString(value);
+            }
+            Object action1 = requestHn.doAction();
+            action = action1;
+            GetResponse getResponse = new GetResponse();
+            //TODO
+            return R.ok("请求成功").put("data", action).put("total", getResponse.SendMassageGetPagePersonAlarm02((String) params1.get("startSwingTime"), (String) params1.get("endSwingTime"), 0, null, oauthConfigBaseInfo02));
+        } else if (farmId == 21) {
+            System.out.println("cangnan");
+            ClientEventFaceRequestCn requestCn = new ClientEventFaceRequestCn(oauthConfigBaseInfo03);
+            requestCn.setContainDomain("1");
+            requestCn.setOpenType("61");
+            if (!StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestCn.setAlarmStartDateString(formatA);
+                requestCn.setAlarmEndDateString(formatD);
+            } else {
+                requestCn.setAlarmStartDateString(value);
+            }
+            Object action1 = requestCn.doAction();
+            action = action1;
+            GetResponse getResponse = new GetResponse();
+            //TODO
+            return R.ok("请求成功").put("data", action).put("total", getResponse.SendMassageGetPagePersonAlarm03((String) params1.get("startSwingTime"), (String) params1.get("endSwingTime"), 0, null, oauthConfigBaseInfo03));
+        } else {
+            //TODO
+            return R.error("请求失败");
         }
-        params1.put("containDomain", "1");
-        params1.put("openType", "61");
-//        params1.put("openResult", 1); //刷脸失败
-        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined?";
-        IClient iClient = new DefaultClient();
-        GeneralRequest generalRequest = new GeneralRequest(URL + Long.valueOf(String.valueOf((new Date()).getTime())), Method.POST);
-        generalRequest.header("Content-Type", " application/json");
-        generalRequest.body(JSON.toJSONString(params1));
-        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
-        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
-        GetResponse getResponse = new GetResponse();
-        //TODO
-        return R.ok("请求成功").put("data", generalResponse).put("total", getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"), (String) params1.get("endSwingTime"),0,null,oauthConfigBaseInfo));
+
     }
 
     //查询人员违规记录 by Yangdi

+ 6 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/constant/Constant.java

@@ -314,4 +314,10 @@ public class Constant {
     public static final String  COMBINED_COUNT = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount";
 
     public static final String  CAR_COMBINED_COUNT = "/evo-apigw/ipms/carcapture/find/conditions?queryTimeBegin={queryTimeBegin}&queryTimeEnd={queryTimeEnd}&carDirect={carDirect}";
+
+    //
+    public static final String  COUNT_TIME = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";
+
+    //
+    public static final String  GET_CAR_RECORD = "/evo-apigw/ipms/carcapture/find/conditions/?{urls}";
 }

+ 133 - 49
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/controller/ClientAllEventControllerTest.java

@@ -1,20 +1,22 @@
 package com.huimv.video.dhicc.test.controller;
 
 
-import com.alibaba.fastjson.JSON;
-import com.dahuatech.hutool.http.Method;
+
 import com.dahuatech.icc.exception.ClientException;
-import com.dahuatech.icc.oauth.http.DefaultClient;
-import com.dahuatech.icc.oauth.http.IClient;
-import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
-import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
 import com.huimv.common.utils.StringUtilsWork;
 import com.huimv.video.dhicc.icc.CommonConstant;
 import com.huimv.video.dhicc.result.R;
 import com.huimv.video.dhicc.service.IClientAllEventService;
 import com.huimv.video.dhicc.service.ISysTelecomEventService;
 import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
-import com.huimv.video.dhicc.test.request.ClientAllEventRecordRequestSg;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
+import com.huimv.video.dhicc.test.request.event.Cn.ClientAllEventRecordRequestCn;
+import com.huimv.video.dhicc.test.request.event.Hn.ClientAllEventRecordRequestHn;
+import com.huimv.video.dhicc.test.request.event.Sg.ClientAllEventRecordRequestSg;
+import com.huimv.video.dhicc.test.request.event.Cn.ClientAllEventRequestCn;
+import com.huimv.video.dhicc.test.request.event.Hn.ClientAllEventRequestHn;
+import com.huimv.video.dhicc.test.request.event.Sg.ClientAllEventRequestSg;
 import net.sf.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -24,12 +26,11 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Map;
 
 
 @RestController
-@RequestMapping("/client/event/test")
+@RequestMapping("/client/event/Test")
 public class ClientAllEventControllerTest {
     @Autowired
     private ISysTelecomEventService sysTelecomEventService;
@@ -37,6 +38,10 @@ public class ClientAllEventControllerTest {
     private IClientAllEventService iClientAllEventService;
     @Autowired
     private OauthConfigBaseInfo oauthConfigBaseInfo;
+    @Autowired
+    private OauthConfigBaseInfo02 oauthConfigBaseInfo02;
+    @Autowired
+    private OauthConfigBaseInfo03 oauthConfigBaseInfo03;
 
     //所有的事件接口
     @RequestMapping("/ListAllEvent")
@@ -63,30 +68,71 @@ public class ClientAllEventControllerTest {
         c.set(Calendar.HOUR, +24);
         Date d = c.getTime();
         String formatD = format.format(d);
-//        Map<String, Object> params = new HashMap<>();
-        ClientAllEventRecordRequestSg requestSg = new ClientAllEventRecordRequestSg(oauthConfigBaseInfo);
-        requestSg.setAlarmStartDateString(formatA);
-        requestSg.setAlarmEndDateString(formatD);
-
-        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
-            requestSg.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
-            requestSg.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+
+        Integer farmId =(int) params1.get("farmId");
+        Object action=null;
+        if (farmId == 1) {
+            System.out.println("shuguang");
+            ClientAllEventRecordRequestSg requestSg = new ClientAllEventRecordRequestSg(oauthConfigBaseInfo);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestSg.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestSg.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestSg.setAlarmStartDateString(formatA);
+                requestSg.setAlarmEndDateString(formatD);
+            }
+            requestSg.setPageNum((Integer) params1.get("pageNum"));
+            requestSg.setPageSize((Integer) params1.get("pageSize"));
+            requestSg.setAlarmType(303);
+            requestSg.setDbType(0);
+            requestSg.setDeviceCategory(1);
+            String[] nodeCodeList = CommonConstant.AllChannle;
+            requestSg.setNodeCodeList(nodeCodeList);
+            Object action1 = requestSg.doAction();
+            action = action1;
         }
-        requestSg.setPageNum((Integer) params1.get("pageNum"));
-        requestSg.setPageSize((Integer) params1.get("pageSize"));
-        requestSg.setAlarmType(303);
-        requestSg.setDbType(0);
-        requestSg.setDeviceCategory(1);
-        String[] nodeCodeList = CommonConstant.AllChannle;
-        requestSg.setNodeCodeList(nodeCodeList);
-        Object action = requestSg.doAction();
-
-      /*  String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
-        IClient iClient = new DefaultClient();
-        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
-        generalRequest.header("Content-Type", " application/json");
-        generalRequest.body(JSON.toJSONString(params));
-        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());*/
+        if (farmId == 22) {
+            System.out.println("haining");
+            ClientAllEventRecordRequestHn requestHn = new ClientAllEventRecordRequestHn(oauthConfigBaseInfo02);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestHn.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestHn.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestHn.setAlarmStartDateString(formatA);
+                requestHn.setAlarmEndDateString(formatD);
+            }
+            requestHn.setPageNum((Integer) params1.get("pageNum"));
+            requestHn.setPageSize((Integer) params1.get("pageSize"));
+            requestHn.setAlarmType(303);
+            requestHn.setDbType(0);
+            requestHn.setDeviceCategory(1);
+            String[] nodeCodeList = CommonConstant.AllChannle;
+            requestHn.setNodeCodeList(nodeCodeList);
+            Object action1 = requestHn.doAction();
+            action = action1;
+        }
+        if (farmId == 21) {
+            System.out.println("cangnan");
+            ClientAllEventRecordRequestCn requestCn = new ClientAllEventRecordRequestCn(oauthConfigBaseInfo03);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestCn.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestCn.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestCn.setAlarmStartDateString(formatA);
+                requestCn.setAlarmEndDateString(formatD);
+            }
+            requestCn.setPageNum((Integer) params1.get("pageNum"));
+            requestCn.setPageSize((Integer) params1.get("pageSize"));
+            requestCn.setAlarmType(303);
+            requestCn.setDbType(0);
+            requestCn.setDeviceCategory(1);
+            String[] nodeCodeList = CommonConstant.AllChannle;
+            requestCn.setNodeCodeList(nodeCodeList);
+            Object action1= requestCn.doAction();
+            action = action1;
+        }
+
+
         return action;
     }
 
@@ -104,24 +150,62 @@ public class ClientAllEventControllerTest {
         c.set(Calendar.HOUR, +24);
         Date d = c.getTime();
         String formatD = format.format(d);
-        Map<String, Object> params = new HashMap<>();
-        params.put("alarmStartDateString", formatA);
-        params.put("alarmEndDateString", formatD);
-        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
-            params.put("alarmStartDateString", params1.get("alarmStartDateString"));
-            params.put("alarmEndDateString", params1.get("alarmEndDateString"));
-        }
-        params.put("alarmType", 303);
-        params.put("dbType", 0);
-        params.put("deviceCategory", 1);
         String[] nodeCodeList = CommonConstant.AllChannle;
-        params.put("nodeCodeList", nodeCodeList);
-        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
-        IClient iClient = new DefaultClient();
-        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
-        generalRequest.header("Content-Type", " application/json");
-        generalRequest.body(JSON.toJSONString(params));
-        JSONObject jsonObject = JSONObject.fromObject(JSONObject.fromObject(iClient.doAction(generalRequest, generalRequest.getResponseClass()).getResult()).get("data"));
+
+        JSONObject jsonObject = null;
+        if ((int) params1.get("farmId") == 1) {
+            System.out.println("shuguang");
+            ClientAllEventRequestSg requestSg = new ClientAllEventRequestSg(oauthConfigBaseInfo);
+            requestSg.setDbType(0);
+            requestSg.setAlarmType(303);
+            requestSg.setDeviceCategory(1);
+            requestSg.setNodeCodeList(nodeCodeList);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestSg.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestSg.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestSg.setAlarmStartDateString(formatA);
+                requestSg.setAlarmEndDateString(formatD);
+            }
+            JSONObject action = JSONObject.fromObject(requestSg.doAction());
+            jsonObject = action;
+
+        }
+        if ((int) params1.get("farmId") == 22) {
+            System.out.println("haining");
+            ClientAllEventRequestHn requestHn = new ClientAllEventRequestHn(oauthConfigBaseInfo02);
+            requestHn.setDbType(0);
+            requestHn.setAlarmType(303);
+            requestHn.setDeviceCategory(1);
+            requestHn.setNodeCodeList(nodeCodeList);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestHn.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestHn.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestHn.setAlarmStartDateString(formatA);
+                requestHn.setAlarmEndDateString(formatD);
+            }
+            JSONObject action = JSONObject.fromObject(requestHn.doAction());
+            jsonObject = action;
+        }
+        if ((int) params1.get("farmId") == 21) {
+            System.out.println("cangnan");
+            ClientAllEventRequestCn requestCn = new ClientAllEventRequestCn(oauthConfigBaseInfo03);
+            requestCn.setDbType(0);
+            requestCn.setAlarmType(303);
+            requestCn.setDeviceCategory(1);
+            requestCn.setNodeCodeList(nodeCodeList);
+            if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+                requestCn.setAlarmStartDateString((String) params1.get("alarmStartDateString"));
+                requestCn.setAlarmEndDateString((String) params1.get("alarmEndDateString"));
+            } else {
+                requestCn.setAlarmStartDateString(formatA);
+                requestCn.setAlarmEndDateString(formatD);
+            }
+            JSONObject action = JSONObject.fromObject(requestCn.doAction());
+            jsonObject = action;
+        }
+
         return jsonObject.get("value").toString();
     }
 

+ 82 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Cn/ClientAllEventRecordRequestCn.java

@@ -0,0 +1,82 @@
+package com.huimv.video.dhicc.test.request.event.Cn;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.request.BaseRequest03;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class ClientAllEventRecordRequestCn extends BaseRequest03<Object> {
+
+
+    private String alarmStartDateString;
+
+    private String alarmEndDateString;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+
+    private Integer alarmType;
+
+    private Integer dbType;
+
+    private Integer deviceCategory;
+
+    private String[] nodeCodeList;
+
+
+    public ClientAllEventRecordRequestCn() {
+    }
+
+    public ClientAllEventRecordRequestCn(OauthConfigBaseInfo03 oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_POST, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.CHANNEL_URL_ALARM_RECORD, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader()) : HttpsURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader());
+        System.out.println(res);
+        //获取响应
+        JSONObject jsonObject = JSONObject.parseObject(res);
+        Object data = jsonObject.get("data");
+        // PersonListResponseSg devicePageResponse = JSON.parseObject(res, PersonListResponseSg.class);
+
+        return data;
+    }
+
+    private void setBody() {
+        //设置请求参数
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("alarmType", this.alarmType);
+        map.put("dbType", this.dbType);
+        map.put("deviceCategory", this.deviceCategory);
+        map.put("nodeCodeList", this.nodeCodeList);
+        map.put("pageNum", this.pageNum);
+        map.put("pageSize", this.pageSize);
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 78 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Cn/ClientAllEventRequestCn.java

@@ -0,0 +1,78 @@
+package com.huimv.video.dhicc.test.request.event.Cn;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.request.BaseRequest03;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class ClientAllEventRequestCn extends BaseRequest03<Object> {
+
+
+
+    private Integer alarmType;
+    private Integer dbType;
+    private Integer deviceCategory;
+    private String[] nodeCodeList;
+    private String alarmStartDateString;
+    private String alarmEndDateString;
+
+
+
+
+
+
+
+    public ClientAllEventRequestCn() {
+    }
+
+    public ClientAllEventRequestCn(OauthConfigBaseInfo03 oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_POST, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.COUNT_TIME, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader()) : HttpsURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader());
+
+        System.out.println(res);
+        //获取响应
+        JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");
+        return action;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmType", this.alarmType);
+        map.put("nodeCodeList", this.nodeCodeList);
+        map.put("dbType", this.dbType);
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("deviceCategory", this.deviceCategory);
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 65 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Cn/ClientEventFaceRequestCn.java

@@ -0,0 +1,65 @@
+package com.huimv.video.dhicc.test.request.event.Cn;
+
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest02;
+import com.huimv.video.dhicc.test.request.BaseRequest03;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+@Data
+public class ClientEventFaceRequestCn extends BaseRequest03<Object> {
+
+
+
+    private String value;
+    private String containDomain;
+    private String openType;
+    private String alarmStartDateString;
+    private String alarmEndDateString;
+
+
+
+
+
+
+
+
+    public ClientEventFaceRequestCn() {
+    }
+
+    public ClientEventFaceRequestCn(OauthConfigBaseInfo03 oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_POST, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.CAR_PERSON_FACE_FAIL, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader()) : HttpsURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader());
+
+        System.out.println(res);
+        //获取响应
+        /*JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");*/
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 63 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Cn/ClientEventgetCarRequestCn.java

@@ -0,0 +1,63 @@
+package com.huimv.video.dhicc.test.request.event.Cn;
+
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.request.BaseRequest03;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+@Data
+public class ClientEventgetCarRequestCn extends BaseRequest03<Object> {
+
+
+
+    private String urls;
+
+
+
+
+
+
+
+
+    public ClientEventgetCarRequestCn() {
+    }
+
+    public ClientEventgetCarRequestCn(OauthConfigBaseInfo03 oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_GET, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.COUNT_TIME, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        this.setUrls(this.getUrl().replace("{urls}",urls));
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doGet03(this) : HttpsURLConnectionUtil.doGet03(this);
+
+        System.out.println(res);
+        //获取响应
+        JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");
+        return action;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 82 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Hn/ClientAllEventRecordRequestHn.java

@@ -0,0 +1,82 @@
+package com.huimv.video.dhicc.test.request.event.Hn;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.request.BaseRequest02;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class ClientAllEventRecordRequestHn extends BaseRequest02<Object> {
+
+
+    private String alarmStartDateString;
+
+    private String alarmEndDateString;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+
+    private Integer alarmType;
+
+    private Integer dbType;
+
+    private Integer deviceCategory;
+
+    private String[] nodeCodeList;
+
+
+    public ClientAllEventRecordRequestHn() {
+    }
+
+    public ClientAllEventRecordRequestHn(OauthConfigBaseInfo02 oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_POST, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.CHANNEL_URL_ALARM_RECORD, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader()) : HttpsURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader());
+        System.out.println(res);
+        //获取响应
+        JSONObject jsonObject = JSONObject.parseObject(res);
+        Object data = jsonObject.get("data");
+        // PersonListResponseSg devicePageResponse = JSON.parseObject(res, PersonListResponseSg.class);
+
+        return data;
+    }
+
+    private void setBody() {
+        //设置请求参数
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("alarmType", this.alarmType);
+        map.put("dbType", this.dbType);
+        map.put("deviceCategory", this.deviceCategory);
+        map.put("nodeCodeList", this.nodeCodeList);
+        map.put("pageNum", this.pageNum);
+        map.put("pageSize", this.pageSize);
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 78 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Hn/ClientAllEventRequestHn.java

@@ -0,0 +1,78 @@
+package com.huimv.video.dhicc.test.request.event.Hn;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.request.BaseRequest02;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class ClientAllEventRequestHn extends BaseRequest02<Object> {
+
+
+
+    private Integer alarmType;
+    private Integer dbType;
+    private Integer deviceCategory;
+    private String[] nodeCodeList;
+    private String alarmStartDateString;
+    private String alarmEndDateString;
+
+
+
+
+
+
+
+    public ClientAllEventRequestHn() {
+    }
+
+    public ClientAllEventRequestHn(OauthConfigBaseInfo02 oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_POST, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.COUNT_TIME, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader()) : HttpsURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader());
+
+        System.out.println(res);
+        //获取响应
+        JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");
+        return action;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmType", this.alarmType);
+        map.put("nodeCodeList", this.nodeCodeList);
+        map.put("dbType", this.dbType);
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("deviceCategory", this.deviceCategory);
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 65 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Hn/ClientEventFaceRequestHn.java

@@ -0,0 +1,65 @@
+package com.huimv.video.dhicc.test.request.event.Hn;
+
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.request.BaseRequest02;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+@Data
+public class ClientEventFaceRequestHn extends BaseRequest02<Object> {
+
+
+
+    private String value;
+    private String containDomain;
+    private String openType;
+    private String alarmStartDateString;
+    private String alarmEndDateString;
+
+
+
+
+
+
+
+
+    public ClientEventFaceRequestHn() {
+    }
+
+    public ClientEventFaceRequestHn(OauthConfigBaseInfo02 oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_POST, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.CAR_PERSON_FACE_FAIL, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader()) : HttpsURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader());
+
+        System.out.println(res);
+        //获取响应
+        /*JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");*/
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 63 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Hn/ClientEventgetCarRequestHn.java

@@ -0,0 +1,63 @@
+package com.huimv.video.dhicc.test.request.event.Hn;
+
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.request.BaseRequest02;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+@Data
+public class ClientEventgetCarRequestHn extends BaseRequest02<Object> {
+
+
+
+    private String urls;
+
+
+
+
+
+
+
+
+    public ClientEventgetCarRequestHn() {
+    }
+
+    public ClientEventgetCarRequestHn(OauthConfigBaseInfo02 oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_GET, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.COUNT_TIME, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        this.setUrls(this.getUrl().replace("{urls}",urls));
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doGet02(this) : HttpsURLConnectionUtil.doGet02(this);
+
+        System.out.println(res);
+        //获取响应
+        JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");
+        return action;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 3 - 2
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/ClientAllEventRecordRequestSg.java

@@ -1,9 +1,10 @@
-package com.huimv.video.dhicc.test.request;
+package com.huimv.video.dhicc.test.request.event.Sg;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
 import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
 import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
 import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
 import com.huimv.video.dhicc.test.utils.UrlUtil;
@@ -13,7 +14,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 @Data
-public class ClientAllEventRecordRequestSg extends BaseRequest<Object>{
+public class ClientAllEventRecordRequestSg extends BaseRequest<Object> {
 
 
     private String alarmStartDateString;

+ 76 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Sg/ClientAllEventRequestSg.java

@@ -0,0 +1,76 @@
+package com.huimv.video.dhicc.test.request.event.Sg;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class ClientAllEventRequestSg extends BaseRequest<Object> {
+
+
+
+    private Integer alarmType;
+    private Integer dbType;
+    private Integer deviceCategory;
+    private String[] nodeCodeList;
+    private String alarmStartDateString;
+    private String alarmEndDateString;
+
+
+
+
+
+
+
+    public ClientAllEventRequestSg() {
+    }
+
+    public ClientAllEventRequestSg(OauthConfigBaseInfo oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_POST, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.COUNT_TIME, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader()) : HttpsURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader());
+
+        System.out.println(res);
+        //获取响应
+        JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");
+        return action;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmType", this.alarmType);
+        map.put("nodeCodeList", this.nodeCodeList);
+        map.put("dbType", this.dbType);
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("deviceCategory", this.deviceCategory);
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 64 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Sg/ClientEventFaceRequestSg.java

@@ -0,0 +1,64 @@
+package com.huimv.video.dhicc.test.request.event.Sg;
+
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+@Data
+public class ClientEventFaceRequestSg extends BaseRequest<Object> {
+
+
+
+    private String value;
+    private String containDomain;
+    private String openType;
+    private String alarmStartDateString;
+    private String alarmEndDateString;
+
+
+
+
+
+
+
+
+    public ClientEventFaceRequestSg() {
+    }
+
+    public ClientEventFaceRequestSg(OauthConfigBaseInfo oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_POST, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.CAR_PERSON_FACE_FAIL, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader()) : HttpsURLConnectionUtil.doPost(this.getUrl(), this.getBody(), this.getHeader());
+
+        System.out.println(res);
+        //获取响应
+        /*JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");*/
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 65 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/event/Sg/ClientEventgetCarRequestSg.java

@@ -0,0 +1,65 @@
+package com.huimv.video.dhicc.test.request.event.Sg;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
+import com.huimv.video.dhicc.test.constant.Constant;
+import com.huimv.video.dhicc.test.request.BaseRequest;
+import com.huimv.video.dhicc.test.utils.HttpURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.HttpsURLConnectionUtil;
+import com.huimv.video.dhicc.test.utils.UrlUtil;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class ClientEventgetCarRequestSg extends BaseRequest<Object> {
+
+
+
+    private String urls;
+
+
+
+
+
+
+
+
+    public ClientEventgetCarRequestSg() {
+    }
+
+    public ClientEventgetCarRequestSg(OauthConfigBaseInfo oauthConfigBaseInfo) {
+        super(oauthConfigBaseInfo, Constant.HTTP_GET, oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.COUNT_TIME, true);
+    }
+
+    @Override
+    public Object doAction() {
+        //重置url信息,替换版本号
+        this.setUrl(UrlUtil.dealVersion(this.getUrl()));
+        //设置请求参数
+        this.setUrls(this.getUrl().replace("{urls}",urls));
+        setBody();
+        //发送请求
+        String res = isEnableHttpTest() ? HttpURLConnectionUtil.doGet(this) : HttpsURLConnectionUtil.doGet(this);
+
+        System.out.println(res);
+        //获取响应
+        JSONObject jsonObject=JSONObject.parseObject(res);
+        System.out.println(jsonObject);
+        Object action = jsonObject.get("data");
+        return action;
+    }
+
+    private void setBody() {
+        //设置请求参数
+
+
+    }
+
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}