Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5c8a2a2c
由
LN
编写于
2023-02-07 13:07:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
看板报警文字使用客户端发过来的文字
1 个父辈
ff1e87ab
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
36 行增加
和
12 行删除
src/main/java/com/neotel/smfcore/core/device/bean/BoxStatusBean.java
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/BoxStatusBean.java
查看文件 @
5c8a2a2
...
@@ -33,7 +33,17 @@ public class BoxStatusBean {
...
@@ -33,7 +33,17 @@ public class BoxStatusBean {
/// 入库失败原因:
/// 入库失败原因:
/// 出库失败原因:
/// 出库失败原因:
/// </summary>
/// </summary>
public
String
msg
;
public
String
msg
=
""
;
/**
* 英文提示消息
*/
public
String
msgEn
=
""
;
public
String
msgJp
=
""
;
public
String
msgCode
=
""
;
public
String
[]
msgParam
;
/// <summary>
/// <summary>
/// 温度
/// 温度
/// </summary>
/// </summary>
...
...
src/main/java/com/neotel/smfcore/core/device/bean/StatusBean.java
查看文件 @
5c8a2a2
...
@@ -76,6 +76,8 @@ public class StatusBean {
...
@@ -76,6 +76,8 @@ public class StatusBean {
*/
*/
public
String
msgEn
=
""
;
public
String
msgEn
=
""
;
public
String
msgJp
=
""
;
public
String
msgCode
=
""
;
public
String
msgCode
=
""
;
public
String
[]
msgParam
;
public
String
[]
msgParam
;
...
@@ -515,14 +517,22 @@ public class StatusBean {
...
@@ -515,14 +517,22 @@ public class StatusBean {
return
doorReelSignal
;
return
doorReelSignal
;
}
}
public
String
getShowMsg
(
Locale
locale
){
public
String
getShowMsg
(
Locale
locale
)
{
//从收到数据中查找
String
lan
=
locale
.
toLanguageTag
();
if
(
lan
.
equals
(
MessageUtils
.
JA_JP
)
&&
ObjectUtil
.
isNotEmpty
(
getMsgJp
()))
{
return
getMsgJp
();
}
else
if
(
lan
.
equals
(
MessageUtils
.
EN_US
)
&&
ObjectUtil
.
isNotEmpty
(
getMsgEn
()))
{
return
getMsgEn
();
}
//提示信息国际化
//提示信息国际化
if
(
ObjectUtil
.
isEmpty
(
getMsgCode
())||
ObjectUtil
.
isEmpty
(
getMsgEn
())
){
if
(
ObjectUtil
.
isEmpty
(
getMsgCode
())
||
ObjectUtil
.
isEmpty
(
getMsgEn
()))
{
return
this
.
msg
;
}
else
{
return
this
.
msg
;
String
code
=
this
.
msgCode
;
}
else
{
if
(!
code
.
startsWith
(
MessageUtils
.
smfcore
)){
String
code
=
this
.
msgCode
;
code
=
MessageUtils
.
smfcore
+
"."
+
this
.
msgCode
;
if
(!
code
.
startsWith
(
MessageUtils
.
smfcore
))
{
code
=
MessageUtils
.
smfcore
+
"."
+
this
.
msgCode
;
}
}
String
newMsg
=
MessageUtils
.
getText
(
code
,
getMsgParam
(),
locale
,
getMsg
());
String
newMsg
=
MessageUtils
.
getText
(
code
,
getMsgParam
(),
locale
,
getMsg
());
return
newMsg
;
return
newMsg
;
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
5c8a2a2
...
@@ -745,19 +745,20 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -745,19 +745,20 @@ public class BaseDeviceHandler implements IDeviceHandler {
StatusBean
bean
=
DevicesStatusUtil
.
getStatusBean
(
statusBean
.
getCid
());
StatusBean
bean
=
DevicesStatusUtil
.
getStatusBean
(
statusBean
.
getCid
());
if
(
bean
==
null
||
bean
.
getBoxStatus
()
==
null
)
{
if
(
bean
==
null
||
bean
.
getBoxStatus
()
==
null
)
{
DeviceMessageUtil
.
addOnlineMessage
(
statusBean
.
getCid
(),
""
,
statusBean
.
getClientIp
());
DeviceMessageUtil
.
addOnlineMessage
(
statusBean
.
getCid
(),
""
,
statusBean
.
getClientIp
());
DevicesStatusUtil
.
updateClientMsg
(
statusBean
.
getCid
(),
""
,
""
,
""
,
null
);
DevicesStatusUtil
.
updateClientMsg
(
statusBean
.
getCid
(),
""
,
""
,
""
,
""
,
null
);
}
else
if
(
bean
.
timeOut
()
&&
(
bean
.
getOfflineTime
()
>
-
1
))
{
}
else
if
(
bean
.
timeOut
()
&&
(
bean
.
getOfflineTime
()
>
-
1
))
{
DeviceMessageUtil
.
addOnlineMessage
(
statusBean
.
getCid
(),
""
,
statusBean
.
getClientIp
());
DeviceMessageUtil
.
addOnlineMessage
(
statusBean
.
getCid
(),
""
,
statusBean
.
getClientIp
());
DevicesStatusUtil
.
updateClientMsg
(
statusBean
.
getCid
(),
""
,
""
,
""
,
null
);
DevicesStatusUtil
.
updateClientMsg
(
statusBean
.
getCid
(),
""
,
""
,
""
,
""
,
null
);
}
}
//展示到界面
//展示到界面
String
msg
=
statusBean
.
getMsg
();
String
msg
=
statusBean
.
getMsg
();
String
msgEn
=
statusBean
.
getMsgEn
();
String
msgEn
=
statusBean
.
getMsgEn
();
String
msgCode
=
statusBean
.
getMsgCode
();
String
msgCode
=
statusBean
.
getMsgCode
();
String
msgJp
=
statusBean
.
getMsgJp
();
if
(
ObjectUtil
.
isNotEmpty
(
msg
)||
ObjectUtil
.
isNotEmpty
(
msgCode
))
{
if
(
ObjectUtil
.
isNotEmpty
(
msg
)||
ObjectUtil
.
isNotEmpty
(
msgCode
))
{
DevicesStatusUtil
.
updateClientMsg
(
statusBean
.
getCid
(),
msgCode
,
msg
,
msgEn
,
statusBean
.
getMsgParam
());
DevicesStatusUtil
.
updateClientMsg
(
statusBean
.
getCid
(),
msgCode
,
msg
,
msgEn
,
msgJp
,
statusBean
.
getMsgParam
());
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"客户端故障消息处理出错"
,
e
);
log
.
error
(
"客户端故障消息处理出错"
,
e
);
...
...
src/main/java/com/neotel/smfcore/core/system/util/DevicesStatusUtil.java
查看文件 @
5c8a2a2
...
@@ -43,6 +43,7 @@ public class DevicesStatusUtil {
...
@@ -43,6 +43,7 @@ public class DevicesStatusUtil {
statusBean
.
setMsgEn
(
msgBean
.
getMsgEn
());
statusBean
.
setMsgEn
(
msgBean
.
getMsgEn
());
statusBean
.
setMsgCode
(
msgBean
.
getMsgCode
());
statusBean
.
setMsgCode
(
msgBean
.
getMsgCode
());
statusBean
.
setMsgParam
(
msgBean
.
getMsgParam
());
statusBean
.
setMsgParam
(
msgBean
.
getMsgParam
());
statusBean
.
setMsgJp
(
msgBean
.
getMsgJp
());
}
}
}
}
return
statusBean
;
return
statusBean
;
...
@@ -58,10 +59,11 @@ public class DevicesStatusUtil {
...
@@ -58,10 +59,11 @@ public class DevicesStatusUtil {
/**
/**
* 更新客户端发上来的消息(设备故障等消息)
* 更新客户端发上来的消息(设备故障等消息)
*/
*/
public
static
StatusBean
updateClientMsg
(
String
cid
,
String
msgCode
,
String
clientMsg
,
String
clientMsgEn
,
String
[]
msgParam
)
{
public
static
StatusBean
updateClientMsg
(
String
cid
,
String
msgCode
,
String
clientMsg
,
String
clientMsgEn
,
String
clientMsgJp
,
String
[]
msgParam
)
{
if
(
clientMsg
==
null
)
{
if
(
clientMsg
==
null
)
{
clientMsg
=
""
;
clientMsg
=
""
;
clientMsgEn
=
""
;
clientMsgEn
=
""
;
clientMsgJp
=
""
;
}
}
if
(
msgCode
==
null
){
if
(
msgCode
==
null
){
msgCode
=
""
;
msgCode
=
""
;
...
@@ -93,6 +95,7 @@ public class DevicesStatusUtil {
...
@@ -93,6 +95,7 @@ public class DevicesStatusUtil {
statusBean
.
setMsgEn
(
clientMsgEn
);
statusBean
.
setMsgEn
(
clientMsgEn
);
statusBean
.
setMsgCode
(
msgCode
);
statusBean
.
setMsgCode
(
msgCode
);
statusBean
.
setMsgParam
(
msgParam
);
statusBean
.
setMsgParam
(
msgParam
);
statusBean
.
setMsgJp
(
clientMsgJp
);
clientMsgs
.
put
(
cid
,
statusBean
);
clientMsgs
.
put
(
cid
,
statusBean
);
return
statusBean
;
return
statusBean
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论