|
|
@ -99,7 +99,8 @@ public class DataProcessServiceImpl extends CommanHandleService implements IData
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int processBusinessData(String jsonData, String imagePath,
|
|
|
|
public int processBusinessData(String jsonData, String imagePath,
|
|
|
|
String imagePatterns, String imageDomain, String imagePrefix, String topic) {
|
|
|
|
String imagePatterns, String imageDomain, String imagePrefix, String topic) {
|
|
|
|
JSONObject json = JSON.parseObject(jsonData);
|
|
|
|
String data = jsonData.replaceAll(" ", "");
|
|
|
|
|
|
|
|
JSONObject json = JSON.parseObject(data);
|
|
|
|
Long ts = json.getLong(TdEngineConstants.PAYLOAD_TS);
|
|
|
|
Long ts = json.getLong(TdEngineConstants.PAYLOAD_TS);
|
|
|
|
String tsStr = String.valueOf(ts);
|
|
|
|
String tsStr = String.valueOf(ts);
|
|
|
|
if (tsStr.length() == 10) {
|
|
|
|
if (tsStr.length() == 10) {
|
|
|
@ -164,7 +165,7 @@ public class DataProcessServiceImpl extends CommanHandleService implements IData
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (value instanceof String) {
|
|
|
|
if (value instanceof String && key !="longitude" && key != "latitude") {
|
|
|
|
String valueStr = (String) value;
|
|
|
|
String valueStr = (String) value;
|
|
|
|
if (StringUtils.isNotBlank(valueStr)) {
|
|
|
|
if (StringUtils.isNotBlank(valueStr)) {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -198,22 +199,49 @@ public class DataProcessServiceImpl extends CommanHandleService implements IData
|
|
|
|
schemaFields.add(tdField);
|
|
|
|
schemaFields.add(tdField);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
TdField tdField = new TdField();
|
|
|
|
|
|
|
|
tdField.setFieldName(key);
|
|
|
|
|
|
|
|
tdField.setFieldValue(value);
|
|
|
|
|
|
|
|
schemaFields.add(tdField);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//经纬度判断
|
|
|
|
|
|
|
|
if (key.equalsIgnoreCase(HwDictConstants.DEFAULT_FUNCTION_LONGITUDE_IDENTIFIER)) {
|
|
|
|
if (key.equalsIgnoreCase(HwDictConstants.DEFAULT_FUNCTION_LONGITUDE_IDENTIFIER)) {
|
|
|
|
longitude = value;
|
|
|
|
String value1 = value.toString();
|
|
|
|
|
|
|
|
String value2 = value1.substring(1,value1.length());
|
|
|
|
|
|
|
|
longitude = value2;
|
|
|
|
|
|
|
|
TdField tdField = new TdField();
|
|
|
|
|
|
|
|
tdField.setFieldName(key);
|
|
|
|
|
|
|
|
tdField.setFieldValue(value2);
|
|
|
|
|
|
|
|
schemaFields.add(tdField);
|
|
|
|
} else if (key.equalsIgnoreCase(HwDictConstants.DEFAULT_FUNCTION_LATITUDE_IDENTIFIER)) {
|
|
|
|
} else if (key.equalsIgnoreCase(HwDictConstants.DEFAULT_FUNCTION_LATITUDE_IDENTIFIER)) {
|
|
|
|
latitude = value;
|
|
|
|
String value1 = value.toString();
|
|
|
|
} else {
|
|
|
|
String value2 = value1.substring(1,value1.length());
|
|
|
|
|
|
|
|
latitude = value2;
|
|
|
|
|
|
|
|
TdField tdField = new TdField();
|
|
|
|
|
|
|
|
tdField.setFieldName(key);
|
|
|
|
|
|
|
|
tdField.setFieldValue(value2);
|
|
|
|
|
|
|
|
schemaFields.add(tdField);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
TdField alarmTdField = new TdField();
|
|
|
|
TdField alarmTdField = new TdField();
|
|
|
|
alarmTdField.setFieldName(originalKey);
|
|
|
|
alarmTdField.setFieldName(originalKey);
|
|
|
|
alarmTdField.setFieldValue(value);
|
|
|
|
alarmTdField.setFieldValue(value);
|
|
|
|
alarmSchemaFields.add(alarmTdField);
|
|
|
|
alarmSchemaFields.add(alarmTdField);
|
|
|
|
|
|
|
|
TdField tdField = new TdField();
|
|
|
|
|
|
|
|
tdField.setFieldName(key);
|
|
|
|
|
|
|
|
tdField.setFieldValue(value);
|
|
|
|
|
|
|
|
schemaFields.add(tdField);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //经纬度判断
|
|
|
|
|
|
|
|
// if (key.equalsIgnoreCase(HwDictConstants.DEFAULT_FUNCTION_LONGITUDE_IDENTIFIER)) {
|
|
|
|
|
|
|
|
// String value1 = value.toString();
|
|
|
|
|
|
|
|
// value2 = value1.substring(2);
|
|
|
|
|
|
|
|
// longitude = value2;
|
|
|
|
|
|
|
|
// } else if (key.equalsIgnoreCase(HwDictConstants.DEFAULT_FUNCTION_LATITUDE_IDENTIFIER)) {
|
|
|
|
|
|
|
|
// String value1 = value.toString();
|
|
|
|
|
|
|
|
// value2 = value1.substring(2);
|
|
|
|
|
|
|
|
// latitude = value2;
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// TdField alarmTdField = new TdField();
|
|
|
|
|
|
|
|
// alarmTdField.setFieldName(originalKey);
|
|
|
|
|
|
|
|
// alarmTdField.setFieldValue(value);
|
|
|
|
|
|
|
|
// alarmSchemaFields.add(alarmTdField);
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|