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
8b71d588
authored
Sep 18, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加获取跌倒数据的接口
parent
d1c95f93
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
8 deletions
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
server-common/src/main/java/com/makeit/module/iot/vo/fall/DeviceInfoContentFall.java
server-common/src/main/java/com/makeit/module/iot/vo/breathe/DeviceInfoContentSpace.java → server-common/src/main/java/com/makeit/module/iot/vo/space/DeviceInfoContentSpace.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportDayServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
server-web/src/test/java/com/makeit/iotapi/IotTest.java → server-web/src/test/java/com/makeit/iotapi/IotDeviceInfoContentFall.java
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
View file @
8b71d588
...
...
@@ -12,7 +12,8 @@ import com.makeit.module.iot.vo.DeviceOperationLogEntity;
import
com.makeit.module.iot.vo.IotPagerResult
;
import
com.makeit.module.iot.vo.ResponseMessage
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentSpace
;
import
com.makeit.module.iot.vo.fall.DeviceInfoContentFall
;
import
com.makeit.module.iot.vo.space.DeviceInfoContentSpace
;
import
com.makeit.utils.LongTimestampUtil
;
import
com.makeit.utils.data.convert.JsonUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
...
...
@@ -23,9 +24,7 @@ import org.springframework.stereotype.Component;
import
java.io.IOException
;
import
java.time.Duration
;
import
java.time.Instant
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
...
...
@@ -145,6 +144,16 @@ public class IotProductDeviceService extends IotCommonService {
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
,
"event"
,
pageSize
,
dateTimeFormatter
.
format
(
startTime
),
dateTimeFormatter
.
format
(
endTime
));
List
<
DeviceInfoContentFall
>
deviceInfoContentSpaceList
=
StreamUtil
.
map
(
deviceOperationLogEntityList
,
e
->
JsonUtil
.
toObj
((
String
)
e
.
getContent
(),
DeviceInfoContentFall
.
class
));
return
deviceInfoContentSpaceList
;
}
/**
* 根据类型查询设备日志
...
...
@@ -195,7 +204,6 @@ public class IotProductDeviceService extends IotCommonService {
}
/**
*
* @param deviceId
* @param typeValue
* @param pageSize
...
...
server-common/src/main/java/com/makeit/module/iot/vo/fall/DeviceInfoContentFall.java
0 → 100644
View file @
8b71d588
package
com
.
makeit
.
module
.
iot
.
vo
.
fall
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@NoArgsConstructor
@Data
public
class
DeviceInfoContentFall
{
@JsonProperty
(
"headers"
)
private
DeviceInfoContentBreathe
.
Headers
headers
;
@JsonProperty
(
"messageType"
)
private
String
messageType
;
@JsonProperty
(
"deviceId"
)
private
String
deviceId
;
@JsonProperty
(
"properties"
)
private
Properties
properties
;
@JsonProperty
(
"timestamp"
)
private
Long
timestamp
;
@NoArgsConstructor
@Data
public
static
class
Properties
{
@JsonProperty
(
"personState"
)
private
Integer
personState
;
@JsonProperty
(
"person"
)
private
Integer
person
;
@JsonProperty
(
"radarHitch"
)
private
String
radarHitch
;
@JsonProperty
(
"track"
)
private
List
<
Integer
>
track
;
@JsonProperty
(
"mount"
)
private
Integer
mount
;
}
}
server-common/src/main/java/com/makeit/module/iot/vo/
breath
e/DeviceInfoContentSpace.java
→
server-common/src/main/java/com/makeit/module/iot/vo/
spac
e/DeviceInfoContentSpace.java
View file @
8b71d588
package
com
.
makeit
.
module
.
iot
.
vo
.
breath
e
;
package
com
.
makeit
.
module
.
iot
.
vo
.
spac
e
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportDayServiceImpl.java
View file @
8b71d588
...
...
@@ -10,7 +10,7 @@ import com.makeit.entity.platform.elder.PlatElderSleepAnalysis;
import
com.makeit.enums.platform.alarm.PlatAlarmConfigEnum
;
import
com.makeit.module.iot.service.IotProductDeviceService
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
com.makeit.module.iot.vo.
breath
e.DeviceInfoContentSpace
;
import
com.makeit.module.iot.vo.
spac
e.DeviceInfoContentSpace
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.elder.*
;
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
View file @
8b71d588
...
...
@@ -4,7 +4,7 @@ import com.makeit.dto.platform.elder.PlatElderIdDTO;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.module.iot.service.IotProductDeviceService
;
import
com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe
;
import
com.makeit.module.iot.vo.
breath
e.DeviceInfoContentSpace
;
import
com.makeit.module.iot.vo.
spac
e.DeviceInfoContentSpace
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.elder.PlatElderRealTimeService
;
import
com.makeit.service.platform.elder.PlatElderService
;
...
...
server-web/src/test/java/com/makeit/iotapi/Iot
Test
.java
→
server-web/src/test/java/com/makeit/iotapi/Iot
DeviceInfoContentFall
.java
View file @
8b71d588
...
...
@@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
public
class
Iot
Test
{
public
class
Iot
DeviceInfoContentFall
{
@Autowired
private
IotTokenService
tokenService
;
...
...
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