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
906e8fab
authored
Sep 26, 2023
by
朱淼
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix bug
parent
cd1d2342
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
3 deletions
server-service/src/main/java/com/makeit/enums/saas/ModelManageTypeEnum.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
server-service/src/main/java/com/makeit/enums/saas/ModelManageTypeEnum.java
0 → 100644
View file @
906e8fab
package
com
.
makeit
.
enums
.
saas
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@AllArgsConstructor
@Getter
public
enum
ModelManageTypeEnum
{
SLEEP
(
"sleep"
,
"睡眠"
),
DISEASE
(
"disease"
,
"呼吸心率"
);
private
String
code
;
private
String
value
;
}
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
View file @
906e8fab
...
@@ -155,6 +155,7 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
...
@@ -155,6 +155,7 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
platRegionSetting
.
setToward
(
dto
.
getToward
());
platRegionSetting
.
setToward
(
dto
.
getToward
());
platRegionSetting
.
setRegionName
(
dto
.
getRegionName
());
platRegionSetting
.
setRegionName
(
dto
.
getRegionName
());
platRegionSetting
.
setRegionRange
(
dto
.
getRegionRange
());
platRegionSetting
.
setRegionRange
(
dto
.
getRegionRange
());
platRegionSetting
.
setRoomRange
(
dto
.
getRoomRange
());
platRegionSetting
.
setDeviceId
(
dto
.
getDeviceId
());
platRegionSetting
.
setDeviceId
(
dto
.
getDeviceId
());
platRegionSetting
.
setRoomId
(
dto
.
getRoomId
());
platRegionSetting
.
setRoomId
(
dto
.
getRoomId
());
platRegionSetting
.
setBackground
(
dto
.
getBackground
());
platRegionSetting
.
setBackground
(
dto
.
getBackground
());
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
View file @
906e8fab
...
@@ -111,7 +111,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
...
@@ -111,7 +111,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
//上级空间
//上级空间
PlatSpace
parentSpace
=
this
.
getById
(
dto
.
getParentId
());
PlatSpace
parentSpace
=
this
.
getById
(
dto
.
getParentId
());
if
(
parentSpace
!=
null
&&
parentSpace
.
getParentPath
().
contains
(
dto
.
getId
()))
{
if
(
parentSpace
!=
null
&&
parentSpace
.
getParentPath
()
!=
null
&&
parentSpace
.
getParentPath
()
.
contains
(
dto
.
getId
()))
{
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_SPACE_NOT_DEL
);
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_SPACE_NOT_DEL
);
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
View file @
906e8fab
...
@@ -14,10 +14,13 @@ import com.makeit.entity.platform.elder.PlatElder;
...
@@ -14,10 +14,13 @@ import com.makeit.entity.platform.elder.PlatElder;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatRoom
;
import
com.makeit.entity.platform.space.PlatRoom
;
import
com.makeit.entity.platform.space.PlatSpace
;
import
com.makeit.entity.platform.space.PlatSpace
;
import
com.makeit.entity.saas.analysis.SaasModelManage
;
import
com.makeit.entity.saas.analysis.SaasSleepAnalysisModel
;
import
com.makeit.enums.platform.alarm.PlatAlarmConfigEnum
;
import
com.makeit.enums.platform.alarm.PlatAlarmConfigEnum
;
import
com.makeit.enums.platform.alarm.PlatAlarmRecordEnum
;
import
com.makeit.enums.platform.alarm.PlatAlarmRecordEnum
;
import
com.makeit.enums.platform.auth.PlatOrgEnum
;
import
com.makeit.enums.platform.auth.PlatOrgEnum
;
import
com.makeit.enums.platform.space.PlatBedStatusEnum
;
import
com.makeit.enums.platform.space.PlatBedStatusEnum
;
import
com.makeit.enums.saas.ModelManageTypeEnum
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
import
com.makeit.service.platform.auth.PlatOrgService
;
import
com.makeit.service.platform.auth.PlatOrgService
;
import
com.makeit.service.platform.elder.PlatElderRealTimeService
;
import
com.makeit.service.platform.elder.PlatElderRealTimeService
;
...
@@ -26,6 +29,8 @@ import com.makeit.service.platform.space.PlatBedService;
...
@@ -26,6 +29,8 @@ import com.makeit.service.platform.space.PlatBedService;
import
com.makeit.service.platform.space.PlatRoomService
;
import
com.makeit.service.platform.space.PlatRoomService
;
import
com.makeit.service.platform.space.PlatSpaceService
;
import
com.makeit.service.platform.space.PlatSpaceService
;
import
com.makeit.service.platform.workstation.WorkStationService
;
import
com.makeit.service.platform.workstation.WorkStationService
;
import
com.makeit.service.saas.SaasModelManageService
;
import
com.makeit.service.saas.SaasSleepAnalysisModelService
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.sql.join.JoinUtil
;
import
com.makeit.utils.sql.join.JoinUtil
;
...
@@ -63,6 +68,10 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -63,6 +68,10 @@ public class WorkStationServiceImpl implements WorkStationService {
private
PlatOrgService
platOrgService
;
private
PlatOrgService
platOrgService
;
@Autowired
@Autowired
private
PlatElderRealTimeService
platElderRealTimeService
;
private
PlatElderRealTimeService
platElderRealTimeService
;
@Autowired
private
SaasModelManageService
saasModelManageService
;
@Autowired
private
SaasSleepAnalysisModelService
saasSleepAnalysisModelService
;
@Override
@Override
public
WorkStationInstitutionStatisticsVO
institutionStatistics
(
WorkStationQueryDTO
dto
)
{
public
WorkStationInstitutionStatisticsVO
institutionStatistics
(
WorkStationQueryDTO
dto
)
{
...
@@ -207,12 +216,24 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -207,12 +216,24 @@ public class WorkStationServiceImpl implements WorkStationService {
e
.
setPathName
(
StreamUtil
.
join
(
l
,
Objects:
:
nonNull
,
PlatSpace:
:
getName
,
"-"
));
e
.
setPathName
(
StreamUtil
.
join
(
l
,
Objects:
:
nonNull
,
PlatSpace:
:
getName
,
"-"
));
});
});
//查询睡眠质量分析模型
// SaasModelManage modelManage = saasModelManageService.getOne(new QueryWrapper<SaasModelManage>().lambda()
// .eq(SaasModelManage::getModelType, ModelManageTypeEnum.SLEEP.getCode())
// .last(" limit 1"));
// Integer turnedComparison = 0;
// if(modelManage != null){
// SaasSleepAnalysisModel model = saasSleepAnalysisModelService.view(modelManage.getModelId());
// if(model != null && model.getTurnedComparison() != null){
// turnedComparison = Integer.valueOf(model.getTurnedComparison());
// }
// }
for
(
WorkStationInstitutionRoomVO
vo
:
roomVOList
)
{
for
(
WorkStationInstitutionRoomVO
vo
:
roomVOList
)
{
vo
.
setPathName
(
vo
.
getPathName
()
+
"-"
+
vo
.
getRoomName
());
vo
.
setPathName
(
vo
.
getPathName
()
+
"-"
+
vo
.
getRoomName
());
if
(
bedMap
.
get
(
vo
.
getRoomId
())
!=
null
)
{
if
(
bedMap
.
get
(
vo
.
getRoomId
())
!=
null
)
{
List
<
WorkStationInstitutionBedVO
>
roomBedVos
=
bedMap
.
get
(
vo
.
getRoomId
());
List
<
WorkStationInstitutionBedVO
>
roomBedVos
=
bedMap
.
get
(
vo
.
getRoomId
());
//获取告警类型及老人状态
//获取告警类型及老人状态
roomBedVos
.
forEach
(
r
->
{
for
(
WorkStationInstitutionBedVO
r
:
roomBedVos
)
{
if
(
StringUtil
.
isNotEmpty
(
r
.
getElderId
())
)
{
if
(
StringUtil
.
isNotEmpty
(
r
.
getElderId
())
)
{
if
(
elderAlarmTypeMap
.
containsKey
(
r
.
getElderId
())){
if
(
elderAlarmTypeMap
.
containsKey
(
r
.
getElderId
())){
r
.
setAlarmTypeMap
(
elderAlarmTypeMap
.
get
(
r
.
getElderId
()));
r
.
setAlarmTypeMap
(
elderAlarmTypeMap
.
get
(
r
.
getElderId
()));
...
@@ -223,10 +244,20 @@ public class WorkStationServiceImpl implements WorkStationService {
...
@@ -223,10 +244,20 @@ public class WorkStationServiceImpl implements WorkStationService {
platElderIdDTO
.
setElderId
(
r
.
getElderId
());
platElderIdDTO
.
setElderId
(
r
.
getElderId
());
platElderIdDTO
.
setDeviceId
(
r
.
getDeviceId
());
platElderIdDTO
.
setDeviceId
(
r
.
getDeviceId
());
PlatElderRealTimeNowVO
nowStatus
=
platElderRealTimeService
.
nowStatus
(
platElderIdDTO
);
PlatElderRealTimeNowVO
nowStatus
=
platElderRealTimeService
.
nowStatus
(
platElderIdDTO
);
//离床:雷达状态上报无人
//翻身:雷达上报的数据符合IOT平台睡眠质量分析模型中配置的翻身规则
//睡眠:雷达上报的数据符合IOT平台睡眠质量分析模型中的入睡时间,状态变更为睡眠
//静息:雷达上报有人,且非睡眠
// if("0".equals(nowStatus.getStatus())){
// r.setElderStatus(nowStatus.getStatus());
// }else if(nowStatus.getBodyMove()!=null && nowStatus.getBodyMove() > turnedComparison){
//
// }
r
.
setElderStatus
(
nowStatus
.
getStatus
());
r
.
setElderStatus
(
nowStatus
.
getStatus
());
}
}
}
}
});
}
vo
.
setList
(
roomBedVos
);
vo
.
setList
(
roomBedVos
);
}
}
}
}
...
...
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