Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 444038d6
由
LN
编写于
2021-11-01 16:07:10 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
客户端发送出库完成任务时若未找到任务,清空库位。
1 个父辈
547746f8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
23 行增加
和
6 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/system/service/po/DataLog.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
444038d
package
com
.
neotel
.
smfcore
.
core
.
device
.
handler
.
impl
;
package
com
.
neotel
.
smfcore
.
core
.
device
.
handler
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
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.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
...
@@ -515,10 +518,10 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -515,10 +518,10 @@ public class BaseDeviceHandler implements IDeviceHandler {
protected
void
finishedOutPos
(
String
cid
,
String
posName
,
int
executeTime
)
throws
ValidateException
{
protected
void
finishedOutPos
(
String
cid
,
String
posName
,
int
executeTime
)
throws
ValidateException
{
DataLog
task
=
taskService
.
findExecutingTask
(
cid
,
posName
);
DataLog
task
=
taskService
.
findExecutingTask
(
cid
,
posName
);
if
(
task
!=
null
&&
task
.
isCheckOutTask
())
{
if
(
task
!=
null
&&
task
.
isCheckOutTask
())
{
if
(
executeTime
>
0
)
{
if
(
executeTime
>
0
)
{
task
.
setExecuteTime
(
executeTime
);
task
.
setExecuteTime
(
executeTime
);
}
}
log
.
info
(
task
.
getBarcode
()
+
"出仓位["
+
task
.
getPosName
()
+
"]完成,执行时间["
+
executeTime
+
"]秒"
);
log
.
info
(
task
.
getBarcode
()
+
"出仓位["
+
task
.
getPosName
()
+
"]完成,执行时间["
+
executeTime
+
"]秒"
);
DataLog
cancelTask
=
taskService
.
findFinishedTask
(
cid
,
posName
);
DataLog
cancelTask
=
taskService
.
findFinishedTask
(
cid
,
posName
);
if
(
cancelTask
!=
null
&&
cancelTask
.
isCancel
())
{
if
(
cancelTask
!=
null
&&
cancelTask
.
isCancel
())
{
//将相同库位已经取消的任务从完成队列里删除
//将相同库位已经取消的任务从完成队列里删除
...
@@ -532,14 +535,27 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -532,14 +535,27 @@ public class BaseDeviceHandler implements IDeviceHandler {
task
=
taskService
.
findFinishedTask
(
cid
,
posName
);
task
=
taskService
.
findFinishedTask
(
cid
,
posName
);
if
(
task
!=
null
&&
task
.
isCheckOutTask
())
{
if
(
task
!=
null
&&
task
.
isCheckOutTask
())
{
if
(
task
.
isCancel
())
{
//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
if
(
task
.
isCancel
())
{
//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
if
(
executeTime
>
0
)
{
if
(
executeTime
>
0
)
{
task
.
setExecuteTime
(
executeTime
);
task
.
setExecuteTime
(
executeTime
);
}
}
log
.
info
(
task
.
getBarcode
()
+
"出仓位["
+
task
.
getPosName
()
+
"]完成,但任务已被取消,修改为完成,执行时间["
+
executeTime
+
"]秒"
);
log
.
info
(
task
.
getBarcode
()
+
"出仓位["
+
task
.
getPosName
()
+
"]完成,但任务已被取消,修改为完成,执行时间["
+
executeTime
+
"]秒"
);
updateCheckoutData
(
task
);
updateCheckoutData
(
task
);
}
}
}
else
{
}
else
{
log
.
warn
(
cid
+
"出仓位["
+
posName
+
"]完成时任务不存在"
);
StoragePos
storagePos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
storagePos
!=
null
&&
storagePos
.
isUsed
())
{
String
barcode
=
storagePos
.
getBarcode
().
getBarcode
();
//查找库位是否为空,如果库位有料,调用清理手动出库的方法清理库存
if
(
ObjectUtil
.
isNotEmpty
(
barcode
))
{
log
.
info
(
cid
+
"出仓位["
+
posName
+
"]完成时任务不存在,清理库位中的库存["
+
barcode
+
"]"
);
taskService
.
addTaskToFinished
(
storagePos
,
null
,
cid
+
"-clear"
);
}
else
{
log
.
info
(
cid
+
"出仓位["
+
posName
+
"]完成时任务不存在,清理库位失败,条码为空"
);
}
}
else
{
log
.
warn
(
cid
+
"出仓位["
+
posName
+
"]完成时任务不存在"
);
}
}
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/system/service/po/DataLog.java
查看文件 @
444038d
...
@@ -274,7 +274,7 @@ public class DataLog extends BasePo implements Serializable {
...
@@ -274,7 +274,7 @@ public class DataLog extends BasePo implements Serializable {
*/
*/
public
boolean
needRemoveFromCache
(){
public
boolean
needRemoveFromCache
(){
if
(
isFinished
()
||
isCancel
()){
if
(
isFinished
()
||
isCancel
()){
if
(
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>
3
*
60
*
1000
){
if
(
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>
5
*
60
*
1000
){
return
true
;
return
true
;
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
444038d
...
@@ -207,6 +207,7 @@ public class TaskService {
...
@@ -207,6 +207,7 @@ public class TaskService {
//从正在执行和等待列表中移除
//从正在执行和等待列表中移除
removeQueueTask
(
task
);
removeQueueTask
(
task
);
task
.
setStatus
(
OP_STATUS
.
CANCEL
.
name
());
task
.
setStatus
(
OP_STATUS
.
CANCEL
.
name
());
task
.
setUpdateDate
(
new
Date
());
updateFinishedTask
(
task
);
updateFinishedTask
(
task
);
log
.
info
(
"任务["
+
task
.
getId
()
+
"] posName["
+
task
.
getPosName
()
+
"] Reel Id["
+
task
.
getBarcode
()
+
"]取消成功"
);
log
.
info
(
"任务["
+
task
.
getId
()
+
"] posName["
+
task
.
getPosName
()
+
"] Reel Id["
+
task
.
getBarcode
()
+
"]取消成功"
);
return
true
;
return
true
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论