Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 19826964
由
LN
编写于
2024-08-02 17:55:32 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库测试修改
1 个父辈
96119e73
全部展开
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
253 行增加
和
149 行删除
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/report/ReportController.java
src/main/java/com/neotel/smfcore/core/storage/rest/query/InventoryQueryCriteria.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/api/LuxsanSpApi.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/bean/SpareNoDetail.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxCheckOutController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpSpareNoController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpUnclaimedController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/service/manager/impl/SpBoxPutInManagerImpl.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
查看文件 @
1982696
...
@@ -112,7 +112,7 @@ public class DataInitManager {
...
@@ -112,7 +112,7 @@ public class DataInitManager {
Message
message
=
Message
.
newMsg
(
MessageType
.
INFO
,
"server"
,
""
,
""
,
"smfcore.messages.serverStart"
,
"服务器启动"
,
null
,
""
);
Message
message
=
Message
.
newMsg
(
MessageType
.
INFO
,
"server"
,
""
,
""
,
"smfcore.messages.serverStart"
,
"服务器启动"
,
null
,
""
);
messageManager
.
save
(
message
);
messageManager
.
save
(
message
);
dataCache
.
getAllInventory
(
null
,
""
);
dataCache
.
getAllInventory
(
null
,
""
);
}
catch
(
Exception
exception
)
{
}
catch
(
Exception
exception
)
{
log
.
error
(
"初始化环境出错..."
+
exception
.
toString
(),
exception
);
log
.
error
(
"初始化环境出错..."
+
exception
.
toString
(),
exception
);
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
1982696
...
@@ -203,6 +203,31 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -203,6 +203,31 @@ public class Barcode extends BasePo implements Serializable {
extraDataMap
.
put
(
key
,
value
);
extraDataMap
.
put
(
key
,
value
);
}
}
}
}
public
int
getNeedOutNum
(){
String
v
=
getExtraData
(
"needOutNum"
);
try
{
return
Integer
.
parseInt
(
v
);
}
catch
(
Exception
exception
){
}
return
0
;
}
public
int
getNeedInNum
(){
String
v
=
getExtraData
(
"needInNum"
);
try
{
return
Integer
.
parseInt
(
v
);
}
catch
(
Exception
exception
){
}
return
0
;
}
public
void
updateNeedInNum
(
int
num
){
updateExtraData
(
"needInNum"
,
num
+
""
);
}
public
void
updateNeedOutNum
(
int
num
){
updateExtraData
(
"needOutNum"
,
num
+
""
);
}
private
int
subListNum
=
0
;
private
int
subListNum
=
0
;
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
1982696
...
@@ -449,11 +449,14 @@ public class DataCache {
...
@@ -449,11 +449,14 @@ public class DataCache {
updateStorageInventory
(
cid
,
partNumberInventory
);
updateStorageInventory
(
cid
,
partNumberInventory
);
}
}
}
}
public
Map
<
String
,
InventoryItem
>
getAllInventory
(
List
<
String
>
storageIds
,
String
blurry
)
{
return
getAllInventory
(
storageIds
,
blurry
,
""
,
""
);
}
/**
/**
* 获取库存信息,key 为 PN
* 获取库存信息,key 为 PN
*/
*/
public
Map
<
String
,
InventoryItem
>
getAllInventory
(
List
<
String
>
storageIds
,
String
blurry
)
{
public
Map
<
String
,
InventoryItem
>
getAllInventory
(
List
<
String
>
storageIds
,
String
blurry
,
String
pn
,
String
wCode
)
{
Map
<
String
,
Storage
>
allStorages
=
getAllStorage
();
Map
<
String
,
Storage
>
allStorages
=
getAllStorage
();
List
<
Storage
>
storages
=
Lists
.
newArrayList
();
List
<
Storage
>
storages
=
Lists
.
newArrayList
();
for
(
Storage
storage
:
allStorages
.
values
())
{
for
(
Storage
storage
:
allStorages
.
values
())
{
...
@@ -466,11 +469,27 @@ public class DataCache {
...
@@ -466,11 +469,27 @@ public class DataCache {
Map
<
String
,
InventoryItem
>
map
=
getInventory
(
storages
);
Map
<
String
,
InventoryItem
>
map
=
getInventory
(
storages
);
Map
<
String
,
InventoryItem
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
InventoryItem
>
resultMap
=
new
HashMap
<>();
for
(
InventoryItem
item
:
map
.
values
())
{
for
(
InventoryItem
item
:
map
.
values
())
{
boolean
add
=
true
;
if
(
ObjectUtil
.
isNotEmpty
(
blurry
))
{
if
(
ObjectUtil
.
isNotEmpty
(
blurry
))
{
if
(
item
.
getPartNumber
().
contains
(
blurry
))
{
if
(
item
.
getPartNumber
().
contains
(
blurry
)||
item
.
getWareHouseCode
().
contains
(
blurry
)||
item
.
getPartname
().
contains
(
blurry
))
{
resultMap
.
put
(
item
.
getPartNumber
(),
item
);
}
else
{
add
=
false
;
}
}
if
(
ObjectUtil
.
isNotEmpty
(
pn
)){
if
(!
item
.
getPartNumber
().
contains
(
pn
)){
add
=
false
;
}
}
}
}
else
{
if
(
ObjectUtil
.
isNotEmpty
(
wCode
)){
if
(!
item
.
getWareHouseCode
().
contains
(
wCode
)){
add
=
false
;
}
}
if
(
add
){
resultMap
.
put
(
item
.
getPartNumber
(),
item
);
resultMap
.
put
(
item
.
getPartNumber
(),
item
);
}
}
}
}
...
@@ -502,6 +521,10 @@ public class DataCache {
...
@@ -502,6 +521,10 @@ public class DataCache {
pnInventoryItem
.
setLockCount
(
pnInventoryItem
.
getLockCount
()
+
storageInventoryItem
.
getLockCount
());
pnInventoryItem
.
setLockCount
(
pnInventoryItem
.
getLockCount
()
+
storageInventoryItem
.
getLockCount
());
pnInventoryItem
.
setStockReel
(
pnInventoryItem
.
getStockReel
()
+
storageInventoryItem
.
getStockReel
());
pnInventoryItem
.
setStockReel
(
pnInventoryItem
.
getStockReel
()
+
storageInventoryItem
.
getStockReel
());
pnInventoryItem
.
setLockReel
(
pnInventoryItem
.
getLockReel
()
+
storageInventoryItem
.
getLockReel
());
pnInventoryItem
.
setLockReel
(
pnInventoryItem
.
getLockReel
()
+
storageInventoryItem
.
getLockReel
());
pnInventoryItem
.
setWareHouseCode
(
storageInventoryItem
.
getWareHouseCode
());
pnInventoryItem
.
setPartname
(
storageInventoryItem
.
getPartname
());
pnInventoryItem
.
setGekouName
(
storageInventoryItem
.
getGekouName
());
pnInventoryItem
.
setPosName
(
storageInventoryItem
.
getPosName
());
resultMap
.
put
(
partNumber
,
pnInventoryItem
);
resultMap
.
put
(
partNumber
,
pnInventoryItem
);
}
}
...
@@ -541,20 +564,6 @@ public class DataCache {
...
@@ -541,20 +564,6 @@ public class DataCache {
storageInventoryMap
.
remove
(
key
);
storageInventoryMap
.
remove
(
key
);
}
}
}
}
//未完成的 Task 也需要锁定
// List<InventoryItem> feederLockInventories = dataLogDao.getStorageLockCount(storage.getId());
// for (InventoryItem feederInventoryItem : feederLockInventories){
// String partNumber = feederInventoryItem.getPartNumber();
// if(!Strings.isNullOrEmpty(partNumber)){
// InventoryItem inventoryItem = storageInventoryMap.get(partNumber);
// if(inventoryItem != null){
// int lockReel = inventoryItem.getLockReel() + feederInventoryItem.getLockReel();
// inventoryItem.setLockReel(lockReel);
// storageInventoryMap.put(partNumber, inventoryItem);
// }
// }
// }
log
.
info
(
"初始化料仓["
+
cid
+
"]的库存信息["
+
storageInventoryMap
.
size
()+
"]条"
);
log
.
info
(
"初始化料仓["
+
cid
+
"]的库存信息["
+
storageInventoryMap
.
size
()+
"]条"
);
inventoryMap
.
put
(
cid
,
storageInventoryMap
);
inventoryMap
.
put
(
cid
,
storageInventoryMap
);
...
...
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
1982696
...
@@ -255,12 +255,9 @@ public class LiteOrderCache {
...
@@ -255,12 +255,9 @@ public class LiteOrderCache {
}
else
if
(
liteOrder
.
isOutBom
())
{
}
else
if
(
liteOrder
.
isOutBom
())
{
liteOrder
.
setStatus
(
LITEORDER_STATUS
.
BOM_FINISHED
);
liteOrder
.
setStatus
(
LITEORDER_STATUS
.
BOM_FINISHED
);
}
else
if
(
liteOrder
.
isOutTails
())
{
}
else
if
(
liteOrder
.
isOutTails
())
{
//if (!"out".equals(liteOrder.getLogo())) {
//liteOrder.setClosed(true);
//} else {
liteOrder
.
setStatus
(
LITEORDER_STATUS
.
TAILS_FINISHED
);
liteOrder
.
setStatus
(
LITEORDER_STATUS
.
TAILS_FINISHED
);
//}
liteOrder
.
setClosed
(
true
);
//liteOrder.setClosed(true);
}
/*else if (liteOrder.isTaskFinished()) {
}
/*else if (liteOrder.isTaskFinished()) {
liteOrder.setClosed(true);
liteOrder.setClosed(true);
}*/
}*/
...
@@ -1153,7 +1150,7 @@ public class LiteOrderCache {
...
@@ -1153,7 +1150,7 @@ public class LiteOrderCache {
//}
//}
}
}
//得到库存信息
//得到库存信息
Map
<
String
,
InventoryItem
>
inventoryMap
=
dataCache
.
getAllInventory
(
storageIds
,
null
);
Map
<
String
,
InventoryItem
>
inventoryMap
=
dataCache
.
getAllInventory
(
storageIds
,
null
,
null
,
null
);
if
(
inventoryMap
!=
null
)
{
if
(
inventoryMap
!=
null
)
{
for
(
LiteOrder
liteOrder
:
liteOrders
)
{
for
(
LiteOrder
liteOrder
:
liteOrders
)
{
//状态是未关闭的,未出库的
//状态是未关闭的,未出库的
...
@@ -1360,17 +1357,17 @@ public class LiteOrderCache {
...
@@ -1360,17 +1357,17 @@ public class LiteOrderCache {
LiteOrder
cacheOrder
=
liteOrderManager
.
findByOrderNo
(
orderNo
);
LiteOrder
cacheOrder
=
liteOrderManager
.
findByOrderNo
(
orderNo
);
if
(
cacheOrder
==
null
)
{
if
(
cacheOrder
==
null
)
{
log
.
info
(
"未找到工单:"
+
orderNo
+
"的信息"
);
log
.
info
(
"未找到工单:"
+
orderNo
+
"的信息"
);
return
"预约单
"
+
orderNo
+
"
不存在"
;
return
"预约单不存在"
;
}
}
if
(
cacheOrder
.
isClosed
())
{
if
(
cacheOrder
.
isClosed
())
{
log
.
info
(
"工单:"
+
orderNo
+
"已经关闭"
);
log
.
info
(
"工单:"
+
orderNo
+
"已经关闭"
);
return
"预约单
"
+
orderNo
+
"
已关闭"
;
return
"预约单已关闭"
;
}
}
if
(
cacheOrder
.
isOutTails
())
{
if
(
cacheOrder
.
isOutTails
())
{
log
.
info
(
"工单:"
+
orderNo
+
"正在执行中"
);
log
.
info
(
"工单:"
+
orderNo
+
"正在执行中"
);
return
"预约单
"
+
orderNo
+
"
正在执行中"
;
return
"预约单正在执行中"
;
}
}
log
.
info
(
"开始执行预约单:"
+
liteOrder
.
getOrderNo
());
log
.
info
(
"开始执行预约单:"
+
liteOrder
.
getOrderNo
());
...
@@ -1399,7 +1396,7 @@ public class LiteOrderCache {
...
@@ -1399,7 +1396,7 @@ public class LiteOrderCache {
StoragePos
pos
=
storagePosManager
.
findPartNumberInStorages
(
storageIdList
,
pn
,
excludePosIds
,
checkOutType
,
""
);
StoragePos
pos
=
storagePosManager
.
findPartNumberInStorages
(
storageIdList
,
pn
,
excludePosIds
,
checkOutType
,
""
);
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
log
.
info
(
"预约单 "
+
liteOrder
.
getOrderNo
()
+
" 的物料 "
+
item
.
getPn
()
+
"未找到"
);
log
.
info
(
"预约单 "
+
liteOrder
.
getOrderNo
()
+
" 的物料 "
+
item
.
getPn
()
+
"未找到"
);
return
"
预约单"
+
liteOrder
.
getOrderNo
()
+
" 的
物料 "
+
item
.
getPn
()
+
"未找到"
;
return
"物料 "
+
item
.
getPn
()
+
"未找到"
;
}
}
cacheOrder
.
setTaskReelCount
(
item
.
getNeedNum
());
cacheOrder
.
setTaskReelCount
(
item
.
getNeedNum
());
...
@@ -1411,7 +1408,7 @@ public class LiteOrderCache {
...
@@ -1411,7 +1408,7 @@ public class LiteOrderCache {
if
(
pn
.
equals
(
subCode
.
getPartNumber
()))
{
if
(
pn
.
equals
(
subCode
.
getPartNumber
()))
{
// 数量不足
// 数量不足
if
(
subCode
.
getAmount
()
<
needOutNum
)
{
if
(
subCode
.
getAmount
()
<
needOutNum
)
{
return
"
预约单"
+
liteOrder
.
getOrderNo
()
+
" 的
物料 "
+
item
.
getPn
()
+
"数量"
+
subCode
.
getAmount
()
+
"不足"
;
return
"物料 "
+
item
.
getPn
()
+
"数量"
+
subCode
.
getAmount
()
+
"不足"
;
}
}
assignNum
=
assignNum
+
subCode
.
getAmount
();
assignNum
=
assignNum
+
subCode
.
getAmount
();
...
@@ -1456,8 +1453,9 @@ public class LiteOrderCache {
...
@@ -1456,8 +1453,9 @@ public class LiteOrderCache {
boolean
hasSmpPn
=
false
;
boolean
hasSmpPn
=
false
;
Barcode
barcode
=
pos
.
getBarcode
();
Barcode
barcode
=
pos
.
getBarcode
();
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
for
(
Barcode
subCode
:
subCodeList
)
{
Barcode
subCode
=
barcode
.
getSubCode
(
pn
);
if
(
pn
.
equals
(
subCode
.
getPartNumber
()))
{
if
(
subCode
!=
null
)
{
// 数量不足
// 数量不足
if
(
subCode
.
getAmount
()
<
needOutNum
)
{
if
(
subCode
.
getAmount
()
<
needOutNum
)
{
throw
new
Exception
(
"库存不足"
);
throw
new
Exception
(
"库存不足"
);
...
@@ -1465,20 +1463,19 @@ public class LiteOrderCache {
...
@@ -1465,20 +1463,19 @@ public class LiteOrderCache {
subCode
.
setOut
(
true
);
subCode
.
setOut
(
true
);
subCode
.
setOrderItemId
(
item
.
getId
());
subCode
.
setOrderItemId
(
item
.
getId
());
subCode
.
setOrderId
(
cacheOrder
.
getId
());
subCode
.
setOrderId
(
cacheOrder
.
getId
());
subCode
.
update
ExtraData
(
"needOutNum"
,
needOutNum
+
""
);
subCode
.
update
NeedOutNum
(
needOutNum
);
if
(
ObjectUtil
.
isNotEmpty
(
item
.
getPartname
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
item
.
getPartname
()))
{
subCode
.
setPn
(
item
.
getP
osN
ame
());
subCode
.
setPn
(
item
.
getP
artn
ame
());
}
}
subCode
=
barcodeManager
.
save
(
subCode
);
subCode
=
barcodeManager
.
save
(
subCode
);
barcode
.
updateSubCodes
(
subCode
);
barcode
.
updateSubCodes
(
subCode
);
barcodeManager
.
save
(
barcode
);
barcodeManager
.
save
(
barcode
);
pos
.
setBarcode
(
barcode
);
log
.
info
(
"预约单 "
+
liteOrder
.
getOrderNo
()
+
" 的 "
+
item
.
getPn
()
+
"找到格口:"
+
subCode
.
getBarcode
());
storagePosManager
.
save
(
pos
);
log
.
info
(
"预约单 "
+
liteOrder
.
getOrderNo
()
+
" 的 "
+
item
.
getPn
()
+
"找到格口:"
+
subCode
.
getBarcode
()
+
",设置需出库数量:"
+
needOutNum
);
assignNum
=
assignNum
+
subCode
.
getAmount
();
assignNum
=
assignNum
+
subCode
.
getAmount
();
hasSmpPn
=
true
;
hasSmpPn
=
true
;
break
;
}
}
}
if
(
hasSmpPn
)
{
if
(
hasSmpPn
)
{
...
...
src/main/java/com/neotel/smfcore/core/report/ReportController.java
查看文件 @
1982696
...
@@ -203,7 +203,7 @@ public class ReportController {
...
@@ -203,7 +203,7 @@ public class ReportController {
@Autowired
@Autowired
private
InventoryItemMapper
inventoryItemMapper
;
private
InventoryItemMapper
inventoryItemMapper
;
private
List
<
InventoryItemDto
>
getInventory
(
InventoryQueryCriteria
criteria
,
Pageable
pageable
)
{
private
List
<
InventoryItemDto
>
getInventory
(
InventoryQueryCriteria
criteria
,
Pageable
pageable
)
{
Map
<
String
,
InventoryItem
>
inventoryItemMap
=
dataCache
.
getAllInventory
(
criteria
.
getStorageIdList
(),
criteria
.
getBlurry
());
Map
<
String
,
InventoryItem
>
inventoryItemMap
=
dataCache
.
getAllInventory
(
criteria
.
getStorageIdList
(),
criteria
.
getBlurry
()
,
criteria
.
getPartNumber
(),
criteria
.
getWarehouseCode
()
);
List
<
InventoryItem
>
list
=
Lists
.
newArrayList
(
inventoryItemMap
.
values
());
List
<
InventoryItem
>
list
=
Lists
.
newArrayList
(
inventoryItemMap
.
values
());
List
<
InventoryItemDto
>
dtoList
=
inventoryItemMapper
.
toDto
(
list
);
List
<
InventoryItemDto
>
dtoList
=
inventoryItemMapper
.
toDto
(
list
);
List
<
InventoryItemDto
>
resultList
=
new
ArrayList
<>();
List
<
InventoryItemDto
>
resultList
=
new
ArrayList
<>();
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/query/InventoryQueryCriteria.java
查看文件 @
1982696
...
@@ -13,6 +13,10 @@ public class InventoryQueryCriteria {
...
@@ -13,6 +13,10 @@ public class InventoryQueryCriteria {
@QueryCondition
(
isDBId
=
true
)
@QueryCondition
(
isDBId
=
true
)
private
String
storageId
;
private
String
storageId
;
private
String
warehouseCode
;
private
String
partNumber
;
@QueryCondition
(
type
=
QueryCondition
.
Type
.
IN
,
propName
=
"storageId"
)
@QueryCondition
(
type
=
QueryCondition
.
Type
.
IN
,
propName
=
"storageId"
)
private
List
<
String
>
storageIdList
;
private
List
<
String
>
storageIdList
;
}
}
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
1982696
...
@@ -133,7 +133,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -133,7 +133,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
}
//获取agv类型的库存
//获取agv类型的库存
Map
<
String
,
InventoryItem
>
agvInventory
=
getAgvBoxInventory
(
storageIds
);
Map
<
String
,
InventoryItem
>
agvInventory
=
getAgvBoxInventory
(
inventoryMap
,
storageIds
);
if
(
agvInventory
!=
null
&&
agvInventory
.
size
()
>
0
){
if
(
agvInventory
!=
null
&&
agvInventory
.
size
()
>
0
){
inventoryMap
.
putAll
(
agvInventory
);
inventoryMap
.
putAll
(
agvInventory
);
}
}
...
@@ -152,7 +152,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -152,7 +152,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
* @param storageIds
* @param storageIds
* @return
* @return
*/
*/
private
Map
<
String
,
InventoryItem
>
getAgvBoxInventory
(
String
...
storageIds
)
{
private
Map
<
String
,
InventoryItem
>
getAgvBoxInventory
(
Map
<
String
,
InventoryItem
>
inventoryMap
,
String
...
storageIds
)
{
Map
<
String
,
InventoryItem
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
InventoryItem
>
resultMap
=
new
HashMap
<>();
for
(
String
storageId
:
storageIds
)
{
for
(
String
storageId
:
storageIds
)
{
/*Storage storage = dataCache.getStorageById(storageId);
/*Storage storage = dataCache.getStorageById(storageId);
...
@@ -166,7 +166,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -166,7 +166,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
List
<
Barcode
>
subCodeList
=
pos
.
getBarcode
().
getSubCodeList
();
List
<
Barcode
>
subCodeList
=
pos
.
getBarcode
().
getSubCodeList
();
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
for
(
Barcode
barcode
:
subCodeList
)
{
for
(
Barcode
barcode
:
subCodeList
)
{
InventoryItem
item
=
result
Map
.
get
(
barcode
.
getPartNumber
());
InventoryItem
item
=
inventory
Map
.
get
(
barcode
.
getPartNumber
());
if
(
item
!=
null
)
{
if
(
item
!=
null
)
{
item
.
setStockReel
(
item
.
getStockReel
()
+
1
);
item
.
setStockReel
(
item
.
getStockReel
()
+
1
);
item
.
setStockCount
(
item
.
getStockCount
()
+
barcode
.
getAmount
());
item
.
setStockCount
(
item
.
getStockCount
()
+
barcode
.
getAmount
());
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/api/LuxsanSpApi.java
查看文件 @
1982696
...
@@ -90,7 +90,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
...
@@ -90,7 +90,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
public
static
List
<
GetUnclaimedResult
>
getUnclaimedDetails
(
GetUnclaimedRequest
request
)
{
public
static
List
<
GetUnclaimedResult
>
getUnclaimedDetails
(
GetUnclaimedRequest
request
)
{
if
(
Debug
)
{
if
(
Debug
)
{
String
msg
=
"{\"msg\":\"操作成功\",\"code\":200,\"data\":[{\"searchValue\":null,\"createBy\":null,\"createTime\":\"2024-08-02 08:40:43\",\"updateBy\":null,\"updateTime\":\"2024-08-02 08:41:26\",\"remark\":null,\"params\":{},\"id\":null,\"flag\":null,\"status\":\"1\",\"orderNo\":\"SA2024080200223\",\"applicantNo\":null,\"applicantName\":null,\"applicantTime\":null,\"project\":null,\"process\":null,\"functionDept\":\"MLB MFG\",\"section\":null,\"line\":null,\"floor\":null,\"delFlag\":null,\"whCode\":null,\"whCodes\":null,\"provideNo\":null,\"receiveNo\":null,\"estimatedTime\":null,\"deptId\":220,\"spareApplyDetail\":[{\"searchValue\":null,\"createBy\":null,\"createTime\":null,\"updateBy\":null,\"updateTime\":null,\"remark\":null,\"params\":{},\"id\":null,\"orderNo\":\"SA2024080200223\",\"deptId\":220,\"partNo\":\"1950130060061A\",\"partName\":\"DEK300mm阶梯刮刀片刀刃0.15刀身0.3|DEK\",\"groupCode\":null,\"applyQty\":5,\"giveOutQty\":null,\"expectQty\":5,\"delFlag\":null,\"spareApplyDetail\":null}]}]}\n"
;
String
msg
=
"{\"msg\":\"操作成功\",\"code\":200,\"data\":[{\"searchValue\":null,\"createBy\":null,\"createTime\":\"2024-08-02 08:40:43\",\"updateBy\":null,\"updateTime\":\"2024-08-02 08:41:26\",\"remark\":null,\"params\":{},\"id\":null,\"flag\":null,\"status\":\"1\",\"orderNo\":\"SA2024080200223\",\"applicantNo\":null,\"applicantName\":null,\"applicantTime\":null,\"project\":null,\"process\":null,\"functionDept\":\"MLB MFG\",\"section\":null,\"line\":null,\"floor\":null,\"delFlag\":null,\"whCode\":null,\"whCodes\":null,\"provideNo\":null,\"receiveNo\":null,\"estimatedTime\":null,\"deptId\":220,\"spareApplyDetail\":[{\"searchValue\":null,\"createBy\":null,\"createTime\":null,\"updateBy\":null,\"updateTime\":null,\"remark\":null,\"params\":{},\"id\":null,\"orderNo\":\"SA2024080200223\",\"deptId\":220,\"partNo\":\"1950130060061A\",\"partName\":\"DEK300mm阶梯刮刀片刀刃0.15刀身0.3|DEK\",\"groupCode\":null,\"applyQty\":5,\"giveOutQty\":null,\"expectQty\":5,\"delFlag\":null,\"spareApplyDetail\":null}]}]}\n"
;
msg
=
"{\"msg\":\"操作成功\",\"code\":200,\"data\":[{\"searchValue\":null,\"createBy\":null,\"createTime\":\"2024-08-02 10:25:23\",\"updateBy\":null,\"updateTime\":\"2024-08-02 10:25:50\",\"remark\":null,\"params\":{},\"id\":null,\"flag\":null,\"status\":\"1\",\"orderNo\":\"SA2024080200381\",\"applicantNo\":null,\"applicantName\":null,\"applicantTime\":null,\"project\":null,\"process\":null,\"functionDept\":\"MLB MFG\",\"section\":null,\"line\":null,\"floor\":null,\"delFlag\":null,\"whCode\":null,\"whCodes\":null,\"provideNo\":null,\"receiveNo\":null,\"estimatedTime\":null,\"deptId\":220,\"spareApplyDetail\":[{\"searchValue\":null,\"createBy\":null,\"createTime\":null,\"updateBy\":null,\"updateTime\":null,\"remark\":null,\"params\":{},\"id\":null,\"orderNo\":\"SA2024080200381\",\"deptId\":220,\"partNo\":\"A01-008-001883-9F\",\"partName\":\"CABLE,38.0FT MECH. GRADE 1(传动钢丝);Spec:72\",\"groupCode\":null,\"applyQty\":3,\"giveOutQty\":null,\"expectQty\":3,\"delFlag\":null,\"spareApplyDetail\":null},{\"searchValue\":null,\"createBy\":null,\"createTime\":null,\"updateBy\":null,\"updateTime\":null,\"remark\":null,\"params\":{},\"id\":null,\"orderNo\":\"SA2024080200381\",\"deptId\":220,\"partNo\":\"F05-008-011901-9F\",\"partName\":\"Asymtek7213248传动轮\",\"groupCode\":null,\"applyQty\":3,\"giveOutQty\":null,\"expectQty\":3,\"delFlag\":null,\"spareApplyDetail\":null}]}]}\n"
;
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
msg
,
LuxsanSpApiResult
.
class
);
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
msg
,
LuxsanSpApiResult
.
class
);
List
<
GetUnclaimedResult
>
testO
=
JSONObject
.
parseArray
(
lizhenApiResult
.
getData
(),
GetUnclaimedResult
.
class
);
List
<
GetUnclaimedResult
>
testO
=
JSONObject
.
parseArray
(
lizhenApiResult
.
getData
(),
GetUnclaimedResult
.
class
);
if
(
testO
!=
null
&&
!
testO
.
isEmpty
())
{
if
(
testO
!=
null
&&
!
testO
.
isEmpty
())
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/bean/SpareNoDetail.java
查看文件 @
1982696
...
@@ -14,4 +14,6 @@ public class SpareNoDetail {
...
@@ -14,4 +14,6 @@ public class SpareNoDetail {
private
int
alrInQty
=
0
;
//已经放入数量
private
int
alrInQty
=
0
;
//已经放入数量
private
String
location
=
""
;
}
}
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxCheckOutController.java
查看文件 @
1982696
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpSpareNoController.java
查看文件 @
1982696
...
@@ -2,14 +2,18 @@ package com.neotel.smfcore.custom.luxsan_sp.controller;
...
@@ -2,14 +2,18 @@ package com.neotel.smfcore.custom.luxsan_sp.controller;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.luxsan_sp.api.LuxsanSpApi
;
import
com.neotel.smfcore.custom.luxsan_sp.api.LuxsanSpApi
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.request.GetSpareNoRequest
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.request.GetSpareNoRequest
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.request.SpareInHourseRequest
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoResult
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoResult
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.SpareInHourseDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNoDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.enums.SpareNostatus
;
import
com.neotel.smfcore.custom.luxsan_sp.enums.SpareNostatus
;
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.ReturnNoCache
;
import
com.neotel.smfcore.custom.luxsan_sp.util.ReturnNoCache
;
...
@@ -101,8 +105,8 @@ public class SpSpareNoController {
...
@@ -101,8 +105,8 @@ public class SpSpareNoController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的入库单信息"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的入库单信息"
);
}
}
String
exeResult
=
spareNoCache
.
ExecuteSpare
(
spareNo
);
String
exeResult
=
spareNoCache
.
ExecuteSpare
(
spareNo
);
if
(
ObjectUtil
.
isNotEmpty
(
exeResult
))
{
if
(
ObjectUtil
.
isNotEmpty
(
exeResult
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"执行退库单失败:"
+
exeResult
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"执行退库单失败:"
+
exeResult
);
}
}
// spareNo.setSpareStatus(SpareNostatus.EXECUTING_STATUS);
// spareNo.setSpareStatus(SpareNostatus.EXECUTING_STATUS);
// spareNoCache.addToMap(spareNo);
// spareNoCache.addToMap(spareNo);
...
@@ -131,5 +135,40 @@ public class SpSpareNoController {
...
@@ -131,5 +135,40 @@ public class SpSpareNoController {
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
"重发入库单"
)
@RequestMapping
(
"/reSend"
)
@AnonymousAccess
public
ResultBean
resend
(
String
spareNoStr
)
{
try
{
log
.
info
(
"入库单:"
+
spareNoStr
+
",点击重发"
);
SpareNo
spareNo
=
spareNoCache
.
getBySpareNo
(
spareNoStr
);
if
(
spareNo
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的入库单信息"
);
}
if
(!
spareNo
.
getStatus
().
equals
(
SpareNostatus
.
CLOSE_STATUS
+
""
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
spareNoStr
+
"入库单未结束,不能重发"
);
}
if
(
spareNo
.
isConfirmed
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
spareNoStr
+
"入库单已确认,不需要重发"
);
}
List
<
SpareInHourseDetail
>
details
=
new
ArrayList
<>();
for
(
SpareNoDetail
detail
:
spareNo
.
getDetailList
())
{
SpareInHourseDetail
spareInHourseDetail
=
new
SpareInHourseDetail
();
spareInHourseDetail
.
setInQty
(
detail
.
getInQty
());
spareInHourseDetail
.
setPartno
(
detail
.
getPartno
());
spareInHourseDetail
.
setLocationCode
(
detail
.
getLocation
());
details
.
add
(
spareInHourseDetail
);
}
LuxsanSpApi
.
spareInHourse
(
new
SpareInHourseRequest
(
spareNo
.
getDeptId
(),
spareNo
.
getNo
(),
spareNo
.
getWhCode
(),
details
));
spareNo
.
setConfirmed
(
true
);
spareNoManager
.
save
(
spareNo
);
spareNoCache
.
addToMap
(
spareNo
);
return
ResultBean
.
newOkResult
(
"重发成功"
);
}
catch
(
ValidateException
ex
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"重发失败:"
+
ex
.
getMessage
());
}
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpUnclaimedController.java
查看文件 @
1982696
...
@@ -164,6 +164,9 @@ public class SpUnclaimedController {
...
@@ -164,6 +164,9 @@ public class SpUnclaimedController {
unclaimed
.
setUnclaimedStatus
(
SpareNostatus
.
EXECUTING_STATUS
);
unclaimed
.
setUnclaimedStatus
(
SpareNostatus
.
EXECUTING_STATUS
);
}
else
if
(
liteOrder
.
isClosed
()){
}
else
if
(
liteOrder
.
isClosed
()){
unclaimed
.
setUnclaimedStatus
(
SpareNostatus
.
CLOSE_STATUS
);
unclaimed
.
setUnclaimedStatus
(
SpareNostatus
.
CLOSE_STATUS
);
}
else
if
(
liteOrder
.
isTaskFinished
()){
unclaimed
.
setUnclaimedStatus
(
SpareNostatus
.
CLOSE_STATUS
);
}
}
unclaimedDetails
.
add
(
unclaimedDetail
);
unclaimedDetails
.
add
(
unclaimedDetail
);
}
}
...
@@ -223,6 +226,7 @@ public class SpUnclaimedController {
...
@@ -223,6 +226,7 @@ public class SpUnclaimedController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
orderNoStr
+
"预约单已经关闭"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
orderNoStr
+
"预约单已经关闭"
);
}
}
log
.
info
(
"放弃出库单:"
+
orderNoStr
);
liteOrder
.
setStatus
(
LITEORDER_STATUS
.
CLOSED
);
liteOrder
.
setStatus
(
LITEORDER_STATUS
.
CLOSED
);
liteOrder
.
setClosed
(
true
);
liteOrder
.
setClosed
(
true
);
liteOrderCache
.
addOrderToMap
(
liteOrder
);
liteOrderCache
.
addOrderToMap
(
liteOrder
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/service/manager/impl/SpBoxPutInManagerImpl.java
查看文件 @
1982696
...
@@ -108,9 +108,9 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
...
@@ -108,9 +108,9 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
if
(
ObjectUtil
.
isEmpty
(
gekouBarcode
.
getPartNumber
())
||
gekouBarcode
.
getPartNumber
().
equals
(
boxBarcode
.
getPartNumber
()))
{
if
(
ObjectUtil
.
isEmpty
(
gekouBarcode
.
getPartNumber
())
||
gekouBarcode
.
getPartNumber
().
equals
(
boxBarcode
.
getPartNumber
()))
{
// 判断物料是否在其他格口
// 判断物料是否在其他格口
String
currP
=
barcodeManager
.
getPNCurrGeKou
(
codeBarcode
.
getPartNumber
());
String
currP
=
barcodeManager
.
getPNCurrGeKou
(
codeBarcode
.
getPartNumber
());
if
(
ObjectUtil
.
isNotEmpty
(
currP
)
&&
(!
currP
.
equals
(
gekouCodeStr
)))
{
if
(
ObjectUtil
.
isNotEmpty
(
currP
)
&&
(!
currP
.
equals
(
gekouCodeStr
)))
{
throw
new
Exception
(
codeBarcode
.
getPartNumber
()
+
"已在"
+
currP
+
"中"
);
throw
new
Exception
(
codeBarcode
.
getPartNumber
()
+
"已在"
+
currP
+
"中"
);
}
}
//是新格口物料
//是新格口物料
...
@@ -140,7 +140,7 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
...
@@ -140,7 +140,7 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
if
(
ObjectUtil
.
isEmpty
(
subCodeList
))
{
if
(
ObjectUtil
.
isEmpty
(
subCodeList
))
{
}
else
{
}
else
{
for
(
Barcode
barcode
:
subCodeList
)
{
for
(
Barcode
barcode
:
subCodeList
)
{
String
inNum
=
barcode
.
getExtraData
(
"needInNum"
);
String
inNum
=
barcode
.
getExtraData
(
"needInNum"
);
if
(
ObjectUtil
.
isEmpty
(
inNum
)
||
inNum
.
equals
(
"0"
))
{
if
(
ObjectUtil
.
isEmpty
(
inNum
)
||
inNum
.
equals
(
"0"
))
{
...
@@ -156,7 +156,7 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
...
@@ -156,7 +156,7 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
}
}
}
}
boolean
finish
=
true
;
//
boolean finish = true;
//判断当前入库的是否和入库单一样
//判断当前入库的是否和入库单一样
if
(
isOrderPutIn
)
{
if
(
isOrderPutIn
)
{
List
<
SpareNoDetail
>
detailList
=
baseNo
.
getDetailList
();
List
<
SpareNoDetail
>
detailList
=
baseNo
.
getDetailList
();
...
@@ -185,15 +185,20 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
...
@@ -185,15 +185,20 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
// 开始放入料箱
// 开始放入料箱
gekouBarcode
.
setPartNumber
(
codeBarcode
.
getPartNumber
());
gekouBarcode
.
setPartNumber
(
codeBarcode
.
getPartNumber
());
gekouBarcode
.
setAmount
(
gekouBarcode
.
getAmount
()
+
codeBarcode
.
getQty
());
gekouBarcode
.
setAmount
(
gekouBarcode
.
getAmount
()
+
codeBarcode
.
getQty
());
gekouBarcode
.
updateExtraData
(
"needInNum"
,
"0"
);
int
neeIn
=
gekouBarcode
.
getNeedInNum
();
neeIn
=
neeIn
-
codeBarcode
.
getQty
();
if
(
neeIn
<
0
)
{
neeIn
=
0
;
}
gekouBarcode
.
updateNeedInNum
(
neeIn
);
boxBarcode
.
updateSubCodes
(
gekouBarcode
);
boxBarcode
.
updateSubCodes
(
gekouBarcode
);
boxBarcode
.
setStatus
(
BARCODE_STATUS
.
OUT_NORMAL
);
boxBarcode
.
setStatus
(
BARCODE_STATUS
.
OUT_NORMAL
);
if
(
pos
==
null
){
if
(
pos
==
null
)
{
throw
new
Exception
(
boxStr
+
"未找到可用的库位"
);
throw
new
Exception
(
boxStr
+
"未找到可用的库位"
);
}
}
log
.
info
(
"reelToBox 入库成功 : boxStr="
+
boxStr
+
",codeStr="
+
rellCodeStr
+
",binCodeStr="
+
gekouCodeStr
+
",数量:"
+
codeBarcode
.
getQty
()
+
",当前数量:"
+
gekouBarcode
.
getAmount
());
log
.
info
(
"reelToBox 入库成功 : boxStr="
+
boxStr
+
",codeStr="
+
rellCodeStr
+
",binCodeStr="
+
gekouCodeStr
+
",数量:"
+
codeBarcode
.
getQty
()
+
",当前数量:"
+
gekouBarcode
.
getAmount
());
//6.生成入库任务
//6.生成入库任务
DataLog
dataLog
=
new
DataLog
();
DataLog
dataLog
=
new
DataLog
();
dataLog
.
setBarcode
(
rellCodeStr
);
dataLog
.
setBarcode
(
rellCodeStr
);
...
@@ -209,90 +214,22 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
...
@@ -209,90 +214,22 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
pos
.
setUsed
(
true
);
pos
.
setUsed
(
true
);
storagePosManager
.
save
(
pos
);
storagePosManager
.
save
(
pos
);
barcodeManager
.
save
(
gekouBarcode
);
barcodeManager
.
save
(
gekouBarcode
);
barcodeManager
.
save
(
boxBarcode
);
barcodeManager
.
save
(
boxBarcode
);
//更新库存
//更新库存
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
dataCache
.
updateInventoryAmount
(
storage
.
getCid
(),
codeBarcode
.
getPartNumber
(),
codeBarcode
.
getQty
());
dataCache
.
updateInventoryAmount
(
storage
.
getCid
(),
codeBarcode
.
getPartNumber
(),
codeBarcode
.
getQty
());
Map
<
String
,
String
>
res
=
new
HashMap
<>();
Map
<
String
,
String
>
res
=
new
HashMap
<>();
res
.
put
(
"PN"
,
codeBarcode
.
getPartNumber
());
res
.
put
(
"PN"
,
codeBarcode
.
getPartNumber
());
res
.
put
(
"InPutNum"
,
codeBarcode
.
getQty
()+
""
);
res
.
put
(
"InPutNum"
,
codeBarcode
.
getQty
()
+
""
);
res
.
put
(
"CurrNum"
,
gekouBarcode
.
getAmount
()+
""
);
res
.
put
(
"CurrNum"
,
gekouBarcode
.
getAmount
()
+
""
);
res
.
put
(
"Code"
,
gekouBarcode
.
getBarcode
());
res
.
put
(
"Code"
,
gekouBarcode
.
getBarcode
());
taskService
.
updateFinishedTask
(
dataLog
);
taskService
.
updateFinishedTask
(
dataLog
);
if
(
isOrderPutIn
)
{
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
spareNoCache
.
addToMap
(
spareNo
);
spareNoManager
.
save
(
spareNo
);
}
else
{
returnNoCache
.
addToMap
(
returnInventoryNo
);
returnNoManager
.
save
(
returnInventoryNo
);
}
}
if
(
isOrderPutIn
){
List
<
SpareNoDetail
>
detailList
=
baseNo
.
getDetailList
();
SpareNoDetail
spareNoDetail
=
null
;
for
(
SpareNoDetail
detail
:
detailList
)
{
//如果相同的话,判断数量是否大于需求数量
if
(
detail
.
getPartno
().
equals
(
codeBarcode
.
getPartNumber
()))
{
spareNoDetail
=
detail
;
break
;
}
}
if
(
spareNoDetail
!=
null
)
{
//数量加
spareNoDetail
.
setAlrInQty
(
spareNoDetail
.
getAlrInQty
()
+
codeBarcode
.
getQty
());
baseNo
.
updateDetailList
(
spareNoDetail
);
log
.
info
(
"开始判断是否完成入库单"
);
for
(
SpareNoDetail
noDetail
:
baseNo
.
getDetailList
())
{
if
(
noDetail
.
getInQty
()
>
noDetail
.
getAlrInQty
())
{
log
.
info
(
"入库未完成"
);
finish
=
false
;
break
;
}
log
.
info
(
"入料noDetail.getInQty()"
+
noDetail
.
getInQty
()
+
"noDetail.getAlrInQty()"
+
noDetail
.
getAlrInQty
());
}
// 最后刷新不能回滚的
if
(
finish
)
{
try
{
// 调用入库接口
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
dataLog
.
setSourceId
(
baseNo
.
getId
());
dataLog
.
setSourceName
(
spareNo
.
getSpareNo
());
((
SpareNo
)
baseNo
).
setStatus
(
SpareNostatus
.
CLOSE_STATUS
+
""
);
((
SpareNo
)
baseNo
).
setConfirmed
(
false
);
log
.
info
(
"入库单已完成,关闭入库单"
+
baseNo
.
getNo
()
);
List
<
SpareInHourseDetail
>
details
=
new
ArrayList
<>();
for
(
SpareNoDetail
detail
:
baseNo
.
getDetailList
())
{
SpareInHourseDetail
spareInHourseDetail
=
new
SpareInHourseDetail
();
spareInHourseDetail
.
setInQty
(
detail
.
getInQty
());
spareInHourseDetail
.
setPartno
(
detail
.
getPartno
());
String
location
=
boxStr
;
// String location = SpareNostatus.LOCATION_CODE.get(baseNo.getWhCode());
spareInHourseDetail
.
setLocationCode
(
location
);
// spareInHourseDetail.setLocationCode(binBarcode.getBarcode());
details
.
add
(
spareInHourseDetail
);
}
LuxsanSpApi
.
spareInHourse
(
new
SpareInHourseRequest
(
baseNo
.
getDeptId
(),
baseNo
.
getNo
(),
baseNo
.
getWhCode
(),
details
));
spareNo
.
setConfirmed
(
true
);
log
.
info
(
"入库单通知API成功,更改状态为已确认:"
+
baseNo
.
getNo
()
);
if
(
isOrderPutIn
)
{
}
spareNoCache
.
reelPutEnd
(
baseNo
,
codeBarcode
.
getPartNumber
(),
codeBarcode
.
getQty
(),
pos
.
getPosName
());
}
catch
(
Exception
e
)
{
log
.
info
(
"调用入库接口失败,失败原因"
+
e
.
getMessage
());
spareNo
.
setConfirmed
(
false
);
throw
new
Exception
(
e
.
getMessage
());
}
finally
{
spareNoManager
.
save
(
spareNo
);
}
}
}
}
}
return
res
;
return
res
;
...
@@ -307,9 +244,9 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
...
@@ -307,9 +244,9 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
public
void
addBackupObj
(
Object
o
)
{
public
void
addBackupObj
(
Object
o
)
{
if
(
o
instanceof
Barcode
)
{
if
(
o
instanceof
Barcode
)
{
backupBarcodes
.
add
(
DeepCopyUtil
.
deepCopy
((
Barcode
)
o
));
backupBarcodes
.
add
(
DeepCopyUtil
.
deepCopy
((
Barcode
)
o
));
}
else
if
(
o
instanceof
BaseNo
)
{
}
else
if
(
o
instanceof
BaseNo
)
{
backupSpareNo
=
DeepCopyUtil
.
deepCopy
((
SpareNo
)
o
);
backupSpareNo
=
DeepCopyUtil
.
deepCopy
((
SpareNo
)
o
);
}
else
if
(
o
instanceof
StoragePos
)
{
}
else
if
(
o
instanceof
StoragePos
)
{
backupPos
=
DeepCopyUtil
.
deepCopy
((
StoragePos
)
o
);
backupPos
=
DeepCopyUtil
.
deepCopy
((
StoragePos
)
o
);
}
}
}
}
...
@@ -321,27 +258,27 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
...
@@ -321,27 +258,27 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
if
(
ObjectUtil
.
isNotEmpty
(
backupBarcodes
))
{
if
(
ObjectUtil
.
isNotEmpty
(
backupBarcodes
))
{
for
(
Barcode
backupBarcode
:
backupBarcodes
)
{
for
(
Barcode
backupBarcode
:
backupBarcodes
)
{
barcodeManager
.
save
(
backupBarcode
);
barcodeManager
.
save
(
backupBarcode
);
log
.
info
(
String
.
format
(
"条码[%s]回滚为"
+
backupBarcode
,
backupBarcode
.
getBarcode
()));
log
.
info
(
String
.
format
(
"条码[%s]回滚为"
+
backupBarcode
,
backupBarcode
.
getBarcode
()));
}
}
}
}
if
(
ObjectUtil
.
isNotNull
(
backupSpareNo
))
{
if
(
ObjectUtil
.
isNotNull
(
backupSpareNo
))
{
if
(
backupSpareNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
if
(
backupSpareNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
spareNoCache
.
addToMap
((
SpareNo
)
backupSpareNo
);
spareNoCache
.
addToMap
((
SpareNo
)
backupSpareNo
);
spareNoManager
.
save
((
SpareNo
)
backupSpareNo
);
spareNoManager
.
save
((
SpareNo
)
backupSpareNo
);
log
.
info
(
String
.
format
(
"入库单[%s]回滚为"
+
backupSpareNo
,
backupSpareNo
.
getNo
()));
log
.
info
(
String
.
format
(
"入库单[%s]回滚为"
+
backupSpareNo
,
backupSpareNo
.
getNo
()));
}
else
{
}
else
{
returnNoCache
.
addToMap
((
ReturnInventoryNo
)
backupSpareNo
);
returnNoCache
.
addToMap
((
ReturnInventoryNo
)
backupSpareNo
);
returnNoManager
.
save
((
ReturnInventoryNo
)
backupSpareNo
);
returnNoManager
.
save
((
ReturnInventoryNo
)
backupSpareNo
);
log
.
info
(
String
.
format
(
"退库单[%s]回滚为"
+
backupSpareNo
,
backupSpareNo
.
getNo
()));
log
.
info
(
String
.
format
(
"退库单[%s]回滚为"
+
backupSpareNo
,
backupSpareNo
.
getNo
()));
}
}
}
}
if
(
ObjectUtil
.
isNotNull
(
backupPos
))
{
if
(
ObjectUtil
.
isNotNull
(
backupPos
))
{
storagePosManager
.
save
(
backupPos
);
storagePosManager
.
save
(
backupPos
);
log
.
info
(
String
.
format
(
"库位[%s]回滚为"
+
backupPos
,
backupPos
.
getPosName
()));
log
.
info
(
String
.
format
(
"库位[%s]回滚为"
+
backupPos
,
backupPos
.
getPosName
()));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"回滚失败,失败原因:"
+
e
.
getMessage
());
throw
new
Exception
(
"回滚失败,失败原因:"
+
e
.
getMessage
());
}
finally
{
}
finally
{
backupBarcodes
=
new
ArrayList
<>();
backupBarcodes
=
new
ArrayList
<>();
backupPos
=
null
;
backupPos
=
null
;
backupSpareNo
=
null
;
backupSpareNo
=
null
;
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
查看文件 @
1982696
...
@@ -125,27 +125,32 @@ public class SpBoxUtil {
...
@@ -125,27 +125,32 @@ public class SpBoxUtil {
int
max
=
barcode
.
getMaxSubNum
();
int
max
=
barcode
.
getMaxSubNum
();
for
(
int
i
=
1
;
i
<=
max
;
i
++)
{
for
(
int
i
=
1
;
i
<=
max
;
i
++)
{
List
<
Object
>
par
=
new
ArrayList
<>();
List
<
Object
>
par
=
new
ArrayList
<>();
String
materialBarcode
=
boxStr
+
"-0"
+
i
;
String
gekouCode
=
boxStr
+
"-"
+
i
;
String
partNumber
=
getPartNumber
(
subCodeList
,
materialBarcode
);
// String partNumber = getPartNumber(subCodeList, materialBarcode);
Barcode
gekou
=
barcode
.
getSubCodeByGeKou
(
gekouCode
);
SpareNoDetail
activeDetail
=
null
;
SpareNoDetail
activeDetail
=
null
;
if
(
gekou
!=
null
){
if
(
ObjectUtil
.
isNotNull
(
activeDetails
))
{
if
(
ObjectUtil
.
isNotNull
(
activeDetails
))
{
List
<
SpareNoDetail
>
spareNoDetails
=
activeDetails
.
stream
()
List
<
SpareNoDetail
>
spareNoDetails
=
activeDetails
.
stream
()
.
filter
(
spareNoDetail
->
spareNoDetail
.
getPartno
().
equals
(
partNumber
))
.
filter
(
spareNoDetail
->
spareNoDetail
.
getPartno
().
equals
(
gekou
.
getPartNumber
()
))
.
limit
(
1
)
.
limit
(
1
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(!
spareNoDetails
.
isEmpty
())
{
if
(!
spareNoDetails
.
isEmpty
())
{
activeDetail
=
spareNoDetails
.
get
(
0
);
activeDetail
=
spareNoDetails
.
get
(
0
);
}
}
}
}
}
//待领取
//待领取
if
(
ObjectUtil
.
isNull
(
activeDetail
))
{
if
(
ObjectUtil
.
isNull
(
activeDetail
))
{
par
.
add
(
0
);
par
.
add
(
0
);
}
else
{
}
else
{
par
.
add
(
activeDetail
.
getInQty
());
// 该pn总共需要的数量
par
.
add
(
activeDetail
.
getInQty
());
// 该pn总共需要的数量
}
}
par
.
add
(
ge
tAmount
(
subCodeList
,
materialBarcode
));
//数量
par
.
add
(
ge
kou
==
null
?
0
:
gekou
.
getAmount
(
));
//数量
par
.
add
(
i
);
//隔口号
par
.
add
(
i
);
//隔口号
par
.
add
(
partNumber
);
//料号
par
.
add
(
gekou
==
null
?
""
:
gekou
.
getPartNumber
()
);
//料号
if
(
ObjectUtil
.
isNull
(
activeDetail
))
{
if
(
ObjectUtil
.
isNull
(
activeDetail
))
{
par
.
add
(
0
);
par
.
add
(
0
);
}
else
{
}
else
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
查看文件 @
1982696
...
@@ -13,8 +13,11 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
...
@@ -13,8 +13,11 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
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.result.GetSpareNoDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoResult
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.GetSpareNoResult
;
import
com.neotel.smfcore.custom.luxsan_sp.api.bean.result.SpareInHourseDetail
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.BaseNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.BaseNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.ReturnInventoryNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.ReturnInventoryNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNo
;
import
com.neotel.smfcore.custom.luxsan_sp.bean.SpareNo
;
...
@@ -203,7 +206,7 @@ public class SpareNoCache {
...
@@ -203,7 +206,7 @@ public class SpareNoCache {
boxBarcode
.
getSubCodeList
())
{
boxBarcode
.
getSubCodeList
())
{
if
(
subBarcode
.
getPartNumber
().
equals
(
pn
))
{
if
(
subBarcode
.
getPartNumber
().
equals
(
pn
))
{
subBarcode
.
setOut
(
false
);
subBarcode
.
setOut
(
false
);
subBarcode
.
update
ExtraData
(
"needInNum"
,
detail
.
getInQty
()
+
""
);
subBarcode
.
update
NeedInNum
(
detail
.
getInQty
()
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",查找到库位号="
+
pos
.
getPosName
()
+
",料箱号="
+
boxBarcode
.
getBarcode
()
+
",格口号="
+
subBarcode
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",查找到库位号="
+
pos
.
getPosName
()
+
",料箱号="
+
boxBarcode
.
getBarcode
()
+
",格口号="
+
subBarcode
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
}
}
}
}
...
@@ -227,7 +230,7 @@ public class SpareNoCache {
...
@@ -227,7 +230,7 @@ public class SpareNoCache {
newPn
.
setAmount
(
0
);
newPn
.
setAmount
(
0
);
newPn
.
setInitialAmount
(
0
);
newPn
.
setInitialAmount
(
0
);
newPn
.
setOut
(
false
);
newPn
.
setOut
(
false
);
newPn
.
update
ExtraData
(
"needInNum"
,
detail
.
getInQty
()
+
""
);
newPn
.
update
NeedInNum
(
detail
.
getInQty
()
);
//查找准备出库的料箱中是否有空格口
//查找准备出库的料箱中是否有空格口
StoragePos
emptyPos
=
null
;
StoragePos
emptyPos
=
null
;
for
(
StoragePos
exPos
:
for
(
StoragePos
exPos
:
...
@@ -334,4 +337,83 @@ public class SpareNoCache {
...
@@ -334,4 +337,83 @@ public class SpareNoCache {
}
}
public
String
reelPutEnd
(
BaseNo
baseNo
,
String
pn
,
int
qty
,
String
posName
)
{
String
msg
=
""
;
if
(
baseNo
==
null
)
{
return
msg
;
}
List
<
SpareNoDetail
>
detailList
=
baseNo
.
getDetailList
();
SpareNoDetail
spareNoDetail
=
null
;
for
(
SpareNoDetail
detail
:
detailList
)
{
//如果相同的话,判断数量是否大于需求数量
if
(
detail
.
getPartno
().
equals
(
pn
))
{
spareNoDetail
=
detail
;
break
;
}
}
if
(
spareNoDetail
==
null
)
{
return
""
;
}
boolean
finish
=
true
;
//数量加
spareNoDetail
.
setAlrInQty
(
spareNoDetail
.
getAlrInQty
()
+
qty
);
spareNoDetail
.
setLocation
(
posName
);
baseNo
.
updateDetailList
(
spareNoDetail
);
log
.
info
(
"开始判断是否完成入库单"
);
for
(
SpareNoDetail
noDetail
:
baseNo
.
getDetailList
())
{
if
(
noDetail
.
getInQty
()
>
noDetail
.
getAlrInQty
())
{
log
.
info
(
"入库未完成"
);
finish
=
false
;
break
;
}
log
.
info
(
"入料noDetail.getInQty()"
+
noDetail
.
getInQty
()
+
"noDetail.getAlrInQty()"
+
noDetail
.
getAlrInQty
());
}
// 最后刷新不能回滚的
try
{
if
(
finish
)
{
// 调用入库接口
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
// dataLog.setSourceId(baseNo.getId());
// dataLog.setSourceName(spareNo.getSpareNo());
((
SpareNo
)
baseNo
).
setStatus
(
SpareNostatus
.
CLOSE_STATUS
+
""
);
((
SpareNo
)
baseNo
).
setConfirmed
(
false
);
log
.
info
(
"入库单已完成,关闭入库单"
+
baseNo
.
getNo
());
List
<
SpareInHourseDetail
>
details
=
new
ArrayList
<>();
for
(
SpareNoDetail
detail
:
baseNo
.
getDetailList
())
{
SpareInHourseDetail
spareInHourseDetail
=
new
SpareInHourseDetail
();
spareInHourseDetail
.
setInQty
(
detail
.
getInQty
());
spareInHourseDetail
.
setPartno
(
detail
.
getPartno
());
// String location = boxStr;
// String location = SpareNostatus.LOCATION_CODE.get(baseNo.getWhCode());
spareInHourseDetail
.
setLocationCode
(
detail
.
getLocation
());
details
.
add
(
spareInHourseDetail
);
}
LuxsanSpApi
.
spareInHourse
(
new
SpareInHourseRequest
(
baseNo
.
getDeptId
(),
baseNo
.
getNo
(),
baseNo
.
getWhCode
(),
details
));
((
SpareNo
)
baseNo
).
setConfirmed
(
true
);
log
.
info
(
"入库单通知API成功,更改状态为已确认:"
+
baseNo
.
getNo
());
}
}
}
catch
(
Exception
e
)
{
log
.
info
(
"调用入库接口失败,失败原因"
+
e
.
getMessage
());
msg
=
e
.
getMessage
();
throw
e
;
}
finally
{
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
addToMap
((
SpareNo
)
baseNo
);
spareNoManager
.
save
((
SpareNo
)
baseNo
);
}
else
{
returnNoCache
.
addToMap
((
ReturnInventoryNo
)
baseNo
);
returnNoManager
.
save
((
ReturnInventoryNo
)
baseNo
);
}
}
return
msg
;
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论