Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 75a9c0ae
由
zshaohui
编写于
2024-07-03 11:13:11 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
手动pk发料修改
1 个父辈
d9958636
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
13 行增加
和
147 行删除
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
查看文件 @
75a9c0a
...
...
@@ -357,11 +357,11 @@ public class OutLineController {
code
=
code
.
toUpperCase
();
//判断是否整箱出库
if
(
isBoxPartition
(
code
)
&&
(
code
.
endsWith
(
"A"
)
||
code
.
endsWith
(
"B"
)))
{
return
finishTask
(
code
,
OP
.
CHECKOUT
,
null
,
OP_STATUS
.
FINISHED
.
name
(),
INOUT_TYPE
.
OUT_BOX
.
name
()
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请扫描料盘进行出库"
);
}
//判断是否隔口出库
else
if
(
isBoxPartition
(
code
)
&&
code
.
indexOf
(
"-"
)
!=
-
1
)
{
return
finishTask
(
code
,
OP
.
CHECKOUT
,
null
,
OP_STATUS
.
FINISHED
.
name
(),
INOUT_TYPE
.
OUT_PARTITION
.
name
()
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请扫描料盘进行出库"
);
}
//判断是否属于料盘出库
else
{
...
...
@@ -372,125 +372,10 @@ public class OutLineController {
private
synchronized
ResultBean
finishTask
(
String
boxStr
,
int
opType
,
Barcode
barcode
,
String
opStatus
,
String
inoutType
)
{
ResultBean
resultBean
=
ResultBean
.
newOkResult
(
""
);
//判断是否为整箱出库
if
(
INOUT_TYPE
.
OUT_BOX
.
name
().
equals
(
inoutType
))
{
//根据箱子号 找到barcode
boxStr
=
getBoxStrbyBoxPartition
(
boxStr
);
Barcode
pidBarcode
=
barcodeManager
.
findByBarcode
(
boxStr
);
//根据料箱获取到全部的物料
List
<
Barcode
>
subCodes
=
pidBarcode
.
getSubCodeList
();
if
(
subCodes
==
null
||
subCodes
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料箱:"
+
pidBarcode
.
getBarcode
()
+
",没有可出库的物料"
);
}
//判断是否全部出库
for
(
Barcode
subCode
:
subCodes
)
{
if
(!
subCode
.
isOut
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
pidBarcode
.
getBarcode
()
+
"不允许全部取出,请核实"
);
}
}
for
(
int
index
=
0
;
index
<
subCodes
.
size
();
)
{
Barcode
subCode
=
subCodes
.
get
(
index
);
//manualCheckOut(subCode);
//生成任务
String
orderItemId
=
subCode
.
getOrderItemId
();
int
amount
=
subCode
.
getAmount
();
subCode
.
setAmount
(
0
);
pidBarcode
.
UpdateSubCode
(
subCode
);
pidBarcode
.
setReelAmount
(
pidBarcode
.
getReelAmount
()
-
1
);
pidBarcode
.
setAmount
(
pidBarcode
.
getAmount
()
-
amount
);
int
extendType
=
StringUtils
.
isNotBlank
(
subCode
.
getOrderItemId
())
?
ExtendType
.
VIRTUAL_PICKING_DETAIL
:
ExtendType
.
VIRTUAL_CHECKOUT
;
DataLog
dataLog
=
generateTask
(
subCode
,
opStatus
,
amount
,
opType
,
orderItemId
,
extendType
,
true
);
log
.
info
(
"整箱出库,生成出库任务,barcode:"
+
subCode
.
getBarcode
()
+
",料箱号为:"
+
pidBarcode
.
getBarcode
());
if
(
subCode
.
getAmount
()
<=
0
)
{
subCode
.
setAmount
(
amount
);
subCode
.
setSelectMsg
(
null
);
subCode
.
setOut
(
false
);
subCode
.
setOrderItemId
(
null
);
subCode
.
setPosName
(
null
);
subCode
.
setHostBarcodeId
(
null
);
subCode
.
setStorageId
(
null
);
barcodeManager
.
save
(
subCode
);
}
}
barcodeManager
.
save
(
pidBarcode
);
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
pidBarcode
);
if
(
pos
!=
null
){
pos
.
setBarcode
(
pidBarcode
);
storagePosManager
.
save
(
pos
);
}
resultBean
.
setData
(
getBoxInfo
(
boxStr
));
}
//判断是否隔口出库
else
if
(
INOUT_TYPE
.
OUT_PARTITION
.
name
().
equals
(
inoutType
))
{
String
newboxStr
=
getBoxStrbyBoxPartition
(
boxStr
);
String
orderItemIdStr
=
""
;
Barcode
pidBarcode
=
barcodeManager
.
findByBarcode
(
newboxStr
);
//获取到需要出库的隔口信息
List
<
Barcode
>
needOutBarcodes
=
new
ArrayList
<>();
List
<
Barcode
>
subCodes
=
pidBarcode
.
getSubCodeList
();
if
(
subCodes
!=
null
&&
!
subCodes
.
isEmpty
())
{
for
(
Barcode
subCode
:
subCodes
)
{
if
(
boxStr
.
equals
(
subCode
.
getPosName
()))
{
needOutBarcodes
.
add
(
subCode
);
}
}
}
if
(
needOutBarcodes
==
null
||
needOutBarcodes
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料箱隔口:"
+
boxStr
+
"扫描错误"
);
}
//判断是否全部出库
for
(
Barcode
subCode
:
needOutBarcodes
)
{
if
(!
subCode
.
isOut
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不允许全部出库,请核实"
);
}
}
for
(
int
index
=
0
;
index
<
needOutBarcodes
.
size
();
index
++)
{
Barcode
subCode
=
needOutBarcodes
.
get
(
index
);
//manualCheckOut(subCode);
String
orderItemId
=
subCode
.
getOrderItemId
();
int
amount
=
subCode
.
getAmount
();
subCode
.
setAmount
(
0
);
pidBarcode
.
UpdateSubCode
(
subCode
);
pidBarcode
.
setReelAmount
(
pidBarcode
.
getReelAmount
()
-
1
);
pidBarcode
.
setAmount
(
pidBarcode
.
getAmount
()
-
amount
);
generateTask
(
subCode
,
opStatus
,
amount
,
opType
,
orderItemId
,
0
,
true
);
log
.
info
(
"隔口出库,生成出库任务,barcode:"
+
subCode
.
getBarcode
()
+
",料箱号为:"
+
subCode
.
getPosName
());
log
.
info
(
"箱子数量为:"
+
pidBarcode
.
getAmount
()
+
",物料数量为:"
+
pidBarcode
.
getReelAmount
()
+
"箱号为:"
+
pidBarcode
.
getBarcode
());
if
(
subCode
.
getAmount
()
<=
0
)
{
subCode
.
setAmount
(
amount
);
subCode
.
setSelectMsg
(
null
);
subCode
.
setOut
(
false
);
subCode
.
setOrderItemId
(
null
);
subCode
.
setPosName
(
null
);
subCode
.
setHostBarcodeId
(
null
);
subCode
.
setStorageId
(
null
);
barcodeManager
.
save
(
subCode
);
}
}
barcodeManager
.
save
(
pidBarcode
);
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
pidBarcode
);
if
(
pos
!=
null
){
pos
.
setBarcode
(
pidBarcode
);
storagePosManager
.
save
(
pos
);
}
resultBean
.
setData
(
getBoxInfo
(
boxStr
));
}
ResultBean
resultBean
=
ResultBean
.
newOkResult
(
""
);
//判断是否为单盘出库
else
if
(
INOUT_TYPE
.
OUT_ONE
.
name
().
equals
(
inoutType
))
{
if
(
INOUT_TYPE
.
OUT_ONE
.
name
().
equals
(
inoutType
))
{
CodeBean
code
=
codeResolve
.
resolveSingleCode
(
boxStr
);
if
(!
code
.
isValid
())
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.noValidCode"
,
"条码无效"
);
...
...
@@ -528,7 +413,7 @@ public class OutLineController {
boolean
isOut
=
false
;
if
(
barcode
.
isOut
())
{
//
manualCheckOut(barcode);
manualCheckOut
(
barcode
);
isOut
=
true
;
String
orderItemId
=
barcode
.
getOrderItemId
();
...
...
@@ -583,12 +468,11 @@ public class OutLineController {
pidBarcode
.
setAmount
(
pidBarcode
.
getAmount
()
-
amount
);
pidBarcode
.
UpdateSubCode
(
barcode
);
//
manualCheckOut(barcode);
manualCheckOut
(
barcode
);
barcodeByOut
=
barcodeManager
.
save
(
barcodeByOut
);
int
extendType
=
StringUtils
.
isNotBlank
(
barcode
.
getOrderItemId
())
?
ExtendType
.
VIRTUAL_PICKING_DETAIL
:
ExtendType
.
VIRTUAL_CHECKOUT
;
generateTask
(
barcode
,
opStatus
,
amount
,
opType
,
orderItemId
,
extendType
,
false
);
log
.
info
(
barcode
.
getBarcode
()
+
"不是出库任务,"
+
barcodeByOut
.
getBarcode
()
+
"需更改out为false"
);
...
...
@@ -653,35 +537,17 @@ public class OutLineController {
public
void
manualCheckOut
(
Barcode
barcode
){
public
void
manualCheckOut
(
Barcode
barcode
)
{
String
itemId
=
barcode
.
getOrderItemId
();
if
(
StringUtils
.
isNotEmpty
(
itemId
)){
if
(
StringUtils
.
isNotEmpty
(
itemId
))
{
LiteOrderItem
orderItem
=
liteOrderItemManager
.
get
(
itemId
);
LiteOrder
liteOrder
=
liteOrderManager
.
get
(
orderItem
.
getOrderId
());
if
(
liteOrder
==
null
){
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()+
"未找到对应的工单出库信息"
);
}
if
(
liteOrder
.
getCheckType
()
==
LiteorderCheckType
.
TICKET_CHECKOUT
){
TicketPickRequest
request
=
new
TicketPickRequest
();
request
.
setPLANT_CODE
(
CommonUtil
.
plantCode
);
request
.
setTICKET_CODE
(
orderItem
.
getTicketCode
());
request
.
setTICKET_ITEM
(
orderItem
.
getTicketItem
());
request
.
setQTY
(
barcode
.
getAmount
());
request
.
setBIN_CODE
(
""
);
List
<
TicketPickLabelList
>
labelList
=
new
ArrayList
<>();
TicketPickLabelList
tickPick
=
new
TicketPickLabelList
();
tickPick
.
setREEL_LIST
(
Arrays
.
asList
(
barcode
.
getBarcode
()));
tickPick
.
setLABEL_ID
(
barcode
.
getLabelId
());
labelList
.
add
(
tickPick
);
request
.
setLABEL_LIST
(
labelList
);
LuxsanApi
.
ticketPick
(
request
);
//LuxsanApi.ticketPost(new TicketPostRequest(CommonUtil.plantCode,orderItem.getTicketCode()));
}
else
if
(
liteOrder
.
getCheckType
()
==
LiteorderCheckType
.
PICKING_CHECKOUT
){
if
(
liteOrder
==
null
)
{
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()
+
"未找到对应的工单出库信息"
);
}
if
(
liteOrder
.
getCheckType
()
==
LiteorderCheckType
.
PICKING_CHECKOUT
)
{
String
batchCode
=
""
;
if
(!
"N/A"
.
equals
(
orderItem
.
getBatchCode
())){
if
(!
"N/A"
.
equals
(
orderItem
.
getBatchCode
()))
{
batchCode
=
orderItem
.
getBatchCode
();
}
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
liteOrder
.
getOrderNo
(),
orderItem
.
getItemId
(),
barcode
.
getPartNumber
()
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论