|
|
|
@ -1,9 +1,7 @@ |
|
|
|
package com.qniao.iot; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.db.Db; |
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
import cn.hutool.json.JSONArray; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
@ -43,7 +41,6 @@ import org.elasticsearch.client.*; |
|
|
|
import org.elasticsearch.client.indices.CreateIndexRequest; |
|
|
|
import org.elasticsearch.client.indices.CreateIndexResponse; |
|
|
|
import org.elasticsearch.client.indices.GetIndexRequest; |
|
|
|
import org.elasticsearch.common.settings.Settings; |
|
|
|
import org.elasticsearch.common.xcontent.XContentType; |
|
|
|
import org.elasticsearch.index.query.QueryBuilders; |
|
|
|
import org.elasticsearch.rest.RestStatus; |
|
|
|
@ -51,10 +48,7 @@ import org.elasticsearch.search.SearchHit; |
|
|
|
import org.elasticsearch.search.SearchHits; |
|
|
|
import org.elasticsearch.search.builder.SearchSourceBuilder; |
|
|
|
import org.elasticsearch.search.sort.SortOrder; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.sql.Date; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.time.*; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
@ -79,13 +73,6 @@ public class IotMonitoringDataJob { |
|
|
|
return requestConfigBuilder; |
|
|
|
})); |
|
|
|
|
|
|
|
private final static String SQL = "select qmrs.machine_id, qmrs.iot_mac as machine_iot_mac, qmrs.status, qml.count_unit\n" + |
|
|
|
"from qn_machine_realtime_state qmrs\n" + |
|
|
|
" LEFT JOIN (select example_id, count_unit from qn_machine_list where is_delete = 0) qml\n" + |
|
|
|
" ON qmrs.iot_mac = qml.example_id\n" + |
|
|
|
"where qmrs.iot_mac = ?\n" + |
|
|
|
" and qmrs.is_delete = 0"; |
|
|
|
|
|
|
|
/** |
|
|
|
* 当前索引日期后缀 |
|
|
|
*/ |
|
|
|
|