|
@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.hhwy.qbeqsjy.common.CommonUtil;
|
|
|
import com.hhwy.qbeqsjy.common.Constants;
|
|
|
+import com.hhwy.qbeqsjy.common.TimeTool;
|
|
|
import com.hhwy.qbeqsjy.dao.CtrlDao;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.kafka.clients.consumer.ConsumerRecord;
|
|
|
import org.apache.kafka.clients.consumer.ConsumerRecords;
|
|
|
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
|
@@ -87,39 +89,37 @@ public class ConsumeService implements ApplicationListener<ContextRefreshedEvent
|
|
|
for (ConsumerRecord<Integer, String> record : records) {
|
|
|
JSONObject message = JSONObject.parseObject(record.value());
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ JSONObject oriField = message.getJSONObject("ORIFIELD");
|
|
|
+ String baseStationId = oriField.getString("BASE_STATION_ID");
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(baseStationId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ String lon = oriField.getString("LONGITUDE");
|
|
|
+ String lat = oriField.getString("LATITUDE");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
JSONObject uniCtrl = message.getJSONObject("UNICTRL");
|
|
|
- String clueId = uniCtrl.getString("U_CLUEID");
|
|
|
+
|
|
|
+ String clueId = uniCtrl.getString("U_CLUEID");
|
|
|
String[] clueIdStrArr = clueId.split("_");
|
|
|
String taskId = clueIdStrArr[Constants.NUM_1];
|
|
|
String clueType = clueIdStrArr[Constants.NUM_2];
|
|
|
String clue = clueIdStrArr[Constants.NUM_3];
|
|
|
String warningInfoJSONStr = message.toJSONString();
|
|
|
String resourceId = uniCtrl.getString("U_RESID");
|
|
|
+ String captureTime = TimeTool.timeStampToDateString(Long.valueOf(oriField.getString("CAPTURE_TIME")));
|
|
|
Object[] warningInfo = new Object[]{taskId, clue, clueType, warningInfoJSONStr, createTime};
|
|
|
warningInfoList.add(warningInfo);
|
|
|
|
|
|
|
|
|
-
|
|
|
- JSONObject oriField = message.getJSONObject("ORIFIELD");
|
|
|
-
|
|
|
- String fieldJSONStr = CommonUtil.getConfValueByKey(resourceId);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
ctrlDao.batchInsertWarningInfo(warningInfoList);
|