|
@@ -8,23 +8,22 @@ import com.dahuatech.icc.oauth.http.IClient;
|
|
import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
|
|
import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
|
|
import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
|
|
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.icc.CommonConstant;
|
|
import com.huimv.video.dhicc.result.R;
|
|
import com.huimv.video.dhicc.result.R;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
|
|
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
|
|
-import com.huimv.video.dhicc.test.request.ClientCarListRequestSg;
|
|
|
|
-import com.huimv.video.dhicc.test.request.ClientSendMassageXixiaoPersonRequestSg;
|
|
|
|
-import jdk.nashorn.internal.ir.IfNode;
|
|
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.cn.ClientCarCombinedCn;
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.cn.ClientCombinedCountRequestCn;
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.cn.ClientSendMassageXixiaoPersonRequestCn;
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.hn.ClientCarCombinedHn;
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.hn.ClientCombinedCountRequestHn;
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.hn.ClientSendMassageXixiaoPersonRequestHn;
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.sg.ClientCarCombinedSg;
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.sg.ClientCombinedCountRequestSg;
|
|
|
|
+import com.huimv.video.dhicc.test.request.screenRequest.sg.ClientSendMassageXixiaoPersonRequestSg;
|
|
import net.sf.json.JSONObject;
|
|
import net.sf.json.JSONObject;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
-import java.util.Calendar;
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -39,6 +38,49 @@ public class GetResponse {
|
|
* @return
|
|
* @return
|
|
* @throws ClientException
|
|
* @throws ClientException
|
|
*/
|
|
*/
|
|
|
|
+ public String carCount(String begin, String end ,String direct,OauthConfigBaseInfo oauthConfigBaseInfo) throws ClientException {
|
|
|
|
+
|
|
|
|
+ ClientCarCombinedSg requestSg = new ClientCarCombinedSg(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setCarDirect(direct);
|
|
|
|
+ requestSg.setQueryTimeBegin(begin);
|
|
|
|
+ requestSg.setQueryTimeEnd(end);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ JSONObject jsonObject1 = JSONObject.fromObject(data);
|
|
|
|
+ System.out.println(jsonObject1);
|
|
|
|
+ return jsonObject1.get("totalRows").toString();
|
|
|
|
+ }
|
|
|
|
+ public String carCount02(String begin, String end ,String direct,OauthConfigBaseInfo02 oauthConfigBaseInfo) throws ClientException {
|
|
|
|
+
|
|
|
|
+ ClientCarCombinedHn requestSg = new ClientCarCombinedHn(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setCarDirect(direct);
|
|
|
|
+ requestSg.setQueryTimeBegin(begin);
|
|
|
|
+ requestSg.setQueryTimeEnd(end);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ JSONObject jsonObject1 = JSONObject.fromObject(data);
|
|
|
|
+ System.out.println(jsonObject1);
|
|
|
|
+ return jsonObject1.get("totalRows").toString();
|
|
|
|
+ }
|
|
|
|
+ public String carCount03(String begin, String end ,String direct,OauthConfigBaseInfo03 oauthConfigBaseInfo) throws ClientException {
|
|
|
|
+
|
|
|
|
+ ClientCarCombinedCn requestSg = new ClientCarCombinedCn(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setCarDirect(direct);
|
|
|
|
+ requestSg.setQueryTimeBegin(begin);
|
|
|
|
+ requestSg.setQueryTimeEnd(end);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ JSONObject jsonObject1 = JSONObject.fromObject(data);
|
|
|
|
+ System.out.println(jsonObject1);
|
|
|
|
+ return jsonObject1.get("totalRows").toString();
|
|
|
|
+ }
|
|
|
|
+
|
|
public String SendMassageGetPage(String begin, String end) throws ClientException {
|
|
public String SendMassageGetPage(String begin, String end) throws ClientException {
|
|
//条件只有开始结束时间 有问题 这个是条数 有统计条数的专门接口
|
|
//条件只有开始结束时间 有问题 这个是条数 有统计条数的专门接口
|
|
//时间参数这里之前让前端传了 我这里只做转发 现在自己加上去
|
|
//时间参数这里之前让前端传了 我这里只做转发 现在自己加上去
|
|
@@ -158,7 +200,51 @@ public class GetResponse {
|
|
* @return
|
|
* @return
|
|
* @throws ClientException
|
|
* @throws ClientException
|
|
*/
|
|
*/
|
|
- public String SendMassageGetPagePersonAlarm(String begin, String end) throws ClientException {
|
|
|
|
|
|
+ public String SendMassageGetPagePersonAlarm(String begin, String end,Integer opentResult,Integer openType,OauthConfigBaseInfo oauthConfigBaseInfo) throws ClientException {
|
|
|
|
+ ClientCombinedCountRequestSg requestSg = new ClientCombinedCountRequestSg(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setContainDomain("1");
|
|
|
|
+ requestSg.setEndSwingTime(end);
|
|
|
|
+ requestSg.setOpenResult(opentResult);
|
|
|
|
+ requestSg.setStartSwingTime(begin);
|
|
|
|
+ requestSg.setOpenType(openType);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ System.out.println(data);
|
|
|
|
+ return data.toString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String SendMassageGetPagePersonAlarm02(String begin, String end,Integer opentResult,Integer openType,OauthConfigBaseInfo02 oauthConfigBaseInfo) throws ClientException {
|
|
|
|
+ ClientCombinedCountRequestHn requestSg = new ClientCombinedCountRequestHn(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setContainDomain("1");
|
|
|
|
+ requestSg.setEndSwingTime(end);
|
|
|
|
+ requestSg.setOpenResult(opentResult);
|
|
|
|
+ requestSg.setStartSwingTime(begin);
|
|
|
|
+ requestSg.setOpenType(openType);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ System.out.println(data);
|
|
|
|
+ return data.toString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String SendMassageGetPagePersonAlarm03(String begin, String end,Integer opentResult,Integer openType,OauthConfigBaseInfo03 oauthConfigBaseInfo) throws ClientException {
|
|
|
|
+ ClientCombinedCountRequestCn requestSg = new ClientCombinedCountRequestCn(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setContainDomain("1");
|
|
|
|
+ requestSg.setEndSwingTime(end);
|
|
|
|
+ requestSg.setOpenResult(opentResult);
|
|
|
|
+ requestSg.setStartSwingTime(begin);
|
|
|
|
+ requestSg.setOpenType(openType);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ System.out.println(data);
|
|
|
|
+ return data.toString();
|
|
|
|
+ }
|
|
|
|
+ /* public String SendMassageGetPagePersonAlarm(String begin, String end) throws ClientException {
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
params.put("startSwingTime", begin);
|
|
params.put("startSwingTime", begin);
|
|
params.put("endSwingTime", end);
|
|
params.put("endSwingTime", end);
|
|
@@ -183,7 +269,7 @@ public class GetResponse {
|
|
JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
|
|
JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
|
|
Object data = jsonObject.get("data");
|
|
Object data = jsonObject.get("data");
|
|
return data.toString();
|
|
return data.toString();
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
|
/* public static void main(String[] args) throws ClientException {
|
|
/* public static void main(String[] args) throws ClientException {
|
|
@@ -234,29 +320,55 @@ public class GetResponse {
|
|
* @return
|
|
* @return
|
|
* @throws ClientException
|
|
* @throws ClientException
|
|
*/
|
|
*/
|
|
- public String SendMassageXixiaoPerson(String begin, String end,Integer farmId,OauthConfigBaseInfo oauthConfigBaseInfo) throws ClientException {
|
|
|
|
- String res = "";
|
|
|
|
- if(farmId ==1){
|
|
|
|
- ClientSendMassageXixiaoPersonRequestSg requestSg = new ClientSendMassageXixiaoPersonRequestSg(oauthConfigBaseInfo);
|
|
|
|
- requestSg.setAlarmStartDateString(begin);
|
|
|
|
- requestSg.setAlarmEndDateString(end);
|
|
|
|
- requestSg.setAlarmType(303);
|
|
|
|
- requestSg.setDbType(0);
|
|
|
|
- requestSg.setDeviceCategory(1);
|
|
|
|
- requestSg.setNodeCodeList(CommonConstant.XixiaoChannle);
|
|
|
|
- System.out.println(requestSg);
|
|
|
|
- res = requestSg.doAction();
|
|
|
|
- JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
- Object data = jsonObject.get("data");
|
|
|
|
- JSONObject jsonObject1 = JSONObject.fromObject(data);
|
|
|
|
- System.out.println(jsonObject1);
|
|
|
|
- return jsonObject1.get("value").toString();
|
|
|
|
- }
|
|
|
|
- return null;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ public String SendMassageXixiaoPerson(String begin, String end,OauthConfigBaseInfo oauthConfigBaseInfo,String[] constantChannle) throws ClientException {
|
|
|
|
+ ClientSendMassageXixiaoPersonRequestSg requestSg = new ClientSendMassageXixiaoPersonRequestSg(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setAlarmStartDateString(begin);
|
|
|
|
+ requestSg.setAlarmEndDateString(end);
|
|
|
|
+ requestSg.setAlarmType(303);
|
|
|
|
+ requestSg.setDbType(0);
|
|
|
|
+ requestSg.setDeviceCategory(1);
|
|
|
|
+ requestSg.setNodeCodeList(constantChannle);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ JSONObject jsonObject1 = JSONObject.fromObject(data);
|
|
|
|
+ System.out.println(jsonObject1);
|
|
|
|
+ return jsonObject1.get("value").toString();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String SendMassageXixiaoPerson02(String begin, String end, OauthConfigBaseInfo02 oauthConfigBaseInfo, String[] constantChannle) throws ClientException {
|
|
|
|
+ ClientSendMassageXixiaoPersonRequestHn requestSg = new ClientSendMassageXixiaoPersonRequestHn(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setAlarmStartDateString(begin);
|
|
|
|
+ requestSg.setAlarmEndDateString(end);
|
|
|
|
+ requestSg.setAlarmType(303);
|
|
|
|
+ requestSg.setDbType(0);
|
|
|
|
+ requestSg.setDeviceCategory(1);
|
|
|
|
+ requestSg.setNodeCodeList(constantChannle);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ JSONObject jsonObject1 = JSONObject.fromObject(data);
|
|
|
|
+ System.out.println(jsonObject1);
|
|
|
|
+ return jsonObject1.get("value").toString();
|
|
|
|
+ }
|
|
|
|
+ public String SendMassageXixiaoPerson03(String begin, String end, OauthConfigBaseInfo03 oauthConfigBaseInfo, String[] constantChannle) throws ClientException {
|
|
|
|
+ ClientSendMassageXixiaoPersonRequestCn requestSg = new ClientSendMassageXixiaoPersonRequestCn(oauthConfigBaseInfo);
|
|
|
|
+ requestSg.setAlarmStartDateString(begin);
|
|
|
|
+ requestSg.setAlarmEndDateString(end);
|
|
|
|
+ requestSg.setAlarmType(303);
|
|
|
|
+ requestSg.setDbType(0);
|
|
|
|
+ requestSg.setDeviceCategory(1);
|
|
|
|
+ requestSg.setNodeCodeList(constantChannle);
|
|
|
|
+ System.out.println(requestSg);
|
|
|
|
+ String res = requestSg.doAction();
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(res);
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
+ JSONObject jsonObject1 = JSONObject.fromObject(data);
|
|
|
|
+ System.out.println(jsonObject1);
|
|
|
|
+ return jsonObject1.get("value").toString();
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* //查大门 ---时间次数的接口-----
|
|
* //查大门 ---时间次数的接口-----
|
|
@@ -344,7 +456,7 @@ public class GetResponse {
|
|
* @return
|
|
* @return
|
|
* @throws ClientException
|
|
* @throws ClientException
|
|
*/
|
|
*/
|
|
- public String SendMassageSiZhuRecord(String begin, String end) throws ClientException {
|
|
|
|
|
|
+ public String SendMassageSiZhuRecord(String begin, String end,OauthConfigBaseInfo oauthConfigBaseInfo) throws ClientException {
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
params.put("alarmStartDateString", begin);
|
|
params.put("alarmStartDateString", begin);
|
|
params.put("alarmEndDateString", end);
|
|
params.put("alarmEndDateString", end);
|
|
@@ -374,6 +486,36 @@ public class GetResponse {
|
|
System.out.println(jsonObject1);
|
|
System.out.println(jsonObject1);
|
|
return jsonObject1.get("value").toString();
|
|
return jsonObject1.get("value").toString();
|
|
}
|
|
}
|
|
|
|
+ /* public String SendMassageSiZhuRecord(String begin, String end,OauthConfigBaseInfo oauthConfigBaseInfo) throws ClientException {
|
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
|
+ params.put("alarmStartDateString", begin);
|
|
|
|
+ params.put("alarmEndDateString", end);
|
|
|
|
+ params.put("alarmType", 303);
|
|
|
|
+ params.put("dbType", 0);
|
|
|
|
+ params.put("deviceCategory", 1);
|
|
|
|
+ //死猪的通道
|
|
|
|
+ String[] nodeCodeList = CommonConstant.SIZhuChannle;
|
|
|
|
+ params.put("nodeCodeList", nodeCodeList);
|
|
|
|
+ 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();
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
|
public Object SendMassagePost(String param, String Url, String chooseMethod) throws ClientException {
|
|
public Object SendMassagePost(String param, String Url, String chooseMethod) throws ClientException {
|