Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a6d2d05d
由
zshaohui
编写于
2023-03-09 14:15:07 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
盘点数据优化
bug修改
1 个父辈
6fb330ee
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
86 行增加
和
42 行删除
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/bean/InventoryData.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/InventoryController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/util/BoxUtil.java
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
查看文件 @
a6d2d05
...
@@ -558,9 +558,12 @@ public class BarcodeRule {
...
@@ -558,9 +558,12 @@ public class BarcodeRule {
}
}
if
(
batch_item
.
hasThisField
()){
if
(
batch_item
.
hasThisField
()){
String
batch
=
batch_item
.
getStrValue
(
codeArr
);
String
batch
=
batch_item
.
getStrValue
(
codeArr
);
if
(
batch
.
indexOf
(
"-"
)
!=
-
1
){
if
(
batch
.
indexOf
(
"-"
)
==
-
1
){
batch
=
batch
.
substring
(
0
,
batch
.
lastIndexOf
(
"-"
));
log
.
info
(
"条码解析失败,BATCH字段不合规则"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"BATCH"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
}
}
batch
=
batch
.
substring
(
0
,
batch
.
lastIndexOf
(
"-"
));
b
.
setBatch
(
batch
);
b
.
setBatch
(
batch
);
}
}
int
quantity
=
0
;
int
quantity
=
0
;
...
@@ -612,9 +615,12 @@ public class BarcodeRule {
...
@@ -612,9 +615,12 @@ public class BarcodeRule {
if
(
dateCode_item
.
hasThisField
()){
if
(
dateCode_item
.
hasThisField
()){
String
dateCode
=
dateCode_item
.
getStrValue
(
codeArr
);
String
dateCode
=
dateCode_item
.
getStrValue
(
codeArr
);
if
(
dateCode
.
indexOf
(
"-"
)
!=
-
1
){
if
(
dateCode
.
indexOf
(
"-"
)
==
-
1
){
dateCode
=
dateCode
.
substring
(
dateCode
.
lastIndexOf
(
"-"
)+
1
);
log
.
info
(
"条码解析失败,DATECODE字段不合规则"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"DATECODE"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
}
}
dateCode
=
dateCode
.
substring
(
dateCode
.
lastIndexOf
(
"-"
)+
1
);
b
.
setDateCode
(
dateCode
);
b
.
setDateCode
(
dateCode
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
a6d2d05
...
@@ -365,6 +365,7 @@ public class DeviceController {
...
@@ -365,6 +365,7 @@ public class DeviceController {
for
(
ReelLockPosInfo
lockPosInfo
:
copyList
)
{
for
(
ReelLockPosInfo
lockPosInfo
:
copyList
)
{
if
(
System
.
currentTimeMillis
()
-
lockPosInfo
.
getCreateDate
().
getTime
()
>=
1000
*
60
*
60
)
{
if
(
System
.
currentTimeMillis
()
-
lockPosInfo
.
getCreateDate
().
getTime
()
>=
1000
*
60
*
60
)
{
ReelLockPosUtil
.
removeReelLockPosInfo
(
lockPosInfo
.
getBarcode
());
ReelLockPosUtil
.
removeReelLockPosInfo
(
lockPosInfo
.
getBarcode
());
log
.
info
(
lockPosInfo
.
getBarcode
()+
"锁定时间超过1小时,解除锁定:"
+
lockPosInfo
.
getCreateDate
());
}
}
}
}
return
resultMap
;
return
resultMap
;
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/bean/InventoryData.java
查看文件 @
a6d2d05
...
@@ -15,6 +15,11 @@ import java.util.List;
...
@@ -15,6 +15,11 @@ import java.util.List;
public
class
InventoryData
extends
BasePo
{
public
class
InventoryData
extends
BasePo
{
/**
/**
* 原始库位
*/
private
String
oriPosName
;
/**
* 料箱号
* 料箱号
*/
*/
private
String
box
;
private
String
box
;
...
@@ -77,13 +82,17 @@ public class InventoryData extends BasePo {
...
@@ -77,13 +82,17 @@ public class InventoryData extends BasePo {
/**
/**
* 盘点批次
* 盘点批次
*/
*/
private
Lo
ng
inventoryBatch
;
private
Stri
ng
inventoryBatch
;
/**
/**
* 盘点的barcode集合
* 盘点的barcode集合
*/
*/
private
List
<
Barcode
>
barcodeList
;
private
List
<
Barcode
>
barcodeList
;
/**
* 是否需要盘点,默认false
*/
private
boolean
needInventory
=
false
;
public
synchronized
void
updateBarcodeList
(
Barcode
barcode
)
{
public
synchronized
void
updateBarcodeList
(
Barcode
barcode
)
{
if
(
barcodeList
==
null
)
{
if
(
barcodeList
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/InventoryController.java
查看文件 @
a6d2d05
...
@@ -4,10 +4,7 @@ import com.google.common.collect.Lists;
...
@@ -4,10 +4,7 @@ import com.google.common.collect.Lists;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
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.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.*
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
...
@@ -109,7 +106,7 @@ public class InventoryController {
...
@@ -109,7 +106,7 @@ public class InventoryController {
int
inventoryCount
=
0
;
int
inventoryCount
=
0
;
String
storageId
=
""
;
String
storageId
=
""
;
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
if
(!
storage
.
isVirtual
()){
if
(!
storage
.
isVirtual
())
{
storageId
=
storage
.
getId
();
storageId
=
storage
.
getId
();
break
;
break
;
}
}
...
@@ -117,13 +114,13 @@ public class InventoryController {
...
@@ -117,13 +114,13 @@ public class InventoryController {
int
count
=
storagePosManager
.
countByQuery
(
new
Query
(
Criteria
.
where
(
"storageId"
).
is
(
storageId
)));
int
count
=
storagePosManager
.
countByQuery
(
new
Query
(
Criteria
.
where
(
"storageId"
).
is
(
storageId
)));
Long
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
;
String
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
+
""
;
if
(
inventoryBatch
!=
null
)
{
if
(
inventoryBatch
!=
null
)
{
inventoryCount
=
inventoryDataManager
.
countByQuery
(
new
Query
(
Criteria
.
where
(
"inventoryBatch"
).
is
(
inventoryBatch
).
and
(
"status"
).
is
(
InventoryStatus
.
FINISHED
.
name
())));
inventoryCount
=
inventoryDataManager
.
countByQuery
(
new
Query
(
Criteria
.
where
(
"inventoryBatch"
).
is
(
inventoryBatch
).
and
(
"status"
).
is
(
InventoryStatus
.
FINISHED
.
name
())));
}
}
resultMap
.
put
(
"inventoryCount"
,
inventoryCount
);
resultMap
.
put
(
"inventoryCount"
,
inventoryCount
);
resultMap
.
put
(
"count"
,
count
);
resultMap
.
put
(
"count"
,
count
);
resultMap
.
put
(
"inventoryBatch"
,
inventoryBatch
==
-
1
?
""
:
inventoryBatch
);
resultMap
.
put
(
"inventoryBatch"
,
StringUtils
.
isBlank
(
inventoryBatch
)
||
"-1"
.
equals
(
inventoryBatch
)
?
""
:
inventoryBatch
);
return
ResultBean
.
newOkResult
(
resultMap
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
}
...
@@ -136,9 +133,9 @@ public class InventoryController {
...
@@ -136,9 +133,9 @@ public class InventoryController {
@RequestMapping
(
"/inventoryStart"
)
@RequestMapping
(
"/inventoryStart"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
inventoryStart
()
{
public
ResultBean
inventoryStart
()
{
Long
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
;
String
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
+
""
;
if
(
inventoryBatch
==
null
||
inventoryBatch
==
-
1
)
{
if
(
StringUtils
.
isBlank
(
inventoryBatch
)
||
"-1"
.
equals
(
inventoryBatch
)
)
{
inventoryBatch
=
System
.
currentTimeMillis
(
);
inventoryBatch
=
DateUtil
.
toDateString
(
System
.
currentTimeMillis
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
dataCache
.
updateCache
(
INVENTORY_DATA
,
inventoryBatch
);
dataCache
.
updateCache
(
INVENTORY_DATA
,
inventoryBatch
);
}
}
log
.
info
(
SecurityUtils
.
getCurrentUsername
()
+
"开始盘点,批次为:"
+
inventoryBatch
);
log
.
info
(
SecurityUtils
.
getCurrentUsername
()
+
"开始盘点,批次为:"
+
inventoryBatch
);
...
@@ -155,8 +152,8 @@ public class InventoryController {
...
@@ -155,8 +152,8 @@ public class InventoryController {
@RequestMapping
(
"/inventoryEnd"
)
@RequestMapping
(
"/inventoryEnd"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
inventoryEnd
(
int
type
)
{
public
ResultBean
inventoryEnd
(
int
type
)
{
Long
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
;
String
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
+
""
;
if
(
inventoryBatch
==
null
)
{
if
(
StringUtils
.
isBlank
(
inventoryBatch
)
||
"-1"
.
equals
(
inventoryBatch
)
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"当前没有要盘点的批次"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"当前没有要盘点的批次"
);
}
}
//根据批次查询所有的盘点数据
//根据批次查询所有的盘点数据
...
@@ -200,14 +197,13 @@ public class InventoryController {
...
@@ -200,14 +197,13 @@ public class InventoryController {
@RequestMapping
(
"/getStoragePosData"
)
@RequestMapping
(
"/getStoragePosData"
)
@AnonymousAccess
@AnonymousAccess
public
List
<
StoragePosDto
>
getStoragePosData
(
String
posName
)
{
public
List
<
StoragePosDto
>
getStoragePosData
(
String
posName
)
{
Map
<
String
,
List
<
StoragePosDto
>>
resultMap
=
new
HashMap
<>();
List
<
Storage
>
storageList
=
new
ArrayList
<>();
List
<
Storage
>
storageList
=
new
ArrayList
<>();
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
if
(!
storage
.
isVirtual
())
{
if
(!
storage
.
isVirtual
())
{
storageList
.
add
(
storage
);
storageList
.
add
(
storage
);
}
}
}
}
Long
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
;
String
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
+
""
;
//获取所有库位信息
//获取所有库位信息
for
(
Storage
storage
:
storageList
)
{
for
(
Storage
storage
:
storageList
)
{
List
<
StoragePos
>
storagePosList
=
storagePosManager
.
findByQuery
(
inventoryQuery
(
posName
,
storage
.
getId
(),
null
));
List
<
StoragePos
>
storagePosList
=
storagePosManager
.
findByQuery
(
inventoryQuery
(
posName
,
storage
.
getId
(),
null
));
...
@@ -222,14 +218,15 @@ public class InventoryController {
...
@@ -222,14 +218,15 @@ public class InventoryController {
}
}
if
(
statusList
.
contains
(
InventoryStatus
.
NEW
.
name
()))
{
if
(
statusList
.
contains
(
InventoryStatus
.
NEW
.
name
()))
{
pos
.
setInventoryStatus
(
InventoryStatus
.
NEW
.
name
());
pos
.
setInventoryStatus
(
InventoryStatus
.
NEW
.
name
());
}
else
if
(!
statusList
.
contains
(
InventoryStatus
.
NEW
.
name
())
&&
statusList
.
contains
(
InventoryStatus
.
EXECUTING
.
name
())){
}
else
if
(!
statusList
.
contains
(
InventoryStatus
.
NEW
.
name
())
&&
statusList
.
contains
(
InventoryStatus
.
EXECUTING
.
name
()))
{
pos
.
setInventoryStatus
(
InventoryStatus
.
EXECUTING
.
name
());
pos
.
setInventoryStatus
(
InventoryStatus
.
EXECUTING
.
name
());
}
else
if
(!
statusList
.
contains
(
InventoryStatus
.
NEW
.
name
())
&&
!
statusList
.
contains
(
InventoryStatus
.
EXECUTING
.
name
())){
}
else
if
(!
statusList
.
contains
(
InventoryStatus
.
NEW
.
name
())
&&
!
statusList
.
contains
(
InventoryStatus
.
EXECUTING
.
name
()))
{
pos
.
setInventoryStatus
(
InventoryStatus
.
FINISHED
.
name
());
pos
.
setInventoryStatus
(
InventoryStatus
.
FINISHED
.
name
());
}
}
}
}
}
}
}
}
storagePosDtos
=
storagePosDtos
.
stream
().
sorted
(
Comparator
.
comparing
(
StoragePosDto
::
getPosName
).
reversed
()).
collect
(
Collectors
.
toList
());
return
storagePosDtos
;
return
storagePosDtos
;
}
}
return
new
ArrayList
<>();
return
new
ArrayList
<>();
...
@@ -245,6 +242,10 @@ public class InventoryController {
...
@@ -245,6 +242,10 @@ public class InventoryController {
@RequestMapping
(
"/inventoryOut"
)
@RequestMapping
(
"/inventoryOut"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
inventoryOut
(
@RequestBody
List
<
String
>
storagePosIdList
)
{
public
ResultBean
inventoryOut
(
@RequestBody
List
<
String
>
storagePosIdList
)
{
String
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
)
+
""
;
if
(
StringUtils
.
isBlank
(
inventoryBatch
)
||
"-1"
.
equals
(
inventoryBatch
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请点击开始盘点"
);
}
if
(
storagePosIdList
==
null
||
storagePosIdList
.
isEmpty
())
{
if
(
storagePosIdList
==
null
||
storagePosIdList
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
}
...
@@ -262,19 +263,19 @@ public class InventoryController {
...
@@ -262,19 +263,19 @@ public class InventoryController {
//生成出库任务
//生成出库任务
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
dataLog
.
setType
(
OP
.
CHECKOUT
);
dataLog
.
setType
(
OP
.
CHECKOUT
);
//
dataLog.setCreator(SecurityUtils.getCurrentUsername());
dataLog
.
setCreator
(
SecurityUtils
.
getCurrentUsername
());
dataLog
.
setExtendType
(
ExtendType
.
INVENTORY_CHECKOUT
);
//盘点出库
dataLog
.
setExtendType
(
ExtendType
.
INVENTORY_CHECKOUT
);
//盘点出库
try
{
try
{
taskService
.
addTaskToExecute
(
dataLog
);
taskService
.
addTaskToExecute
(
dataLog
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"盘点出库失败:"
+
e
.
getMessage
());
log
.
error
(
"盘点出库失败:"
+
e
.
getMessage
());
continue
;
continue
;
}
}
}
//生成盘点数据
//生成盘点数据
generateInventoryData
(
barcode
,
pos
);
generateInventoryData
(
barcode
,
pos
);
}
}
}
}
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -518,7 +519,8 @@ public class InventoryController {
...
@@ -518,7 +519,8 @@ public class InventoryController {
}
}
data
.
setReelCount
(
BoxUtil
.
getPartitionCount
(
posName
,
boxBarcode
.
getSubCodeList
()));
data
.
setReelCount
(
BoxUtil
.
getPartitionCount
(
posName
,
boxBarcode
.
getSubCodeList
()));
data
.
setAmout
(
BoxUtil
.
getPartitionNum
(
posName
,
boxBarcode
.
getSubCodeList
()));
data
.
setAmout
(
BoxUtil
.
getPartitionNum
(
posName
,
boxBarcode
.
getSubCodeList
()));
data
.
setInventoryBatch
(
inventoryBatch
);
data
.
setInventoryBatch
(
inventoryBatch
+
""
);
data
.
setCreator
(
SecurityUtils
.
getCurrentUsername
());
}
}
data
.
setInventoryReelCount
(
data
.
getInventoryReelCount
()
+
1
);
data
.
setInventoryReelCount
(
data
.
getInventoryReelCount
()
+
1
);
data
.
setInventoryAmout
(
data
.
getInventoryAmout
()
+
barcode
.
getAmount
());
data
.
setInventoryAmout
(
data
.
getInventoryAmout
()
+
barcode
.
getAmount
());
...
@@ -543,40 +545,56 @@ public class InventoryController {
...
@@ -543,40 +545,56 @@ public class InventoryController {
*/
*/
private
void
generateInventoryData
(
Barcode
barcode
,
StoragePos
pos
)
{
private
void
generateInventoryData
(
Barcode
barcode
,
StoragePos
pos
)
{
//判断盘点批次是否存在
//判断盘点批次是否存在
Long
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
);
String
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
);
if
(
inventoryBatch
==
null
)
{
//获取原始库位
inventoryBatch
=
System
.
currentTimeMillis
();
String
posName
=
pos
.
getPosName
();
dataCache
.
updateCache
(
INVENTORY_DATA
,
inventoryBatch
);
String
oriPosName
=
posName
.
substring
(
0
,
posName
.
lastIndexOf
(
"-"
));
}
//开始处理数据
//开始处理数据
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
if
(
barcode
==
null
)
{
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
InventoryData
data
=
new
InventoryData
();
InventoryData
data
=
new
InventoryData
();
//料箱号
data
.
setMatch
(
true
);
data
.
setBox
(
barcode
.
getBarcode
());
data
.
setStatus
(
InventoryStatus
.
FINISHED
.
name
());
//隔口码
data
.
setNeedInventory
(
false
);
data
.
setCreator
(
SecurityUtils
.
getCurrentUsername
());
data
.
setInventoryBatch
(
inventoryBatch
);
data
.
setOriPosName
(
oriPosName
);
data
.
setPosName
(
pos
.
getPosName
());
inventoryDataManager
.
save
(
data
);
}
else
{
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
String
partition
=
getInventoryPartition
(
subCodeList
);
String
partition
=
getInventoryPartition
(
subCodeList
);
data
.
setBoxPartition
(
partition
);
String
boxStr
=
barcode
.
getBarcode
();
int
count
=
boxStr
.
startsWith
(
"CS"
)
?
8
:
2
;
//CS开头的8个隔口,其他是2个
for
(
int
i
=
1
;
i
<=
count
;
i
++)
{
String
priPartition
=
boxStr
+
"-"
+
i
;
InventoryData
data
=
new
InventoryData
();
data
.
setBoxPartition
(
priPartition
);
//料号
//料号
String
partNumber
=
BoxUtil
.
getPartitionPartNumber
(
p
artition
,
subCodeList
);
String
partNumber
=
BoxUtil
.
getPartitionPartNumber
(
priP
artition
,
subCodeList
);
data
.
setPartNumber
(
partNumber
);
data
.
setPartNumber
(
partNumber
);
//物料描述
//物料描述
data
.
setDescribe
(
""
);
data
.
setDescribe
(
""
);
//储位
//储位
data
.
setPosName
(
pos
.
getPosName
());
data
.
setPosName
(
pos
.
getPosName
());
//卷数
//卷数
int
partitionCount
=
BoxUtil
.
getPartitionCount
(
p
artition
,
subCodeList
);
int
partitionCount
=
BoxUtil
.
getPartitionCount
(
priP
artition
,
subCodeList
);
data
.
setReelCount
(
partitionCount
);
data
.
setReelCount
(
partitionCount
);
//数量
//数量
int
partitionNum
=
BoxUtil
.
getPartitionNum
(
p
artition
,
subCodeList
);
int
partitionNum
=
BoxUtil
.
getPartitionNum
(
priP
artition
,
subCodeList
);
data
.
setAmout
(
partitionNum
);
data
.
setAmout
(
partitionNum
);
//创建人
data
.
setCreator
(
SecurityUtils
.
getCurrentUsername
());
data
.
setCreator
(
SecurityUtils
.
getCurrentUsername
());
//盘点批次
data
.
setInventoryBatch
(
inventoryBatch
);
data
.
setInventoryBatch
(
inventoryBatch
);
data
.
setOriPosName
(
oriPosName
);
if
(
partition
.
equals
(
boxStr
+
"-"
+
i
))
{
data
.
setNeedInventory
(
true
);
}
else
{
data
.
setNeedInventory
(
false
);
data
.
setStatus
(
InventoryStatus
.
FINISHED
.
name
());
}
inventoryDataManager
.
save
(
data
);
inventoryDataManager
.
save
(
data
);
}
}
}
}
}
/**
/**
* 随机获取一个隔扣码进行返回
* 随机获取一个隔扣码进行返回
...
@@ -585,8 +603,12 @@ public class InventoryController {
...
@@ -585,8 +603,12 @@ public class InventoryController {
* @return
* @return
*/
*/
private
String
getInventoryPartition
(
List
<
Barcode
>
subCodeList
)
{
private
String
getInventoryPartition
(
List
<
Barcode
>
subCodeList
)
{
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
int
index
=
new
Random
().
nextInt
(
subCodeList
.
size
());
int
index
=
new
Random
().
nextInt
(
subCodeList
.
size
());
return
subCodeList
.
get
(
index
).
getPosName
();
return
subCodeList
.
get
(
index
).
getPosName
();
}
else
{
return
""
;
}
}
}
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/util/BoxUtil.java
查看文件 @
a6d2d05
...
@@ -65,9 +65,12 @@ public class BoxUtil {
...
@@ -65,9 +65,12 @@ public class BoxUtil {
* @return
* @return
*/
*/
public
static
int
getPartitionNum
(
String
partition
,
List
<
Barcode
>
subCodeList
)
{
public
static
int
getPartitionNum
(
String
partition
,
List
<
Barcode
>
subCodeList
)
{
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
int
num
=
subCodeList
.
stream
().
filter
(
item
->
partition
.
equals
(
item
.
getPosName
())).
mapToInt
(
Barcode:
:
getAmount
).
sum
();
int
num
=
subCodeList
.
stream
().
filter
(
item
->
partition
.
equals
(
item
.
getPosName
())).
mapToInt
(
Barcode:
:
getAmount
).
sum
();
return
num
;
return
num
;
}
}
return
0
;
}
/**
/**
...
@@ -97,9 +100,12 @@ public class BoxUtil {
...
@@ -97,9 +100,12 @@ public class BoxUtil {
* @return
* @return
*/
*/
public
static
int
getPartitionCount
(
String
partition
,
List
<
Barcode
>
subCodeList
)
{
public
static
int
getPartitionCount
(
String
partition
,
List
<
Barcode
>
subCodeList
)
{
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
int
partitionCount
=
(
int
)
subCodeList
.
stream
().
filter
(
item
->
partition
.
equals
(
item
.
getPosName
())).
count
();
int
partitionCount
=
(
int
)
subCodeList
.
stream
().
filter
(
item
->
partition
.
equals
(
item
.
getPosName
())).
count
();
return
partitionCount
;
return
partitionCount
;
}
}
return
0
;
}
/**
/**
* 获取隔口的信息
* 获取隔口的信息
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论