Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e71444db
由
LN
编写于
2022-05-30 11:14:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
工单出库和转储单出库挑料规则修改。
1 个父辈
c6b20dfa
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
53 行增加
和
17 行删除
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/outList/util/OutListCache.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
e71444d
...
@@ -499,7 +499,6 @@ public class LiteOrderCache implements ITaskListener {
...
@@ -499,7 +499,6 @@ public class LiteOrderCache implements ITaskListener {
int
targetNum
=
needNum
;
int
targetNum
=
needNum
;
for
(
int
i
=
0
;
i
<
posList
.
size
();
i
++
for
(
int
i
=
0
;
i
<
posList
.
size
();
i
++
)
{
)
{
StoragePos
tempPos
=
null
;
List
<
StoragePos
>
forPosList
=
new
ArrayList
<>();
List
<
StoragePos
>
forPosList
=
new
ArrayList
<>();
for
(
StoragePos
pos
:
for
(
StoragePos
pos
:
posList
)
{
posList
)
{
...
@@ -523,9 +522,12 @@ public class LiteOrderCache implements ITaskListener {
...
@@ -523,9 +522,12 @@ public class LiteOrderCache implements ITaskListener {
if
(
isGuizhong
||
needJieliao
)
{
if
(
isGuizhong
||
needJieliao
)
{
if
(
pos
.
getBarcode
().
getAmount
()
>=
targetNum
)
{
if
(
pos
.
getBarcode
().
getAmount
()
>=
targetNum
)
{
//一盘刚好满足
//一盘刚好满足
targetNum
=
0
;
targetNum
-=
pos
.
getBarcode
().
getAmount
()
;
itemPosList
.
add
(
pos
);
itemPosList
.
add
(
pos
);
itemPosNameList
.
add
(
pos
.
getPosName
());
itemPosNameList
.
add
(
pos
.
getPosName
());
if
(
targetNum
<
0
)
{
jieliaoPosMap
.
put
(
pos
.
getPosName
(),
targetNum
);
}
break
;
break
;
}
else
if
(
isLast
)
{
}
else
if
(
isLast
)
{
//一盘料不足,直接加入
//一盘料不足,直接加入
...
@@ -533,7 +535,7 @@ public class LiteOrderCache implements ITaskListener {
...
@@ -533,7 +535,7 @@ public class LiteOrderCache implements ITaskListener {
itemPosNameList
.
add
(
pos
.
getPosName
());
itemPosNameList
.
add
(
pos
.
getPosName
());
targetNum
-=
pos
.
getBarcode
().
getAmount
();
targetNum
-=
pos
.
getBarcode
().
getAmount
();
if
(
targetNum
<
0
)
{
if
(
targetNum
<
0
)
{
jieliaoPosMap
.
put
(
tempP
os
.
getPosName
(),
targetNum
);
jieliaoPosMap
.
put
(
p
os
.
getPosName
(),
targetNum
);
}
}
break
;
break
;
}
}
...
...
src/main/java/com/neotel/smfcore/core/outList/util/OutListCache.java
查看文件 @
e71444d
...
@@ -238,8 +238,6 @@ public class OutListCache implements ITaskListener {
...
@@ -238,8 +238,6 @@ public class OutListCache implements ITaskListener {
continue
;
continue
;
}
}
List
<
StoragePos
>
itemPosList
=
new
ArrayList
<>();
List
<
String
>
itemPosNameList
=
new
ArrayList
<>();
//查找PN的所有库存,PN=pn,未锁定,qty 从大到小,入库时间正序
//查找PN的所有库存,PN=pn,未锁定,qty 从大到小,入库时间正序
List
<
StoragePos
>
posList
=
storagePosManager
.
findOrderItemInStorage
(
availableStorageIds
,
pn
,
taskService
.
excludePosIds
());
List
<
StoragePos
>
posList
=
storagePosManager
.
findOrderItemInStorage
(
availableStorageIds
,
pn
,
taskService
.
excludePosIds
());
...
@@ -272,24 +270,60 @@ public class OutListCache implements ITaskListener {
...
@@ -272,24 +270,60 @@ public class OutListCache implements ITaskListener {
}
}
}
}
List
<
StoragePos
>
itemPosList
=
new
ArrayList
<>();
List
<
String
>
itemPosNameList
=
new
ArrayList
<>();
//此PN未完成
//此PN未完成
int
targetNum
=
needNum
;
int
targetNum
=
needNum
;
StoragePos
tempPos
=
null
;
for
(
StoragePos
pos
:
for
(
int
i
=
0
;
i
<
posList
.
size
();
i
++
posList
)
{
)
{
//已经在出库列表
List
<
StoragePos
>
forPosList
=
new
ArrayList
<>();
if
(
itemPosNameList
.
contains
(
pos
.
getPosName
()))
{
for
(
StoragePos
pos
:
continue
;
posList
)
{
if
(!
needOutPosMap
.
containsKey
(
pos
.
getPosName
()))
{
forPosList
.
add
(
pos
);
}
}
//循环剩余的库位,查找
int
forIndex
=
-
1
;
for
(
StoragePos
pos
:
forPosList
)
{
forIndex
++;
boolean
isLast
=
(
forIndex
==
(
forPosList
.
size
()
-
1
));
//不需要截料,也不按照整盘比,按照数量满足或最后一盘来出
if
(
pos
.
getBarcode
().
getAmount
()
>=
targetNum
||
isLast
)
{
itemPosList
.
add
(
pos
);
itemPosNameList
.
add
(
pos
.
getPosName
());
targetNum
-=
pos
.
getBarcode
().
getAmount
();
break
;
}
if
(
targetNum
<=
0
)
{
break
;
}
}
}
//不需要截料,也不按照整盘比,直接数量最大的发料
itemPosList
.
add
(
pos
);
itemPosNameList
.
add
(
pos
.
getPosName
());
targetNum
-=
pos
.
getBarcode
().
getAmount
();
if
(
targetNum
<=
0
)
{
if
(
targetNum
<=
0
)
{
break
;
break
;
}
}
}
}
// StoragePos tempPos = null;
// for (StoragePos pos :
// posList) {
// //已经在出库列表
// if (itemPosNameList.contains(pos.getPosName())) {
// continue;
// }
// //不需要截料,也不按照整盘比,直接数量最大的发料
// itemPosList.add(pos);
// itemPosNameList.add(pos.getPosName());
// targetNum -= pos.getBarcode().getAmount();
//
// if (targetNum <= 0) {
// break;
// }
// }
//判断数量是否满足
//判断数量是否满足
if
(
targetNum
>
0
)
{
if
(
targetNum
>
0
)
{
int
outNum
=
needNum
-
targetNum
;
int
outNum
=
needNum
-
targetNum
;
...
...
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
e71444d
...
@@ -589,7 +589,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -589,7 +589,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
}
@Override
@Override
public
List
<
StoragePos
>
findOrderItemInStorage
(
List
<
String
>
storageIdList
,
String
pn
,
Collection
<
String
>
excludePosIds
)
{
public
List
<
StoragePos
>
findOrderItemInStorage
(
List
<
String
>
storageIdList
,
String
pn
,
Collection
<
String
>
excludePosIds
)
{
Criteria
c
=
Criteria
.
where
(
"barcode.partNumber"
).
is
(
pn
)
Criteria
c
=
Criteria
.
where
(
"barcode.partNumber"
).
is
(
pn
)
.
and
(
"id"
).
nin
(
excludePosIds
)
.
and
(
"id"
).
nin
(
excludePosIds
)
.
and
(
"enabled"
).
is
(
true
)
//可用
.
and
(
"enabled"
).
is
(
true
)
//可用
...
@@ -600,7 +600,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -600,7 +600,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
}
Query
q
=
new
Query
(
c
);
Query
q
=
new
Query
(
c
);
//数量从大到小,出库先进先出
//数量从大到小,出库先进先出
Sort
sort
=
Sort
.
by
(
Sort
.
Direction
.
DE
SC
,
"barcode.amount"
);
Sort
sort
=
Sort
.
by
(
Sort
.
Direction
.
A
SC
,
"barcode.amount"
);
sort
.
and
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"canCheckOutTime"
));
sort
.
and
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"canCheckOutTime"
));
q
.
with
(
sort
);
q
.
with
(
sort
);
List
<
StoragePos
>
posList
=
storagePosDao
.
findByQuery
(
q
);
List
<
StoragePos
>
posList
=
storagePosDao
.
findByQuery
(
q
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论