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
7bf13aaf
authored
Feb 18, 2024
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
modify:bug 修改
parent
97a45a95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 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 @
7bf13aaf
...
...
@@ -5,12 +5,15 @@ import com.alibaba.fastjson.JSONObject;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.alarm.PlatAlarmRecord
;
import
com.makeit.entity.platform.elder.ElderSleepAnalysisVO
;
import
com.makeit.entity.platform.elder.PlatElderBreatheAnalysis
;
import
com.makeit.entity.platform.elder.PlatElderSleepAnalysis
;
import
com.makeit.external.huineng.HuiNengService
;
import
com.makeit.global.annotation.AuthIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.elder.*
;
import
com.makeit.vo.platform.elder.wakeUpAnalysisVO
;
...
...
@@ -19,6 +22,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
...
...
@@ -50,6 +54,10 @@ public class PlatElderSleepController {
private
PlatElderBreatheHeartRateRecordService
platElderBreatheHeartRateRecordService
;
@Autowired
private
HuiNengService
huiNengService
;
@Resource
private
PlatAlarmRecordService
platAlarmRecordService
;
@Resource
private
PlatAlarmConfigService
alarmConfigService
;
@ApiOperation
(
"测试"
)
...
...
@@ -152,5 +160,16 @@ public class PlatElderSleepController {
@RequestParam
Integer
day
)
{
return
ApiResponseUtils
.
success
(
platElderBreatheAnalysisService
.
elderGetUpAnalysisTask
(
month
,
day
));
}
@ApiOperation
(
"测试"
)
@GetMapping
(
"test11"
)
@AuthIgnore
@TenantIdIgnore
public
ApiResponseEntity
<
Void
>
test11
(
@RequestParam
String
id
)
{
PlatAlarmRecord
alarmRecord
=
platAlarmRecordService
.
getById
(
id
);
PlatAlarmConfig
alarmConfig
=
alarmConfigService
.
getById
(
alarmRecord
.
getAlarmId
());
platAlarmRecordService
.
noticeDeviceAlarm
(
alarmConfig
,
alarmRecord
);
return
ApiResponseUtils
.
success
();
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
View file @
7bf13aaf
...
...
@@ -305,7 +305,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
log
.
error
(
"通知家属异常"
,
e
);
}
//通知内部人员
noticeUser
(
alarmConfig
,
alarmRecord
);
//
noticeUser(alarmConfig, alarmRecord);
}
...
...
@@ -471,7 +471,8 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
String
[]
tenantChannels
=
alertChannel
.
split
(
","
);
List
<
String
>
tenantChannelList
=
Lists
.
newArrayList
(
Arrays
.
asList
(
tenantChannels
));
String
[]
split
=
notifyChannel
.
split
(
","
);
List
<
String
>
split
=
Arrays
.
stream
(
notifyChannel
.
split
(
","
)).
sorted
(
Comparator
.
reverseOrder
())
.
collect
(
Collectors
.
toList
());
for
(
String
sendType
:
split
)
{
//租户告警渠道 没配置的 就不发送
if
(!
tenantChannelList
.
contains
(
sendType
)){
...
...
@@ -507,7 +508,11 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
msgSendDTO
.
setAlarmType
(
alarmConfig
.
getAlarmType
());
//todo 小程序消息
msgUtil
.
send
(
msgSendDTO
);
try
{
msgUtil
.
send
(
msgSendDTO
);
}
catch
(
Exception
e
)
{
log
.
error
(
"发送消息失败!"
);
}
}
}
}
...
...
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