Commit 437a22cd by huangjy

feat,查询时间范围内上报的日志

parent ff95625f
...@@ -127,7 +127,7 @@ public class IotProductDeviceService extends IotCommonService { ...@@ -127,7 +127,7 @@ public class IotProductDeviceService extends IotCommonService {
public List<DeviceInfoContentBreathe> getDeviceLogByTimeRangeBreathe(String deviceId, int pageSize, LocalDateTime startTime, LocalDateTime endTime) { public List<DeviceInfoContentBreathe> getDeviceLogByTimeRangeBreathe(String deviceId, int pageSize, LocalDateTime startTime, LocalDateTime endTime) {
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
List<DeviceOperationLogEntity> deviceOperationLogEntityList = getDeviceLogByTimeRange(deviceId, "reportProperty", pageSize, dateTimeFormatter.format(startTime), dateTimeFormatter.format(endTime)); List<DeviceOperationLogEntity> deviceOperationLogEntityList = getDeviceLogByTimeRange(deviceId, "event", pageSize, dateTimeFormatter.format(startTime), dateTimeFormatter.format(endTime));
List<DeviceInfoContentBreathe> deviceInfoContentBreatheList = StreamUtil.map(deviceOperationLogEntityList, e -> JsonUtil.toObj((String) e.getContent(), DeviceInfoContentBreathe.class)); List<DeviceInfoContentBreathe> deviceInfoContentBreatheList = StreamUtil.map(deviceOperationLogEntityList, e -> JsonUtil.toObj((String) e.getContent(), DeviceInfoContentBreathe.class));
...@@ -137,7 +137,7 @@ public class IotProductDeviceService extends IotCommonService { ...@@ -137,7 +137,7 @@ public class IotProductDeviceService extends IotCommonService {
public List<DeviceInfoContentSpace> getDeviceLogByTimeRangeSpace(String deviceId, int pageSize, LocalDateTime startTime, LocalDateTime endTime) { public List<DeviceInfoContentSpace> getDeviceLogByTimeRangeSpace(String deviceId, int pageSize, LocalDateTime startTime, LocalDateTime endTime) {
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
List<DeviceOperationLogEntity> deviceOperationLogEntityList = getDeviceLogByTimeRange(deviceId, "reportProperty", pageSize, dateTimeFormatter.format(startTime), dateTimeFormatter.format(endTime)); List<DeviceOperationLogEntity> deviceOperationLogEntityList = getDeviceLogByTimeRange(deviceId, "event", pageSize, dateTimeFormatter.format(startTime), dateTimeFormatter.format(endTime));
List<DeviceInfoContentSpace> deviceInfoContentSpaceList = StreamUtil.map(deviceOperationLogEntityList, e -> JsonUtil.toObj((String) e.getContent(), DeviceInfoContentSpace.class)); List<DeviceInfoContentSpace> deviceInfoContentSpaceList = StreamUtil.map(deviceOperationLogEntityList, e -> JsonUtil.toObj((String) e.getContent(), DeviceInfoContentSpace.class));
...@@ -198,16 +198,6 @@ public class IotProductDeviceService extends IotCommonService { ...@@ -198,16 +198,6 @@ public class IotProductDeviceService extends IotCommonService {
IotQueryParam iotQueryParam = buildQueryParam(pageSize); IotQueryParam iotQueryParam = buildQueryParam(pageSize);
List<Term> terms = Lists.newArrayList(); List<Term> terms = Lists.newArrayList();
Term term = Term.builder()
.column("type")
.termType("btw")
.type(Term.Type.or)
.value(typeValue)
.terms(Lists.newArrayList())
.options(Lists.newArrayList())
.build();
terms.add(term);
Term term1 = Term.builder() Term term1 = Term.builder()
.column("timestamp") .column("timestamp")
.termType("gte") .termType("gte")
...@@ -228,7 +218,7 @@ public class IotProductDeviceService extends IotCommonService { ...@@ -228,7 +218,7 @@ public class IotProductDeviceService extends IotCommonService {
.column("type") .column("type")
.termType("eq") .termType("eq")
.type(Term.Type.or) .type(Term.Type.or)
.value("event") .value(typeValue)
.terms(Lists.newArrayList()) .terms(Lists.newArrayList())
.options(Lists.newArrayList()) .options(Lists.newArrayList())
.build(); .build();
......
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 sign in to comment