Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 42452084
由
sunke
编写于
2022-11-10 09:38:54 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
感应料架第一盘未入库时扫第二盘自动取消第一盘的入库任务
物料分组出库时,如果库位已有任务,忽略
1 个父辈
d08b3718
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
33 行增加
和
30 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/LineBoxHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialController.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/LineBoxHandler.java
查看文件 @
4245208
...
...
@@ -15,13 +15,13 @@ public class LineBoxHandler extends BaseDeviceHandler {
@Override
public
StatusBean
handleClientRequest
(
StatusBean
statusBean
,
HttpServletRequest
request
)
{
statusBean
.
setClientIp
(
request
.
getRemoteHost
());
String
cid
=
statusBean
.
getCid
();
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
)
{
log
.
error
(
"料仓cid: ["
+
cid
+
"]不存在"
);
return
null
;
}
statusBean
.
setClientIp
(
request
.
getRemoteHost
());
handleMsg
(
statusBean
);
statusBean
=
saveAlarmAndHumidity
(
statusBean
);
statusBean
=
handleInOutFinished
(
statusBean
);
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
查看文件 @
4245208
...
...
@@ -82,12 +82,14 @@ public class NLPShelfHandler extends BaseDeviceHandler {
for
(
DataLog
queueTask
:
queueTasks
)
{
if
(
queueTask
.
isPutInTask
()
&&
(
queueTask
.
isWait
()
||
queueTask
.
isExecuting
()))
{
if
(!
Strings
.
isNullOrEmpty
(
groupId
)
&&
queueTask
.
getGroupId
().
equals
(
groupId
))
{
log
.
info
(
"codeIn ["
+
code
+
"]["
+
groupId
+
"]入库失败:条码["
+
queueTask
.
getBarcode
()
+
"]的任务还未结束 "
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.unfinished"
,
"the task of [{0}] is unfinished"
,
new
String
[]{
queueTask
.
getBarcode
()});
log
.
info
(
"codeIn ["
+
code
+
"]["
+
groupId
+
"]入库时取消条码["
+
queueTask
.
getBarcode
()
+
"]的未完成入库任务"
);
//return ResultBean.newErrorResult(-1,"smfcore.unfinished","the task of [{0}] is unfinished",new String[]{queueTask.getBarcode()});
taskService
.
cancelTask
(
queueTask
.
getId
());
}
if
(!
Strings
.
isNullOrEmpty
(
storageId
)
&&
queueTask
.
getStorageId
().
equals
(
storageId
))
{
log
.
info
(
"codeIn ["
+
code
+
"]["
+
storageId
+
"]入库失败:料架["
+
queueTask
.
getStorageId
()
+
"]的任务还未结束 "
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.unfinished"
,
"the task of [{0}] is unfinished"
,
new
String
[]{
queueTask
.
getStorageName
()});
log
.
info
(
"codeIn ["
+
code
+
"]["
+
storageId
+
"]入库时取消料架["
+
queueTask
.
getStorageId
()
+
"]的未完成入库任务"
);
//return ResultBean.newErrorResult(-1,"smfcore.unfinished","the task of [{0}] is unfinished",new String[]{queueTask.getStorageName()});
taskService
.
cancelTask
(
queueTask
.
getId
());
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialController.java
查看文件 @
4245208
...
...
@@ -273,19 +273,21 @@ public class MaterialController {
}
for
(
String
posId
:
posIds
)
{
StoragePos
pos
=
storagePosManager
.
get
(
posId
);
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"posId"
,
posId
});
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
}
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
String
outResult
=
taskService
.
checkout
(
storage
,
pos
,
true
,
SecurityUtils
.
getCurrentUsername
());
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
throw
new
ValidateException
(
"smfcore.error"
,
outResult
);
try
{
StoragePos
pos
=
storagePosManager
.
get
(
posId
);
if
(
pos
!=
null
)
{
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
log
.
error
(
"storageId["
+
pos
.
getStorageId
()+
"]不存在,忽略posId="
+
posId
+
"的任务"
);
}
else
{
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
taskService
.
checkout
(
storage
,
pos
,
true
,
SecurityUtils
.
getCurrentUsername
());
}
}
else
{
log
.
error
(
"posId["
+
posId
+
"]不存在,忽略posId="
+
posId
+
"的任务"
);
}
}
catch
(
Exception
e
){
log
.
error
(
"标签出库库位"
+
posId
+
"时出错"
+
e
.
getMessage
());
}
}
}
else
{
...
...
@@ -296,24 +298,23 @@ public class MaterialController {
List
<
StoragePos
>
posList
=
storagePosManager
.
findByQuery
(
query
);
if
(
posList
.
size
()
<=
0
)
{
//未找到出库信息
throw
new
ValidateException
(
"smfcore.label.noReel"
,
"
未找到可出库的物料"
);
log
.
info
(
"出库标签["
+
labelId
+
"]时
未找到可出库的物料"
);
}
for
(
StoragePos
pos
:
posList
)
{
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
for
(
StoragePos
pos
:
posList
)
{
try
{
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
log
.
error
(
"storageId["
+
pos
.
getStorageId
()+
"]不存在,忽略posId="
+
pos
.
getId
()+
"的任务"
);
}
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
taskService
.
checkout
(
storage
,
pos
,
true
,
SecurityUtils
.
getCurrentUsername
());
}
catch
(
Exception
e
){
log
.
error
(
"标签出库库位"
+
pos
.
getPosName
()+
"时出错"
+
e
.
getMessage
());
}
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
String
outResult
=
taskService
.
checkout
(
storage
,
pos
,
true
,
SecurityUtils
.
getCurrentUsername
());
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
throw
new
ValidateException
(
"smfcore.error"
,
outResult
);
}
}
}
return
ResultBean
.
newOkResult
(
"ok"
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论