Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1926b14b
由
zshaohui
编写于
2023-03-07 11:04:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.线外扫码入库,直接完成任务状态
2.盘点功能优化
1 个父辈
d177a906
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
35 行增加
和
11 行删除
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/InventoryController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/InventoryController.java
查看文件 @
1926b14
...
...
@@ -107,13 +107,23 @@ public class InventoryController {
public
ResultBean
getInventoryInfo
()
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
int
inventoryCount
=
0
;
int
count
=
storagePosManager
.
countByQuery
(
new
Query
());
String
storageId
=
""
;
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
if
(!
storage
.
isVirtual
()){
storageId
=
storage
.
getId
();
break
;
}
}
int
count
=
storagePosManager
.
countByQuery
(
new
Query
(
Criteria
.
where
(
"storageId"
).
is
(
storageId
)));
Long
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
);
if
(
inventoryBatch
!=
null
)
{
inventoryCount
=
inventoryDataManager
.
countByQuery
(
new
Query
(
Criteria
.
where
(
"inventoryBatch"
).
is
(
inventoryBatch
).
and
(
"status"
).
is
(
InventoryStatus
.
FINISHED
.
name
())));
}
resultMap
.
put
(
"inventoryCount"
,
inventoryCount
);
resultMap
.
put
(
"count"
,
count
);
resultMap
.
put
(
"inventoryBatch"
,
inventoryBatch
==
-
1
?
""
:
inventoryBatch
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
...
...
@@ -127,10 +137,11 @@ public class InventoryController {
@AnonymousAccess
public
ResultBean
inventoryStart
()
{
Long
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
);
if
(
inventoryBatch
==
null
)
{
if
(
inventoryBatch
==
null
||
inventoryBatch
==
-
1
)
{
inventoryBatch
=
System
.
currentTimeMillis
();
dataCache
.
updateCache
(
INVENTORY_DATA
,
inventoryBatch
);
}
log
.
info
(
SecurityUtils
.
getCurrentUsername
()
+
"开始盘点,批次为:"
+
inventoryBatch
);
return
ResultBean
.
newOkResult
(
"盘点批次为:"
+
inventoryBatch
);
}
...
...
@@ -176,7 +187,7 @@ public class InventoryController {
}
}
}
dataCache
.
updateCache
(
INVENTORY_DATA
,
nul
l
);
dataCache
.
updateCache
(
INVENTORY_DATA
,
-
1
l
);
return
ResultBean
.
newOkResult
(
""
);
}
...
...
@@ -188,7 +199,7 @@ public class InventoryController {
*/
@RequestMapping
(
"/getStoragePosData"
)
@AnonymousAccess
public
Map
<
String
,
List
<
StoragePosDto
>
>
getStoragePosData
(
String
posName
)
{
public
List
<
StoragePosDto
>
getStoragePosData
(
String
posName
)
{
Map
<
String
,
List
<
StoragePosDto
>>
resultMap
=
new
HashMap
<>();
List
<
Storage
>
storageList
=
new
ArrayList
<>();
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
...
...
@@ -218,9 +229,10 @@ public class InventoryController {
}
}
}
resultMap
.
put
(
storage
.
getName
(),
storagePosMapper
.
toDto
(
storagePosList
));
storagePosList
=
storagePosList
.
stream
().
sorted
(
Comparator
.
comparing
(
StoragePos
::
getPosName
)).
collect
(
Collectors
.
toList
());
return
storagePosMapper
.
toDto
(
storagePosList
);
}
return
resultMap
;
return
new
ArrayList
<>()
;
}
...
...
@@ -451,8 +463,8 @@ public class InventoryController {
String
boxStr
=
BoxUtil
.
getBoxStr
(
currentRfid
);
//判断当前料箱是否为要盘点的料箱
Barcode
boxBarcode
=
barcodeManager
.
findByBarcode
(
boxStr
);
if
(
boxBarcode
==
null
||
!
boxBarcode
.
isInventory
()){
return
boxStr
+
"不是要盘点的料箱"
;
if
(
boxBarcode
==
null
||
!
boxBarcode
.
isInventory
())
{
return
boxStr
+
"不是要盘点的料箱"
;
}
Barcode
barcode
=
codeBean
.
getBarcode
();
//判断是否在料箱中
...
...
@@ -467,7 +479,7 @@ public class InventoryController {
//开始查询盘点数据
//盘点批次
Long
inventoryBatch
=
dataCache
.
getCache
(
INVENTORY_DATA
);
if
(
inventoryBatch
==
null
)
{
if
(
inventoryBatch
==
null
)
{
inventoryBatch
=
-
1
l
;
}
InventoryData
data
=
inventoryDataManager
.
findOne
(
new
Query
(
Criteria
.
where
(
"inventoryBatch"
).
is
(
inventoryBatch
).
and
(
"boxPartition"
).
is
(
posName
)));
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
查看文件 @
1926b14
...
...
@@ -436,6 +436,7 @@ public class OutLineController {
}
}
resultBean
.
setData
(
getBoxInfo
(
boxStr
));
finishVirtualTask
(
boxStr
);
if
(
hasBrand
)
{
resultBean
.
setCode
(
3
);
return
resultBean
;
...
...
@@ -502,6 +503,7 @@ public class OutLineController {
//}
}
resultBean
.
setData
(
getBoxInfo
(
boxStr
));
finishVirtualTask
(
boxStr
);
if
(
hasBrand
)
{
resultBean
.
setCode
(
3
);
return
resultBean
;
...
...
@@ -650,6 +652,7 @@ public class OutLineController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不需要出库"
);
}
resultBean
.
setData
(
getBoxInfo
(
boxStr
));
finishVirtualTask
(
boxStr
);
if
(
hasBrand
)
{
log
.
info
(
"hasBrand--"
+
hasBrand
);
resultBean
.
setCode
(
3
);
...
...
@@ -663,6 +666,7 @@ public class OutLineController {
//任务取消
else
if
(
INOUT_TYPE
.
CANCEL_ONE
.
name
().
equals
(
inoutType
))
{
finishVirtualTask
(
boxStr
);
//根据箱子号 找到barcode
Barcode
pidBarcode
=
barcodeManager
.
findByBarcode
(
boxStr
);
//判断是否有要出库的任务,给取消掉
...
...
@@ -759,6 +763,16 @@ public class OutLineController {
String
code
=
paramMap
.
get
(
"code"
);
//code = getBoxStrbyBoxPartition(code);
//判断是否有出库任务,如果有就完成
Map
<
String
,
Object
>
resultMap
=
getBoxInfo
(
code
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
/**
* 虚拟仓任务完成
* @param code
*/
private
void
finishVirtualTask
(
String
code
)
{
DataLog
task
=
null
;
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
for
(
DataLog
queueTask
:
queueTasks
)
{
...
...
@@ -789,8 +803,6 @@ public class OutLineController {
}
}
}
Map
<
String
,
Object
>
resultMap
=
getBoxInfo
(
code
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论