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
ad18f3cb
authored
Nov 01, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:告警新增误报
parent
9f3670c0
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
50 additions
and
4 deletions
db/上线后sql/update.sql
server-module/src/main/java/com/makeit/module/controller/alarm/PlatAlarmRecordController.java
server-module/src/main/java/com/makeit/module/controller/children/alarm/PlatAlarmRecordChildrenController.java
server-module/src/main/java/com/makeit/module/controller/wechat/alarm/PlatAlarmRecordWechatController.java
server-service/src/main/java/com/makeit/entity/platform/alarm/PlatAlarmRecord.java
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/dataScreen/impl/DataScreenServiceImpl.java
server-service/src/main/java/com/makeit/vo/platform/alarm/PlatAlarmRecordVO.java
db/上线后sql/update.sql
View file @
ad18f3cb
ALTER
TABLE
`plat_device_other`
ALTER
TABLE
`plat_device_other`
ALTER
TABLE
`plat_device_other`
ALTER
TABLE
`plat_device_other`
ADD
COLUMN
`secure_id`
varchar
(
255
)
COMMENT
'密钥id'
AFTER
`protocol_password`
,
ADD
COLUMN
`secure_id`
varchar
(
255
)
COMMENT
'密钥id'
AFTER
`protocol_password`
,
ADD
COLUMN
`secure_key`
varchar
(
255
)
COMMENT
'密钥key'
AFTER
`secure_id`
;
ADD
COLUMN
`secure_key`
varchar
(
255
)
COMMENT
'密钥key'
AFTER
`secure_id`
;
ALTER
TABLE
`plat_alarm_record`
ADD
COLUMN
`misinformation_flag`
char
(
1
)
DEFAULT
0
COMMENT
'是否误报 1 误报 0 没有误报'
AFTER
`read_flag`
;
\ No newline at end of file
server-module/src/main/java/com/makeit/module/controller/alarm/PlatAlarmRecordController.java
View file @
ad18f3cb
...
@@ -48,6 +48,13 @@ public class PlatAlarmRecordController {
...
@@ -48,6 +48,13 @@ public class PlatAlarmRecordController {
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
();
}
}
@ApiOperation
(
"误报"
)
@PostMapping
(
"misinformation"
)
public
ApiResponseEntity
<
Void
>
misinformation
(
@RequestBody
BaseIdDTO
dto
)
{
platAlarmRecordService
.
misinformation
(
dto
.
getId
());
return
ApiResponseUtils
.
success
();
}
@ApiOperation
(
"未读条数"
)
@ApiOperation
(
"未读条数"
)
@PostMapping
(
"unreadCount"
)
@PostMapping
(
"unreadCount"
)
public
ApiResponseEntity
<
Integer
>
unreadCount
(
@RequestBody
PlatAlarmRecordQueryDTO
dto
)
{
public
ApiResponseEntity
<
Integer
>
unreadCount
(
@RequestBody
PlatAlarmRecordQueryDTO
dto
)
{
...
...
server-module/src/main/java/com/makeit/module/controller/children/alarm/PlatAlarmRecordChildrenController.java
View file @
ad18f3cb
...
@@ -50,5 +50,12 @@ public class PlatAlarmRecordChildrenController {
...
@@ -50,5 +50,12 @@ public class PlatAlarmRecordChildrenController {
Integer
count
=
platAlarmRecordService
.
unreadCount
(
dto
);
Integer
count
=
platAlarmRecordService
.
unreadCount
(
dto
);
return
ApiResponseUtils
.
success
(
count
);
return
ApiResponseUtils
.
success
(
count
);
}
}
@ApiOperation
(
"误报"
)
@PostMapping
(
"misinformation"
)
public
ApiResponseEntity
<
Void
>
misinformation
(
@RequestBody
BaseIdDTO
dto
)
{
platAlarmRecordService
.
misinformation
(
dto
.
getId
());
return
ApiResponseUtils
.
success
();
}
}
}
server-module/src/main/java/com/makeit/module/controller/wechat/alarm/PlatAlarmRecordWechatController.java
View file @
ad18f3cb
...
@@ -70,5 +70,12 @@ public class PlatAlarmRecordWechatController {
...
@@ -70,5 +70,12 @@ public class PlatAlarmRecordWechatController {
platAlarmRecordService
.
noticeRelation
(
dto
.
getId
());
platAlarmRecordService
.
noticeRelation
(
dto
.
getId
());
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
();
}
}
@ApiOperation
(
"误报"
)
@PostMapping
(
"misinformation"
)
public
ApiResponseEntity
<
Void
>
misinformation
(
@RequestBody
BaseIdDTO
dto
)
{
platAlarmRecordService
.
misinformation
(
dto
.
getId
());
return
ApiResponseUtils
.
success
();
}
}
}
server-service/src/main/java/com/makeit/entity/platform/alarm/PlatAlarmRecord.java
View file @
ad18f3cb
...
@@ -88,6 +88,8 @@ public class PlatAlarmRecord extends BaseBusEntity {
...
@@ -88,6 +88,8 @@ public class PlatAlarmRecord extends BaseBusEntity {
@ApiModelProperty
(
value
=
"0-未读 1-已读"
)
@ApiModelProperty
(
value
=
"0-未读 1-已读"
)
private
String
readFlag
;
private
String
readFlag
;
@ApiModelProperty
(
value
=
"是否误报 1 误报 0 没有误报"
)
private
String
misinformationFlag
;
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/alarm/PlatAlarmRecordService.java
View file @
ad18f3cb
...
@@ -65,4 +65,6 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
...
@@ -65,4 +65,6 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
void
read
(
String
id
);
void
read
(
String
id
);
Integer
unreadCount
(
PlatAlarmRecordQueryDTO
dto
);
Integer
unreadCount
(
PlatAlarmRecordQueryDTO
dto
);
void
misinformation
(
String
id
);
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
View file @
ad18f3cb
...
@@ -124,9 +124,6 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -124,9 +124,6 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
public
PageVO
<
PlatAlarmRecordVO
>
childrenPage
(
PageReqDTO
<
PlatAlarmRecordQueryDTO
>
dto
)
{
public
PageVO
<
PlatAlarmRecordVO
>
childrenPage
(
PageReqDTO
<
PlatAlarmRecordQueryDTO
>
dto
)
{
PlatElderChildrenInfo
platElderChildrenInfo
=
platElderChildrenInfoService
.
getById
(
WechatUserUtil
.
getUserId
());
PlatElderChildrenInfo
platElderChildrenInfo
=
platElderChildrenInfoService
.
getById
(
WechatUserUtil
.
getUserId
());
log
.
info
(
"子女端账号:"
+
platElderChildrenInfo
.
toString
());
log
.
info
(
"子女端账号:"
+
platElderChildrenInfo
.
toString
());
if
(
platElderChildrenInfo
==
null
)
{
return
new
PageVO
<>();
}
String
elderId
=
platElderChildrenInfo
.
getElderId
();
String
elderId
=
platElderChildrenInfo
.
getElderId
();
if
(
StringUtils
.
isBlank
(
elderId
)){
if
(
StringUtils
.
isBlank
(
elderId
)){
return
new
PageVO
<>();
return
new
PageVO
<>();
...
@@ -558,4 +555,17 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -558,4 +555,17 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
LambdaQueryWrapper
<
PlatAlarmRecord
>
lambdaQueryWrapper
=
getLambdaQueryWrapper
(
dto
);
LambdaQueryWrapper
<
PlatAlarmRecord
>
lambdaQueryWrapper
=
getLambdaQueryWrapper
(
dto
);
return
Math
.
toIntExact
(
count
(
lambdaQueryWrapper
));
return
Math
.
toIntExact
(
count
(
lambdaQueryWrapper
));
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
misinformation
(
String
id
)
{
PlatAlarmRecord
platAlarmRecord
=
getById
(
id
);
platAlarmRecord
.
setMisinformationFlag
(
CommonEnum
.
YES
.
getValue
());
platAlarmRecord
.
setStatus
(
CommonEnum
.
YES
.
getValue
());
updateById
(
platAlarmRecord
);
// todo 误报结果写入设备
}
}
}
server-service/src/main/java/com/makeit/service/platform/dataScreen/impl/DataScreenServiceImpl.java
View file @
ad18f3cb
...
@@ -245,6 +245,7 @@ public class DataScreenServiceImpl implements DataScreenService {
...
@@ -245,6 +245,7 @@ public class DataScreenServiceImpl implements DataScreenService {
List
<
PlatAlarmRecord
>
alarmRecords
=
platAlarmRecordService
.
list
(
new
QueryWrapper
<
PlatAlarmRecord
>().
lambda
()
List
<
PlatAlarmRecord
>
alarmRecords
=
platAlarmRecordService
.
list
(
new
QueryWrapper
<
PlatAlarmRecord
>().
lambda
()
.
between
(
PlatAlarmRecord:
:
getAlarmDate
,
dto
.
getStartTime
(),
dto
.
getEndTime
())
.
between
(
PlatAlarmRecord:
:
getAlarmDate
,
dto
.
getStartTime
(),
dto
.
getEndTime
())
.
isNotNull
(
PlatAlarmRecord:
:
getElderIds
)
.
isNotNull
(
PlatAlarmRecord:
:
getElderIds
)
.
in
(
PlatAlarmRecord:
:
getMisinformationFlag
,
CommonEnum
.
NO
.
getValue
())
.
in
(
PlatAlarmRecord:
:
getOrgId
,
dto
.
getOrgIds
()));
.
in
(
PlatAlarmRecord:
:
getOrgId
,
dto
.
getOrgIds
()));
long
total
=
alarmRecords
.
size
();
long
total
=
alarmRecords
.
size
();
long
handledNumber
=
alarmRecords
.
stream
()
long
handledNumber
=
alarmRecords
.
stream
()
...
@@ -448,6 +449,7 @@ public class DataScreenServiceImpl implements DataScreenService {
...
@@ -448,6 +449,7 @@ public class DataScreenServiceImpl implements DataScreenService {
Page
<
PlatAlarmRecord
>
pages
=
platAlarmRecordService
.
page
(
p
,
new
QueryWrapper
<
PlatAlarmRecord
>().
lambda
()
Page
<
PlatAlarmRecord
>
pages
=
platAlarmRecordService
.
page
(
p
,
new
QueryWrapper
<
PlatAlarmRecord
>().
lambda
()
.
between
(
dto
.
getStartTime
()!=
null
&&
dto
.
getEndTime
()!=
null
,
PlatAlarmRecord:
:
getAlarmDate
,
dto
.
getStartTime
(),
dto
.
getEndTime
())
.
between
(
dto
.
getStartTime
()!=
null
&&
dto
.
getEndTime
()!=
null
,
PlatAlarmRecord:
:
getAlarmDate
,
dto
.
getStartTime
(),
dto
.
getEndTime
())
.
in
(
PlatAlarmRecord:
:
getOrgId
,
dto
.
getOrgIds
())
.
in
(
PlatAlarmRecord:
:
getOrgId
,
dto
.
getOrgIds
())
.
in
(
PlatAlarmRecord:
:
getMisinformationFlag
,
CommonEnum
.
NO
.
getValue
())
.
isNotNull
(
PlatAlarmRecord:
:
getElderIds
)
.
isNotNull
(
PlatAlarmRecord:
:
getElderIds
)
.
orderByDesc
(
PlatAlarmRecord:
:
getAlarmDate
));
.
orderByDesc
(
PlatAlarmRecord:
:
getAlarmDate
));
List
<
PlatAlarmRecord
>
alarmRecords
=
pages
.
getRecords
();
List
<
PlatAlarmRecord
>
alarmRecords
=
pages
.
getRecords
();
...
...
server-service/src/main/java/com/makeit/vo/platform/alarm/PlatAlarmRecordVO.java
View file @
ad18f3cb
...
@@ -61,6 +61,10 @@ public class PlatAlarmRecordVO extends BaseTenantDTO {
...
@@ -61,6 +61,10 @@ public class PlatAlarmRecordVO extends BaseTenantDTO {
@ApiModelProperty
(
value
=
"0-未读 1-已读"
)
@ApiModelProperty
(
value
=
"0-未读 1-已读"
)
private
String
readFlag
;
private
String
readFlag
;
@ApiModelProperty
(
value
=
"是否误报 1 误报 0 没有误报"
)
private
String
misinformationFlag
;
private
String
deviceId
;
private
String
deviceId
;
}
}
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