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
131db3a8
authored
Nov 01, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:空间实时定位问题
parent
02533394
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 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 @
131db3a8
...
...
@@ -276,26 +276,28 @@ public class IotProductDeviceService extends IotCommonService {
}
public
List
<
DeviceInfoContentSpace
>
getDeviceLogByTimeRangeSpace
(
String
deviceId
,
int
pageSize
,
LocalDateTime
startTime
,
LocalDateTime
endTime
)
{
DateTimeFormatter
dateTimeFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
DeviceInfoContentSpace
>
deviceInfoContentSpaceList
=
Lists
.
newArrayList
();
int
count
=
pageSize
/
10000
;
for
(
int
i
=
0
;
i
<
count
+
1
;
i
++)
{
List
<
DeviceOperationLogEntity
>
deviceOperationLogList
=
getDeviceLogByTimeRange
(
deviceId
,
REPORT_PROPERTY
,
10000
,
dateTimeFormatter
.
format
(
startTime
),
dateTimeFormatter
.
format
(
endTime
));
List
<
String
>
lastDayHourRange
=
getLastDayHourRange
(
startTime
);
for
(
String
hourRange
:
lastDayHourRange
)
{
String
[]
hourRangeArray
=
hourRange
.
split
(
"~"
);
List
<
DeviceOperationLogEntity
>
deviceOperationLogList
=
getDeviceLogByTimeRange
(
deviceId
,
REPORT_PROPERTY
,
5000
,
hourRangeArray
[
0
],
hourRangeArray
[
1
]);
List
<
DeviceInfoContentSpace
>
tempDeviceInfoContentSpaceList
=
StreamUtil
.
map
(
deviceOperationLogList
,
e
->
JsonUtil
.
toObj
((
String
)
e
.
getContent
(),
DeviceInfoContentSpace
.
class
));
deviceInfoContentSpaceList
.
addAll
(
tempDeviceInfoContentSpaceList
);
}
return
deviceInfoContentSpaceList
;
}
public
List
<
DeviceInfoContentFall
>
getDeviceLogByTimeRangeFall
(
String
deviceId
,
int
pageSize
,
LocalDateTime
startTime
,
LocalDateTime
endTime
)
{
DateTimeFormatter
dateTimeFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
DeviceOperationLogEntity
>
deviceOperationLogEntityList
=
getDeviceLogByTimeRange
(
deviceId
,
REPORT_PROPERTY
,
pageSize
,
dateTimeFormatter
.
format
(
startTime
),
dateTimeFormatter
.
format
(
endTime
));
List
<
DeviceInfoContentFall
>
deviceInfoContentFallList
=
StreamUtil
.
map
(
deviceOperationLogEntityList
,
e
->
JsonUtil
.
toObj
((
String
)
e
.
getContent
(),
DeviceInfoContentFall
.
class
));
List
<
DeviceInfoContentFall
>
deviceInfoContentFallList
=
Lists
.
newArrayList
();
List
<
String
>
lastDayHourRange
=
getLastDayHourRange
(
startTime
);
for
(
String
hourRange
:
lastDayHourRange
)
{
String
[]
hourRangeArray
=
hourRange
.
split
(
"~"
);
List
<
DeviceOperationLogEntity
>
deviceOperationLogList
=
getDeviceLogByTimeRange
(
deviceId
,
REPORT_PROPERTY
,
5000
,
hourRangeArray
[
0
],
hourRangeArray
[
1
]);
List
<
DeviceInfoContentFall
>
tempDeviceInfoContentSpaceList
=
StreamUtil
.
map
(
deviceOperationLogList
,
e
->
JsonUtil
.
toObj
((
String
)
e
.
getContent
(),
DeviceInfoContentFall
.
class
));
deviceInfoContentFallList
.
addAll
(
tempDeviceInfoContentSpaceList
);
}
return
deviceInfoContentFallList
;
}
...
...
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