Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
707e1093
Commit
707e1093
authored
Oct 13, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整确警缺陷逻辑
parent
312adcb1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
60 deletions
+48
-60
EquipmentSpecificAlarmLog.java
.../equipmanage/common/entity/EquipmentSpecificAlarmLog.java
+4
-0
ConfirmAlarmServiceImpl.java
...oin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
+31
-8
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+13
-52
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificAlarmLog.java
View file @
707e1093
...
...
@@ -219,4 +219,8 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
*/
@TableField
(
value
=
"emergency_level_describe"
)
private
String
emergencyLevelDescribe
;
@ApiModelProperty
(
value
=
"是否是缺陷提交确认"
,
notes
=
"是否是缺陷提交确认"
)
@TableField
(
exist
=
false
)
private
boolean
addDefect
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
View file @
707e1093
...
...
@@ -34,6 +34,7 @@ import org.springframework.util.ObjectUtils;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
@Service
...
...
@@ -209,15 +210,37 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
ent
.
setUpdateDate
(
new
Date
());
ent
.
setConfirmDate
(
new
Date
());
int
i
=
0
;
if
(
ent
.
getIsBatch
()
==
0
){
i
=
equipmentSpecificAlarmLogMapper
.
updateById
(
ent
);
}
else
{
LambdaUpdateWrapper
<
EquipmentSpecificAlarmLog
>
updateWrapper
=
new
LambdaUpdateWrapper
<
EquipmentSpecificAlarmLog
>().
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificId
,
ent
.
getEquipmentSpecificId
()).
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
ent
.
getEquipmentSpecificIndexKey
())
.
isNull
(
EquipmentSpecificAlarmLog:
:
getConfirmDate
);
i
=
equipmentSpecificAlarmLogMapper
.
update
(
ent
,
updateWrapper
);
ent
.
setConfirmTypeName
(
ConfirmAlamEnum
.
getTypeByCode
(
ent
.
getConfirmType
()));
if
(!
ent
.
isAddDefect
())
{
if
(
ent
.
getIsBatch
()
==
0
){
i
=
equipmentSpecificAlarmLogMapper
.
updateById
(
ent
);
}
else
{
LambdaUpdateWrapper
<
EquipmentSpecificAlarmLog
>
updateWrapper
=
new
LambdaUpdateWrapper
<
EquipmentSpecificAlarmLog
>().
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificId
,
ent
.
getEquipmentSpecificId
()).
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
ent
.
getEquipmentSpecificIndexKey
())
.
isNull
(
EquipmentSpecificAlarmLog:
:
getConfirmDate
);
i
=
equipmentSpecificAlarmLogMapper
.
update
(
ent
,
updateWrapper
);
}
}
else
{
// 自动确警处理
EquipmentSpecific
specific
=
equipmentSpecificMapper
.
selectById
(
ent
.
getEquipmentSpecificId
());
Date
date
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
date
);
ent
.
setTraceId
(
null
);
String
equipmentName
=
StringUtil
.
isNotEmpty
(
specific
.
getCode
())
?
specific
.
getName
()
+
"("
+
specific
.
getCode
()
+
")"
:
specific
.
getName
();
if
(
ent
.
getConfirmType
().
equals
(
AlarmTypeEnum
.
PB
.
getCode
()))
{
ent
.
setAlarmReason
(
equipmentName
+
"频繁故障/误报,将设备报警信息屏蔽。"
);
}
else
{
ent
.
setAlarmReason
(
equipmentName
+
"引起设备报警"
);
}
ent
.
setResolveResult
(
dateString
+
"系统收到设备复归(已消除)信号,系统自动处理。"
);
ent
.
setConfirmUser
(
""
);
ent
.
setConfirmUserName
(
"系统自动处理"
);
ent
.
setConfirmDate
(
date
);
equipmentSpecificAlarmLogService
.
updateById
(
ent
);
}
//int i = confirmAlarmMapper.confirmAlam(ent);
if
(
i
>
0
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
707e1093
...
...
@@ -599,65 +599,26 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
public
static
List
<
EquipmentSpecificAlarmLog
>
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
String
traceId
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
,
boolean
flag
)
{
String
traceId
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
,
boolean
flag
)
{
LambdaQueryWrapper
<
EquipmentSpecificAlarmLog
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getIotCode
,
iotCode
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
equipmentSpecificIndexKey
);
queryWrapper
.
ne
(
EquipmentSpecificAlarmLog:
:
getStatus
,
AlarmStatusEnum
.
HF
.
getCode
());
List
<
EquipmentSpecificAlarmLog
>
logs
=
equipmentSpecificAlarmLogService
.
getBaseMapper
()
.
selectList
(
queryWrapper
);
if
(
0
<
logs
.
size
())
{
EquipmentSpecificAlarmLog
log
=
logs
.
get
(
0
);
String
cleanType
=
equipmentSpecificMapper
.
getEquipmentBySpecificId
(
log
.
getEquipmentSpecificId
());
EquipmentSpecific
specific
=
equipmentSpecificMapper
.
selectById
(
log
.
getEquipmentSpecificId
());
Date
date
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
date
);
logs
.
forEach
(
x
->
{
x
.
setCleanTime
(
new
Date
());
x
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
x
.
setEquipmentSpecificIndexValue
(
TrueOrFalseEnum
.
fake
.
value
);
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
x
.
setTraceId
(
traceId
);
}
// 自动确警处理
if
(
StringUtil
.
isNotEmpty
(
cleanType
)
&&
AlarmCleanTypeEnum
.
ZDXC
.
getCode
().
equals
(
cleanType
)){
x
.
setConfirmType
(
x
.
getType
());
x
.
setConfirmTypeName
(
ConfirmAlamEnum
.
getTypeByCode
(
x
.
getType
()));
String
equipmentName
=
StringUtil
.
isNotEmpty
(
specific
.
getCode
())
?
specific
.
getName
()
+
"("
+
specific
.
getCode
()
+
")"
:
specific
.
getName
();
if
(
x
.
getType
().
equals
(
AlarmTypeEnum
.
PB
.
getCode
()))
{
x
.
setAlarmReason
(
equipmentName
+
"频繁故障/误报,将设备报警信息屏蔽。"
);
}
else
{
x
.
setAlarmReason
(
equipmentName
+
"引起设备报警"
);
}
x
.
setResolveResult
(
dateString
+
"系统收到设备复归(已消除)信号,系统自动处理。"
);
x
.
setConfirmUser
(
""
);
x
.
setConfirmUserName
(
"系统自动处理"
);
x
.
setConfirmDate
(
date
);
}
});
if
(
jcsSwitch
&&
AlarmTypeEnum
.
HZGJ
.
getCode
().
equals
(
log
.
getType
()))
{
Token
token
=
remoteSecurityService
.
getServerToken
();
String
toke
=
token
.
getToke
();
String
appKey
=
token
.
getAppKey
();
String
product
=
token
.
getProduct
();
String
userId
=
remoteSecurityService
.
getAgencyUser
().
getUserId
();
// 确警消息发送
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
userId
))
{
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
ConfirmAlarmServiceImpl
.
sendIotSystemAlarm
(
log
,
userId
,
appKey
,
product
,
toke
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}).
start
();
}
List
<
EquipmentSpecificAlarmLog
>
logs
=
equipmentSpecificAlarmLogService
.
getBaseMapper
().
selectList
(
queryWrapper
);
logs
.
forEach
(
x
->
{
x
.
setCleanTime
(
new
Date
());
x
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
x
.
setEquipmentSpecificIndexValue
(
TrueOrFalseEnum
.
fake
.
value
);
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
x
.
setTraceId
(
traceId
);
}
});
if
(!
logs
.
isEmpty
())
{
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
}
if
(
flag
)
{
List
<
EquipmentSpecificIndex
>
indexList
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexBySpeIotCode
(
iotCode
);
publishDataToCanvas
(
indexList
);
...
...
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