Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e36133a6
由
LN
编写于
2024-04-06 16:06:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
分配库位处理
1 个父辈
42a61a02
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
4 行删除
src/main/java/com/neotel/smfcore/common/utils/ReelLockPosUtil.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
src/main/java/com/neotel/smfcore/common/utils/ReelLockPosUtil.java
查看文件 @
e36133a
package
com
.
neotel
.
smfcore
.
common
.
utils
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -25,15 +26,15 @@ public class ReelLockPosUtil {
/**
* 料盘锁定库位信息,用于包装料分配到其他料仓
*/
private
static
Map
<
String
,
ReelLockPosInfo
>
reelLocKPosMap
;
private
static
Map
<
String
,
ReelLockPosInfo
>
reelLocKPosMap
=
Maps
.
newConcurrentMap
()
;
@PostConstruct
public
void
init
()
{
dataCache
=
autodataCache
;
reelLocKPosMap
=
dataCache
.
getCache
(
REEL_LOCK_POS_MAP_KEY
);
if
(
reelLocKPosMap
==
null
)
{
reelLocKPosMap
=
new
HashMap
<
String
,
ReelLockPosInfo
>(){}
;
Map
<
String
,
ReelLockPosInfo
>
cacheReelLocKPosMap
=
dataCache
.
getCache
(
REEL_LOCK_POS_MAP_KEY
);
if
(
cacheReelLocKPosMap
!=
null
)
{
reelLocKPosMap
.
putAll
(
cacheReelLocKPosMap
)
;
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
e36133a
...
...
@@ -5,6 +5,7 @@ import com.google.common.base.Strings;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.mks.api.response.APIException
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
...
...
@@ -332,6 +333,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
//返回 105=查找空库位失败
//返回 106=唯一码已有入库任务
//返回 107=物料已过期,无法入库
//返回 108=库位被锁定,暂停入库,重新获取库位号
//返回108=已有待完成的出入库任务,直接NG
//返回110=接口验证失败,需要去XRay重新点料
...
...
@@ -628,7 +630,39 @@ public class RobotBoxHandler extends BaseDeviceHandler {
// }
// }
// }
ReelLockPosInfo
oldLockInfo
=
ReelLockPosUtil
.
getLockPosInfoByCode
(
barcode
.
getBarcode
());
if
(
oldLockInfo
!=
null
)
{
if
(!
oldLockInfo
.
getBarcode
().
equals
(
barcode
.
getBarcode
()))
{
// String result = "-1";
// okMsg = rfid + " [" + barcode.getBarcode() + "]锁定库位[" + pos.getPosName() + "],清理旧有锁定信息";
// resultMap.put("result", result);
// resultMap.put("msg", okMsg);
//已经锁定过库位,但不是同一个条码,需要把对应位置的锁定信息清理掉
ReelLockPosUtil
.
removeReelLockPosInfo
(
oldLockInfo
.
getBarcode
());
log
.
info
(
"清理锁定库位:库位号["
+
oldLockInfo
.
getLockPosName
()
+
"]上物料["
+
oldLockInfo
.
getBarcode
()
+
"]锁定的库位"
);
}
}
log
.
info
(
okMsg
+
oldLockInfo
);
ReelLockPosInfo
reelLocInfo
=
new
ReelLockPosInfo
();
reelLocInfo
.
setBarcode
(
barcode
.
getBarcode
());
reelLocInfo
.
setCid
(
storage
.
getCid
());
reelLocInfo
.
setLockPosName
(
pos
.
getPosName
());
reelLocInfo
.
setLockPosId
(
pos
.
getId
());
reelLocInfo
=
ReelLockPosUtil
.
addReelLockPosInfo
(
reelLocInfo
,
cidList
);
if
(
reelLocInfo
==
null
)
{
errorMsg
=
"["
+
barcode
.
getBarcode
()
+
"]库位["
+
reelLocInfo
.
getLockPosName
()+
"]已被锁定,暂停入库"
;
lineMsg
=
errorMsg
;
DeviceMessageUtil
.
updateLineMsg
(
lineMsg
,
code
,
cids
,
reelLocInfo
.
getLockPosName
(),
"smfcore.linemsg.posLock"
,
new
String
[]{
barcode
.
getBarcode
(),
reelLocInfo
.
getLockPosName
()});
resultMap
.
put
(
"result"
,
"107"
);
resultMap
.
put
(
"msg"
,
errorMsg
);
return
resultMap
;
}
resultMap
.
put
(
"result"
,
"0"
);
resultMap
.
put
(
"msg"
,
"ok"
);
DataLog
newTask
=
taskService
.
addPutInTaskToExecute
(
storage
,
barcode
,
pos
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论