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
bc95c428
authored
Sep 25, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev' of
http://git.xmmakeit.com/huangjiay/iot-platform-server
into dev
parents
73fc2f86
725fefd3
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
12 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/FallAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/HeartAlarm.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportWeekServiceImpl.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/service/wechat/impl/PlatElderCenterWechatServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/FallAlarm.java
View file @
bc95c428
...
...
@@ -47,9 +47,14 @@ public class FallAlarm implements IAlarm {
String
deviceId
=
platDevice
.
getOriDeviceId
();
String
personState
=
Convert
.
toStr
(
properties
.
get
(
"personState"
));
AlarmRedisDTO
alarmRedisDTO
=
RedisUtil
.
get
(
RedisConst
.
ALARM_DEVICE_FALL_ID
+
deviceId
);
if
(
alarmRedisDTO
==
null
){
alarmRedisDTO
=
new
AlarmRedisDTO
();
alarmRedisDTO
.
setAlarm
(
CommonEnum
.
NO
.
getValue
());
}
if
(
StringUtils
.
equals
(
personState
,
CommonEnum
.
YES
.
getValue
()))
{
if
(
StringUtils
.
equals
(
alarmRedisDTO
.
getAlarm
(),
CommonEnum
.
YES
.
getValue
())){
log
.
error
(
"长者跌倒,已告警过,设备iot_id:"
+
deviceId
);
return
;
}
notice
(
platAlarmCheckDTO
);
alarmRedisDTO
.
setAlarm
(
CommonEnum
.
YES
.
getValue
());
...
...
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/HeartAlarm.java
View file @
bc95c428
...
...
@@ -63,7 +63,7 @@ public class HeartAlarm implements IAlarm {
//计数
AlarmRedisDTO
alarmRedisDTO
=
RedisUtil
.
get
(
RedisConst
.
ALARM_DEVICE_HR_ID
+
deviceId
);
if
(
StringUtils
.
equals
(
personState
,
CommonEnum
.
NO
.
getValue
()
))
{
if
(
StringUtils
.
equals
Any
(
personState
,
CommonEnum
.
NO
.
getValue
(),
"3"
))
{
RedisUtil
.
delete
(
RedisConst
.
ALARM_DEVICE_HR_ID
+
deviceId
);
return
;
}
...
...
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
View file @
bc95c428
...
...
@@ -307,7 +307,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
public
void
edit
(
PlatOrg
dto
)
{
check
(
dto
);
PlatOrg
platOrg
=
this
.
getById
(
dto
.
getId
());
if
(
StringUtils
.
isBlank
(
dto
.
getParentId
())||
StringUtils
.
equals
(
dto
.
getParentId
(),
"1"
))
{
if
(
StringUtils
.
isBlank
(
dto
.
getParentId
())||
StringUtils
.
equals
(
dto
.
getParentId
(),
TreeConst
.
TOP_LEVEL
))
{
}
else
{
PlatOrg
parent
=
getById
(
dto
.
getParentId
());
dto
.
setPath
(
parent
.
getPath
()
+
","
+
parent
.
getId
());
...
...
@@ -316,7 +316,9 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
if
(!
StringUtils
.
equals
(
dto
.
getType
(),
platOrg
.
getType
())){
LambdaUpdateWrapper
<
PlatSpace
>
platSpaceLambdaUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
PlatSpace
.
class
)
.
set
(
PlatSpace:
:
getAttribute
,
dto
.
getType
())
.
eq
(
PlatSpace:
:
getOrgId
,
dto
.
getId
());
.
eq
(
PlatSpace:
:
getOrgId
,
dto
.
getId
())
.
set
(
PlatSpace:
:
getParentId
,
dto
.
getParentId
())
;
platSpaceService
.
update
(
platSpaceLambdaUpdateWrapper
);
}
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportWeekServiceImpl.java
View file @
bc95c428
...
...
@@ -367,7 +367,7 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
String
finalDeviceId
=
deviceId
;
String
finalOriDeviceId
=
oriDeviceId
;
lambdaQueryWrapper
.
and
(
qw
->
{
lambdaQueryWrapper
.
and
(
StringUtils
.
isNotBlank
(
platElderIdDTO
.
getElderId
())||
StringUtils
.
isNotBlank
(
finalDeviceId
)||
StringUtils
.
isNotBlank
(
finalOriDeviceId
),
qw
->
{
if
(
StringUtils
.
isNotBlank
(
platElderIdDTO
.
getElderId
()))
{
lambdaQueryWrapper
.
eq
(
PlatElderBreatheDayStat:
:
getElderId
,
platElderIdDTO
.
getElderId
());
}
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
View file @
bc95c428
...
...
@@ -114,7 +114,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
//上级空间
PlatSpace
parentSpace
=
this
.
getById
(
dto
.
getParentId
());
if
(
parentSpace
.
getParentPath
().
contains
(
dto
.
getId
()))
{
if
(
parentSpace
!=
null
&&
parentSpace
.
getParentPath
().
contains
(
dto
.
getId
()))
{
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_SPACE_NOT_DEL
);
}
...
...
server-service/src/main/java/com/makeit/service/platform/workstation/impl/WorkStationServiceImpl.java
View file @
bc95c428
...
...
@@ -160,7 +160,9 @@ public class WorkStationServiceImpl implements WorkStationService {
if
(
spaces
.
isEmpty
())
{
return
new
PageVO
<>();
}
List
<
String
>
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
dto
.
setOrgIds
(
orgIds
);
dto
.
setSpaceIds
(
spaceIds
);
}
else
{
//获取父级的所有子级空间
spaces
=
platSpaceService
.
listChild
(
dto
.
getSpaceIds
());
...
...
@@ -172,6 +174,7 @@ public class WorkStationServiceImpl implements WorkStationService {
.
eq
(
StringUtil
.
isNotEmpty
(
dto
.
getAlarmType
()),
PlatAlarmRecord:
:
getAlarmType
,
dto
.
getAlarmType
())
.
eq
(
PlatAlarmRecord:
:
getStatus
,
PlatAlarmRecordEnum
.
AlarmRecordStatusEnum
.
UNHANDLED
.
getValue
())
.
in
(
PlatAlarmRecord:
:
getOrgId
,
dto
.
getOrgIds
())
.
orderByDesc
(
PlatAlarmRecord:
:
getAlarmDate
)
);
List
<
String
>
elderIds
=
alarmRecords
.
stream
().
filter
(
t
->
StringUtil
.
isNotEmpty
(
t
.
getElderIds
()))
.
map
(
PlatAlarmRecord:
:
getElderIds
).
collect
(
Collectors
.
toList
());
...
...
@@ -180,6 +183,9 @@ public class WorkStationServiceImpl implements WorkStationService {
elderIdList
.
addAll
(
Arrays
.
asList
(
e
.
split
(
","
)));
});
if
(
StringUtil
.
isNotEmpty
(
dto
.
getAlarmType
())){
if
(
elderIdList
.
isEmpty
()){
return
new
PageVO
<>();
}
dto
.
setElderIds
(
elderIdList
);
}
...
...
@@ -238,17 +244,22 @@ public class WorkStationServiceImpl implements WorkStationService {
if
(
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
HEART
.
getValue
().
equals
(
a
.
getAlarmType
())
||
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
BREATHE
.
getValue
().
equals
(
a
.
getAlarmType
())
){
if
(
typeMap
.
containsKey
(
a
.
getAlarmType
())){
if
(
StringUtil
.
isNotEmpty
(
a
.
getRemark
())){
String
remark
=
typeMap
.
get
(
a
.
getAlarmType
())+
","
+
a
.
getRemark
();
typeMap
.
put
(
a
.
getAlarmType
(),
remark
);
}
}
else
{
if
(!
typeMap
.
containsKey
(
a
.
getAlarmType
())){
if
(
StringUtil
.
isNotEmpty
(
a
.
getRemark
())){
typeMap
.
put
(
a
.
getAlarmType
(),
a
.
getRemark
());
}
}
// if(typeMap.containsKey(a.getAlarmType())){
// if(StringUtil.isNotEmpty(a.getRemark())){
// String remark = typeMap.get(a.getAlarmType())+","+a.getRemark();
// typeMap.put(a.getAlarmType(),remark);
// }
//
// }else {
// if(StringUtil.isNotEmpty(a.getRemark())){
// typeMap.put(a.getAlarmType(),a.getRemark());
// }
// }
}
else
{
typeMap
.
put
(
a
.
getAlarmType
(),
""
);
}
...
...
@@ -348,6 +359,8 @@ public class WorkStationServiceImpl implements WorkStationService {
if
(
spaces
.
isEmpty
())
{
return
new
PageVO
<>();
}
List
<
String
>
spaceIds
=
spaces
.
stream
().
map
(
PlatSpace:
:
getId
).
collect
(
Collectors
.
toList
());
dto
.
setSpaceIds
(
spaceIds
);
}
else
{
//获取父级的所有子级空间
spaces
=
platSpaceService
.
listChild
(
dto
.
getSpaceIds
());
...
...
@@ -359,6 +372,7 @@ public class WorkStationServiceImpl implements WorkStationService {
.
eq
(
StringUtil
.
isNotEmpty
(
dto
.
getAlarmType
()),
PlatAlarmRecord:
:
getAlarmType
,
dto
.
getAlarmType
())
.
eq
(
PlatAlarmRecord:
:
getStatus
,
PlatAlarmRecordEnum
.
AlarmRecordStatusEnum
.
UNHANDLED
.
getValue
())
.
in
(
PlatAlarmRecord:
:
getOrgId
,
dto
.
getOrgIds
())
.
orderByDesc
(
PlatAlarmRecord:
:
getAlarmDate
)
);
List
<
String
>
elderIds
=
alarmRecords
.
stream
().
filter
(
t
->
StringUtil
.
isNotEmpty
(
t
.
getElderIds
()))
.
map
(
PlatAlarmRecord:
:
getElderIds
).
collect
(
Collectors
.
toList
());
...
...
@@ -368,6 +382,9 @@ public class WorkStationServiceImpl implements WorkStationService {
elderIdList
.
addAll
(
Arrays
.
asList
(
e
.
split
(
","
)));
});
if
(
StringUtil
.
isNotEmpty
(
dto
.
getAlarmType
())){
if
(
elderIdList
.
isEmpty
()){
return
new
PageVO
<>();
}
dto
.
setElderIds
(
elderIdList
);
}
...
...
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderCenterWechatServiceImpl.java
View file @
bc95c428
...
...
@@ -78,6 +78,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
new
QueryWrapper
<
PlatAlarmRecord
>().
lambda
()
.
eq
(
PlatAlarmRecord:
:
getStatus
,
PlatAlarmRecordEnum
.
AlarmRecordStatusEnum
.
UNHANDLED
.
getValue
())
.
eq
(
PlatAlarmRecord:
:
getOrgId
,
space
.
getOrgId
())
.
orderByDesc
(
PlatAlarmRecord:
:
getAlarmDate
)
);
//长者对应的报警类型
Map
<
String
,
Map
<
String
,
String
>>
elderAlarmTypeMap
=
workStationService
.
mapElderAlarmType
(
alarmRecords
);
...
...
@@ -133,6 +134,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
new
QueryWrapper
<
PlatAlarmRecord
>().
lambda
()
.
eq
(
PlatAlarmRecord:
:
getStatus
,
PlatAlarmRecordEnum
.
AlarmRecordStatusEnum
.
UNHANDLED
.
getValue
())
.
eq
(
PlatAlarmRecord:
:
getOrgId
,
space
.
getOrgId
())
.
orderByDesc
(
PlatAlarmRecord:
:
getAlarmDate
)
);
WorkStationQueryDTO
queryDTO
=
new
WorkStationQueryDTO
();
queryDTO
.
setSpaceIds
(
spaceIds
);
...
...
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