Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
437a22cd
authored
Sep 14, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat,查询时间范围内上报的日志
parent
ff95625f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
View file @
437a22cd
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment