Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a651f240
由
张少辉
编写于
2026-01-26 16:29:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.一键上架功能优化
2.增加批量禁用/启用库位
1 个父辈
95915295
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
62 行增加
和
51 行删除
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/core/storage/rest/query/StoragePosFindCriteria.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
a651f24
...
...
@@ -561,7 +561,6 @@ public class StoragePosController {
baseCriteria
.
and
(
"barcode.type"
).
is
(
componentType
);
}
String
expire
=
criteria
.
getExpire
();
if
(!
Strings
.
isNullOrEmpty
(
expire
))
{
if
(
"solder"
.
equalsIgnoreCase
(
expire
))
{
...
...
@@ -571,6 +570,15 @@ public class StoragePosController {
}
}
Integer
barcodeStatus
=
criteria
.
getBarcodeStatus
();
if
(
barcodeStatus
!=
null
&&
barcodeStatus
!=
-
1
){
if
(
barcodeStatus
==
0
){
baseCriteria
.
and
(
"barcode.status"
).
is
(
BARCODE_STATUS
.
IN_STORE
);
}
else
{
baseCriteria
.
and
(
"barcode.status"
).
ne
(
BARCODE_STATUS
.
IN_STORE
);
}
}
query
.
addCriteria
(
baseCriteria
);
return
query
;
}
...
...
@@ -847,60 +855,62 @@ public class StoragePosController {
@ApiOperation
(
"一键上架"
)
@RequestMapping
(
"/oneClickPutaway"
)
//@AnonymousAccess
public
ResultBean
oneClickPutaway
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
posName
=
paramMap
.
get
(
"posName"
);
String
boxStr
=
paramMap
.
get
(
"boxStr"
);
log
.
info
(
"收到一键上架请求,操作人:"
+
SecurityUtils
.
getLoginUsername
()
+
",库位号:"
+
posName
+
",料箱号:"
+
boxStr
);
if
(
StringUtils
.
isEmpty
(
posName
)
||
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"库位号或者料箱号不能为空"
);
}
//如果不是C07,C13,C15开头的 报错
if
(!
boxStr
.
startsWith
(
"C07"
)
&&
!
boxStr
.
startsWith
(
"C13"
)
&&
!
boxStr
.
startsWith
(
"C15"
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不是有效的料箱条码"
);
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"库位号:"
+
posName
+
"不存在"
);
}
Barcode
barcode
=
null
;
try
{
barcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
}
catch
(
ValidateException
e
)
{
return
ResultBean
.
newErrorResult
(-
1
,
e
.
getMsgKey
(),
e
.
getMessage
(),
e
.
getMsgParam
());
}
//判断库位是否绑定其他料箱
Barcode
posBarcode
=
pos
.
getBarcode
();
if
(
posBarcode
!=
null
){
if
(!
posBarcode
.
getBarcode
().
equals
(
barcode
.
getBarcode
())){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
",已经绑定其他料箱号:"
+
posBarcode
.
getBarcode
());
public
ResultBean
oneClickPutaway
(
@RequestBody
List
<
Map
<
String
,
String
>>
paramMapList
)
{
if
(
paramMapList
==
null
||
paramMapList
.
isEmpty
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请选择对应的料箱"
);
}
for
(
Map
<
String
,
String
>
paramMap
:
paramMapList
)
{
String
posName
=
paramMap
.
get
(
"posName"
);
String
boxStr
=
paramMap
.
get
(
"boxStr"
);
log
.
info
(
"收到一键上架请求,操作人:"
+
SecurityUtils
.
getLoginUsername
()
+
",库位号:"
+
posName
+
",料箱号:"
+
boxStr
);
if
(
StringUtils
.
isEmpty
(
posName
)
||
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"库位号或者料箱号不能为空"
);
}
}
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
//判断当前料箱有没有任务
for
(
DataLog
task
:
allTasks
)
{
if
(!
task
.
isCancel
()
&&
!
task
.
isFinished
())
{
if
(
barcode
.
getBarcode
().
equals
(
task
.
getBarcode
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()+
"有正在执行中的任务,请确认"
);
//如果不是C07,C13,C15开头的 报错
if
(!
boxStr
.
startsWith
(
"C07"
)
&&
!
boxStr
.
startsWith
(
"C13"
)
&&
!
boxStr
.
startsWith
(
"C15"
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不是有效的料箱条码"
);
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"库位号:"
+
posName
+
"不存在"
);
}
Barcode
barcode
=
null
;
try
{
barcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
}
catch
(
ValidateException
e
)
{
return
ResultBean
.
newErrorResult
(-
1
,
e
.
getMsgKey
(),
e
.
getMessage
(),
e
.
getMsgParam
());
}
//判断料箱是否在库
if
(
barcode
.
getStatus
()
==
BARCODE_STATUS
.
IN_STORE
){
continue
;
}
//判断库位是否绑定其他料箱
Barcode
posBarcode
=
pos
.
getBarcode
();
if
(
posBarcode
!=
null
)
{
if
(!
posBarcode
.
getBarcode
().
equals
(
barcode
.
getBarcode
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
",已经绑定其他料箱号:"
+
posBarcode
.
getBarcode
());
}
if
(
pos
.
getId
().
equals
(
task
.
getPosId
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"有正在执行中的任务,请确认"
);
}
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
//判断当前料箱有没有任务
for
(
DataLog
task
:
allTasks
)
{
if
(!
task
.
isCancel
()
&&
!
task
.
isFinished
())
{
if
(
barcode
.
getBarcode
().
equals
(
task
.
getBarcode
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"有正在执行中的任务,请确认"
);
}
if
(
pos
.
getId
().
equals
(
task
.
getPosId
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"有正在执行中的任务,请确认"
);
}
}
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
dataLog
.
setOperator
(
SecurityUtils
.
getLoginUsername
());
dataLog
.
setType
(
OP
.
PUT_IN
);
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
dataLog
);
BoxHandleUtil
.
intoPos
(
dataLog
);
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
dataLog
.
setOperator
(
SecurityUtils
.
getLoginUsername
());
dataLog
.
setType
(
OP
.
PUT_IN
);
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
dataLog
);
BoxHandleUtil
.
intoPos
(
dataLog
);
return
ResultBean
.
newOkResult
(
""
);
}
...
...
@@ -1213,5 +1223,4 @@ public class StoragePosController {
}
return
ResultBean
.
newOkResult
(
""
);
}
}
src/main/java/com/neotel/smfcore/core/storage/rest/query/StoragePosFindCriteria.java
查看文件 @
a651f24
...
...
@@ -110,6 +110,8 @@ public class StoragePosFindCriteria {
private
String
machineTypes
;
private
Integer
barcodeStatus
=
-
1
;
@ApiModelProperty
(
"料箱状态,是否在库"
)
@QueryCondition
(
type
=
QueryCondition
.
Type
.
IN
,
propName
=
"barcode.status"
)
private
List
<
Integer
>
boxStatusList
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论