Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 86b9a1b3
由
zshaohui
编写于
2023-11-27 10:13:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.增加任务取消,屏蔽库位
2.出库传给客户端,增加inOutType字段
1 个父辈
d623991c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
45 行增加
和
1 行删除
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
86b9a1b
...
@@ -11,6 +11,7 @@ import com.neotel.smfcore.common.exception.ValidateException;
...
@@ -11,6 +11,7 @@ import com.neotel.smfcore.common.exception.ValidateException;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.Constants
;
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.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.api.bean.CodeValidateParam
;
import
com.neotel.smfcore.core.api.bean.CodeValidateParam
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
...
@@ -35,6 +36,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
...
@@ -35,6 +36,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
import
com.neotel.smfcore.security.service.manager.IGroupManager
;
import
com.neotel.smfcore.security.service.manager.IGroupManager
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -624,4 +626,44 @@ public class DeviceController {
...
@@ -624,4 +626,44 @@ public class DeviceController {
data
.
put
(
"plateH"
,
pos
.
getBarcode
().
getHeight
()
+
""
);
data
.
put
(
"plateH"
,
pos
.
getBarcode
().
getHeight
()
+
""
);
return
ResultBean
.
newOkResult
(
data
);
return
ResultBean
.
newOkResult
(
data
);
}
}
@ApiOperation
(
"取消任务,禁用库位"
)
@RequestMapping
(
value
=
"/service/store/cancelAndDisable"
)
@ResponseBody
@AnonymousAccess
public
ResultBean
cancelAndDisable
(
HttpServletRequest
request
)
{
String
posName
=
request
.
getParameter
(
"posName"
);
if
(
StringUtils
.
isNotBlank
(
posName
))
{
DataLog
task
=
null
;
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
for
(
DataLog
dataLog
:
allTasks
)
{
if
(
posName
.
equals
(
dataLog
.
getPosName
())
&&
dataLog
.
isCheckOutTask
()
&&
!
dataLog
.
isFinished
())
{
task
=
dataLog
;
break
;
}
}
if
(
task
!=
null
)
{
boolean
result
=
taskService
.
cancelTask
(
task
);
if
(
result
)
{
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
!=
null
)
{
pos
.
setEnabled
(
false
);
storagePosManager
.
save
(
pos
);
dataCache
.
updateDisablePos
(
pos
);
log
.
info
(
"任务["
+
task
.
getId
()
+
"] posName["
+
task
.
getPosName
()
+
"] Reel Id["
+
task
.
getBarcode
()
+
"]取消成功,禁用库位["
+
task
.
getPosName
()
+
"]"
);
DeviceMessageUtil
.
addEnabledPosMessage
(
pos
,
SecurityUtils
.
getCurrentUsername
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
!=
null
)
{
dataCache
.
reloadStorage
(
storage
,
""
);
}
}
return
ResultBean
.
newOkResult
(
""
);
}
}
else
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.task.notExist"
,
"Task does not exist"
);
}
}
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.cancelOutTask.fail"
,
"客户端取消入库任务[{0}]失败:{1}"
,
new
String
[]{
posName
,
""
});
}
}
}
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
86b9a1b
...
@@ -249,7 +249,7 @@ public class TaskService {
...
@@ -249,7 +249,7 @@ public class TaskService {
return
tasks
;
return
tasks
;
}
}
p
rivate
boolean
cancelTask
(
DataLog
task
)
{
p
ublic
boolean
cancelTask
(
DataLog
task
)
{
if
(
task
!=
null
)
{
if
(
task
!=
null
)
{
//从正在执行和等待列表中移除
//从正在执行和等待列表中移除
removeQueueTask
(
task
);
removeQueueTask
(
task
);
...
@@ -509,6 +509,8 @@ public class TaskService {
...
@@ -509,6 +509,8 @@ public class TaskService {
}
}
statusBean
.
addData
(
"hSerial"
,
task
.
getSourceName
());
statusBean
.
addData
(
"hSerial"
,
task
.
getSourceName
());
statusBean
.
addPosInfo
(
task
.
getBarcode
(),
posName
,
plateW
,
plateH
,
isSingleOut
);
statusBean
.
addPosInfo
(
task
.
getBarcode
(),
posName
,
plateW
,
plateH
,
isSingleOut
);
statusBean
.
addData
(
"inOutType"
,
task
.
getInOutType
());
log
.
info
(
task
.
getId
()+
"inOutType:"
+
task
.
getInOutType
());
log
.
info
(
"出库"
+
storage
.
getName
()
+
"["
+
posName
+
"]物料["
+
task
.
getBarcode
()
+
"]"
+
isSingleOut
+
"发送到客户端"
+
cid
);
log
.
info
(
"出库"
+
storage
.
getName
()
+
"["
+
posName
+
"]物料["
+
task
.
getBarcode
()
+
"]"
+
isSingleOut
+
"发送到客户端"
+
cid
);
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论