Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
4d9a0baf
Commit
4d9a0baf
authored
Feb 02, 2023
by
ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复报警bug
parent
f7f2a3e9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
11 deletions
+13
-11
DeviceServerHandler.java
.../java/iot/sixiang/license/device/DeviceServerHandler.java
+1
-1
OperateSAMStatusResponseEventHandler.java
...g/license/event/OperateSAMStatusResponseEventHandler.java
+2
-2
ForwardConnectionListener.java
...ot/sixiang/license/forward/ForwardConnectionListener.java
+1
-1
UserInfoVO.java
...rc/main/java/iot/sixiang/license/model/vo/UserInfoVO.java
+3
-1
OperateConnectionListener.java
...ot/sixiang/license/operate/OperateConnectionListener.java
+1
-1
ReportService.java
.../main/java/iot/sixiang/license/service/ReportService.java
+1
-1
ReportServiceImpl.java
...a/iot/sixiang/license/service/impl/ReportServiceImpl.java
+3
-3
TerminalDeviceServiceImpl.java
...xiang/license/service/impl/TerminalDeviceServiceImpl.java
+1
-1
No files found.
license/src/main/java/iot/sixiang/license/device/DeviceServerHandler.java
View file @
4d9a0baf
...
...
@@ -184,7 +184,7 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
UserInfoVO
user
=
userMapper
.
getUserBySn
(
sn
);
Report
report
=
Report
.
builder
().
category
(
0
).
type
(
6
).
sn
(
sn
).
userName
(
user
.
getUserName
())
.
userCompany
(
user
.
getCompany
()).
createTime
(
new
Date
()).
updateTime
(
new
Date
()).
build
();
reportService
.
reportToEmail
(
report
);
reportService
.
reportToEmail
(
report
,
user
.
getNotify
()
);
}
return
license
;
}
...
...
license/src/main/java/iot/sixiang/license/event/OperateSAMStatusResponseEventHandler.java
View file @
4d9a0baf
...
...
@@ -63,7 +63,7 @@ public class OperateSAMStatusResponseEventHandler {
UserInfoVO
user
=
userMapper
.
getRootAccount
();
Report
report
=
Report
.
builder
().
category
(
1
).
type
(
1
).
userName
(
user
.
getUserName
())
.
userCompany
(
user
.
getCompany
()).
createTime
(
new
Date
()).
updateTime
(
new
Date
()).
build
();
reportService
.
reportToEmail
(
report
);
reportService
.
reportToEmail
(
report
,
user
.
getNotify
()
);
}
}
SamMonitor
samMonitor
=
new
SamMonitor
();
...
...
@@ -79,7 +79,7 @@ public class OperateSAMStatusResponseEventHandler {
UserInfoVO
user
=
userMapper
.
getRootAccount
();
Report
report
=
Report
.
builder
().
category
(
1
).
type
(
2
).
userName
(
user
.
getUserName
())
.
userCompany
(
user
.
getCompany
()).
createTime
(
new
Date
()).
updateTime
(
new
Date
()).
build
();
reportService
.
reportToEmail
(
report
);
reportService
.
reportToEmail
(
report
,
user
.
getNotify
()
);
}
}
}
license/src/main/java/iot/sixiang/license/forward/ForwardConnectionListener.java
View file @
4d9a0baf
...
...
@@ -46,7 +46,7 @@ public class ForwardConnectionListener extends BaseConnectionListener {
Report
report
=
Report
.
builder
().
category
(
1
).
type
(
3
).
userName
(
user
.
getUserName
())
.
description
(
"桥接客户端,连接服务器"
+
this
.
host
+
":"
+
this
.
port
+
"失败"
)
.
userCompany
(
user
.
getCompany
()).
createTime
(
new
Date
()).
updateTime
(
new
Date
()).
build
();
reportService
.
reportToEmail
(
report
);
reportService
.
reportToEmail
(
report
,
user
.
getNotify
()
);
// forward client连接失败,则强制踢掉设备客户端
DeviceClientBeForcedOfflineEvent
deviceClientBeForcedOfflineEvent
=
new
DeviceClientBeForcedOfflineEvent
();
deviceClientBeForcedOfflineEvent
.
setSn
(
this
.
sn
);
...
...
license/src/main/java/iot/sixiang/license/model/vo/UserInfoVO.java
View file @
4d9a0baf
...
...
@@ -10,10 +10,12 @@ import lombok.Data;
*/
@Data
public
class
UserInfoVO
{
@ApiModelProperty
(
"用户
号
"
)
@ApiModelProperty
(
"用户
名
"
)
private
String
userName
;
@ApiModelProperty
(
"公司名"
)
private
String
company
;
@ApiModelProperty
(
"通知邮箱"
)
private
String
notify
;
}
license/src/main/java/iot/sixiang/license/operate/OperateConnectionListener.java
View file @
4d9a0baf
...
...
@@ -37,7 +37,7 @@ public class OperateConnectionListener extends BaseConnectionListener {
Report
report
=
Report
.
builder
().
category
(
1
).
type
(
3
).
userName
(
user
.
getUserName
())
.
description
(
"运维客户端,连接服务器"
+
this
.
host
+
":"
+
this
.
port
+
"失败"
)
.
userCompany
(
user
.
getCompany
()).
createTime
(
new
Date
()).
updateTime
(
new
Date
()).
build
();
reportService
.
reportToEmail
(
report
);
reportService
.
reportToEmail
(
report
,
user
.
getNotify
()
);
}
else
{
log
.
info
(
"运维客户端,连接服务器成功:{},{}"
,
this
.
host
,
this
.
port
);
//TODO 查询SAM状态
...
...
license/src/main/java/iot/sixiang/license/service/ReportService.java
View file @
4d9a0baf
...
...
@@ -15,5 +15,5 @@ public interface ReportService {
PageResult
<
ReportVO
>
getReportList
(
ReportDTO
reportDTO
);
void
reportToEmail
(
Report
report
);
void
reportToEmail
(
Report
report
,
String
notify
);
}
license/src/main/java/iot/sixiang/license/service/impl/ReportServiceImpl.java
View file @
4d9a0baf
...
...
@@ -72,8 +72,8 @@ public class ReportServiceImpl implements ReportService {
@Async
(
"mailExecutor"
)
@Override
public
void
reportToEmail
(
Report
report
)
{
if
(!
Validator
.
isEmail
(
report
.
getUserName
()
))
{
public
void
reportToEmail
(
Report
report
,
String
notify
)
{
if
(!
Validator
.
isEmail
(
notify
))
{
throw
new
IotLicenseException
(
403
,
"报警失败,无效的邮箱账号"
);
}
reportMapper
.
insert
(
report
);
...
...
@@ -94,6 +94,6 @@ public class ReportServiceImpl implements ReportService {
}
else
{
throw
new
IotLicenseException
(
403
,
"报警失败,无效的报警大类"
);
}
emailUtils
.
sendSimpleMail
(
report
.
getUserName
()
,
"实名制身份验证云平台"
,
content
);
emailUtils
.
sendSimpleMail
(
notify
,
"实名制身份验证云平台"
,
content
);
}
}
license/src/main/java/iot/sixiang/license/service/impl/TerminalDeviceServiceImpl.java
View file @
4d9a0baf
...
...
@@ -98,7 +98,7 @@ public class TerminalDeviceServiceImpl implements TerminalDeviceService {
}
Report
report
=
Report
.
builder
().
category
(
0
).
type
(
type
).
sn
(
pmsUseLog
.
getSn
()).
userName
(
user
.
getUserName
())
.
userCompany
(
user
.
getCompany
()).
createTime
(
new
Date
()).
updateTime
(
new
Date
()).
build
();
reportService
.
reportToEmail
(
report
);
reportService
.
reportToEmail
(
report
,
user
.
getNotify
()
);
boolean
res
=
pmsUseService
.
reportErrorMsg
(
reportErrorMsgDTO
);
if
(!
res
)
{
return
BaseResult
.
failed
();
...
...
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