Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8eabae17
由
hc
编写于
2024-07-26 12:41:52 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
fix:手动入库,手动出库
1 个父辈
5b78e07e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
95 行增加
和
48 行删除
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxCheckOutController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxCheckOutController.java
查看文件 @
8eabae1
...
@@ -113,26 +113,32 @@ public class SpBoxCheckOutController {
...
@@ -113,26 +113,32 @@ public class SpBoxCheckOutController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codeStr
+
"不是有效的条码"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codeStr
+
"不是有效的条码"
);
}
}
//3.判断当前需不需要出库
//3.获取当前预约单
String
itemId
=
binBarcode
.
getOrderItemId
();
if
(
StringUtils
.
isEmpty
(
itemId
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codeStr
+
"没有要出库的任务"
);
}
//4.获取当前预约单
String
orderId
=
binBarcode
.
getOrderId
();
String
orderId
=
binBarcode
.
getOrderId
();
LiteOrder
liteOrder
=
liteOrderManager
.
get
(
orderId
);
// 判断是不是工单出库
LiteOrder
newLiteOrder
=
liteOrderCache
.
getLiteOrder
(
liteOrder
.
getOrderNo
());
boolean
isOrderCheckout
=
StringUtils
.
isNotBlank
(
orderId
);
if
(
newLiteOrder
==
null
){
LiteOrder
liteOrder
=
null
;
newLiteOrder
=
liteOrderManager
.
findByOrderNo
(
liteOrder
.
getOrderNo
());
LiteOrder
newLiteOrder
=
null
;
}
if
(
isOrderCheckout
)
{
liteOrder
=
liteOrderManager
.
get
(
orderId
);
newLiteOrder
=
liteOrderCache
.
getLiteOrder
(
liteOrder
.
getOrderNo
());
if
(
newLiteOrder
==
null
){
newLiteOrder
=
liteOrderManager
.
findByOrderNo
(
liteOrder
.
getOrderNo
());
}
//判断所属的工单任务是否完成
//4.判断当前需不需要出库
String
result
=
handleOrderNo
(
newLiteOrder
,
itemId
,
codeBarcode
.
getQty
());
String
itemId
=
binBarcode
.
getOrderItemId
();
if
(
StringUtils
.
isNotEmpty
(
result
)){
if
(
StringUtils
.
isEmpty
(
itemId
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
result
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codeStr
+
"没有要出库的任务"
);
}
}
//判断所属的工单任务是否完成
String
result
=
handleOrderNo
(
newLiteOrder
,
itemId
,
codeBarcode
.
getQty
());
if
(
StringUtils
.
isNotEmpty
(
result
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
result
);
}
}
//4.开始拿出料箱
//4.开始拿出料箱
binBarcode
.
setAmount
(
binBarcode
.
getAmount
()-
codeBarcode
.
getQty
());
binBarcode
.
setAmount
(
binBarcode
.
getAmount
()-
codeBarcode
.
getQty
());
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
查看文件 @
8eabae1
package
com
.
neotel
.
smfcore
.
custom
.
luxsan_sp
.
controller
;
package
com
.
neotel
.
smfcore
.
custom
.
luxsan_sp
.
controller
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
...
@@ -22,7 +21,6 @@ import com.neotel.smfcore.custom.luxsan_sp.api.LuxsanSpApi;
...
@@ -22,7 +21,6 @@ import com.neotel.smfcore.custom.luxsan_sp.api.LuxsanSpApi;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.request.SpareInHourseRequest
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.request.SpareInHourseRequest
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.SpareInHourseDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.SpareInHourseDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.*
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.*
;
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.IReturnNoManager
;
import
com.neotel.smfcore.custom.luxsan_sp.service.manager.ISpareNoManager
;
import
com.neotel.smfcore.custom.luxsan_sp.service.manager.ISpareNoManager
;
import
com.neotel.smfcore.custom.luxsan_sp.util.*
;
import
com.neotel.smfcore.custom.luxsan_sp.util.*
;
...
@@ -37,6 +35,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -37,6 +35,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Consumer
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Api
(
tags
=
"备件仓 料箱入库"
)
@Api
(
tags
=
"备件仓 料箱入库"
)
@RestController
@RestController
...
@@ -142,6 +143,22 @@ public class SpBoxPutInController {
...
@@ -142,6 +143,22 @@ public class SpBoxPutInController {
if
(!
binBarcode
.
getBarcode
().
startsWith
(
boxBarcode
.
getBarcode
()))
{
if
(!
binBarcode
.
getBarcode
().
startsWith
(
boxBarcode
.
getBarcode
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
binCodeStr
+
"不是当前料箱:"
+
boxStr
+
"的隔口"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
binCodeStr
+
"不是当前料箱:"
+
boxStr
+
"的隔口"
);
}
}
// 匹配是否存在该料格
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
if
(
ObjectUtil
.
isNull
(
subCodeList
))
{
boxBarcode
.
setSubCodeList
(
new
ArrayList
<>());
subCodeList
=
boxBarcode
.
getSubCodeList
();
subCodeList
.
add
(
binBarcode
);
}
else
{
if
(!
(
subCodeList
.
stream
()
.
map
(
Barcode:
:
getBarcode
)
.
collect
(
Collectors
.
toList
())
.
contains
(
binCodeStr
))
)
{
subCodeList
.
add
(
binBarcode
);
}
}
//2.解析条码信息
//2.解析条码信息
CodeBarcode
codeBarcode
=
CodeUtil
.
getCodeBarcode
(
codeStr
);
CodeBarcode
codeBarcode
=
CodeUtil
.
getCodeBarcode
(
codeStr
);
...
@@ -152,10 +169,14 @@ public class SpBoxPutInController {
...
@@ -152,10 +169,14 @@ public class SpBoxPutInController {
//判断有没有正在执行入库单
//判断有没有正在执行入库单
SpareNo
spareNo
=
spareNoCache
.
getExecutIngSpareNo
();
SpareNo
spareNo
=
spareNoCache
.
getExecutIngSpareNo
();
ReturnInventoryNo
returnInventoryNo
=
returnNoCache
.
getExecutingOrderNo
();
ReturnInventoryNo
returnInventoryNo
=
returnNoCache
.
getExecutingOrderNo
();
BaseNo
baseNo
=
null
;
boolean
isOrderPutIn
=
false
;
if
(
ObjectUtil
.
isAllEmpty
(
spareNo
,
returnInventoryNo
))
{
if
(
ObjectUtil
.
isAllEmpty
(
spareNo
,
returnInventoryNo
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"没有找到正在执行的入库单或者退库单"
);
// return ResultBean.newErrorResult(-1,"","没有找到正在执行的入库单或者退库单");
}
else
{
baseNo
=
ObjectUtil
.
isEmpty
(
spareNo
)
?
returnInventoryNo
:
spareNo
;
isOrderPutIn
=
true
;
}
}
BaseNo
baseNo
=
ObjectUtil
.
isEmpty
(
spareNo
)
?
returnInventoryNo
:
spareNo
;
//3.判断与当前隔口的料号是否匹配
//3.判断与当前隔口的料号是否匹配
...
@@ -164,13 +185,25 @@ public class SpBoxPutInController {
...
@@ -164,13 +185,25 @@ public class SpBoxPutInController {
// binPartNumber = "";
// binPartNumber = "";
// }
// }
boolean
isOk
=
false
;
boolean
isMatch
=
false
;
int
binCodeNum
=
Integer
.
parseInt
(
binCodeStr
.
split
(
"-"
)[
1
]);
String
codePartNumber
=
codeBarcode
.
getPartNumber
();
String
codePartNumber
=
codeBarcode
.
getPartNumber
();
for
(
Barcode
barcode
:
boxBarcode
.
getSubCodeList
())
{
for
(
Barcode
barcode
:
boxBarcode
.
getSubCodeList
())
{
String
pn
=
barcode
.
getPartNumber
();
String
pn
=
barcode
.
getPartNumber
();
int
binNum
=
Integer
.
parseInt
(
barcode
.
getBarcode
().
split
(
"-"
)[
1
]);
int
binNum
=
Integer
.
parseInt
(
barcode
.
getBarcode
().
split
(
"-"
)[
1
]);
if
(
pn
.
equals
(
codePartNumber
)
&&
(
binNum
==
Integer
.
parseInt
(
binCodeStr
.
split
(
"-"
)[
1
])))
{
if
((
binNum
==
binCodeNum
))
{
isOk
=
true
;
// 要入的料格找到了
if
(
StringUtils
.
isNotBlank
(
barcode
.
getPartNumber
()))
{
if
(
pn
.
equals
(
codePartNumber
))
{
isMatch
=
true
;
}
}
else
{
if
(
isOrderPutIn
)
{
}
else
{
barcode
.
setPartNumber
(
codePartNumber
);
}
}
break
;
break
;
}
}
}
}
...
@@ -181,15 +214,15 @@ public class SpBoxPutInController {
...
@@ -181,15 +214,15 @@ public class SpBoxPutInController {
// return ResultBean.newErrorResult(-1, "", codeStr + "与隔口:" + binCodeStr + "的料号不匹配");
// return ResultBean.newErrorResult(-1, "", codeStr + "与隔口:" + binCodeStr + "的料号不匹配");
// }
// }
// }
// }
if
(!
is
Ok
)
{
if
(!
is
Match
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codeStr
+
"
与隔口:"
+
binCodeStr
+
"的料号
不匹配"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codeStr
+
"
的料号["
+
codePartNumber
+
"]与隔口:"
+
binCodeStr
+
"的料号["
+
binBarcode
.
getPartNumber
()+
"]
不匹配"
);
}
}
//判断是否已经完成了
//判断是否已经完成了
boolean
finish
=
true
;
boolean
finish
=
true
;
//判断当前入库的是否和入库单一样
//判断当前入库的是否和入库单一样
if
(
baseNo
!=
null
)
{
if
(
isOrderPutIn
)
{
List
<
SpareNoDetail
>
detailList
=
baseNo
.
getDetailList
();
List
<
SpareNoDetail
>
detailList
=
baseNo
.
getDetailList
();
SpareNoDetail
spareNoDetail
=
null
;
SpareNoDetail
spareNoDetail
=
null
;
...
@@ -256,7 +289,7 @@ public class SpBoxPutInController {
...
@@ -256,7 +289,7 @@ public class SpBoxPutInController {
pos
.
setBarcode
(
boxBarcode
);
pos
.
setBarcode
(
boxBarcode
);
pos
.
setUsed
(
true
);
pos
.
setUsed
(
true
);
if
(
finish
){
if
(
finish
&&
isOrderPutIn
){
// 调用入库接口
// 调用入库接口
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
List
<
SpareInHourseDetail
>
details
=
new
ArrayList
<>();
List
<
SpareInHourseDetail
>
details
=
new
ArrayList
<>();
...
@@ -274,12 +307,14 @@ public class SpBoxPutInController {
...
@@ -274,12 +307,14 @@ public class SpBoxPutInController {
}
}
}
}
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
if
(
isOrderPutIn
)
{
spareNoCache
.
addToMap
(
spareNo
);
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
spareNoManager
.
save
(
spareNo
);
spareNoCache
.
addToMap
(
spareNo
);
}
else
{
spareNoManager
.
save
(
spareNo
);
returnNoCache
.
addToMap
(
returnInventoryNo
);
}
else
{
returnNoManager
.
save
(
returnInventoryNo
);
returnNoCache
.
addToMap
(
returnInventoryNo
);
returnNoManager
.
save
(
returnInventoryNo
);
}
}
}
storagePosManager
.
save
(
pos
);
storagePosManager
.
save
(
pos
);
barcodeManager
.
save
(
binBarcode
);
barcodeManager
.
save
(
binBarcode
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
查看文件 @
8eabae1
...
@@ -23,6 +23,7 @@ import java.util.Arrays;
...
@@ -23,6 +23,7 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.function.Predicate
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
...
@@ -86,7 +87,9 @@ public class SpBoxUtil {
...
@@ -86,7 +87,9 @@ public class SpBoxUtil {
if
(
ObjectUtil
.
isNull
(
no
))
{
if
(
ObjectUtil
.
isNull
(
no
))
{
no
=
returnNoCache
.
getExecutingOrderNo
();
no
=
returnNoCache
.
getExecutingOrderNo
();
}
}
spareNoDetails
=
no
.
getDetailList
();
if
(
ObjectUtil
.
isNotNull
(
no
))
{
spareNoDetails
=
no
.
getDetailList
();
}
}
else
if
(
type
==
2
)
{
}
else
if
(
type
==
2
)
{
LiteOrder
executingOrder
=
liteOrderCache
.
getExecutingOrder
();
LiteOrder
executingOrder
=
liteOrderCache
.
getExecutingOrder
();
if
(
executingOrder
==
null
)
{
if
(
executingOrder
==
null
)
{
...
@@ -126,28 +129,31 @@ public class SpBoxUtil {
...
@@ -126,28 +129,31 @@ public class SpBoxUtil {
// 正在执行的任务的details
// 正在执行的任务的details
List
<
SpareNoDetail
>
activeDetails
=
getActiveDetails
(
type
);
List
<
SpareNoDetail
>
activeDetails
=
getActiveDetails
(
type
);
if
(
ObjectUtil
.
isEmpty
(
activeDetails
))
{
if
(
ObjectUtil
.
isEmpty
(
activeDetails
))
{
return
null
;
}
}
for
(
int
i
=
1
;
i
<=
6
;
i
++)
{
for
(
int
i
=
1
;
i
<=
6
;
i
++)
{
List
<
Object
>
par
=
new
ArrayList
<>();
List
<
Object
>
par
=
new
ArrayList
<>();
String
materialBarcode
=
boxStr
+
"-0"
+
i
;
String
materialBarcode
=
boxStr
+
"-0"
+
i
;
String
partNumber
=
getPartNumber
(
subCodeList
,
materialBarcode
);
String
partNumber
=
getPartNumber
(
subCodeList
,
materialBarcode
);
for
(
SpareNoDetail
activeDetail
:
activeDetails
)
{
SpareNoDetail
activeDetail
=
null
;
if
(
activeDetail
.
getPartno
().
equals
(
partNumber
))
{
if
(
ObjectUtil
.
isNotNull
(
activeDetails
))
{
par
.
add
(
activeDetail
.
getInQty
());
// 该pn总共需要的数量
activeDetail
=
activeDetails
.
stream
()
}
else
{
.
filter
(
spareNoDetail
->
spareNoDetail
.
getPartno
().
equals
(
partNumber
))
par
.
add
(
0
);
.
limit
(
1
)
}
.
collect
(
Collectors
.
toList
()).
get
(
0
);
}
if
(
ObjectUtil
.
isNull
(
activeDetail
))
{
par
.
add
(
0
);
}
else
{
par
.
add
(
activeDetail
.
getInQty
());
// 该pn总共需要的数量
}
}
par
.
add
(
getAmount
(
subCodeList
,
materialBarcode
));
//数量
par
.
add
(
getAmount
(
subCodeList
,
materialBarcode
));
//数量
par
.
add
(
i
);
//隔口号
par
.
add
(
i
);
//隔口号
par
.
add
(
partNumber
);
//料号
par
.
add
(
partNumber
);
//料号
for
(
SpareNoDetail
activeDetail
:
activeDetails
)
{
if
(
ObjectUtil
.
isNull
(
activeDetail
))
{
if
(
activeDetail
.
getPartno
().
equals
(
partNumber
))
{
par
.
add
(
0
);
par
.
add
(
activeDetail
.
getAlrInQty
());
// 该pn已完成数量
}
else
{
}
else
{
par
.
add
(
activeDetail
.
getAlrInQty
());
// 该pn已完成数量
par
.
add
(
0
);
}
}
}
pars
.
add
(
par
);
pars
.
add
(
par
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论