Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ce43893c
由
孙克
编写于
2024-05-06 13:25:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
库存料格中不再保存,直接保存到料箱中
1 个父辈
0ad6690d
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
133 行增加
和
129 行删除
src/main/java/com/neotel/smfcore/common/exception/handler/GlobalExceptionHandler.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BinCacheUtil.java
src/main/java/com/neotel/smfcore/common/exception/handler/GlobalExceptionHandler.java
查看文件 @
ce43893
...
@@ -35,7 +35,7 @@ public class GlobalExceptionHandler {
...
@@ -35,7 +35,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
Throwable
.
class
)
@ExceptionHandler
(
Throwable
.
class
)
public
ResponseEntity
<
ApiError
>
handleException
(
Throwable
e
){
public
ResponseEntity
<
ApiError
>
handleException
(
Throwable
e
){
// 打印堆栈信息
// 打印堆栈信息
log
.
error
(
ThrowableUtil
.
getStackTrace
(
e
));
log
.
error
(
e
.
getMessage
(
));
return
buildResponseEntity
(
ApiError
.
error
(
e
.
getMessage
()));
return
buildResponseEntity
(
ApiError
.
error
(
e
.
getMessage
()));
}
}
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
ce43893
...
@@ -593,6 +593,15 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -593,6 +593,15 @@ public class Barcode extends BasePo implements Serializable {
}
}
}
}
public
void
removeFromSubCodes
(
Barcode
subCode
){
if
(
subCodeList
!=
null
&&
subCodeList
.
size
()
>
0
){
boolean
removeOk
=
subCodeList
.
removeIf
(
t
->
t
.
getBarcode
().
equals
(
subCode
.
getBarcode
()));
if
(
removeOk
){
setAmount
(
getAmount
()
-
subCode
.
getAmount
());
}
}
}
public
void
updateSubCodes
(
Barcode
subCode
)
{
public
void
updateSubCodes
(
Barcode
subCode
)
{
if
(
subCodeList
==
null
)
{
if
(
subCodeList
==
null
)
{
subCodeList
=
new
ArrayList
<>();
subCodeList
=
new
ArrayList
<>();
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
ce43893
...
@@ -106,12 +106,12 @@ public class CDeviceController {
...
@@ -106,12 +106,12 @@ public class CDeviceController {
@RequestMapping
(
"/putInMaterialBin"
)
@RequestMapping
(
"/putInMaterialBin"
)
@AnonymousAccess
@AnonymousAccess
public
synchronized
ResultBean
putInMaterialBin
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
synchronized
ResultBean
putInMaterialBin
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
binCode
=
paramMap
.
get
(
"binCode"
);
//料格
String
binCode
Str
=
paramMap
.
get
(
"binCode"
);
//料格
String
codeStr
=
paramMap
.
get
(
"codeStr"
);
//物料条码
String
codeStr
=
paramMap
.
get
(
"codeStr"
);
//物料条码
String
materialStr
=
paramMap
.
get
(
"materialStr"
);
//料串信息
String
materialStr
=
paramMap
.
get
(
"materialStr"
);
//料串信息
//判断入参是否为空
//判断入参是否为空
if
(
StringUtils
.
isEmpty
(
binCode
))
{
if
(
StringUtils
.
isEmpty
(
binCode
Str
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料格信息"
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料格信息"
});
}
}
...
@@ -130,12 +130,8 @@ public class CDeviceController {
...
@@ -130,12 +130,8 @@ public class CDeviceController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料条码无效"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料条码无效"
);
}
}
//判断料格是否正常
Barcode
binBarcode
=
codeResolve
.
resolveOneValideBarcode
(
binCode
);
if
(
binBarcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料格条码无效"
);
}
log
.
info
(
"料串["
+
materialStr
+
"]上的物料["
+
barcode
.
getBarcode
()+
"] 放入了料箱["
+
binCodeStr
+
"]"
);
//判断是否存在料箱中
//判断是否存在料箱中
if
(
StringUtils
.
isNotEmpty
(
barcode
.
getPosName
()))
{
if
(
StringUtils
.
isNotEmpty
(
barcode
.
getPosName
()))
{
log
.
info
(
barcode
.
getBarcode
()
+
"已经存在料格"
+
barcode
.
getPosName
());
log
.
info
(
barcode
.
getBarcode
()
+
"已经存在料格"
+
barcode
.
getPosName
());
...
@@ -162,47 +158,83 @@ public class CDeviceController {
...
@@ -162,47 +158,83 @@ public class CDeviceController {
}
}
List
<
Barcode
>
subCodeList
=
binBarcode
.
getSubCodeList
();
//判断料格是否正常
Barcode
boxBarcode
=
null
;
StoragePos
inPos
=
null
;
try
{
String
boxStr
=
BoxHandleUtil
.
getBoxStr
(
binCodeStr
);
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
inPos
=
storagePosManager
.
getByBarcode
(
boxStr
);
if
(
inPos
!=
null
){
boxBarcode
=
inPos
.
getBarcode
();
log
.
error
(
"流程异常:料箱["
+
boxStr
+
"]在库位["
+
inPos
.
getPosName
()+
"],但物料["
+
barcode
.
getBarcode
()+
"]放入了料格中"
);
}
}
catch
(
ValidateException
ve
){
return
ResultBean
.
newErrorResult
(-
1
,
ve
.
getMsgKey
(),
"料格条码不正确:"
+
binCodeStr
);
}
if
(
boxBarcode
!=
null
){
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
Barcode
subCodeInBin
=
null
;
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
Barcode
subCode
=
subCodeList
.
get
(
0
);
//找到料箱中该料格的第一个条码
for
(
Barcode
subCodeInBox
:
subCodeList
)
{
if
(
subCodeInBox
.
getPosName
().
equalsIgnoreCase
(
binCodeStr
)){
subCodeInBin
=
subCodeInBox
;
break
;
}
}
if
(
subCodeInBin
!=
null
){
String
partNumber
=
barcode
.
getPartNumber
();
String
partNumber
=
barcode
.
getPartNumber
();
String
provider
=
barcode
.
getProvider
();
String
provider
=
barcode
.
getProvider
();
String
warehouseCode
=
barcode
.
getWarehouseCode
();
String
warehouseCode
=
barcode
.
getWarehouseCode
();
if
(
partNumber
.
equals
(
subCode
.
getPartNumber
())
if
(
partNumber
.
equals
(
subCodeInBin
.
getPartNumber
())
&&
provider
.
equals
(
subCode
.
getProvider
())
&&
provider
.
equals
(
subCodeInBin
.
getProvider
())
&&
subCode
.
getWarehouseCode
().
equals
(
warehouseCode
))
{
&&
subCodeInBin
.
getWarehouseCode
().
equals
(
warehouseCode
))
{
//判断GR信息是否相同
//判断GR信息是否相同
log
.
info
(
barcode
.
getBarcode
()+
"当前物料的来源是:"
+
soucre
+
",料格"
+
binBarcode
.
getBarcode
()+
"的来源是:"
+
binBarcode
.
getBarSource
());
log
.
info
(
barcode
.
getBarcode
()+
"当前物料的来源是:"
+
soucre
+
",料格"
+
subCodeInBin
.
getBarcode
()+
"的来源是:"
+
subCodeInBin
.
getBarSource
());
if
(
StringUtils
.
isNotEmpty
(
soucre
)){
if
(
StringUtils
.
isNotEmpty
(
soucre
)){
if
(!
soucre
.
equals
(
binBarcode
.
getBarSource
())){
if
(!
soucre
.
equals
(
subCodeInBin
.
getBarSource
())){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
binCode
+
"的来源是:"
+
binBarcode
.
getBarSource
()+
"与当前入库的来源:"
+
soucre
+
"不一致"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
binCodeStr
+
"的来源是:"
+
subCodeInBin
.
getBarSource
()+
"与当前入库的来源:"
+
soucre
+
"不一致"
);
}
}
}
}
}
else
{
}
else
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料号:"
+
partNumber
+
",供应商:"
+
provider
+
",库别:"
+
warehouseCode
"料号:"
+
partNumber
+
",供应商:"
+
provider
+
",库别:"
+
warehouseCode
+
"与料格中的料号:"
+
subCode
.
getPartNumber
()
+
",供应商:"
+
subCode
.
getProvider
()
+
"库别:"
+
subCode
.
getWarehouseCode
()
+
"不一致"
);
+
"与料格中的料号:"
+
subCodeInBin
.
getPartNumber
()
+
",供应商:"
+
subCodeInBin
.
getProvider
()
+
"库别:"
+
subCodeInBin
.
getWarehouseCode
()
+
"不一致"
);
}
}
}
}
}
String
boxStr
=
BoxHandleUtil
.
getBoxStr
(
binCode
);
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
//判断隔口是否可以放入
//判断隔口是否可以放入
if
(
BinCacheUtil
.
canPutInBinCode
(
binCode
,
warhouseCode
))
{
if
(
BinCacheUtil
.
canPutInBinCode
(
binCodeStr
,
warhouseCode
))
{
if
(
MaterialUtil
.
bindGr
(
materialStr
)){
if
(
MaterialUtil
.
bindGr
(
materialStr
)){
BindGrInfo
bindGrInfo
=
MaterialUtil
.
getBindGrInfo
(
materialStr
);
BindGrInfo
bindGrInfo
=
MaterialUtil
.
getBindGrInfo
(
materialStr
);
LuxsanApi
.
newLabelToCell
(
new
NewLabelToCellRequest
(
LuxsanApi
.
newLabelToCell
(
new
NewLabelToCellRequest
(
CommonUtil
.
plantCode
,
CommonUtil
.
plantCode
,
Arrays
.
asList
(
bindGrInfo
.
getUdCode
()),
Arrays
.
asList
(
bindGrInfo
.
getUdCode
()),
barcode
.
getAmount
(),
barcode
.
getAmount
(),
binCode
,
Arrays
.
asList
(
barcode
.
getFullCode
())
binCodeStr
,
Arrays
.
asList
(
barcode
.
getFullCode
())
));
));
}
}
generatePutInTask
(
barcode
,
binBarcode
,
OP
.
PUT_IN
,
soucre
,
warhouseCode
,
boxBarcode
);
barcode
.
setPosName
(
binCodeStr
);
barcode
.
setWarehouseCode
(
warhouseCode
);
barcode
.
setBarSource
(
soucre
);
barcode
=
barcodeManager
.
save
(
barcode
);
generatePutInTask
(
barcode
,
boxBarcode
);
if
(
inPos
!=
null
){
//流程异常时,为保证数据一致性, pos中的box barcode也需要更新
inPos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
inPos
);
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不可以放到料格:"
+
binCode
);
}
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不可以放到料格:"
+
binCodeStr
);
}
}
...
@@ -215,10 +247,10 @@ public class CDeviceController {
...
@@ -215,10 +247,10 @@ public class CDeviceController {
log
.
info
(
"料箱或者料串已经放满,收到料格信息为"
+
binCode
+
",料串信息为:"
+
materialStr
);
log
.
info
(
"料箱或者料串已经放满,收到料格信息为"
+
binCode
+
",料串信息为:"
+
materialStr
);
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
binCode
);
//
Barcode barcode = codeResolve.resolveOneValideBarcode(binCode);
if
(
barcode
==
null
)
{
//
if (barcode == null) {
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
binCode
});
//
throw new ValidateException("smfcore.error.barcode.invalid", "{0}不是有效的条码", new String[]{binCode});
}
//
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -289,7 +321,7 @@ public class CDeviceController {
...
@@ -289,7 +321,7 @@ public class CDeviceController {
reelLocInfo
.
setLockPosId
(
pos
.
getId
());
reelLocInfo
.
setLockPosId
(
pos
.
getId
());
reelLocInfo
=
ReelLockPosUtil
.
addReelLockPosInfo
(
reelLocInfo
,
cidList
);
reelLocInfo
=
ReelLockPosUtil
.
addReelLockPosInfo
(
reelLocInfo
,
cidList
);
if
(
reelLocInfo
==
null
)
{
if
(
reelLocInfo
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"["
+
barcode
.
getBarcode
()
+
"]库位
["
+
reelLocInfo
.
getLockPosName
()
+
"]已被锁定
,暂停入库"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"["
+
barcode
.
getBarcode
()
+
"]库位
锁定失败
,暂停入库"
,
new
String
[]{});
}
}
//4.生成入库任务
//4.生成入库任务
...
@@ -336,118 +368,97 @@ public class CDeviceController {
...
@@ -336,118 +368,97 @@ public class CDeviceController {
@AnonymousAccess
@AnonymousAccess
public
synchronized
ResultBean
reelCheckOut
(
String
boxStr
)
{
public
synchronized
ResultBean
reelCheckOut
(
String
boxStr
)
{
//1.解析条码内容
//1.解析条码内容
Barcode
binCode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
//
Barcode binCode = codeResolve.resolveOneValideBarcode(boxStr);
//解析料箱信息
//解析料箱信息
String
box
=
BoxHandleUtil
.
getBoxStr
(
b
inCode
.
getBarcode
()
);
String
box
=
BoxHandleUtil
.
getBoxStr
(
b
oxStr
);
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
box
);
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
box
);
//2.获取要出库的code
int
seq
=
binCode
.
getSeq
();
Barcode
barcode
=
null
;
for
(
Barcode
subCode
:
boxBarcode
.
getSubCodeList
())
{
if
(
seq
==
subCode
.
getSeq
()
&&
binCode
.
getBarcode
().
equals
(
subCode
.
getPosName
()))
{
barcode
=
subCode
;
break
;
}
}
List
<
Barcode
>
barcodeList
=
new
ArrayList
<>();
StoragePos
inPos
=
storagePosManager
.
getByBarcode
(
boxStr
);
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
if
(
inPos
!=
null
){
for
(
Barcode
subCode
:
subCodeList
)
{
boxBarcode
=
inPos
.
getBarcode
();
if
(
binCode
.
getBarcode
().
equals
(
subCode
.
getPosName
())){
log
.
error
(
"流程异常:料箱["
+
boxStr
+
"]在库位["
+
inPos
.
getPosName
()+
"],但物料从料格中出库"
);
barcodeList
.
add
(
subCode
);
}
}
}
//2.获取要出库的code
//int seq = binCode.getSeq();
//Barcode barcode = null;
// for (Barcode subCode : boxBarcode.getSubCodeList()) {
// if (seq == subCode.getSeq() && binCode.getBarcode().equals(subCode.getPosName())) {
// barcode = subCode;
// break;
// }
// }
//判断barcode是否为需要出库的
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
if
(!
barcode
.
isOut
()){
for
(
Barcode
subCode
:
subCodeList
)
{
log
.
info
(
barcode
.
getBarcode
()+
"不是要出库的料盘"
);
if
(
boxStr
.
equals
(
subCode
.
getPosName
())
&&
subCode
.
isOut
()){
Barcode
needOutBarcode
=
null
;
//第一个该格口的就是要出的, 生成出库任务
for
(
Barcode
subCode
:
barcodeList
)
{
if
(
subCode
.
isOut
()){
needOutBarcode
=
subCode
;
break
;
}
}
if
(
needOutBarcode
!=
null
){
String
orderItemId
=
needOutBarcode
.
getOrderItemId
();
needOutBarcode
.
setOrderItemId
(
""
);
needOutBarcode
.
setOut
(
false
);
log
.
info
(
needOutBarcode
.
getBarcode
()+
"需要改成不需要出库"
);
barcodeManager
.
save
(
needOutBarcode
);
binCode
.
updateSubCodes
(
needOutBarcode
);
boxBarcode
.
updateSubCodes
(
needOutBarcode
);
barcode
.
setOut
(
true
);
barcode
.
setOrderItemId
(
orderItemId
);
log
.
info
(
barcode
.
getBarcode
()+
"改成要出库,orderItemId为:"
+
orderItemId
);
}
}
//3.判断barcode是否为空
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到可以出库的物料"
);
}
//4.开始生成出库任务
//4.开始生成出库任务
log
.
info
(
barcode
.
getBarcode
()
+
"从"
+
binCode
.
getBarcode
()
+
"出库,序列号为:"
+
seq
);
log
.
info
(
subCode
.
getBarcode
()
+
"从"
+
boxStr
+
"出库"
);
DataLog
dataLog
=
new
DataLog
(
new
Storage
(),
subCode
,
new
StoragePos
());
String
orderItemId
=
subCode
.
getOrderItemId
();
//4.生成出库任务
LiteOrderItem
orderItem
=
null
;
int
checkType
=
-
1
;
if
(
StringUtils
.
isNotEmpty
(
orderItemId
))
{
String
orderItemId
=
barcode
.
getOrderItemId
(
);
orderItem
=
liteOrderItemManager
.
get
(
orderItemId
);
String
orderId
=
""
;
}
String
orderNo
=
""
;
String
orderNo
=
""
;
String
orderId
=
""
;
int
checkType
=
-
1
;
String
pkItemId
=
""
;
String
pkItemId
=
""
;
String
face
=
""
;
String
face
=
""
;
String
brand
=
""
;
String
brand
=
""
;
String
batchCode
=
""
;
String
batchCode
=
""
;
if
(
StringUtils
.
isNotEmpty
(
orderItemId
)){
if
(
orderItem
!=
null
){
LiteOrderItem
orderItem
=
liteOrderItemManager
.
get
(
orderItemId
);
if
(
orderItem
!=
null
){
orderId
=
orderItem
.
getOrderId
();
orderNo
=
orderItem
.
getOrderNo
();
orderNo
=
orderItem
.
getOrderNo
();
orderId
=
orderItem
.
getOrderId
();
pkItemId
=
orderItem
.
getItemId
();
pkItemId
=
orderItem
.
getItemId
();
face
=
orderItem
.
getFace
();
face
=
orderItem
.
getFace
();
brand
=
orderItem
.
getBrand
();
brand
=
orderItem
.
getBrand
();
if
(!
"N/A"
.
equals
(
orderItem
.
getBatchCode
())){
if
(!
"N/A"
.
equals
(
orderItem
.
getBatchCode
())){
batchCode
=
orderItem
.
getBatchCode
();
batchCode
=
orderItem
.
getBatchCode
();
}
}
}
LiteOrder
order
=
liteOrderManager
.
get
(
orderItem
.
getOrderId
());
LiteOrder
order
=
liteOrderManager
.
get
(
orderItem
.
getOrderId
());
if
(
order
!=
null
){
if
(
order
!=
null
){
checkType
=
order
.
getCheckType
();
checkType
=
order
.
getCheckType
();
}
}
}
}
int
amount
=
barcode
.
getAmount
();
String
posName
=
barcode
.
getPosName
();
barcode
.
setPosName
(
""
);
barcode
.
setAmount
(
0
);
binCode
.
setSeq
(
binCode
.
getSeq
()-
1
);
binCode
.
updateSubCodes
(
barcode
);
binCode
.
setAmount
(
binCode
.
getAmount
()
-
amount
);
barcodeManager
.
save
(
binCode
);
binCode
.
setAmount
(
boxBarcode
.
getAmount
()
-
amount
);
boxBarcode
.
updateSubCodes
(
barcode
);
barcodeManager
.
save
(
boxBarcode
);
//TODO: barcode是否也要保存?? 24002AT这盘料未人subBarcode中清除
barcode
.
setAmount
(
amount
);
DataLog
dataLog
=
new
DataLog
(
new
Storage
(),
barcode
,
new
StoragePos
());
dataLog
.
setSubSourceId
(
orderItemId
);
dataLog
.
setSubSourceId
(
orderItemId
);
dataLog
.
setSourceId
(
orderId
);
dataLog
.
setSourceId
(
orderId
);
dataLog
.
setSourceName
(
orderNo
);
dataLog
.
setSourceName
(
orderNo
);
dataLog
.
setType
(
OP
.
CHECKOUT
);
dataLog
.
setType
(
OP
.
CHECKOUT
);
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
dataLog
.
setPosName
(
posName
);
dataLog
.
setPosName
(
boxStr
);
taskService
.
updateFinishedTask
(
dataLog
);
taskService
.
updateFinishedTask
(
dataLog
);
boxBarcode
.
removeFromSubCodes
(
subCode
);
barcodeManager
.
save
(
boxBarcode
);
if
(
inPos
!=
null
){
//流程异常时,为保证数据一致性, pos中的box barcode也需要更新
inPos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
inPos
);
}
//清理条码档案信息
subCode
.
setPosName
(
""
);
subCode
.
setOut
(
false
);
subCode
.
setOrderId
(
""
);
subCode
.
setOrderItemId
(
""
);
subCode
.
setBarSource
(
""
);
barcodeManager
.
saveBarcode
(
subCode
);
//通知WMS
if
(
checkType
==
LiteorderCheckType
.
PICKING_CHECKOUT
){
if
(
checkType
==
LiteorderCheckType
.
PICKING_CHECKOUT
){
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
orderNo
,
pkItemId
,
barcode
.
getPartNumber
()
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
orderNo
,
pkItemId
,
subCode
.
getPartNumber
()
,
barcode
.
getWarehouseCode
(),
brand
,
face
,
batchCode
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
,
subCode
.
getWarehouseCode
(),
brand
,
face
,
batchCode
,
Arrays
.
asList
(
subCode
.
getBarcode
())));
}
break
;
}
}
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
...
@@ -540,37 +551,21 @@ public class CDeviceController {
...
@@ -540,37 +551,21 @@ public class CDeviceController {
return
barcode
;
return
barcode
;
}
}
private
void
generatePutInTask
(
Barcode
barcode
,
Barcode
binBarcode
,
int
type
,
String
source
,
String
warhouseCode
,
Barcode
boxBarcode
)
{
private
void
generatePutInTask
(
Barcode
barcode
,
Barcode
boxBarcode
)
{
DataLog
dataLog
=
new
DataLog
();
DataLog
dataLog
=
new
DataLog
();
dataLog
.
setPosId
(
b
in
Barcode
.
getId
());
dataLog
.
setPosId
(
b
ox
Barcode
.
getId
());
dataLog
.
setPosName
(
b
inBarcode
.
getBarcod
e
());
dataLog
.
setPosName
(
b
arcode
.
getPosNam
e
());
dataLog
.
setBarcode
(
barcode
.
getBarcode
());
dataLog
.
setBarcode
(
barcode
.
getBarcode
());
dataLog
.
setW
(
barcode
.
getPlateSize
());
dataLog
.
setW
(
barcode
.
getPlateSize
());
dataLog
.
setH
(
barcode
.
getHeight
());
dataLog
.
setH
(
barcode
.
getHeight
());
dataLog
.
setPartNumber
(
barcode
.
getPartNumber
());
dataLog
.
setPartNumber
(
barcode
.
getPartNumber
());
dataLog
.
setNum
(
barcode
.
getAmount
());
dataLog
.
setNum
(
barcode
.
getAmount
());
dataLog
.
setType
(
type
);
dataLog
.
setType
(
OP
.
PUT_IN
);
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
dataLog
.
setBatchInfo
(
barcode
.
getBatch
());
dataLog
.
setBatchInfo
(
barcode
.
getBatch
());
dataLog
.
setSourceName
(
source
);
dataLog
.
setSourceName
(
barcode
.
getBarSource
());
dataLog
.
setWarehouseCode
(
warhouseCode
);
dataLog
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
int
seq
=
binBarcode
.
getSeq
();
seq
=
seq
+
1
;
barcode
.
setSeq
(
seq
);
barcode
.
setWarehouseCode
(
warhouseCode
);
barcode
.
setPosName
(
binBarcode
.
getBarcode
());
barcode
=
barcodeManager
.
save
(
barcode
);
binBarcode
.
setSeq
(
seq
);
binBarcode
.
setWarehouseCode
(
warhouseCode
);
binBarcode
.
setAmount
(
binBarcode
.
getAmount
()+
barcode
.
getAmount
());
binBarcode
.
setBarSource
(
source
);
binBarcode
.
updateSubCodes
(
barcode
);
barcodeManager
.
save
(
binBarcode
);
boxBarcode
.
updateSubCodes
(
barcode
);
boxBarcode
.
updateSubCodes
(
barcode
);
boxBarcode
.
setAmount
(
boxBarcode
.
getAmount
()+
barcode
.
getAmount
());
boxBarcode
.
setAmount
(
boxBarcode
.
getAmount
()+
barcode
.
getAmount
());
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BinCacheUtil.java
查看文件 @
ce43893
...
@@ -21,7 +21,7 @@ public class BinCacheUtil {
...
@@ -21,7 +21,7 @@ public class BinCacheUtil {
private
static
DataCache
dataCache
;
private
static
DataCache
dataCache
;
private
static
long
binCodeUpdateTime
=
0
l
;
private
static
long
binCodeUpdateTime
=
0
L
;
@Autowired
@Autowired
private
void
setDataCache
(
DataCache
cache
){
private
void
setDataCache
(
DataCache
cache
){
...
@@ -30,7 +30,7 @@ public class BinCacheUtil {
...
@@ -30,7 +30,7 @@ public class BinCacheUtil {
public
static
boolean
canPutInBinCode
(
String
binCode
,
String
warehouseCode
)
{
public
static
boolean
canPutInBinCode
(
String
binCode
,
String
warehouseCode
)
{
Map
<
String
,
String
>
cacheMap
=
new
HashMap
<>();
Map
<
String
,
String
>
cacheMap
=
new
HashMap
<>();
if
(
binCodeUpdateTime
==
0
l
||
(
System
.
currentTimeMillis
()
-
binCodeUpdateTime
>=
1000
*
60
*
60
))
{
if
(
binCodeUpdateTime
==
0
L
||
(
System
.
currentTimeMillis
()
-
binCodeUpdateTime
>=
1000
*
60
*
60
))
{
List
<
QueryBinResult
>
resultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_0
,
warehouseCode
));
List
<
QueryBinResult
>
resultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_0
,
warehouseCode
));
for
(
QueryBinResult
result
:
resultList
)
{
for
(
QueryBinResult
result
:
resultList
)
{
cacheMap
.
put
(
result
.
getBIN_CODE
(),
result
.
getWAREHOUSE_CODE
());
cacheMap
.
put
(
result
.
getBIN_CODE
(),
result
.
getWAREHOUSE_CODE
());
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论