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
dd754f0e
authored
Oct 11, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
saas端--租户设备管理:查看-数据分析:月报下的表格的对应数据没有返回
parent
34c46add
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
db/inti-elder.sql
server-service/src/main/java/com/makeit/entity/platform/elder/PlatElderReportMonth.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderReportMonthServiceImpl.java
db/inti-elder.sql
View file @
dd754f0e
...
...
@@ -329,7 +329,8 @@ CREATE TABLE `plat_elder_sleep_analysis`
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天睡觉分析'
;
CREATE
TABLE
`plat_elder_breathe_abnormal`
(
CREATE
TABLE
`plat_elder_breathe_abnormal`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'id'
,
`elder_id`
varchar
(
64
)
NOT
NULL
COMMENT
'长者id'
,
`breathe_analysis_id`
varchar
(
64
)
NOT
NULL
COMMENT
'呼吸分析id'
,
...
...
@@ -344,9 +345,12 @@ CREATE TABLE `plat_elder_breathe_abnormal` (
`tenant_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'租户id'
,
PRIMARY
KEY
(
`id`
),
KEY
`index_elder_id`
(
`elder_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天呼吸异常'
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天呼吸异常'
;
CREATE
TABLE
`plat_elder_breathe_analysis`
(
CREATE
TABLE
`plat_elder_breathe_analysis`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'id'
,
`elder_id`
varchar
(
64
)
NOT
NULL
COMMENT
'长者id'
,
`breathe_score`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'睡眠评分'
,
...
...
@@ -363,12 +367,16 @@ CREATE TABLE `plat_elder_breathe_analysis` (
`tenant_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'租户id'
,
PRIMARY
KEY
(
`id`
),
KEY
`index_elder_id`
(
`elder_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天呼吸分析'
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天呼吸分析'
;
CREATE
TABLE
`plat_elder_report_month`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'id'
,
`elder_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'长者id'
,
breathe_device_id
VARCHAR
(
64
)
NULL
COMMENT
'呼吸心率设备id'
,
breathe_ori_device_id
VARCHAR
(
64
)
NULL
COMMENT
'呼吸心率设备原始id'
,
day
date
NOT
NULL
COMMENT
'日期'
,
sleep_result
varchar
(
64
)
NOT
NULL
COMMENT
'睡眠结果'
,
heart_rate
int
NOT
NULL
COMMENT
'心率'
,
...
...
@@ -389,7 +397,7 @@ CREATE TABLE `plat_elder_report_month`
ALTER
TABLE
`dev_iot_yanglao_platform`
.
`plat_elder_sleep_analysis`
ADD
COLUMN
`action_count`
int
(
4
)
COMMENT
'体动次数'
AFTER
`happen_date`
,
ADD
COLUMN
`turned_count`
int
(
4
)
COMMENT
'翻身次数'
AFTER
`action_count`
;
ADD
COLUMN
`turned_count`
int
(
4
)
COMMENT
'翻身次数'
AFTER
`action_count`
;
ALTER
TABLE
`dev_iot_yanglao_platform`
.
`plat_elder_sleep`
ADD
COLUMN
`elder_sleep_type`
int
(
4
)
COMMENT
'睡眠类型 1 睡眠 2 小憩'
AFTER
`happen_date`
;
...
...
server-service/src/main/java/com/makeit/entity/platform/elder/PlatElderReportMonth.java
View file @
dd754f0e
...
...
@@ -27,6 +27,12 @@ public class PlatElderReportMonth extends BaseBusEntity {
@ApiModelProperty
(
value
=
"长者id"
)
private
String
elderId
;
@ApiModelProperty
(
value
=
"呼吸心率设备id"
)
private
String
breatheDeviceId
;
@ApiModelProperty
(
value
=
"呼吸心率设备原始id"
)
private
String
breatheOriDeviceId
;
@ApiModelProperty
(
value
=
"日期"
)
private
LocalDate
day
;
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderReportMonthServiceImpl.java
View file @
dd754f0e
...
...
@@ -127,9 +127,11 @@ public class PlatElderReportMonthServiceImpl extends ServiceImpl<PlatElderReport
LocalDate
end
=
LocalDateTimeUtils
.
getMonthMax
(
start
);
List
<
PlatElderReportMonth
>
monthList
=
list
(
new
QueryWrapper
<
PlatElderReportMonth
>().
lambda
()
.
eq
(
PlatElderReportMonth:
:
getElderId
,
platElderIdDTO
.
getElderId
())
.
eq
(
StringUtils
.
isNotBlank
(
platElderIdDTO
.
getElderId
()),
PlatElderReportMonth:
:
getElderId
,
platElderIdDTO
.
getElderId
())
.
eq
(
StringUtils
.
isNotBlank
(
platElderIdDTO
.
getDeviceId
()),
PlatElderReportMonth:
:
getBreatheDeviceId
,
platElderIdDTO
.
getDeviceId
())
.
ge
(
PlatElderReportMonth:
:
getDay
,
start
)
.
le
(
PlatElderReportMonth:
:
getDay
,
end
)
.
orderByAsc
(
PlatElderReportMonth:
:
getDay
)
);
List
<
PlatElderReportMonthVO
>
voList
=
BeanDtoVoUtils
.
listVo
(
monthList
,
PlatElderReportMonthVO
.
class
);
...
...
@@ -179,6 +181,10 @@ public class PlatElderReportMonthServiceImpl extends ServiceImpl<PlatElderReport
List
<
DeviceInfoContentBreathe
>
breatheList
=
iotProductDeviceService
.
getDeviceLogByTimeRangeBreathe
(
platDevice
.
getOriDeviceId
(),
2
*
24
*
3600
,
yesStart
,
yesEnd
);
if
(
CollectionUtils
.
isNotEmpty
(
breatheList
))
{
reportMonth
.
setBreatheDeviceId
(
platDevice
.
getId
());
reportMonth
.
setBreatheOriDeviceId
(
platDevice
.
getOriDeviceId
());
reportMonth
.
setHeartRate
((
int
)
(
StreamUtil
.
reduce
(
breatheList
,
i
->
(
long
)
i
.
getProperties
().
getHr
(),
0L
,
Long:
:
sum
)
/
breatheList
.
size
()));
reportMonth
.
setRespiratoryRate
((
int
)
(
StreamUtil
.
reduce
(
breatheList
,
i
->
(
long
)
i
.
getProperties
().
getBr
(),
0L
,
Long:
:
sum
)
/
breatheList
.
size
()));
}
...
...
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