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
88cc2321
authored
Feb 19, 2024
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
modify:bug 修改
parent
ee0017fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
server-module/src/main/java/com/makeit/module/controller/elder/PlatElderSleepController.java
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
server-module/src/main/java/com/makeit/module/controller/elder/PlatElderSleepController.java
View file @
88cc2321
...
...
@@ -163,8 +163,6 @@ public class PlatElderSleepController {
@ApiOperation
(
"测试"
)
@GetMapping
(
"test11"
)
@AuthIgnore
@TenantIdIgnore
public
ApiResponseEntity
<
Void
>
test11
(
@RequestParam
String
id
)
{
PlatAlarmRecord
alarmRecord
=
platAlarmRecordService
.
getById
(
id
);
PlatAlarmConfig
alarmConfig
=
alarmConfigService
.
getById
(
alarmRecord
.
getAlarmId
());
...
...
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
View file @
88cc2321
...
...
@@ -36,7 +36,6 @@ import com.makeit.global.aspect.tenant.TenantIdIgnore;
import
com.makeit.mapper.platform.alarm.PlatAlarmRecordMapper
;
import
com.makeit.mapper.platform.elder.PlatElderChildrenInfoMapper
;
import
com.makeit.module.iot.service.IotDevicePropertiesOperateService
;
import
com.makeit.module.system.entity.SysDictionary
;
import
com.makeit.module.system.service.SysDictionaryService
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
...
...
@@ -356,40 +355,46 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
if
(
CollUtil
.
isEmpty
(
childInfoList
))
{
return
list
;
}
PlatDevice
device
=
platDeviceService
.
getById
(
alarmRecord
.
getDeviceId
());
PageReqDTO
<
PlatDeviceQueryDTO
>
pageReqDTO
=
new
PageReqDTO
<>();
pageReqDTO
.
setPage
(
1
);
pageReqDTO
.
setLimit
(
1
);
PlatDeviceQueryDTO
queryDTO
=
new
PlatDeviceQueryDTO
();
queryDTO
.
setId
(
alarmRecord
.
getDeviceId
());
queryDTO
.
setOriDeviceId
(
device
.
getOriDeviceId
());
queryDTO
.
setTenantId
(
alarmRecord
.
getTenantId
());
pageReqDTO
.
setData
(
queryDTO
);
PageVO
<
PlatDeviceListVO
>
platPage
=
platDeviceService
.
platPage
(
pageReqDTO
);
String
regionName
=
""
;
if
(
platPage
!=
null
&&
CollUtil
.
isNotEmpty
(
platPage
.
getList
()))
{
regionName
=
platPage
.
getList
().
get
(
0
).
getSpaceName
();
}
if
(
StrUtil
.
isBlank
(
regionName
))
{
regionName
=
StrUtil
.
isNotBlank
(
alarmRecord
.
getRegionName
())
?
alarmRecord
.
getRegionName
()
:
" "
;
}
List
<
SysDictionary
>
dictList
=
sysDictionaryService
.
list
(
Wrappers
.<
SysDictionary
>
lambdaQuery
().
like
(
SysDictionary:
:
getCode
,
"alarm.alarmType"
));
Map
<
String
,
SysDictionary
>
dictMap
=
StreamUtil
.
toMapDep
(
dictList
,
SysDictionary:
:
getValue
);
SysDictionary
dictionary
=
dictMap
.
get
(
alarmRecord
.
getAlarmType
());
String
finalRegionName
=
regionName
;
PlatElder
elder
=
platElderService
.
getById
(
alarmRecord
.
getElderIds
());
childInfoList
.
forEach
(
c
->
{
if
(
StrUtil
.
isBlank
(
c
.
getWeChatOpenid
()))
{
return
;
}
MsgSendDTO
.
ReceiverInfo
receiverInfo
=
new
MsgSendDTO
.
ReceiverInfo
();
receiverInfo
.
setRegionName
(
finalRegionName
);
receiverInfo
.
setName
(
alarmRecord
.
getElder
Name
());
receiverInfo
.
setName
(
elder
.
get
Name
());
receiverInfo
.
setWeChatOpenid
(
c
.
getWeChatOpenid
());
receiverInfo
.
setAlarmDate
(
alarmRecord
.
getAlarmDate
());
receiverInfo
.
setAlarmType
(
dictionary
!=
null
?
dictionary
.
getName
()
:
alarmRecord
.
getAlarmType
(
));
receiverInfo
.
setAlarmType
(
DICT_MAP
.
get
(
alarmRecord
.
getAlarmType
()
));
list
.
add
(
receiverInfo
);
});
return
list
;
}
private
static
final
Map
<
String
,
String
>
DICT_MAP
=
new
HashMap
<>();
static
{
DICT_MAP
.
put
(
"1"
,
"长者跌倒"
);
DICT_MAP
.
put
(
"2"
,
"呼吸异常"
);
DICT_MAP
.
put
(
"3"
,
"心率异常"
);
DICT_MAP
.
put
(
"4"
,
"行为异常"
);
DICT_MAP
.
put
(
"5"
,
"离床告警"
);
}
/**
* 通知工作人员
* 短信
...
...
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