Browse Source

事件、照片

Newspaper 2 years ago
parent
commit
f7090ecddf

+ 50 - 14
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/GetPicture.java

@@ -7,6 +7,8 @@ import com.dahuatech.icc.oauth.http.IccTokenResponse;
 import com.dahuatech.icc.oauth.profile.IccProfile;
 import com.huimv.common.utils.StringUtilsWork;
 import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.test.manager.IOauthIntegrationManager;
+import com.huimv.video.dhicc.test.response.GetTokenResponse;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
@@ -14,6 +16,7 @@ import org.apache.http.conn.ssl.SSLContextBuilder;
 import org.apache.http.conn.ssl.TrustStrategy;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
@@ -28,30 +31,63 @@ import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
 
 import static com.huimv.video.dhicc.icc.CommonConstant.IPAndPort;
+import static com.huimv.video.dhicc.icc.CommonConstant.Sg_IPAndPort;
 
 
 @RestController
 @RequestMapping("/picture")
 public class GetPicture {
+    @Autowired
+    private IOauthIntegrationManager oauthIntegrationManager;
     @RequestMapping("/get")
     public void getCarRecord(HttpServletRequest request, HttpServletResponse response,
                              @RequestParam(name = "fileUrl", required = false) String fileUrl,
                              @RequestParam(name = "alarmPicture", required = false) String alarmPicture,
-                             @RequestParam(name = "path", required = false) String path
+                             @RequestParam(name = "path", required = false) String path,
+                             @RequestParam(name = "farmId") Integer farmId
     ) throws IOException, ClientException {
-        String url;
-        IClient iClient = new DefaultClient();
-        //如果 fileURL不为空  就认为是拿摄像头抓拍图片
-        if (StringUtilsWork.isNotEmpty(fileUrl)) {
-            url = IPAndPort + "/evo-apigw/" + fileUrl;
-        } else if (StringUtilsWork.isNotEmpty(path)) {
-            //档案的图片
-            IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
-            url = IPAndPort + "/evo-pic/" + path + "?token=" + token.getAccess_token() + "&oss_addr=" + CommonConstant.Document_oss_addr;
-        } else {
-            //事件的图片
-            IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
-            url = IPAndPort + "/evo-pic/" + alarmPicture + "?token=" + token.getAccess_token() + "&oss_addr=" + CommonConstant.shijian_oss_addr;
+        String url = "";
+        if (farmId == 1){
+            GetTokenResponse tokenTest01 = oauthIntegrationManager.getTokenTest01();
+            String access_token = tokenTest01.getData().getAccess_token();
+            //如果 fileURL不为空  就认为是拿摄像头抓拍图片
+            if (StringUtilsWork.isNotEmpty(fileUrl)) {
+                url = Sg_IPAndPort + "/evo-apigw/" + fileUrl;
+            } else if (StringUtilsWork.isNotEmpty(path)) {
+                //档案的图片
+                url = Sg_IPAndPort + "/evo-pic/" + path + "?token=" + access_token + "&oss_addr=" + CommonConstant.Sg_Document_Oss_Addr;
+            } else {
+                //事件的图片
+                url = Sg_IPAndPort + "/evo-pic/" + alarmPicture + "?token=" + access_token + "&oss_addr=" + CommonConstant.Sg_Shijian_Oss_Addr;
+            }
+        }else if (farmId == 22){
+            GetTokenResponse tokenTest02 = oauthIntegrationManager.getTokenTest02();
+            String access_token = tokenTest02.getData().getAccess_token();
+            //如果 fileURL不为空  就认为是拿摄像头抓拍图片
+            //目前只有曙光照片
+            if (StringUtilsWork.isNotEmpty(fileUrl)) {
+                url = Sg_IPAndPort + "/evo-apigw/" + fileUrl;
+            } else if (StringUtilsWork.isNotEmpty(path)) {
+                //档案的图片
+                url = Sg_IPAndPort + "/evo-pic/" + path + "?token=" + access_token + "&oss_addr=" + CommonConstant.Sg_Document_Oss_Addr;
+            } else {
+                //事件的图片
+                url = Sg_IPAndPort + "/evo-pic/" + alarmPicture + "?token=" + access_token + "&oss_addr=" + CommonConstant.Sg_Shijian_Oss_Addr;
+            }
+        }else if (farmId == 21){
+            GetTokenResponse tokenTest03 = oauthIntegrationManager.getTokenTest03();
+            String access_token = tokenTest03.getData().getAccess_token();
+            //如果 fileURL不为空  就认为是拿摄像头抓拍图片
+            //目前只有曙光照片
+            if (StringUtilsWork.isNotEmpty(fileUrl)) {
+                url = Sg_IPAndPort + "/evo-apigw/" + fileUrl;
+            } else if (StringUtilsWork.isNotEmpty(path)) {
+                //档案的图片
+                url = Sg_IPAndPort + "/evo-pic/" + path + "?token=" + access_token + "&oss_addr=" + CommonConstant.Sg_Document_Oss_Addr;
+            } else {
+                //事件的图片
+                url = Sg_IPAndPort + "/evo-pic/" + alarmPicture + "?token=" + access_token + "&oss_addr=" + CommonConstant.Sg_Shijian_Oss_Addr;
+            }
         }
         HttpResponse httpResponse = null;
         try {

File diff suppressed because it is too large
+ 17 - 1
huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/CommonConstant.java


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

@@ -278,4 +278,10 @@ public class Constant {
 
     //车辆通行列表
     public static final String CAR_CAPTURE_RECORD = "/evo-apigw/ipms/carcapture/find/conditions?pageNum={pageNum}&pageSize={pageSize}";
+
+    //event
+    public static final String EVENT_URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";
+
+    //event-count
+    public static final String EVENT_COUNT_URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";
 }

+ 101 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/controller/ClientXunZhengControllerTest.java

@@ -0,0 +1,101 @@
+package com.huimv.video.dhicc.test.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.result.R;
+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.XunZhengRequest.Cn.XunZhengCountRequestCn;
+import com.huimv.video.dhicc.test.request.XunZhengRequest.Cn.XunZhengRequestCn;
+import com.huimv.video.dhicc.test.request.XunZhengRequest.Hn.XunZhengCountRequestHn;
+import com.huimv.video.dhicc.test.request.XunZhengRequest.Sg.XunZhengCountRequestSg;
+import com.huimv.video.dhicc.test.request.XunZhengRequest.Hn.XunZhengRequestHn;
+import com.huimv.video.dhicc.test.request.XunZhengRequest.Sg.XunZhengRequestSg;
+import com.huimv.video.dhicc.test.token.Token;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("event")
+public class ClientXunZhengControllerTest {
+    @Autowired
+    private OauthConfigBaseInfo oauthConfigBaseInfo;
+    @Autowired
+    private OauthConfigBaseInfo02 oauthConfigBaseInfo02;
+    @Autowired
+    private OauthConfigBaseInfo03 oauthConfigBaseInfo03;
+
+    @RequestMapping
+    public R xunZhengEvent(@RequestBody XunZhengRequestSg xunZhengRequestSg){
+        Integer farmId = xunZhengRequestSg.getFarmId();
+        if (farmId == 1){
+            System.out.println("曙光");
+            XunZhengRequestSg requestSg = new XunZhengRequestSg(oauthConfigBaseInfo);
+            Token token = requestSg.getToken();
+
+            System.out.println(token);
+            System.out.println(token.getAccess_token());
+            requestSg.setEventType(xunZhengRequestSg.getEventType());
+            requestSg.setPageNum(xunZhengRequestSg.getPageNum());
+            requestSg.setPageSize(xunZhengRequestSg.getPageSize());
+            requestSg.setAlarmStartDateString(xunZhengRequestSg.getAlarmStartDateString());
+            requestSg.setAlarmEndDateString(xunZhengRequestSg.getAlarmEndDateString());
+            String result = requestSg.doAction();
+            XunZhengCountRequestSg countRequestSg = new XunZhengCountRequestSg(oauthConfigBaseInfo);
+            countRequestSg.setEventType(xunZhengRequestSg.getEventType());
+            countRequestSg.setPageNum(xunZhengRequestSg.getPageNum());
+            countRequestSg.setPageSize(xunZhengRequestSg.getPageSize());
+            countRequestSg.setAlarmEndDateString(xunZhengRequestSg.getAlarmEndDateString());
+            countRequestSg.setAlarmStartDateString(xunZhengRequestSg.getAlarmStartDateString());
+            JSONObject jsonObject = JSON.parseObject(countRequestSg.doAction());
+            String data = String.valueOf(jsonObject.get("data")) ;
+            Object count = JSON.parseObject(data).get("value");
+            return R.ok("请求成功").put("data",result).put("total",count);
+        }
+        else if (farmId == 22 ){
+            System.out.println("海宁");
+            XunZhengRequestHn requestHn = new XunZhengRequestHn(oauthConfigBaseInfo02);
+            requestHn.setEventType(xunZhengRequestSg.getEventType());
+            requestHn.setPageNum(xunZhengRequestSg.getPageNum());
+            requestHn.setPageSize(xunZhengRequestSg.getPageSize());
+            requestHn.setAlarmStartDateString(xunZhengRequestSg.getAlarmStartDateString());
+            requestHn.setAlarmEndDateString(xunZhengRequestSg.getAlarmEndDateString());
+            String result = requestHn.doAction();
+            XunZhengCountRequestHn countRequestHn = new XunZhengCountRequestHn(oauthConfigBaseInfo02);
+            countRequestHn.setEventType(xunZhengRequestSg.getEventType());
+            countRequestHn.setPageNum(xunZhengRequestSg.getPageNum());
+            countRequestHn.setPageSize(xunZhengRequestSg.getPageSize());
+            countRequestHn.setAlarmEndDateString(xunZhengRequestSg.getAlarmEndDateString());
+            countRequestHn.setAlarmStartDateString(xunZhengRequestSg.getAlarmStartDateString());
+            JSONObject jsonObject = JSON.parseObject(countRequestHn.doAction());
+            String data = String.valueOf(jsonObject.get("data")) ;
+            Object count = JSON.parseObject(data).get("value");
+            return R.ok("请求成功").put("data",result).put("total",count);
+        }else if (farmId == 21){
+            System.out.println("苍南");
+            XunZhengRequestCn requestCn = new XunZhengRequestCn(oauthConfigBaseInfo03);
+            requestCn.setEventType(xunZhengRequestSg.getEventType());
+            requestCn.setPageNum(xunZhengRequestSg.getPageNum());
+            requestCn.setPageSize(xunZhengRequestSg.getPageSize());
+            requestCn.setAlarmStartDateString(xunZhengRequestSg.getAlarmStartDateString());
+            requestCn.setAlarmEndDateString(xunZhengRequestSg.getAlarmEndDateString());
+            String result = requestCn.doAction();
+            XunZhengCountRequestCn countRequestCn = new XunZhengCountRequestCn(oauthConfigBaseInfo03);
+            countRequestCn.setEventType(xunZhengRequestSg.getEventType());
+            countRequestCn.setPageNum(xunZhengRequestSg.getPageNum());
+            countRequestCn.setPageSize(xunZhengRequestSg.getPageSize());
+            countRequestCn.setAlarmEndDateString(xunZhengRequestSg.getAlarmEndDateString());
+            countRequestCn.setAlarmStartDateString(xunZhengRequestSg.getAlarmStartDateString());
+            JSONObject jsonObject = JSON.parseObject(countRequestCn.doAction());
+            String data = String.valueOf(jsonObject.get("data")) ;
+            Object count = JSON.parseObject(data).get("value");
+            return R.ok("请求成功").put("data",result).put("total",count);
+        }else {
+            return R.error();
+        }
+    }
+
+}

+ 74 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/XunZhengRequest/Cn/XunZhengCountRequestCn.java

@@ -0,0 +1,74 @@
+package com.huimv.video.dhicc.test.request.XunZhengRequest.Cn;
+
+import com.alibaba.fastjson.JSON;
+import com.huimv.video.dhicc.icc.CommonConstant;
+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;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class XunZhengCountRequestCn extends BaseRequest03 {
+
+    private Integer farmId;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+
+    private String alarmStartDateString;
+
+    private String alarmEndDateString;
+
+    private Integer eventType;
+
+    public XunZhengCountRequestCn(OauthConfigBaseInfo03 oauthConfigBaseInfo){
+        super(oauthConfigBaseInfo, Constant.HTTP_POST,oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.EVENT_COUNT_URL, true);
+    }
+
+    @Override
+    public String 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());
+
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("alarmType", 303);
+        map.put("dbType", 0);
+        map.put("deviceCategory", 1);
+        //nodeCodeList 目前还没有 先用曙光的
+        if (this.eventType == 1){
+            map.put("nodeCodeList", CommonConstant.Sg_SiZhuChannle);
+        }else if (this.eventType == 2){
+            map.put("nodeCodeList", CommonConstant.Sg_DoorChannle);
+        }else if (this.eventType == 3){
+            map.put("nodeCodeList", CommonConstant.Sg_XunZhengChannle);
+        }else {
+            map.put("nodeCodeList", CommonConstant.Sh_MaiZhuChannle);
+        }
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 83 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/XunZhengRequest/Cn/XunZhengRequestCn.java

@@ -0,0 +1,83 @@
+package com.huimv.video.dhicc.test.request.XunZhengRequest.Cn;
+
+import com.alibaba.fastjson.JSON;
+import com.huimv.video.dhicc.icc.CommonConstant;
+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;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class XunZhengRequestCn extends BaseRequest03 {
+
+    private Integer farmId;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+
+    private String alarmStartDateString;
+
+    private String alarmEndDateString;
+
+    private Integer eventType;
+
+
+    public XunZhengRequestCn(){
+    }
+
+    public XunZhengRequestCn(OauthConfigBaseInfo03 oauthConfigBaseInfo){
+        super(oauthConfigBaseInfo, Constant.HTTP_POST,oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.EVENT_URL, true);
+    }
+
+    @Override
+    public String 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());
+        //获取响应
+
+        // PersonListResponseSg devicePageResponse = JSON.parseObject(res, PersonListResponseSg.class);
+
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+        Map<String, Object> map = new HashMap<>();
+        map.put("pageNum", this.pageNum);
+        map.put("pageSize", this.pageSize);
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("alarmType", 303);
+        map.put("dbType", 0);
+        map.put("deviceCategory", 1);
+        //nodeCodeList 目前还没有 先用曙光的
+        if (this.eventType == 1){
+            map.put("nodeCodeList", CommonConstant.Sg_SiZhuChannle);
+        }else if (this.eventType == 2){
+            map.put("nodeCodeList", CommonConstant.Sg_DoorChannle);
+        }else if (this.eventType == 3){
+            map.put("nodeCodeList", CommonConstant.Sg_XunZhengChannle);
+        }else {
+            map.put("nodeCodeList", CommonConstant.Sh_MaiZhuChannle);
+        }
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 74 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/XunZhengRequest/Hn/XunZhengCountRequestHn.java

@@ -0,0 +1,74 @@
+package com.huimv.video.dhicc.test.request.XunZhengRequest.Hn;
+
+import com.alibaba.fastjson.JSON;
+import com.huimv.video.dhicc.icc.CommonConstant;
+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 XunZhengCountRequestHn extends BaseRequest02 {
+
+    private Integer farmId;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+
+    private String alarmStartDateString;
+
+    private String alarmEndDateString;
+
+    private Integer eventType;
+
+    public XunZhengCountRequestHn(OauthConfigBaseInfo02 oauthConfigBaseInfo){
+        super(oauthConfigBaseInfo, Constant.HTTP_POST,oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.EVENT_COUNT_URL, true);
+    }
+
+    @Override
+    public String 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());
+
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("alarmType", 303);
+        map.put("dbType", 0);
+        map.put("deviceCategory", 1);
+        //nodeCodeList 目前还没有 先用曙光的
+        if (this.eventType == 1){
+            map.put("nodeCodeList", CommonConstant.Sg_SiZhuChannle);
+        }else if (this.eventType == 2){
+            map.put("nodeCodeList", CommonConstant.Sg_DoorChannle);
+        }else if (this.eventType == 3){
+            map.put("nodeCodeList", CommonConstant.Sg_XunZhengChannle);
+        }else {
+            map.put("nodeCodeList", CommonConstant.Sh_MaiZhuChannle);
+        }
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 81 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/XunZhengRequest/Hn/XunZhengRequestHn.java

@@ -0,0 +1,81 @@
+package com.huimv.video.dhicc.test.request.XunZhengRequest.Hn;
+
+import com.alibaba.fastjson.JSON;
+import com.huimv.video.dhicc.icc.CommonConstant;
+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.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 XunZhengRequestHn extends BaseRequest02 {
+
+    private Integer farmId;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+
+    private String alarmStartDateString;
+
+    private String alarmEndDateString;
+
+    private Integer eventType;
+
+    public XunZhengRequestHn(){
+    }
+
+    public XunZhengRequestHn(OauthConfigBaseInfo02 oauthConfigBaseInfo){
+        super(oauthConfigBaseInfo, Constant.HTTP_POST,oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.EVENT_URL, true);
+    }
+
+    @Override
+    public String 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());
+        //获取响应
+
+        // PersonListResponseSg devicePageResponse = JSON.parseObject(res, PersonListResponseSg.class);
+
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+        Map<String, Object> map = new HashMap<>();
+        map.put("pageNum", this.pageNum);
+        map.put("pageSize", this.pageSize);
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("alarmType", 303);
+        map.put("dbType", 0);
+        map.put("deviceCategory", 1);
+        //nodeCodeList 目前还没有 先用曙光的
+        if (this.eventType == 1){
+            map.put("nodeCodeList", CommonConstant.Sg_SiZhuChannle);
+        }else if (this.eventType == 2){
+            map.put("nodeCodeList", CommonConstant.Sg_DoorChannle);
+        }else if (this.eventType == 3){
+            map.put("nodeCodeList", CommonConstant.Sg_XunZhengChannle);
+        }else {
+            map.put("nodeCodeList", CommonConstant.Sh_MaiZhuChannle);
+        }
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 72 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/XunZhengRequest/Sg/XunZhengCountRequestSg.java

@@ -0,0 +1,72 @@
+package com.huimv.video.dhicc.test.request.XunZhengRequest.Sg;
+
+import cn.hutool.json.JSONObject;
+import com.alibaba.fastjson.JSON;
+import com.huimv.video.dhicc.icc.CommonConstant;
+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 XunZhengCountRequestSg extends BaseRequest {
+
+    private Integer farmId;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+
+    private String alarmStartDateString;
+
+    private String alarmEndDateString;
+
+    private Integer eventType;
+
+    public XunZhengCountRequestSg(OauthConfigBaseInfo oauthConfigBaseInfo){
+        super(oauthConfigBaseInfo, Constant.HTTP_POST,oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.EVENT_COUNT_URL, true);
+    }
+
+    @Override
+    public String 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());
+
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("alarmType", 303);
+        map.put("dbType", 0);
+        map.put("deviceCategory", 1);
+        if (this.eventType == 1){
+            map.put("nodeCodeList", CommonConstant.Sg_SiZhuChannle);
+        }else if (this.eventType == 2){
+            map.put("nodeCodeList", CommonConstant.Sg_DoorChannle);
+        }else if (this.eventType == 3){
+            map.put("nodeCodeList", CommonConstant.Sg_XunZhengChannle);
+        }else {
+            map.put("nodeCodeList", CommonConstant.Sh_MaiZhuChannle);
+        }
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 79 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/XunZhengRequest/Sg/XunZhengRequestSg.java

@@ -0,0 +1,79 @@
+package com.huimv.video.dhicc.test.request.XunZhengRequest.Sg;
+
+import com.alibaba.fastjson.JSON;
+import com.huimv.video.dhicc.icc.CommonConstant;
+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 XunZhengRequestSg extends BaseRequest {
+
+    private Integer farmId;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+
+    private String alarmStartDateString;
+
+    private String alarmEndDateString;
+
+    private Integer eventType;
+
+    public XunZhengRequestSg(){
+    }
+
+    public XunZhengRequestSg(OauthConfigBaseInfo oauthConfigBaseInfo){
+        super(oauthConfigBaseInfo, Constant.HTTP_POST,oauthConfigBaseInfo.getHttpConfigInfo().getPrefixUrl() + Constant.EVENT_URL, true);
+    }
+
+    @Override
+    public String 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());
+        //获取响应
+
+        // PersonListResponseSg devicePageResponse = JSON.parseObject(res, PersonListResponseSg.class);
+
+        return res;
+    }
+
+    private void setBody() {
+        //设置请求参数
+        Map<String, Object> map = new HashMap<>();
+        map.put("pageNum", this.pageNum);
+        map.put("pageSize", this.pageSize);
+        map.put("alarmStartDateString", this.alarmStartDateString);
+        map.put("alarmEndDateString", this.alarmEndDateString);
+        map.put("alarmType", 303);
+        map.put("dbType", 0);
+        map.put("deviceCategory", 1);
+        if (this.eventType == 1){
+            map.put("nodeCodeList", CommonConstant.Sg_SiZhuChannle);
+        }else if (this.eventType == 2){
+            map.put("nodeCodeList", CommonConstant.Sg_DoorChannle);
+        }else if (this.eventType == 3){
+            map.put("nodeCodeList", CommonConstant.Sg_XunZhengChannle);
+        }else {
+            map.put("nodeCodeList", CommonConstant.Sh_MaiZhuChannle);
+        }
+        this.setBody(JSON.toJSONString(map));
+
+    }
+
+    public boolean isEnableHttpTest() {
+        return super.getOauthConfigBaseInfo().getHttpConfigInfo().isEnableHttpTest();
+    }
+}

+ 4 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/response/EventResponse.java

@@ -0,0 +1,4 @@
+package com.huimv.video.dhicc.test.response;
+
+public class EventResponse extends BaseResponse {
+}