|
@@ -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
|