Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0ee4aae6
由
LN
编写于
2024-11-19 16:10:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
入库时查找最匹配的库位
1 个父辈
82db65f6
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
35 行增加
和
0 行删除
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/panacim/PanaApiController.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
0ee4aae
...
...
@@ -915,6 +915,7 @@ public class TaskService {
private
synchronized
StoragePos
findEmptyPosInStorages
(
Barcode
barcode
,
List
<
Storage
>
availbleStorageList
,
final
Set
<
String
>
hasOutTaskStorageIds
,
String
lastPosId
)
{
StoragePos
findPos
=
null
;
//第一遍查找,先不查找有出库任务的料仓
for
(
Storage
storage
:
availbleStorageList
)
{
if
(!
storage
.
isSmdDuo
()){
//DUO料仓无论是否有出库任务,都可以查找空库位
...
...
@@ -927,7 +928,17 @@ public class TaskService {
log
.
debug
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位"
);
StoragePos
pos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
lastPosId
);
if
(
pos
!=
null
)
{
//判断尺寸是否一致
if
(
isSameSize
(
barcode
,
pos
)){
log
.
info
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找到空位["
+
pos
.
getPosName
()+
"],尺寸与条码一致,直接返回"
);
return
pos
;
}
else
if
(
findPos
==
null
){
log
.
info
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找到空位["
+
pos
.
getPosName
()+
"],尺寸不一致,先暂存库位"
);
findPos
=
pos
;
}
else
if
(
findPos
.
getW
()>
pos
.
getW
()||
findPos
.
getH
()>
pos
.
getH
()){
log
.
info
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找到空位["
+
pos
.
getPosName
()+
"],比暂存库位["
+
findPos
.
getPosName
()+
"]跟匹配,替换为暂存库位"
);
findPos
=
pos
;
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位失败:"
+
e
.
getMessage
());
...
...
@@ -940,12 +951,25 @@ public class TaskService {
log
.
debug
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位"
);
StoragePos
pos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
lastPosId
);
if
(
pos
!=
null
)
{
if
(
isSameSize
(
barcode
,
pos
)){
log
.
info
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找到空位["
+
pos
.
getPosName
()+
"],尺寸与条码一致,直接返回"
);
return
pos
;
}
else
if
(
findPos
==
null
){
log
.
info
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找到空位["
+
pos
.
getPosName
()+
"],尺寸不一致,先暂存库位"
);
findPos
=
pos
;
}
else
if
(
findPos
.
getW
()>
pos
.
getW
()||
findPos
.
getH
()>
pos
.
getH
()){
log
.
info
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找到空位["
+
pos
.
getPosName
()+
"],比暂存库位["
+
findPos
.
getPosName
()+
"]跟匹配,替换为暂存库位"
);
findPos
=
pos
;
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位失败:"
+
e
.
getMessage
());
}
}
if
(
findPos
!=
null
){
log
.
info
(
"为["
+
barcode
.
getBarcode
()
+
"]未查找到尺寸一直的库位,返回暂存的库位["
+
findPos
.
getPosName
()+
"]"
);
return
findPos
;
}
try
{
String
cids
=
""
;
for
(
Storage
storage
:
availbleStorageList
)
{
...
...
@@ -959,6 +983,12 @@ public class TaskService {
return
null
;
}
private
boolean
isSameSize
(
Barcode
barcode
,
StoragePos
pos
){
if
(
barcode
.
getPlateSize
()==
pos
.
getW
()&&
barcode
.
getHeight
()==
pos
.
getH
()){
return
true
;
}
return
false
;
}
/**
* 检查二维码是否合法并且可以入库,没问题的话存入到数据库
...
...
src/main/java/com/neotel/smfcore/custom/panacim/PanaApiController.java
查看文件 @
0ee4aae
...
...
@@ -44,6 +44,11 @@ import java.util.concurrent.atomic.AtomicLong;
@Controller
@RequestMapping
(
"/rest/api"
)
public
class
PanaApiController
extends
BaseSmfApiListener
{
// api:
// name: PanaCIM
// codeResolveUrl: PanaCIM
// outNotifyUrl: PanaCIM
// inNotifyUrl: PanaCIM
@Autowired
protected
TaskService
taskService
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论