Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 614d16c2
由
LN
编写于
2024-07-22 15:39:45 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
不同类型料箱格口数量不一样
1 个父辈
bd210c83
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
112 行增加
和
172 行删除
src/main/java/com/neotel/smfcore/core/storage/service/manager/IStoragePosManager.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpReturnInventoryController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpSpareNoController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/ReturnNoCache.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/IStoragePosManager.java
查看文件 @
614d16c
...
@@ -101,5 +101,5 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
...
@@ -101,5 +101,5 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
StoragePos
findBoxPNInStorages
(
List
<
String
>
storageIdList
,
String
pn
,
Collection
<
String
>
excludePosIds
,
CHECKOUT_TYPE
checkOutType
)
;
StoragePos
findBoxPNInStorages
(
List
<
String
>
storageIdList
,
String
pn
,
Collection
<
String
>
excludePosIds
,
CHECKOUT_TYPE
checkOutType
)
;
StoragePos
findEmptyBoxToPutIn
(
List
<
String
>
storageIdList
,
String
pn
,
Collection
<
String
>
excludePosIds
,
CHECKOUT_TYPE
checkOutType
)
;
StoragePos
findEmptyBoxToPutIn
(
List
<
String
>
storageIdList
,
String
pn
,
Collection
<
String
>
excludePosIds
,
CHECKOUT_TYPE
checkOutType
,
String
boxType
,
int
maxCount
)
;
}
}
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
614d16c
...
@@ -929,11 +929,17 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -929,11 +929,17 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
}
@Override
@Override
public
StoragePos
findEmptyBoxToPutIn
(
List
<
String
>
storageIdList
,
String
pn
,
Collection
<
String
>
excludePosIds
,
CHECKOUT_TYPE
checkOutType
)
{
public
StoragePos
findEmptyBoxToPutIn
(
List
<
String
>
storageIdList
,
String
pn
,
Collection
<
String
>
excludePosIds
,
CHECKOUT_TYPE
checkOutType
,
String
boxType
,
int
maxCount
)
{
String
regex
=
"^"
+
boxType
+
".*"
;
Pattern
pattern
=
Pattern
.
compile
(
regex
);
Criteria
c
=
Criteria
.
where
(
"id"
).
nin
(
excludePosIds
);
Criteria
c
=
Criteria
.
where
(
"id"
).
nin
(
excludePosIds
);
c
=
c
.
and
(
"enabled"
).
is
(
true
);
//可用
c
=
c
.
and
(
"enabled"
).
is
(
true
);
//可用
c
.
and
(
"used"
).
is
(
true
);
c
.
and
(
"used"
).
is
(
true
);
c
.
and
(
"barcode"
).
exists
(
true
);
//已使用有料箱
c
.
and
(
"barcode"
).
exists
(
true
);
//已使用有料箱
c
.
and
(
"barcode.barcode"
).
regex
(
pattern
);
c
.
and
(
"barcode.status"
).
is
(
BARCODE_STATUS
.
IN_STORE
);
c
.
and
(
"barcode.status"
).
is
(
BARCODE_STATUS
.
IN_STORE
);
if
(
storageIdList
!=
null
)
{
if
(
storageIdList
!=
null
)
{
c
=
c
.
and
(
"storageId"
).
in
(
storageIdList
);
c
=
c
.
and
(
"storageId"
).
in
(
storageIdList
);
...
@@ -945,7 +951,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -945,7 +951,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
Query
q
=
new
Query
(
c
);
Query
q
=
new
Query
(
c
);
q
.
with
(
sort
);
q
.
with
(
sort
);
String
proName
=
"
subCodeList."
+
(
6
-
1
);
String
proName
=
"
barcode.subCodeList."
+
(
maxCount
-
1
);
q
.
addCriteria
(
Criteria
.
where
(
proName
).
exists
(
false
));
q
.
addCriteria
(
Criteria
.
where
(
proName
).
exists
(
false
));
StoragePos
pos
=
storagePosDao
.
findOne
(
q
);
StoragePos
pos
=
storagePosDao
.
findOne
(
q
);
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpReturnInventoryController.java
查看文件 @
614d16c
...
@@ -79,7 +79,7 @@ public class SpReturnInventoryController {
...
@@ -79,7 +79,7 @@ public class SpReturnInventoryController {
if
(
returnInventoryNo
==
null
)
{
if
(
returnInventoryNo
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的退库单信息"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的退库单信息"
);
}
}
String
exeResult
=
returnNoCache
.
Execute
(
returnInventoryNo
);
String
exeResult
=
spareNoCache
.
ExecuteReturn
(
returnInventoryNo
);
if
(
ObjectUtil
.
isNotEmpty
(
exeResult
)){
if
(
ObjectUtil
.
isNotEmpty
(
exeResult
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"执行退库单失败:"
+
exeResult
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"执行退库单失败:"
+
exeResult
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpSpareNoController.java
查看文件 @
614d16c
...
@@ -95,7 +95,7 @@ public class SpSpareNoController {
...
@@ -95,7 +95,7 @@ public class SpSpareNoController {
if
(
spareNo
==
null
)
{
if
(
spareNo
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的入库单信息"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的入库单信息"
);
}
}
String
exeResult
=
spareNoCache
.
Execute
(
spareNo
);
String
exeResult
=
spareNoCache
.
Execute
Spare
(
spareNo
);
if
(
ObjectUtil
.
isNotEmpty
(
exeResult
)){
if
(
ObjectUtil
.
isNotEmpty
(
exeResult
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"执行退库单失败:"
+
exeResult
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"执行退库单失败:"
+
exeResult
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/ReturnNoCache.java
查看文件 @
614d16c
...
@@ -100,142 +100,4 @@ public class ReturnNoCache {
...
@@ -100,142 +100,4 @@ public class ReturnNoCache {
returnNoManager
.
save
(
returnInventoryNo
);
returnNoManager
.
save
(
returnInventoryNo
);
}
}
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
IBarcodeManager
barcodeManager
;
@Autowired
private
DataCache
dataCache
;
@Autowired
private
TaskService
taskService
;
/**
*
*/
public
synchronized
String
Execute
(
ReturnInventoryNo
returnNo
)
{
try
{
if
(
returnNo
.
getSpareStatus
().
equals
(
SpareNostatus
.
EXECUTING_STATUS
))
{
return
"已在执行中"
;
}
String
orderNo
=
returnNo
.
getOrderNo
();
log
.
info
(
"开始执行ReturnInventoryNo["
+
orderNo
+
"] "
);
List
<
StoragePos
>
needOutPos
=
new
ArrayList
<>();
List
<
String
>
storageIdList
=
new
ArrayList
<>();
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
storageIdList
.
add
(
storage
.
getId
());
}
for
(
SpareNoDetail
detail
:
returnNo
.
getDetailList
())
{
String
pn
=
detail
.
getPartno
();
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
//根据pn查找
StoragePos
pos
=
storagePosManager
.
findBoxPNInStorages
(
storageIdList
,
pn
,
excludePosIds
,
dataCache
.
getCheckOutType
());
if
(
pos
!=
null
)
{
Barcode
boxBarcode
=
pos
.
getBarcode
();
for
(
Barcode
subBarcode
:
boxBarcode
.
getSubCodeList
())
{
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
());
}
}
boxBarcode
.
setOut
(
false
);
boxBarcode
.
setStatus
(
BARCODE_STATUS
.
IN_STORE
);
needOutPos
.
add
(
pos
);
}
else
{
Barcode
newPn
=
new
Barcode
();
newPn
.
setPn
(
pn
);
newPn
.
setAmount
(
0
);
newPn
.
setInitialAmount
(
0
);
newPn
.
setOut
(
false
);
newPn
.
updateExtraData
(
"needInNum"
,
detail
.
getInQty
()
+
""
);
//查找准备出库的料箱中是否有空格口
StoragePos
emptyPos
=
needOutPos
.
stream
()
.
filter
(
emptyP
->
(
emptyP
.
getBarcode
().
getSubCodeList
().
size
()
<
6
))
.
findFirst
()
.
orElse
(
null
);
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
+
",使用料箱的空格口="
+
pos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
}
else
{
//寻找一个空格口
excludePosIds
=
taskService
.
excludePosIds
();
emptyPos
=
storagePosManager
.
findEmptyBoxToPutIn
(
storageIdList
,
pn
,
excludePosIds
,
dataCache
.
getCheckOutType
());
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
+
",查找到有空格口料箱="
+
pos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
}
else
{
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",未找到可用的空料箱="
);
}
}
}
}
//开始生成出库任务
int
index
=
1
;
for
(
StoragePos
pos
:
needOutPos
)
{
Barcode
barcode
=
pos
.
getBarcode
();
log
.
info
(
"入库单"
+
orderNo
+
", 为库位="
+
pos
.
getPosName
()
+
",料箱="
+
barcode
.
getBarcode
()
+
"生成出库任务:"
+
index
);
barcodeManager
.
saveBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
log
.
info
(
pos
.
getPosName
()
+
"出库,料箱号为:"
+
barcode
.
getBarcode
());
DataLog
task
=
new
DataLog
(
storage
,
barcode
,
pos
);
task
.
setSourceId
(
returnNo
.
getId
());
task
.
setSourceName
(
orderNo
);
task
.
setSubSourceId
(
barcode
.
getLockName
());
task
.
setSubSourceInfo
(
barcode
.
getLockName
());
task
.
setLoc
(
"s1"
);
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setCreator
(
SecurityUtils
.
getCurrentUsername
());
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
try
{
taskService
.
addTaskToExecute
(
task
);
}
catch
(
Exception
e
)
{
e
.
getMessage
();
}
index
++;
}
returnNo
.
setSpareStatus
(
SpareNostatus
.
EXECUTING_STATUS
);
addToMap
(
returnNo
);
returnNoManager
.
save
(
returnNo
);
}
catch
(
Exception
exception
)
{
log
.
error
(
"执行ReturnInventoryNo 出错: "
+
exception
.
toString
());
}
return
""
;
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
查看文件 @
614d16c
...
@@ -173,4 +173,20 @@ public class SpBoxUtil {
...
@@ -173,4 +173,20 @@ public class SpBoxUtil {
}
}
public
static
int
GetBoxSubCount
(
String
boxStr
)
{
//返回格口数量
if
(
boxStr
.
startsWith
(
"CS"
))
{
return
6
;
}
else
if
(
boxStr
.
startsWith
(
"CB"
))
{
return
4
;
}
else
if
(
boxStr
.
startsWith
(
"CM"
))
{
return
1
;
}
return
0
;
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
查看文件 @
614d16c
package
com
.
neotel
.
smfcore
.
custom
.
luxsan_sp
.
util
;
package
com
.
neotel
.
smfcore
.
custom
.
luxsan_sp
.
util
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
...
@@ -14,9 +15,12 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
...
@@ -14,9 +15,12 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoResult
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoResult
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.BaseNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.ReturnInventoryNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNoDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNoDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.enums.SpareNostatus
;
import
com.neotel.smfcore.custom.luxsan_sp.enums.SpareNostatus
;
import
com.neotel.smfcore.custom.luxsan_sp.service.manager.IReturnNoManager
;
import
com.neotel.smfcore.custom.luxsan_sp.service.manager.ISpareNoManager
;
import
com.neotel.smfcore.custom.luxsan_sp.service.manager.ISpareNoManager
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.ehcache.impl.internal.concurrent.ConcurrentHashMap
;
import
org.ehcache.impl.internal.concurrent.ConcurrentHashMap
;
...
@@ -127,18 +131,55 @@ public class SpareNoCache {
...
@@ -127,18 +131,55 @@ public class SpareNoCache {
@Autowired
@Autowired
private
TaskService
taskService
;
private
TaskService
taskService
;
@Autowired
private
ReturnNoCache
returnNoCache
;
@Autowired
private
IReturnNoManager
returnNoManager
;
public
String
ExecuteReturn
(
ReturnInventoryNo
returnNo
){
if
(
returnNo
.
getSpareStatus
().
equals
(
SpareNostatus
.
EXECUTING_STATUS
))
{
return
"已在执行中"
;
}
String
result
=
ExecuteNo
(
returnNo
.
getOrderNo
(),
returnNo
);
if
(
ObjectUtil
.
isNotEmpty
(
result
)){
return
result
;
}
returnNo
.
setSpareStatus
(
SpareNostatus
.
EXECUTING_STATUS
);
returnNoCache
.
addToMap
(
returnNo
);
returnNoManager
.
save
(
returnNo
);
return
""
;
}
public
String
ExecuteSpare
(
SpareNo
spareNo
){
if
(
spareNo
.
getSpareStatus
().
equals
(
SpareNostatus
.
EXECUTING_STATUS
))
{
return
"已在执行中"
;
}
String
result
=
ExecuteNo
(
spareNo
.
getSpareNo
(),
spareNo
);
if
(
ObjectUtil
.
isNotEmpty
(
result
)){
return
result
;
}
spareNo
.
setSpareStatus
(
SpareNostatus
.
EXECUTING_STATUS
);
addToMap
(
spareNo
);
spareNoManager
.
save
(
spareNo
);
return
""
;
}
/**
/**
*
*
*/
*/
p
ublic
synchronized
String
Execute
(
SpareNo
spar
eNo
)
{
p
rivate
synchronized
String
ExecuteNo
(
String
orderNo
,
BaseNo
bas
eNo
)
{
try
{
try
{
if
(
spar
eNo
.
getSpareStatus
().
equals
(
SpareNostatus
.
EXECUTING_STATUS
))
{
if
(
bas
eNo
.
getSpareStatus
().
equals
(
SpareNostatus
.
EXECUTING_STATUS
))
{
return
"已在执行中"
;
return
"已在执行中"
;
}
}
String
orderNo
=
spareNo
.
getSpareNo
();
log
.
info
(
"开始执行 入库单 ["
+
orderNo
+
"] "
);
log
.
info
(
"开始执行ReturnInventoryNo["
+
orderNo
+
"] "
);
List
<
StoragePos
>
needOutPos
=
new
ArrayList
<>();
List
<
StoragePos
>
needOutPos
=
new
ArrayList
<>();
List
<
String
>
storageIdList
=
new
ArrayList
<>();
List
<
String
>
storageIdList
=
new
ArrayList
<>();
...
@@ -146,7 +187,7 @@ public class SpareNoCache {
...
@@ -146,7 +187,7 @@ public class SpareNoCache {
storageIdList
.
add
(
storage
.
getId
());
storageIdList
.
add
(
storage
.
getId
());
}
}
for
(
SpareNoDetail
detail
:
spar
eNo
.
getDetailList
())
{
for
(
SpareNoDetail
detail
:
bas
eNo
.
getDetailList
())
{
String
pn
=
detail
.
getPartno
();
String
pn
=
detail
.
getPartno
();
...
@@ -177,10 +218,16 @@ public class SpareNoCache {
...
@@ -177,10 +218,16 @@ public class SpareNoCache {
newPn
.
setOut
(
false
);
newPn
.
setOut
(
false
);
newPn
.
updateExtraData
(
"needInNum"
,
detail
.
getInQty
()
+
""
);
newPn
.
updateExtraData
(
"needInNum"
,
detail
.
getInQty
()
+
""
);
//查找准备出库的料箱中是否有空格口
//查找准备出库的料箱中是否有空格口
StoragePos
emptyPos
=
needOutPos
.
stream
()
StoragePos
emptyPos
=
null
;
.
filter
(
emptyP
->
(
emptyP
.
getBarcode
().
getSubCodeList
().
size
()
<
6
))
for
(
StoragePos
exPos
:
.
findFirst
()
needOutPos
)
{
.
orElse
(
null
);
int
subCount
=
SpBoxUtil
.
GetBoxSubCount
(
exPos
.
getBarcode
().
getBarcode
());
if
(
exPos
.
getBarcode
().
getSubCodeList
().
size
()
<
subCount
)
{
emptyPos
=
exPos
;
break
;
}
}
Barcode
emptyBox
=
null
;
Barcode
emptyBox
=
null
;
if
(
emptyPos
!=
null
)
{
if
(
emptyPos
!=
null
)
{
//使用此格口
//使用此格口
...
@@ -195,23 +242,33 @@ public class SpareNoCache {
...
@@ -195,23 +242,33 @@ public class SpareNoCache {
}
else
{
}
else
{
excludePosIds
=
taskService
.
excludePosIds
();
excludePosIds
=
taskService
.
excludePosIds
();
//寻找一个空格口
//寻找一个空格口
emptyPos
=
storagePosManager
.
findEmptyBoxToPutIn
(
storageIdList
,
pn
,
excludePosIds
,
dataCache
.
getCheckOutType
());
List
<
String
>
boxTypes
=
new
ArrayList
<>();
emptyBox
=
emptyPos
.
getBarcode
();
boxTypes
.
add
(
"CS"
);
if
(
pos
!=
null
)
{
boxTypes
.
add
(
"CB"
);
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
emptyBox
.
getSubCodeList
().
size
());
boxTypes
.
add
(
"CM"
);
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
for
(
String
type
:
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
boxTypes
)
{
subL
.
add
(
newPn
);
int
count
=
SpBoxUtil
.
GetBoxSubCount
(
type
);
emptyBox
.
setSubCodeList
(
subL
);
emptyPos
=
storagePosManager
.
findEmptyBoxToPutIn
(
storageIdList
,
pn
,
excludePosIds
,
dataCache
.
getCheckOutType
(),
type
,
count
);
emptyBox
.
setOut
(
false
);
emptyBox
=
emptyPos
.
getBarcode
();
emptyBox
.
setStatus
(
BARCODE_STATUS
.
IN_STORE
);
if
(
pos
!=
null
)
{
needOutPos
.
add
(
pos
);
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
emptyBox
.
getSubCodeList
().
size
());
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",查找到有空格口料箱="
+
pos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
}
else
{
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
subL
.
add
(
newPn
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",未找到可用的空料箱="
);
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
+
"未找到可用的空料箱="
);
}
}
}
}
}
}
}
...
@@ -229,7 +286,7 @@ public class SpareNoCache {
...
@@ -229,7 +286,7 @@ public class SpareNoCache {
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
log
.
info
(
pos
.
getPosName
()
+
"出库,料箱号为:"
+
barcode
.
getBarcode
());
log
.
info
(
pos
.
getPosName
()
+
"出库,料箱号为:"
+
barcode
.
getBarcode
());
DataLog
task
=
new
DataLog
(
storage
,
barcode
,
pos
);
DataLog
task
=
new
DataLog
(
storage
,
barcode
,
pos
);
task
.
setSourceId
(
spar
eNo
.
getId
());
task
.
setSourceId
(
bas
eNo
.
getId
());
task
.
setSourceName
(
orderNo
);
task
.
setSourceName
(
orderNo
);
task
.
setSubSourceId
(
barcode
.
getLockName
());
task
.
setSubSourceId
(
barcode
.
getLockName
());
task
.
setSubSourceInfo
(
barcode
.
getLockName
());
task
.
setSubSourceInfo
(
barcode
.
getLockName
());
...
@@ -245,13 +302,12 @@ public class SpareNoCache {
...
@@ -245,13 +302,12 @@ public class SpareNoCache {
index
++;
index
++;
}
}
spareNo
.
setSpareStatus
(
SpareNostatus
.
EXECUTING_STATUS
);
addToMap
(
spareNo
);
spareNoManager
.
save
(
spareNo
);
}
catch
(
Exception
exception
)
{
}
catch
(
Exception
exception
)
{
log
.
error
(
"执行ReturnInventoryNo 出错: "
+
exception
.
toString
());
log
.
error
(
"执行ReturnInventoryNo 出错: "
+
exception
.
toString
());
}
}
return
""
;
return
""
;
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论