Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7b274a59
由
LN
编写于
2024-06-27 09:18:35 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
错误消息未显示问题修改
1 个父辈
b3f9ed8e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
41 行删除
src/main/java/com/neotel/smfcore/core/device/bean/StatusBean.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/system/util/DevicesStatusUtil.java
src/main/java/com/neotel/smfcore/core/device/bean/StatusBean.java
查看文件 @
7b274a5
...
...
@@ -9,6 +9,7 @@ import com.neotel.smfcore.core.storage.enums.DeviceType;
import
com.neotel.smfcore.core.system.service.po.AlarmInfo
;
import
lombok.Data
;
import
lombok.ToString
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.*
;
...
...
@@ -22,6 +23,7 @@ import java.util.*;
*/
@ToString
@Data
@Slf4j
public
class
StatusBean
{
/// <summary>
...
...
@@ -133,10 +135,10 @@ public class StatusBean {
*/
public
List
<
MsgInfo
>
msgList
;
/**
* 消息合并
*/
public
List
<
MsgInfo
>
mergeMsgList
;
//
/**
//
* 消息合并
//
*/
//
public List<MsgInfo> mergeMsgList;
/**
* 料仓类型
...
...
@@ -685,12 +687,12 @@ public class StatusBean {
}
public
String
getShowMsg
(
Locale
locale
)
{
if
(
ObjectUtil
.
isEmpty
(
this
.
m
ergeM
sgList
))
{
if
(
ObjectUtil
.
isEmpty
(
this
.
msgList
))
{
return
""
;
}
String
returnMsg
=
""
;
for
(
MsgInfo
msg
:
m
ergeM
sgList
)
{
msgList
)
{
String
mMsg
=
GetMsgStr
(
msg
,
locale
);
if
(
ObjectUtil
.
isEmpty
(
returnMsg
))
{
returnMsg
=
mMsg
;
...
...
@@ -729,43 +731,46 @@ public class StatusBean {
return
resultMap
;
}
public
List
<
MsgInfo
>
MsgDataProcess
()
{
List
<
MsgInfo
>
mergeMsgList
=
new
ArrayList
<>();
if
(
msgList
!=
null
&&
!
msgList
.
isEmpty
())
{
mergeMsgList
.
addAll
(
msgList
);
}
if
(
ObjectUtil
.
isNotEmpty
(
msg
))
{
//判断是否有换行
String
[]
msgArray
=
this
.
msg
.
split
(
"\r\n"
);
if
(
msgArray
.
length
>
0
)
{
for
(
String
msg
:
msgArray
)
{
if
(
ObjectUtil
.
isEmpty
(
msg
))
{
continue
;
}
String
msgType
=
MessageType
.
ERROR
.
name
();
if
(
msg
.
startsWith
(
"A="
))
{
msgType
=
MessageType
.
ERROR
.
name
(
);
msg
=
msg
.
substring
(
2
);
}
else
if
(
msg
.
startsWith
(
"I="
))
{
msgType
=
MessageType
.
INFO
.
name
(
);
msg
=
msg
.
substring
(
2
);
}
else
if
(
msg
.
startsWith
(
"W="
))
{
msgType
=
MessageType
.
WARNING
.
name
(
);
msg
=
msg
.
substring
(
2
);
}
if
(
msgArray
.
length
==
1
)
{
mergeMsgList
.
add
(
new
MsgInfo
(
msg
,
msgType
,
msgEn
,
msgJp
,
msgCode
,
msgParam
,
""
,
""
,
""
));
}
else
{
mergeMsgList
.
add
(
new
MsgInfo
(
msg
,
msgType
));
public
List
<
MsgInfo
>
MsgDataProcess
()
{
try
{
//消息格式处理
if
(
getMsgList
()
==
null
&&
ObjectUtil
.
isNotEmpty
(
msg
))
{
msgList
=
new
ArrayList
<>();
//判断是否有换行
String
[]
msgArray
=
this
.
msg
.
split
(
"\r\n"
);
if
(
msgArray
.
length
>
0
)
{
for
(
String
msg
:
msgArray
)
{
if
(
ObjectUtil
.
isEmpty
(
msg
)
)
{
continue
;
}
String
msgType
=
MessageType
.
ERROR
.
name
();
if
(
msg
.
startsWith
(
"A="
))
{
msgType
=
MessageType
.
ERROR
.
name
();
msg
=
msg
.
substring
(
2
);
}
else
if
(
msg
.
startsWith
(
"I="
))
{
msgType
=
MessageType
.
INFO
.
name
();
msg
=
msg
.
substring
(
2
);
}
else
if
(
msg
.
startsWith
(
"W="
))
{
msgType
=
MessageType
.
WARNING
.
name
();
msg
=
msg
.
substring
(
2
);
}
if
(
msgArray
.
length
==
1
)
{
msgList
.
add
(
new
MsgInfo
(
msg
,
msgType
,
msgEn
,
msgJp
,
msgCode
,
msgParam
,
""
,
""
,
""
));
}
else
{
msgList
.
add
(
new
MsgInfo
(
msg
,
msgType
));
}
}
}
}
else
if
(
getMsgList
()
==
null
)
{
msgList
=
new
ArrayList
<>();
}
}
catch
(
Exception
e
)
{
log
.
error
(
""
+
getCid
()
+
"MsgDataProcess 出錯:"
+
e
.
toString
(),
e
);
}
setMergeMsgList
(
mergeMsgList
);
return
mergeMsgList
;
return
msgList
;
}
public
void
setRMsg
(
String
msgKey
,
String
[]
msgParam
,
String
message
)
{
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
7b274a5
...
...
@@ -925,7 +925,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
statusBean
.
setOp
(
statusBeanToSave
.
getOp
());
statusBean
.
setSeq
(
statusBeanToSave
.
getSeq
());
statusBean
.
setClientIp
(
statusBeanToSave
.
getClientIp
());
statusBean
.
setM
ergeMsgList
(
statusBeanToSave
.
getMerge
MsgList
());
statusBean
.
setM
sgList
(
statusBeanToSave
.
get
MsgList
());
/**
* 已解除的报警信息存到数据库中
...
...
src/main/java/com/neotel/smfcore/core/system/util/DevicesStatusUtil.java
查看文件 @
7b274a5
...
...
@@ -204,7 +204,7 @@ public class DevicesStatusUtil {
StatusBean
statusBean
=
new
StatusBean
();
statusBean
.
setCid
(
cid
);
statusBean
.
setTime
(
System
.
currentTimeMillis
());
//
statusBean.setMsgList(msgs);
statusBean
.
setMsgList
(
msgs
);
clientMsgs
.
put
(
cid
,
statusBean
);
return
statusBean
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论