Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 42184f56
由
zshaohui
编写于
2024-07-02 14:16:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
原材料Gr手动入库
1 个父辈
0c23fb7a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
54 行增加
和
78 行删除
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
42184f5
...
...
@@ -1382,93 +1382,72 @@ public class LiteOrderCache {
for
(
LiteOrderItem
orderItem
:
cacheOrder
.
getOrderItems
())
{
int
remainNum
=
orderItem
.
getNeedNum
()
-
orderItem
.
getTotalOutNum
();
//1.查找所有符合条件的pn
if
(
remainNum
<=
0
)
{
continue
;
}
Collection
<
String
>
excludePosIds
=
excludeOutPosIds
();
//找到hold的
List
<
String
>
holdPosIdList
=
getHoldPosIdList
(
cacheOrder
);
if
(
holdPosIdList
!=
null
&&
!
holdPosIdList
.
isEmpty
())
{
excludePosIds
.
addAll
(
holdPosIdList
);
}
if
(
dataLogList
!=
null
&&
!
dataLogList
.
isEmpty
())
{
for
(
DataLog
dataLog
:
dataLogList
)
{
excludePosIds
.
add
(
dataLog
.
getPosId
());
}
}
String
partNumber
=
orderItem
.
getPn
();
int
taskNum
=
0
;
int
remainNum
=
orderItem
.
getNeedNum
()
-
orderItem
.
getTotalOutNum
();
String
pn
=
orderItem
.
getPn
();
String
warehouseCode
=
orderItem
.
getWarehouseCode
();
Criteria
c
=
Criteria
.
where
(
"barcode.partNumber"
).
is
(
pn
)
.
and
(
"id"
).
nin
(
excludePosIds
)
.
and
(
"enabled"
).
is
(
true
)
.
and
(
"storageId"
).
in
(
storageIdList
)
.
and
(
"barcode.warehouseCode"
).
is
(
warehouseCode
);
while
(
taskNum
<
remainNum
)
{
List
<
StoragePos
>
posList
=
storagePosManager
.
findByQuery
(
new
Query
(
c
)
);
log
.
info
(
orderNo
+
"已分配数量为:"
+
taskNum
+
",剩余数量为:"
+
remainNum
);
if
(
storageIdList
!=
null
&&
!
storageIdList
.
isEmpty
())
{
posList
.
addAll
(
0
,
storagePosList
);
}
Collection
<
String
>
excludePosIds
=
excludeOutPosIds
();
if
(
dataLogList
!=
null
&&
!
dataLogList
.
isEmpty
()){
for
(
DataLog
dataLog
:
dataLogList
)
{
excludePosIds
.
add
(
dataLog
.
getPosId
());
}
}
if
(
posList
==
null
||
posList
.
isEmpty
())
{
finishedOrderTasks
(
cacheOrder
);
throw
new
ValidateException
(
""
,
orderItem
.
getPn
()
+
"库存不足,odn:"
+
cacheOrder
.
getOrderNo
()
+
"无法进行出库"
);
}
//1.先从执行的料箱中出库
StoragePos
pos
=
null
;
if
(
storagePosList
!=
null
&&
!
storagePosList
.
isEmpty
())
{
for
(
StoragePos
storagePos
:
storagePosList
)
{
if
(
excludePosIds
.
contains
(
storagePos
.
getId
()))
{
continue
;
}
if
(
partNumber
.
equals
(
storagePos
.
getBarcode
().
getPartNumber
()))
{
pos
=
storagePos
;
break
;
}
}
}
//开始寻找组合数量为needOutNum的库存
List
<
Integer
>
amountList
=
new
ArrayList
<>();
for
(
StoragePos
storagePos
:
posList
)
{
Barcode
barcode
=
storagePos
.
getBarcode
();
amountList
.
add
(
barcode
.
getQty
());
if
(
pos
==
null
)
{
pos
=
storagePosManager
.
findPartNumberInStorages
(
storageIdList
,
partNumber
,
excludePosIds
,
checkoutType
,
orderItem
.
getBrand
(),
orderItem
.
getWarehouseCode
());
}
if
(
pos
==
null
)
{
break
;
}
else
{
Barcode
barcode
=
pos
.
getBarcode
();
log
.
info
(
barcode
.
getBarcode
()
+
"需要生成出库任务,工单号为:"
+
orderNo
+
",数量为:"
+
barcode
.
getQty
());
taskNum
=
taskNum
+
barcode
.
getQty
();
taskReelCount
=
taskReelCount
+
1
;
DataLog
task
=
newTask
(
pos
);
task
.
setSourceId
(
cacheOrder
.
getId
());
task
.
setSourceName
(
cacheOrder
.
getOrderNo
());
task
.
setSubSourceId
(
orderItem
.
getId
());
task
.
setSubSourceInfo
(
orderItem
.
getFeederInfo
());
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setLoc
(
TaskLocUtil
.
OUT
);
if
(
StringUtils
.
isNotEmpty
(
barcode
.
getCartonId
())){
task
.
setCartonId
(
barcode
.
getCartonId
());
}
task
.
setOdn
(
true
);
dataLogList
.
add
(
task
);
}
}
//寻找到组合
List
<
List
<
Integer
>>
combinations
=
CombinationUtil
.
findCombinationsWithoutDuplicates
(
amountList
,
remainNum
);
Collections
.
sort
(
combinations
,
Comparator
.
comparingInt
(
List:
:
size
));
if
(
combinations
.
isEmpty
())
{
//如果数量不满足,则提示出来
if
(
taskNum
<
remainNum
){
finishedOrderTasks
(
cacheOrder
);
throw
new
ValidateException
(
""
,
orderItem
.
getPn
()
+
"需要出库的数量为:"
+
remainNum
+
",未找到符合条件的组合
"
);
throw
new
ValidateException
(
""
,
orderItem
.
getPn
()
+
"库存不足,odn:"
+
cacheOrder
.
getOrderNo
()+
"无法进行出库
"
);
}
}
//开始出库
List
<
Integer
>
needOutNumList
=
combinations
.
get
(
0
);
while
(
needOutNumList
.
size
()
>
0
)
{
Integer
qty
=
needOutNumList
.
get
(
0
);
for
(
StoragePos
pos
:
posList
)
{
if
(
excludePosIds
.
contains
(
pos
.
getId
()))
{
continue
;
}
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
.
getQty
()
==
qty
)
{
log
.
info
(
barcode
.
getBarcode
()
+
"需要生成出库任务,工单号为:"
+
orderNo
+
",数量为:"
+
barcode
.
getQty
());
taskReelCount
=
taskReelCount
+
1
;
DataLog
task
=
newTask
(
pos
);
task
.
setSourceId
(
cacheOrder
.
getId
());
task
.
setSourceName
(
cacheOrder
.
getOrderNo
());
task
.
setSubSourceId
(
orderItem
.
getId
());
task
.
setSubSourceInfo
(
orderItem
.
getFeederInfo
());
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setLoc
(
TaskLocUtil
.
OUT
);
if
(
StringUtils
.
isNotEmpty
(
barcode
.
getCartonId
()))
{
task
.
setCartonId
(
barcode
.
getCartonId
());
}
task
.
setOdn
(
true
);
dataLogList
.
add
(
task
);
excludePosIds
.
add
(
pos
.
getId
());
break
;
}
}
needOutNumList
.
remove
(
0
);
}
for
(
DataLog
dataLog
:
dataLogList
)
{
taskService
.
addTaskToExecute
(
dataLog
);
}
if
(
taskReelCount
<=
0
)
{
...
...
@@ -1477,9 +1456,6 @@ public class LiteOrderCache {
throw
new
ValidateException
(
"smfcore.order.out.noTask"
,
"工单无可执行的任务"
);
}
for
(
DataLog
dataLog
:
dataLogList
)
{
taskService
.
addTaskToExecute
(
dataLog
);
}
cacheOrder
.
setTaskReelCount
(
taskReelCount
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
0 → 100644
查看文件 @
42184f5
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
查看文件 @
42184f5
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论