Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cc3a9e06
由
LN
编写于
2023-01-13 11:30:41 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
20388 agv与客户端通信 :增加X16转发,msg增加国际化处理
1 个父辈
1b725840
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
49 行增加
和
13 行删除
src/main/java/com/neotel/smfcore/custom/djk20388/DJK20388AGVController.java
src/main/java/com/neotel/smfcore/custom/djk20388/bean/LabelingStatus.java
src/main/java/com/neotel/smfcore/custom/djk20388/DJK20388AGVController.java
查看文件 @
cc3a9e0
...
...
@@ -5,8 +5,10 @@ import com.google.common.base.Strings;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.custom.djk20388.bean.AgvLogInfo
;
import
com.neotel.smfcore.custom.djk20388.bean.AgvViewDto
;
import
com.neotel.smfcore.custom.djk20388.bean.LabelingStatus
;
import
com.neotel.smfcore.custom.djk20388.util.AgvDataUtil
;
...
...
@@ -19,6 +21,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Map
;
@Slf4j
...
...
@@ -40,6 +45,23 @@ public class DJK20388AGVController {
labelingStatus
.
setMimoCid
(
getMimoCid
());
}
labelingStatus
=
AgvDataUtil
.
process
(
labelingStatus
);
//锡膏料仓data中的X16需要返回给贴标机
String
mimoCid
=
labelingStatus
.
getMimoCid
()
;
if
(
ObjectUtil
.
isEmpty
(
mimoCid
)){
mimoCid
=
getMimoCid
();
}
if
(
ObjectUtil
.
isNotEmpty
(
mimoCid
))
{
StatusBean
bean
=
DevicesStatusUtil
.
getStatusBean
(
mimoCid
);
if
(
bean
!=
null
&&
bean
.
getBoxStatus
()
!=
null
&&
(
bean
.
timeOut
()
==
false
))
{
String
X16
=
bean
.
getFromData
(
"X16"
);
Map
<
String
,
String
>
x16Data
=
new
HashMap
<>();
x16Data
.
put
(
"X16"
,
X16
);
labelingStatus
.
addOp
(
x16Data
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
""
,
e
);
}
...
...
@@ -64,7 +86,16 @@ public class DJK20388AGVController {
agvViewDto
.
setMimoData
(
bean
.
getData
());
}
}
agvViewDto
.
setLogList
(
AgvDataUtil
.
getLastLogs
(
10
));
Locale
locale
=
servletRequest
.
getLocale
();
//国际化
List
<
AgvLogInfo
>
logs
=
AgvDataUtil
.
getLastLogs
(
10
);
for
(
int
i
=
0
;
i
<=
logs
.
size
();
i
++){
if
(
ObjectUtil
.
isNotEmpty
(
logs
.
get
(
i
).
getMsgCode
())){
String
msg
=
MessageUtils
.
getText
(
logs
.
get
(
i
).
getMsgCode
(),
logs
.
get
(
i
).
getMsgParams
(),
locale
,
logs
.
get
(
i
).
getMsg
());
logs
.
get
(
i
).
setMsg
(
msg
);
}
}
agvViewDto
.
setLogList
(
logs
);
return
agvViewDto
;
}
private
String
getMimoCid
()
{
...
...
src/main/java/com/neotel/smfcore/custom/djk20388/bean/LabelingStatus.java
查看文件 @
cc3a9e0
...
...
@@ -71,11 +71,16 @@ public class LabelingStatus implements Serializable {
* 添加一些服务器的操作发送到客户端(批量入库)
* @param opMap
*/
public
void
addOp
(
Map
<
String
,
String
>
opMap
){
if
(
opMap
!=
null
&&
!
opMap
.
isEmpty
())
{
public
void
addOp
(
Map
<
String
,
String
>
opMap
)
{
if
(
opMap
!=
null
&&
!
opMap
.
isEmpty
())
{
for
(
Map
.
Entry
<
String
,
String
>
op
:
opMap
.
entrySet
())
{
addData
(
op
.
getKey
(),
op
.
getValue
());
log
.
info
(
"LabelingStatus addOp ["
+
op
.
getKey
()+
"]=["
+
op
.
getValue
()+
"]"
);
// addData(op.getKey(), op.getValue());
data
.
put
(
op
.
getKey
(),
op
.
getValue
());
if
(
op
.
getKey
().
equals
(
"X16"
))
{
log
.
debug
(
"LabelingStatus addOp ["
+
op
.
getKey
()
+
"]=["
+
op
.
getValue
()
+
"]"
);
}
else
{
log
.
info
(
"LabelingStatus addOp ["
+
op
.
getKey
()
+
"]=["
+
op
.
getValue
()
+
"]"
);
}
}
}
}
...
...
@@ -88,14 +93,14 @@ public class LabelingStatus implements Serializable {
mimoOpMap
.
put
(
cid
,
opMap
);
}
}
private
void
addData
(
String
key
,
String
value
){
String
oldValue
=
data
.
get
(
key
);
String
valueStr
=
value
;
if
(!
Strings
.
isNullOrEmpty
(
oldValue
)){
valueStr
=
valueStr
+
"|"
+
oldValue
;
}
data
.
put
(
key
,
valueStr
);
}
//
private void addData(String key, String value){
//
String oldValue = data.get(key);
//
String valueStr = value;
//
if(!Strings.isNullOrEmpty(oldValue)){
//
valueStr = valueStr + "|" + oldValue;
//
}
//
data.put(key, valueStr);
//
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论