Commit 45302635 by WangJinfeng

fix RTDmpFetch bug

parent 1a17688a
...@@ -3,7 +3,7 @@ package mobvista.dmp.datasource.rtdmp; ...@@ -3,7 +3,7 @@ package mobvista.dmp.datasource.rtdmp;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import mobvista.dmp.common.MobvistaConstant; import mobvista.dmp.common.Constants;
import mobvista.dmp.datasource.rtdmp.entity.Tuple; import mobvista.dmp.datasource.rtdmp.entity.Tuple;
import mobvista.dmp.util.*; import mobvista.dmp.util.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -312,7 +312,7 @@ public class RTDmpFetch { ...@@ -312,7 +312,7 @@ public class RTDmpFetch {
while ((line = rd.readLine()) != null) { while ((line = rd.readLine()) != null) {
result.append(line); result.append(line);
} }
JSONObject jsonObject = MobvistaConstant.String2JSONObject(result.toString()); JSONObject jsonObject = Constants.String2JSONObject(result.toString());
if (jsonObject.getInteger("code") == 200 && jsonObject.containsKey("data")) { if (jsonObject.getInteger("code") == 200 && jsonObject.containsKey("data")) {
jsonArray = jsonObject.getJSONArray("data"); jsonArray = jsonObject.getJSONArray("data");
} }
...@@ -492,7 +492,7 @@ public class RTDmpFetch { ...@@ -492,7 +492,7 @@ public class RTDmpFetch {
while ((line = rd.readLine()) != null) { while ((line = rd.readLine()) != null) {
result.append(line); result.append(line);
} }
JSONObject jsonObject = MobvistaConstant.String2JSONObject(result.toString()); JSONObject jsonObject = Constants.String2JSONObject(result.toString());
if (jsonObject.getInteger("code") == 200 && jsonObject.containsKey("data") && jsonObject.getJSONArray("data").size() > 0) { if (jsonObject.getInteger("code") == 200 && jsonObject.containsKey("data") && jsonObject.getJSONArray("data").size() > 0) {
res = jsonObject.getJSONArray("data").getJSONObject(0); res = jsonObject.getJSONArray("data").getJSONObject(0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment