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
6d5b2de6
authored
Sep 11, 2023
by
李小龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
整理代码
parent
7c260ac2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
11 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/PlatAlarmRecordService.java
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/auth/PlatOrgService.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
server-service/src/main/java/com/makeit/service/saas/impl/PlatTenantServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/alarm/PlatAlarmRecordService.java
View file @
6d5b2de6
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO
;
import
com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.alarm.PlatAlarmRecord
;
import
com.makeit.entity.platform.alarm.PlatAlarmRecord
;
import
com.makeit.vo.platform.alarm.PlatAlarmRecordVO
;
import
com.makeit.vo.platform.alarm.PlatAlarmRecordVO
;
...
@@ -28,4 +29,10 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
...
@@ -28,4 +29,10 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
void
deal
(
String
recordId
);
void
deal
(
String
recordId
);
void
noticeRelation
(
String
recordId
);
void
noticeRelation
(
String
recordId
);
void
noticeChildren
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
);
void
noticeUser
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
);
void
noticeDeviceAlarm
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
);
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
View file @
6d5b2de6
...
@@ -9,9 +9,11 @@ import com.makeit.common.page.PageVO;
...
@@ -9,9 +9,11 @@ import com.makeit.common.page.PageVO;
import
com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO
;
import
com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.alarm.PlatAlarmRecord
;
import
com.makeit.entity.platform.alarm.PlatAlarmRecord
;
import
com.makeit.entity.platform.auth.PlatUser
;
import
com.makeit.entity.platform.elder.PlatElderChildrenInfo
;
import
com.makeit.entity.platform.elder.PlatElderChildrenInfo
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.exception.BusinessException
;
import
com.makeit.exception.BusinessException
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.mapper.platform.alarm.PlatAlarmRecordMapper
;
import
com.makeit.mapper.platform.alarm.PlatAlarmRecordMapper
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
import
com.makeit.service.platform.alarm.PlatAlarmRecordService
;
...
@@ -139,11 +141,34 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -139,11 +141,34 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
public
void
noticeRelation
(
String
recordId
)
{
public
void
noticeRelation
(
String
recordId
)
{
PlatAlarmRecord
platAlarmRecord
=
this
.
getById
(
recordId
);
PlatAlarmRecord
platAlarmRecord
=
this
.
getById
(
recordId
);
PlatAlarmConfig
platAlarmConfig
=
platAlarmConfigService
.
getById
(
platAlarmRecord
.
getAlarmId
());
PlatAlarmConfig
platAlarmConfig
=
platAlarmConfigService
.
getById
(
platAlarmRecord
.
getAlarmId
());
String
elderIds
=
platAlarmRecord
.
getElderIds
();
String
elderIds
=
platAlarmRecord
.
getElderIds
();
if
(
StringUtils
.
isBlank
(
elderIds
))
{
if
(
StringUtils
.
isBlank
(
elderIds
))
{
throw
new
BusinessException
(
"设备没绑定长者"
);
throw
new
BusinessException
(
"设备没绑定长者"
);
}
}
noticeChildren
(
platAlarmConfig
,
platAlarmRecord
);
}
/**
* 发送消息
*/
@Transactional
@Override
public
void
noticeDeviceAlarm
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
){
}
/**
* 通知家属
* 子女端小程序
* 短信
* 语音短信
* @param alarmConfig
* @param alarmRecord
*/
@Transactional
@TenantIdIgnore
public
void
noticeChildren
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
){
String
elderIds
=
alarmRecord
.
getElderIds
();
List
<
PlatElderChildrenInfo
>
allChildInfoList
=
new
ArrayList
<>();
List
<
PlatElderChildrenInfo
>
allChildInfoList
=
new
ArrayList
<>();
String
[]
elderIdSplit
=
elderIds
.
split
(
","
);
String
[]
elderIdSplit
=
elderIds
.
split
(
","
);
...
@@ -160,7 +185,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -160,7 +185,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
}
allChildInfoList
.
addAll
(
childrenInfoList
);
allChildInfoList
.
addAll
(
childrenInfoList
);
Set
<
String
>
phoneSet
=
childrenInfoList
.
stream
().
map
(
PlatElderChildrenInfo:
:
getPhone
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
phoneSet
=
childrenInfoList
.
stream
().
map
(
PlatElderChildrenInfo:
:
getPhone
).
collect
(
Collectors
.
toSet
());
String
notifyChannel
=
platA
larmConfig
.
getNotifyChannel
();
String
notifyChannel
=
a
larmConfig
.
getNotifyChannel
();
String
[]
split
=
notifyChannel
.
split
(
","
);
String
[]
split
=
notifyChannel
.
split
(
","
);
//告警配置和租户告警 字典一致
//告警配置和租户告警 字典一致
...
@@ -172,7 +197,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -172,7 +197,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
MsgSendDTO
msgSendDTO
=
new
MsgSendDTO
();
MsgSendDTO
msgSendDTO
=
new
MsgSendDTO
();
msgSendDTO
.
setSendTypeEnum
(
sendTypeEnum
);
msgSendDTO
.
setSendTypeEnum
(
sendTypeEnum
);
msgSendDTO
.
setReceiverList
(
phoneSet
);
msgSendDTO
.
setReceiverList
(
phoneSet
);
msgSendDTO
.
setOriContent
(
platA
larmRecord
.
getContent
());
msgSendDTO
.
setOriContent
(
a
larmRecord
.
getContent
());
//todo 小程序消息
//todo 小程序消息
msgUtil
.
send
(
msgSendDTO
);
msgUtil
.
send
(
msgSendDTO
);
}
}
...
@@ -180,16 +205,29 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -180,16 +205,29 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
}
String
childIdJoin
=
allChildInfoList
.
stream
().
map
(
BaseEntity:
:
getId
).
collect
(
Collectors
.
joining
(
","
));
String
childIdJoin
=
allChildInfoList
.
stream
().
map
(
BaseEntity:
:
getId
).
collect
(
Collectors
.
joining
(
","
));
//通知的子女
//通知的子女
platAlarmConfig
.
setNotifyRelation
(
childIdJoin
);
alarmConfig
.
setNotifyRelation
(
childIdJoin
);
platAlarmRecord
.
setNoticeStatus
(
CommonEnum
.
YES
.
getValue
());
alarmRecord
.
setNoticeStatus
(
CommonEnum
.
YES
.
getValue
());
updateById
(
platAlarmRecord
);
alarmRecord
.
setTenantId
(
alarmConfig
.
getTenantId
());
saveOrUpdate
(
alarmRecord
);
}
}
/**
/**
* 发送消息
* 通知工作人员
* 短信
* 语音短信
* 邮件
* @param alarmConfig
* @param alarmRecord
*/
*/
public
void
noticeDeviceAlarm
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
){
@Transactional
@Override
@TenantIdIgnore
public
void
noticeUser
(
PlatAlarmConfig
alarmConfig
,
PlatAlarmRecord
alarmRecord
){
String
notifyWay
=
alarmConfig
.
getNotifyWay
();
List
<
PlatUser
>
platUserList
=
new
ArrayList
<>();
if
(
StringUtils
.
equals
(
notifyWay
,
"1"
)){
}
else
{
}
}
}
}
}
server-service/src/main/java/com/makeit/service/platform/auth/PlatOrgService.java
View file @
6d5b2de6
...
@@ -87,4 +87,11 @@ public interface PlatOrgService extends IService<PlatOrg> {
...
@@ -87,4 +87,11 @@ public interface PlatOrgService extends IService<PlatOrg> {
PageVO
<
PlatOrg
>
page
(
PageReqDTO
<
PlatOrgQueryDTO
>
pageReqDTO
);
PageVO
<
PlatOrg
>
page
(
PageReqDTO
<
PlatOrgQueryDTO
>
pageReqDTO
);
List
<
PlatOrg
>
subOrgList
(
PlatOrgQueryDTO
platOrgQueryDTO
);
List
<
PlatOrg
>
subOrgList
(
PlatOrgQueryDTO
platOrgQueryDTO
);
/**
* 组织表增加一条数据
* 增加告警配置
* @param platOrg
*/
void
saveOrg
(
PlatOrg
platOrg
);
}
}
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatOrgServiceImpl.java
View file @
6d5b2de6
...
@@ -278,7 +278,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
...
@@ -278,7 +278,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
PlatOrg
parent
=
getById
(
dto
.
getParentId
());
PlatOrg
parent
=
getById
(
dto
.
getParentId
());
dto
.
setPath
(
parent
.
getPath
()
+
","
+
parent
.
getId
());
dto
.
setPath
(
parent
.
getPath
()
+
","
+
parent
.
getId
());
}
}
save
(
dto
);
save
Org
(
dto
);
return
dto
.
getId
();
return
dto
.
getId
();
}
}
...
@@ -511,4 +511,15 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
...
@@ -511,4 +511,15 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
return
list
(
queryWrapper
);
return
list
(
queryWrapper
);
}
}
/**
* 组织表增加一条数据
* 增加告警配置
* @param platOrg
*/
@Override
public
void
saveOrg
(
PlatOrg
platOrg
)
{
save
(
platOrg
);
}
}
}
server-service/src/main/java/com/makeit/service/saas/impl/PlatTenantServiceImpl.java
View file @
6d5b2de6
...
@@ -223,7 +223,7 @@ implements PlatTenantService {
...
@@ -223,7 +223,7 @@ implements PlatTenantService {
//组织表增加一条数据
//组织表增加一条数据
PlatOrg
platOrg
=
convertToPlatOrg
(
tntTenant
);
PlatOrg
platOrg
=
convertToPlatOrg
(
tntTenant
);
platOrgService
.
save
(
platOrg
);
platOrgService
.
save
Org
(
platOrg
);
//分配菜单
//分配菜单
assignMenuList
(
tntTenant
.
getId
(),
dto
.
getMenuIdList
());
assignMenuList
(
tntTenant
.
getId
(),
dto
.
getMenuIdList
());
...
...
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