Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 92658bfa
由
zshaohui
编写于
2025-12-16 15:07:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.入库连续扫2次码 bug修复
1 个父辈
e4564619
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
8 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
查看文件 @
92658bf
...
...
@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpSession
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
@Api
(
tags
=
"SHELF: NLP感应料架"
)
@RestController
...
...
@@ -48,6 +49,8 @@ public class NLPShelfHandler extends BaseDeviceHandler {
@Autowired
private
IUserManager
userManager
;
private
Map
<
String
,
String
>
cacheMap
=
new
ConcurrentHashMap
<>();
/**
* 扫码
*/
...
...
@@ -67,14 +70,14 @@ public class NLPShelfHandler extends BaseDeviceHandler {
//获取数量
String
newAmountStr
=
mapValues
.
get
(
"newAmount"
);
if
(
StringUtils
.
isEmpty
(
newAmountStr
)){
if
(
StringUtils
.
isEmpty
(
newAmountStr
))
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"amount"
});
}
log
.
info
(
"barcode:[{}],新设置数量为[{}]"
,
code
,
newAmountStr
);
log
.
info
(
"barcode:[{}],新设置数量为[{}]"
,
code
,
newAmountStr
);
Integer
newAmount
=
Integer
.
valueOf
(
newAmountStr
);
if
(
newAmount
==
null
||
newAmount
<=
0
){
if
(
newAmount
==
null
||
newAmount
<=
0
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.wrongQty"
,
"条码[{0}]对应的数量<=0为: {1}"
,
new
String
[]{
code
,
newAmountStr
});
}
...
...
@@ -95,7 +98,11 @@ public class NLPShelfHandler extends BaseDeviceHandler {
if
(
groupId
!=
null
&&
groupId
.
equals
(
"-1"
))
{
groupId
=
""
;
}
String
value
=
cacheMap
.
get
(
storageId
);
if
(
StringUtils
.
isEmpty
(
value
))
{
cacheMap
.
put
(
storageId
,
storageId
);
}
synchronized
(
cacheMap
.
get
(
storageId
))
{
// WebSocketServer.sendMsg("", new SocketMsg("{0}未找到库位:{1}"+code, MsgType.INFO,"smfclient.nlp.cannotFindPos",new String[]{"消息测试","库位号"}));
String
loginUser
=
SecurityUtils
.
getLoginUsername
();
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
...
...
@@ -114,7 +121,7 @@ public class NLPShelfHandler extends BaseDeviceHandler {
}
}
try
{
try
{
CodeValidateParam
params
=
new
CodeValidateParam
(
loginUser
,
groupId
,
storageId
,
code
,
token
);
Barcode
barcodeSave
=
smfApi
.
canPutInBeforeResolve
(
params
);
...
...
@@ -132,10 +139,10 @@ public class NLPShelfHandler extends BaseDeviceHandler {
//设置新数量
barcodeSave
.
setAmount
(
newAmount
);
return
putIn
(
loginUser
,
groupId
,
storageId
,
barcodeSave
,
token
);
}
catch
(
ValidateException
ve
){
return
ResultBean
.
newErrorResult
(-
1
,
ve
.
getMsgKey
(),
ve
.
getDefaultMsg
(),
ve
.
getMsgParam
());
}
catch
(
ValidateException
ve
)
{
return
ResultBean
.
newErrorResult
(-
1
,
ve
.
getMsgKey
(),
ve
.
getDefaultMsg
(),
ve
.
getMsgParam
());
}
}
}
protected
ResultBean
putIn
(
String
loginUser
,
String
groupId
,
String
storageId
,
Barcode
barcode
,
String
token
)
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论