Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d8f273dd
由
LN
编写于
2024-07-22 16:02:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
614d16c2
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
64 行增加
和
56 行删除
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
查看文件 @
d8f273d
...
...
@@ -179,7 +179,7 @@ public class SpareNoCache {
return
"已在执行中"
;
}
log
.
info
(
"开始执行 入库单 ["
+
orderNo
+
"] "
);
log
.
info
(
"开始执行 入库单 ["
+
orderNo
+
"] "
);
List
<
StoragePos
>
needOutPos
=
new
ArrayList
<>();
List
<
String
>
storageIdList
=
new
ArrayList
<>();
...
...
@@ -187,6 +187,8 @@ public class SpareNoCache {
storageIdList
.
add
(
storage
.
getId
());
}
//先查找pn存在的箱子
List
<
SpareNoDetail
>
noPnDetial
=
new
ArrayList
<>();
for
(
SpareNoDetail
detail
:
baseNo
.
getDetailList
())
{
String
pn
=
detail
.
getPartno
();
...
...
@@ -202,7 +204,7 @@ public class SpareNoCache {
if
(
subBarcode
.
getPartNumber
().
equals
(
pn
))
{
subBarcode
.
setOut
(
false
);
subBarcode
.
updateExtraData
(
"needInNum"
,
detail
.
getInQty
()
+
""
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",查找到库位号="
+
pos
.
getPosName
()
+
",料箱号="
+
boxBarcode
.
getBarcode
()
+
",格口号="
+
subBarcode
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",查找到库位号="
+
pos
.
getPosName
()
+
",料箱号="
+
boxBarcode
.
getBarcode
()
+
",格口号="
+
subBarcode
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
}
}
boxBarcode
.
setOut
(
false
);
...
...
@@ -210,65 +212,71 @@ public class SpareNoCache {
needOutPos
.
add
(
pos
);
}
else
{
noPnDetial
.
add
(
detail
);
}
Barcode
newPn
=
new
Barcode
();
newPn
.
setPn
(
pn
);
newPn
.
setAmount
(
0
);
newPn
.
setInitialAmount
(
0
);
newPn
.
setOut
(
false
);
newPn
.
updateExtraData
(
"needInNum"
,
detail
.
getInQty
()
+
""
);
//查找准备出库的料箱中是否有空格口
StoragePos
emptyPos
=
null
;
for
(
StoragePos
exPos
:
needOutPos
)
{
int
subCount
=
SpBoxUtil
.
GetBoxSubCount
(
exPos
.
getBarcode
().
getBarcode
());
if
(
exPos
.
getBarcode
().
getSubCodeList
().
size
()
<
subCount
)
{
emptyPos
=
exPos
;
break
;
}
}
//PN不存在,需要查找空箱
for
(
SpareNoDetail
detail
:
noPnDetial
)
{
String
pn
=
detail
.
getPartno
();
Barcode
newPn
=
new
Barcode
();
newPn
.
setPn
(
pn
);
newPn
.
setAmount
(
0
);
newPn
.
setInitialAmount
(
0
);
newPn
.
setOut
(
false
);
newPn
.
updateExtraData
(
"needInNum"
,
detail
.
getInQty
()
+
""
);
//查找准备出库的料箱中是否有空格口
StoragePos
emptyPos
=
null
;
for
(
StoragePos
exPos
:
needOutPos
)
{
int
subCount
=
SpBoxUtil
.
GetBoxSubCount
(
exPos
.
getBarcode
().
getBarcode
());
if
(
exPos
.
getBarcode
().
getSubCodeList
().
size
()
<
subCount
)
{
emptyPos
=
exPos
;
break
;
}
}
Barcode
emptyBox
=
null
;
if
(
emptyPos
!=
null
)
{
//使用此格口
emptyBox
=
emptyPos
.
getBarcode
();
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
emptyBox
.
getSubCodeList
().
size
());
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
subL
.
add
(
newPn
);
emptyBox
.
setSubCodeList
(
subL
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",使用料箱的空格口="
+
emptyPos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
Barcode
emptyBox
=
null
;
if
(
emptyPos
!=
null
)
{
//使用此格口
}
else
{
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
//寻找一个空格口
List
<
String
>
boxTypes
=
new
ArrayList
<>();
boxTypes
.
add
(
"CS"
);
boxTypes
.
add
(
"CB"
);
boxTypes
.
add
(
"CM"
);
for
(
String
type
:
boxTypes
)
{
int
count
=
SpBoxUtil
.
GetBoxSubCount
(
type
);
emptyPos
=
storagePosManager
.
findEmptyBoxToPutIn
(
storageIdList
,
pn
,
excludePosIds
,
dataCache
.
getCheckOutType
(),
type
,
count
);
emptyBox
=
emptyPos
.
getBarcode
();
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
emptyBox
.
getSubCodeList
().
size
());
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
subL
.
add
(
newPn
);
emptyBox
.
setSubCodeList
(
subL
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",使用料箱的空格口="
+
pos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
}
else
{
excludePosIds
=
taskService
.
excludePosIds
();
//寻找一个空格口
List
<
String
>
boxTypes
=
new
ArrayList
<>();
boxTypes
.
add
(
"CS"
);
boxTypes
.
add
(
"CB"
);
boxTypes
.
add
(
"CM"
);
for
(
String
type
:
boxTypes
)
{
int
count
=
SpBoxUtil
.
GetBoxSubCount
(
type
);
emptyPos
=
storagePosManager
.
findEmptyBoxToPutIn
(
storageIdList
,
pn
,
excludePosIds
,
dataCache
.
getCheckOutType
(),
type
,
count
);
emptyBox
=
emptyPos
.
getBarcode
();
if
(
pos
!=
null
)
{
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
emptyBox
.
getSubCodeList
().
size
());
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
subL
.
add
(
newPn
);
emptyBox
.
setSubCodeList
(
subL
);
emptyBox
.
setOut
(
false
);
emptyBox
.
setStatus
(
BARCODE_STATUS
.
IN_STORE
);
needOutPos
.
add
(
pos
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
","
+
type
+
"查找到有空格口料箱="
+
pos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
break
;
}
else
{
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
","
+
type
+
"未找到可用的空料箱="
);
}
}
if
(
emptyPos
!=
null
)
{
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
emptyBox
.
getSubCodeList
().
size
());
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
subL
.
add
(
newPn
);
emptyBox
.
setSubCodeList
(
subL
);
emptyBox
.
setOut
(
false
);
emptyBox
.
setStatus
(
BARCODE_STATUS
.
IN_STORE
);
needOutPos
.
add
(
emptyPos
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
","
+
type
+
"查找到有空格口料箱="
+
emptyPos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
break
;
}
else
{
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
","
+
type
+
"未找到可用的空料箱="
);
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论