Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 468d4c82
由
LN
编写于
2024-08-20 17:16:21 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.入库单执行时出错。
2.库存报表数量错误。
1 个父辈
7c8bc054
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
96 行增加
和
33 行删除
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/storage/bean/InventoryItem.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpAgvDeviceClientController.java
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/service/manager/impl/SpBoxPutInManagerImpl.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
468d4c8
...
@@ -735,15 +735,41 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -735,15 +735,41 @@ public class Barcode extends BasePo implements Serializable {
if
(
subCodeList
==
null
)
{
if
(
subCodeList
==
null
)
{
subCodeList
=
new
ArrayList
<>();
subCodeList
=
new
ArrayList
<>();
}
}
if
(
subCodeList
==
null
||
subCodeList
.
isEmpty
())
{
if
(
subCodeList
.
size
()<=
0
||
subCodeList
.
isEmpty
())
{
subCodeList
.
add
(
subCode
);
subCodeList
.
add
(
subCode
);
}
else
{
}
else
{
//移除
//移除
subCodeList
.
removeIf
(
t
->
t
.
getBarcode
().
equals
(
subCode
.
getBarcode
()));
subCodeList
.
removeIf
(
t
->
t
.
getBarcode
().
equals
(
subCode
.
getBarcode
()));
if
(
subCode
.
getAmount
()
>
0
){
subCodeList
.
add
(
subCode
);
subCodeList
.
add
(
subCode
);
}
}
}
subListNum
=
subCodeList
.
size
();
subListNum
=
subCodeList
.
size
();
}
}
public
String
getEmptySubName
(){
int
maxNum
=
getMaxSubNum
();
if
(
subCodeList
==
null
){
subCodeList
=
new
ArrayList
<>();
}
for
(
int
i
=
1
;
i
<=
maxNum
;
i
++
)
{
String
sName
=
barcode
+
"-"
+
i
;
boolean
has
=
false
;
for
(
Barcode
sub
:
subCodeList
)
{
if
(
sub
.
getBarcode
().
equals
(
sName
)){
has
=
true
;
break
;
}
}
if
(
has
){
continue
;
}
else
{
return
sName
;
}
}
return
""
;
}
}
}
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
468d4c8
...
@@ -580,13 +580,21 @@ public class DataCache {
...
@@ -580,13 +580,21 @@ public class DataCache {
* @param amount
* @param amount
* @return
* @return
*/
*/
public
int
updateInventoryAmount
(
String
cid
,
String
partNumber
,
int
amount
){
public
int
updateInventoryAmount
(
String
cid
,
String
partNumber
,
int
amount
,
String
pn
,
String
wcode
){
if
(
amount
!=
0
){
if
(
amount
!=
0
){
log
.
info
(
"updateInventoryAmount : cid="
+
cid
+
",pn="
+
partNumber
+
",amount="
+
amount
);
if
(
ObjectUtil
.
isEmpty
(
pn
)){
pn
=
""
;
}
if
(
ObjectUtil
.
isEmpty
(
wcode
)){
wcode
=
""
;
}
log
.
info
(
"updateInventoryAmount : cid="
+
cid
+
",pn="
+
partNumber
+
",amount="
+
amount
+
",pn="
+
pn
);
InventoryItem
inventoryItem
=
getStorageInventoryByPartNumber
(
cid
,
partNumber
);
InventoryItem
inventoryItem
=
getStorageInventoryByPartNumber
(
cid
,
partNumber
);
if
(
inventoryItem
==
null
){
if
(
inventoryItem
==
null
){
inventoryItem
=
new
InventoryItem
();
inventoryItem
=
new
InventoryItem
();
inventoryItem
.
setPartNumber
(
partNumber
);
inventoryItem
.
setPartNumber
(
partNumber
);
inventoryItem
.
setWareHouseCode
(
wcode
);
inventoryItem
.
setPartname
(
pn
);
}
}
inventoryItem
.
updateInventory
(
amount
);
inventoryItem
.
updateInventory
(
amount
);
updateStorageInventory
(
cid
,
inventoryItem
);
updateStorageInventory
(
cid
,
inventoryItem
);
...
...
src/main/java/com/neotel/smfcore/core/storage/bean/InventoryItem.java
查看文件 @
468d4c8
...
@@ -54,10 +54,19 @@ public class InventoryItem {
...
@@ -54,10 +54,19 @@ public class InventoryItem {
*/
*/
private
String
storageName
;
private
String
storageName
;
/**
* 库别
*/
private
String
wareHouseCode
;
private
String
wareHouseCode
;
private
String
posName
;
private
String
posName
;
/**
* 格口号
*/
private
String
gekouName
;
private
String
gekouName
;
/**
* 品名
*/
private
String
partname
;
private
String
partname
;
/**
/**
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
查看文件 @
468d4c8
...
@@ -842,7 +842,7 @@ public class OutLineController {
...
@@ -842,7 +842,7 @@ public class OutLineController {
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
for
(
Barcode
subCode
:
subCodeList
)
{
for
(
Barcode
subCode
:
subCodeList
)
{
dataCache
.
updateInventoryAmount
(
dataCache
.
getStorageById
(
pos
.
getStorageId
()).
getCid
(),
subCode
.
getPartNumber
(),
-
subCode
.
getAmount
());
dataCache
.
updateInventoryAmount
(
dataCache
.
getStorageById
(
pos
.
getStorageId
()).
getCid
(),
subCode
.
getPartNumber
(),
-
subCode
.
getAmount
()
,
subCode
.
getPn
(),
pos
.
getWareHouseCode
()
);
}
}
}
}
}
}
...
@@ -880,7 +880,7 @@ public class OutLineController {
...
@@ -880,7 +880,7 @@ public class OutLineController {
for
(
Barcode
subCode
:
subCodeList
)
{
for
(
Barcode
subCode
:
subCodeList
)
{
subCode
.
setStorageId
(
storage
.
getId
());
subCode
.
setStorageId
(
storage
.
getId
());
barcodeManager
.
save
(
subCode
);
barcodeManager
.
save
(
subCode
);
dataCache
.
updateInventoryAmount
(
storage
.
getCid
(),
subCode
.
getPartNumber
(),
subCode
.
getAmount
());
dataCache
.
updateInventoryAmount
(
storage
.
getCid
(),
subCode
.
getPartNumber
(),
subCode
.
getAmount
()
,
subCode
.
getPn
(),
pos
.
getWareHouseCode
()
);
}
}
}
}
barcode
.
setSubCodeList
(
subCodeList
);
barcode
.
setSubCodeList
(
subCodeList
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpAgvDeviceClientController.java
查看文件 @
468d4c8
...
@@ -412,7 +412,7 @@ public class SpAgvDeviceClientController {
...
@@ -412,7 +412,7 @@ public class SpAgvDeviceClientController {
for
(
Barcode
subCode
:
subCodes
)
{
for
(
Barcode
subCode
:
subCodes
)
{
subCode
.
setStorageId
(
storage
.
getId
());
subCode
.
setStorageId
(
storage
.
getId
());
barcodeManager
.
save
(
subCode
);
barcodeManager
.
save
(
subCode
);
dataCache
.
updateInventoryAmount
(
storage
.
getCid
(),
subCode
.
getPartNumber
(),
subCode
.
getAmount
());
dataCache
.
updateInventoryAmount
(
storage
.
getCid
(),
subCode
.
getPartNumber
(),
subCode
.
getAmount
()
,
subCode
.
getPn
(),
storagePos
.
getWareHouseCode
()
);
}
}
}
}
barcode
.
setSubCodeList
(
subCodes
);
barcode
.
setSubCodeList
(
subCodes
);
...
@@ -473,7 +473,7 @@ public class SpAgvDeviceClientController {
...
@@ -473,7 +473,7 @@ public class SpAgvDeviceClientController {
if
(
subCodes
!=
null
&&
!
subCodes
.
isEmpty
())
{
if
(
subCodes
!=
null
&&
!
subCodes
.
isEmpty
())
{
Storage
storage
=
dataCache
.
getStorageById
(
storagePos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
storagePos
.
getStorageId
());
for
(
Barcode
subCode
:
subCodes
)
{
for
(
Barcode
subCode
:
subCodes
)
{
dataCache
.
updateInventoryAmount
(
storage
.
getCid
(),
subCode
.
getPartNumber
(),
-
subCode
.
getAmount
());
dataCache
.
updateInventoryAmount
(
storage
.
getCid
(),
subCode
.
getPartNumber
(),
-
subCode
.
getAmount
()
,
subCode
.
getPn
(),
storagePos
.
getWareHouseCode
()
);
}
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxCheckOutController.java
查看文件 @
468d4c8
...
@@ -221,7 +221,7 @@ public class SpBoxCheckOutController {
...
@@ -221,7 +221,7 @@ public class SpBoxCheckOutController {
//更新库存
//更新库存
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());
if
(
liteOrder
!=
null
){
if
(
liteOrder
!=
null
){
handleOrderNo
(
liteOrder
,
gekouBarcode
.
getPartNumber
(),
taskOutNum
);
handleOrderNo
(
liteOrder
,
gekouBarcode
.
getPartNumber
(),
taskOutNum
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
查看文件 @
468d4c8
...
@@ -55,7 +55,7 @@ public class SpBoxPutInController {
...
@@ -55,7 +55,7 @@ public class SpBoxPutInController {
String
currentRfid
=
station
.
getCurrentRfid
();
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
ObjectUtil
.
isEmpty
(
currentRfid
)){
if
(
ObjectUtil
.
isEmpty
(
currentRfid
)){
if
(
LuxsanSpApi
.
Debug
){
if
(
LuxsanSpApi
.
Debug
){
currentRfid
=
"C
B0066A
"
;
currentRfid
=
"C
S9999
"
;
}
}
}
}
// log.info("getStationInfo工位上"+currentRfid);
// log.info("getStationInfo工位上"+currentRfid);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/service/manager/impl/SpBoxPutInManagerImpl.java
查看文件 @
468d4c8
...
@@ -226,7 +226,7 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
...
@@ -226,7 +226,7 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
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
());
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
查看文件 @
468d4c8
...
@@ -280,13 +280,18 @@ public class SpareNoCache {
...
@@ -280,13 +280,18 @@ public class SpareNoCache {
StoragePos
emptyPos
=
null
;
StoragePos
emptyPos
=
null
;
for
(
StoragePos
exPos
:
for
(
StoragePos
exPos
:
needOutPos
.
values
())
{
needOutPos
.
values
())
{
int
subCount
=
exPos
.
getBarcode
().
getMaxSubNum
();
// int subCount = exPos.getBarcode().getMaxSubNum();
if
(
exPos
.
getBarcode
().
getSubCodeList
().
size
()
<
subCount
)
{
// if (exPos.getBarcode().getSubCodeList().size() < subCount) {
//验证库别
// //验证库别
if
(
exPos
.
getWareHouseCode
().
equals
(
baseNo
.
getWhCode
())){
// if(exPos.getWareHouseCode().equals(baseNo.getWhCode())){
emptyPos
=
exPos
;
// emptyPos = exPos;
break
;
// break;
}
// }
// }
String
epPos
=
exPos
.
getBarcode
().
getEmptySubName
();
if
(
ObjectUtil
.
isNotEmpty
(
epPos
)){
emptyPos
=
exPos
;
break
;
}
}
}
}
...
@@ -296,17 +301,25 @@ public class SpareNoCache {
...
@@ -296,17 +301,25 @@ public class SpareNoCache {
if
(
emptyPos
!=
null
)
{
if
(
emptyPos
!=
null
)
{
//使用此格口
//使用此格口
emptyBox
=
emptyPos
.
getBarcode
();
emptyBox
=
emptyPos
.
getBarcode
();
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
emptyBox
.
getSubCodeList
().
size
());
String
emptySubPn
=
emptyBox
.
getEmptySubName
();
newPn
.
setBarcode
(
emptySubPn
);
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
// List<Barcode> subL = emptyBox.getSubCodeList();
subL
.
add
(
newPn
);
// subL.add(newPn);
emptyBox
.
setSubCodeList
(
subL
);
// emptyBox.setSubCodeList(subL);
emptyBox
.
updateSubCodes
(
newPn
);
barcodeManager
.
save
(
emptyBox
);
emptyPos
.
setBarcode
(
emptyBox
);
emptyPos
.
setBarcode
(
emptyBox
);
storagePosManager
.
save
(
emptyPos
);
needOutPos
.
put
(
emptyPos
.
getPosName
(),
emptyPos
);
needOutPos
.
put
(
emptyPos
.
getPosName
(),
emptyPos
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",使用料箱的空格口="
+
emptyPos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
",使用料箱的空格口="
+
emptyPos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
}
else
{
}
else
{
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
for
(
StoragePos
exPos
:
needOutPos
.
values
())
{
excludePosIds
.
add
(
exPos
.
getId
());
}
//寻找一个空格口
//寻找一个空格口
List
<
String
>
boxTypes
=
new
ArrayList
<>();
List
<
String
>
boxTypes
=
new
ArrayList
<>();
boxTypes
.
add
(
""
);
boxTypes
.
add
(
""
);
...
@@ -323,18 +336,25 @@ public class SpareNoCache {
...
@@ -323,18 +336,25 @@ public class SpareNoCache {
}
}
if
(
emptyPos
!=
null
)
{
if
(
emptyPos
!=
null
)
{
emptyBox
=
emptyPos
.
getBarcode
();
emptyBox
=
emptyPos
.
getBarcode
();
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
(
emptyBox
.
getSubCodeList
()
==
null
?
1
:
emptyBox
.
getSubCodeList
().
size
()));
// newPn.setBarcode(emptyBox.getBarcode() + "-" + (emptyBox.getSubCodeList() == null ? 1 : emptyBox.getSubCodeList().size()));
// newPn = barcodeManager.save(newPn);
String
emptySubPn
=
emptyBox
.
getEmptySubName
();
newPn
.
setBarcode
(
emptySubPn
);
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
// newPn = barcodeManager.save(newPn);
if
(
subL
==
null
)
{
// newPn = barcodeManager.saveBarcode(newPn);
subL
=
new
ArrayList
<>();
// List<Barcode> subL = emptyBox.getSubCodeList();
}
// if (subL == null) {
subL
.
add
(
newPn
);
// subL = new ArrayList<>();
emptyBox
.
setSubCodeList
(
subL
);
// }
// subL.add(newPn);
// emptyBox.setSubCodeList(subL);
emptyBox
.
updateSubCodes
(
newPn
);
emptyBox
.
setOut
(
false
);
emptyBox
.
setOut
(
false
);
emptyBox
.
setStatus
(
BARCODE_STATUS
.
IN_STORE
);
emptyBox
.
setStatus
(
BARCODE_STATUS
.
IN_STORE
);
barcodeManager
.
save
(
emptyBox
);
emptyPos
.
setBarcode
(
emptyBox
);
emptyPos
.
setBarcode
(
emptyBox
);
storagePosManager
.
save
(
emptyPos
);
needOutPos
.
put
(
emptyPos
.
getPosName
(),
emptyPos
);
needOutPos
.
put
(
emptyPos
.
getPosName
(),
emptyPos
);
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
","
+
type
+
"查找到有空格口料箱="
+
emptyPos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
log
.
info
(
"入库单"
+
orderNo
+
", Pn="
+
pn
+
","
+
type
+
"查找到有空格口料箱="
+
emptyPos
.
getPosName
()
+
",料箱号="
+
emptyBox
.
getBarcode
()
+
",格口号="
+
newPn
.
getBarcode
()
+
",需要入库数量="
+
detail
.
getInQty
());
...
@@ -353,7 +373,7 @@ public class SpareNoCache {
...
@@ -353,7 +373,7 @@ public class SpareNoCache {
for
(
StoragePos
pos
:
needOutPos
.
values
()
for
(
StoragePos
pos
:
needOutPos
.
values
()
)
{
)
{
Barcode
barcode
=
pos
.
getBarcode
();
Barcode
barcode
=
pos
.
getBarcode
();
log
.
info
(
"入库单"
+
orderNo
+
", 为库位="
+
pos
.
getPosName
()
+
",料箱="
+
barcode
.
getBarcode
()
+
"生成出库任务:"
+
index
);
log
.
info
(
"入库单"
+
orderNo
+
", 为库位="
+
pos
.
getPosName
()
+
",料箱="
+
barcode
.
getBarcode
()
+
"生成出库任务:"
+
(
index
+
1
)
);
pos
.
setBarcode
(
barcode
);
pos
.
setBarcode
(
barcode
);
barcodeManager
.
save
(
barcode
);
barcodeManager
.
save
(
barcode
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论