Authored by zhengyouwei

fix

... ... @@ -58,6 +58,8 @@ public class ClientReportErrorModel {
private String udid;
private String param;
public ClientReportErrorModel() {
}
... ... @@ -292,6 +294,14 @@ public class ClientReportErrorModel {
this.udid = udid;
}
public String getParam() {
return param;
}
public void setParam(String param) {
this.param = param;
}
@Override
public String toString() {
return "ClientReportErrorModel{" +
... ...
... ... @@ -3,6 +3,7 @@ package com.yoho.opsmanager.common.util;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yoho.opsmanager.common.model.ClientReport.ClientReportErrorModel;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.collections.CollectionUtils;
... ... @@ -218,22 +219,23 @@ public class ClientReportUtil {
} else {
clientReportErrorModel.setEi(String.valueOf(paramMap.get("ei")));
for (String key : paramMap.keySet()) {
switch (key) {
case "body":
String bodyvalue = String.valueOf(paramMap.get(key));
clientReportErrorModel.setBody(bodyvalue);
break;
case "ei":
String eivalue = String.valueOf(paramMap.get(key));
clientReportErrorModel.setEi(eivalue);
break;
case "response":
String response = String.valueOf(paramMap.get(key));
clientReportErrorModel.setResponse(response);
break;
}
}
clientReportErrorModel.setParam(JSONObject.fromObject(paramMap).toString());
// for (String key : paramMap.keySet()) {
// switch (key) {
// case "body":
// String bodyvalue = String.valueOf(paramMap.get(key));
// clientReportErrorModel.setBody(bodyvalue);
// break;
// case "ei":
// String eivalue = String.valueOf(paramMap.get(key));
// clientReportErrorModel.setEi(eivalue);
// break;
// case "response":
// String response = String.valueOf(paramMap.get(key));
// clientReportErrorModel.setResponse(response);
// break;
// }
// }
clientReportErrorModel.setExceptionType(base64Encode(et));
}
list.add(clientReportErrorModel);
... ...
... ... @@ -97,6 +97,7 @@ public class ClientWriteRunnable implements Runnable {
build.time(System.currentTimeMillis() * 1000000 + random.nextInt(999999), TimeUnit.NANOSECONDS);
//插入原始数据表
buildData.addField("uid", clientReportErrorModel.getUid());
buildData.addField("param",clientReportErrorModel.getParam() == null? "null":clientReportErrorModel.getParam());
buildData.addField("response", clientReportErrorModel.getResponse() == null ? "null" : clientReportErrorModel.getResponse());
buildData.time(System.currentTimeMillis() * 1000000 + random.nextInt(999999), TimeUnit.NANOSECONDS);
errorReportMapper.writeData(buildData.build());
... ...