Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4dd19615
由
LN
编写于
2024-04-25 09:00:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.入库成功时清除lastLineMsg。2.看板只显示报警提示
1 个父辈
d0bc15e8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
49 行增加
和
9 行删除
src/main/java/com/neotel/smfcore/core/device/bean/StatusBean.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/core/kanban/rest/BoxKanbanController.java
src/main/java/com/neotel/smfcore/core/device/bean/StatusBean.java
查看文件 @
4dd1961
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.core.device.enums.BOX_STATUS
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.message.enums.MessageType
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.system.service.po.AlarmInfo
;
import
lombok.Data
;
...
...
@@ -511,18 +512,56 @@ public class StatusBean {
return
doorReelSignal
;
}
public
String
getShowMsg
(
Locale
locale
){
public
String
getShowMsg
(
Locale
locale
)
{
if
(
ObjectUtil
.
isEmpty
(
this
.
msg
)){
return
""
;
}
//从收到数据中查找
String
lan
=
locale
.
toLanguageTag
();
if
(
lan
.
equals
(
MessageUtils
.
EN_US
)
&&
ObjectUtil
.
isNotEmpty
(
getMsgEn
()))
{
String
resultMsg
=
getMsgEn
().
replace
(
"A="
,
""
).
replace
(
"I="
,
""
).
replace
(
"W="
,
""
);
return
resultMsg
;
}
//提示信息国际化
if
(
ObjectUtil
.
isEmpty
(
getMsgCode
())||
ObjectUtil
.
isEmpty
(
getMsgEn
())
)
{
return
this
.
msg
;
}
else
{
String
code
=
this
.
msgCode
;
if
(!
code
.
startsWith
(
MessageUtils
.
smfcore
))
{
code
=
MessageUtils
.
smfcore
+
"."
+
this
.
msgCode
;
if
(
ObjectUtil
.
isEmpty
(
getMsgCode
()))
{
return
this
.
msg
.
replace
(
"A="
,
""
).
replace
(
"I="
,
""
).
replace
(
"W="
,
""
)
;
}
else
{
String
code
=
this
.
msgCode
;
if
(!
code
.
startsWith
(
MessageUtils
.
smfcore
))
{
code
=
MessageUtils
.
smfcore
+
"."
+
this
.
msgCode
;
}
String
newMsg
=
MessageUtils
.
getText
(
code
,
getMsgParam
(),
locale
,
getMsg
());
String
newMsg
=
this
.
msg
.
replace
(
"A="
,
""
).
replace
(
"I="
,
""
).
replace
(
"W="
,
""
);
newMsg
=
MessageUtils
.
getText
(
code
,
getMsgParam
(),
locale
,
newMsg
);
return
newMsg
;
}
}
public
String
getErrorMsg
(
Locale
locale
)
{
if
(
ObjectUtil
.
isEmpty
(
this
.
msg
)){
return
""
;
}
//判断是否有换行
String
[]
msgArray
=
this
.
msg
.
split
(
"\r\n"
);
if
(
msgArray
.
length
>
0
)
{
for
(
String
msg
:
msgArray
)
{
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
(
msgType
.
equals
(
MessageType
.
ERROR
.
name
())){
return
msg
;
}
}
}
return
""
;
}
}
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
4dd1961
...
...
@@ -290,6 +290,7 @@ public class DeviceController {
DeviceMessageUtil
.
updateLineMsg
(
lineMsg
,
code
,
cids
,
""
,
""
,
null
);
}
else
{
lineMsg
=
okMsg
;
DeviceMessageUtil
.
lastLineMsg
=
null
;
}
return
resultMap
;
}
...
...
src/main/java/com/neotel/smfcore/core/kanban/rest/BoxKanbanController.java
查看文件 @
4dd1961
...
...
@@ -492,7 +492,7 @@ public class BoxKanbanController {
boxDto
.
setHumidity
(
humidity
);
boxDto
.
setTemperature
(
temperature
);
boxDto
.
setStatus
(
bean
.
getStatus
());
boxDto
.
setMsg
(
bean
.
get
Show
Msg
(
locale
));
boxDto
.
setMsg
(
bean
.
get
Error
Msg
(
locale
));
boxDto
.
setBarcode
(
bean
.
getCode
());
boxDto
.
setPosName
(
bean
.
getPosId
());
boxDto
.
setData
(
bean
.
getData
());
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论