Browse Source

整理代码。

zhuoning 3 years ago
parent
commit
add128e663

+ 20 - 12
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/ClientAllEventServiceImpl.java

@@ -1,6 +1,7 @@
 package com.huimv.video.dhicc.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.dahuatech.hutool.http.Method;
 import com.dahuatech.icc.exception.ClientException;
 import com.dahuatech.icc.oauth.http.DefaultClient;
@@ -128,12 +129,6 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
         if(total == null){
             total = "0";
         }
-        System.out.println("################### total>>"+total);
-//        GeneralResponse gr = getAccidentRecord1(paramsMap);
-//        com.alibaba.fastjson.JSONObject.toJSONString(gr);
-//        com.alibaba.fastjson.JSONObject grJo = JSON.parseObject(JSON.toJSONString(getAccidentRecord1(paramsMap)));
-//        com.alibaba.fastjson.JSONObject resultJo = grJo.getJSONObject("result");
-//        System.out.println("resultJo>>"+resultJo);
         //
         return R.ok("请求成功").put("data", getAccidentRecord1(paramsMap)).put("total", Integer.parseInt(total)).put("isVideo",false);
     }
@@ -148,10 +143,6 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
     //车辆闸机事件
     private R getCarAutoGate(HttpServletRequest request, Map<String, Object> paramsMap) throws ClientException {
         Integer  farmId= (int) paramsMap.get("farmId");
-//        JSONObject carJo = JSONObject.fromObject(getCarRecord(request,farmId));
-//        String resultText = carJo.getString("result");
-//        String dataText = JSON.parseObject(resultText).getString("data");
-//        String totalRowsText = JSON.parseObject(dataText).getString("totalRows");
         GeneralResponse 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");
@@ -385,8 +376,8 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
         String formatD = format.format(d);
         System.out.println(formatA+formatD);
 
-        System.out.println("formatA>>"+formatA);
-        System.out.println("formatD>>"+formatD);
+        System.out.println("########### formatA>>"+formatA);
+        System.out.println("########### formatD>>"+formatD);
 
         params1.put("pageNum",1);
         params1.put("pageSize",20);
@@ -403,11 +394,28 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
         generalRequest.header("Content-Type", " application/json");
         generalRequest.body(JSON.toJSONString(params1));
         GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+//        System.out.println("## generalResponse>>"+generalResponse.toString());
         JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+//        System.out.println("## getResult>>"+generalResponse.getResult());
         GetResponse getResponse = new GetResponse();
 
         System.out.println("total>>"+getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"),(String) params1.get("endSwingTime")));
         System.out.println(jsonObject.toString());
+//        System.out.println("## 1>>"+JSON.toJSONString(generalResponse.getResult()));
+//        JSON.parseObject(JSON.toJSONString(generalResponse.getResult()));
+//        com.alibaba.fastjson.JSONObject resultJo = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(generalResponse.getResult());
+//        System.out.println("## resultJo>>"+resultJo);
+        com.alibaba.fastjson.JSONObject grObj = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(generalResponse);
+        System.out.println("grObj>>"+grObj);
+        com.alibaba.fastjson.JSONObject resultJo = grObj.getJSONObject("result");
+        System.out.println("resultJo>>"+resultJo);
+        com.alibaba.fastjson.JSONObject dataJo = resultJo.getJSONObject("data");
+        System.out.println("dataJo>>"+dataJo);
+        JSONArray pageDataJa = dataJo.getJSONArray("pageData");
+        System.out.println("pageDataJa>>"+pageDataJa);
+        System.out.println("pageDataJa.size>>"+pageDataJa.size());
+
+
 
     }
 }