Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e1872237
由
LN
编写于
2024-09-19 10:12:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加移库功能
1 个父辈
26f35b58
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
108 行增加
和
5 行删除
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
e187223
...
...
@@ -231,6 +231,9 @@ public class StoragePosController {
String
opUser
=
SecurityUtils
.
getCurrentUsername
();
log
.
info
(
opUser
+
"清理库位["
+
storagePos
.
getPosName
()
+
"]中的库存"
+
barcode
.
getBarcode
());
taskService
.
addTaskToFinished
(
storagePos
,
null
,
opUser
+
"-clear"
);
//清理锁定
ReelLockPosUtil
.
removeReelLockPosInfo
(
barcode
.
getBarcode
());
}
return
ResultBean
.
newOkResult
(
""
);
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
查看文件 @
e187223
...
...
@@ -48,14 +48,14 @@ public class SpBoxPutInController {
public
ResultBean
getStationInfo
(
Integer
type
)
{
//默认是s1 工位
Station
station
=
StationCacheUtil
.
getStation
(
"s1"
);
if
(
station
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"当前工位没有料箱信息"
);
if
(
station
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"当前工位没有料箱信息"
);
}
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
ObjectUtil
.
isEmpty
(
currentRfid
))
{
if
(
LuxsanSpApi
.
Debug
)
{
currentRfid
=
"CS0130
"
;
if
(
ObjectUtil
.
isEmpty
(
currentRfid
))
{
if
(
LuxsanSpApi
.
Debug
)
{
currentRfid
=
"CS0130A
"
;
}
}
// log.info("getStationInfo工位上"+currentRfid);
...
...
@@ -138,4 +138,39 @@ public class SpBoxPutInController {
return
ResultBean
.
newOkResult
(
"OK"
);
}
//以料格为维度,一个料格
@ApiOperation
(
"移库"
)
@RequestMapping
(
"/moveBoxPos"
)
@AnonymousAccess
public
ResultBean
moveBoxPos
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
throws
Exception
{
try
{
String
boxBarcode
=
paramMap
.
get
(
"boxBarcode"
).
trim
();
String
targetPosName
=
paramMap
.
get
(
"targetPos"
).
trim
();
log
.
info
(
"moveBoxPos , 参数:箱子号="
+
boxBarcode
+
", 目标库位号="
+
targetPosName
);
//解析料箱信息
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
boxBarcode
);
if
(
boxBarcode
==
null
)
{
throw
new
Exception
(
"不是有效的料箱条码"
);
}
StoragePos
targetPos
=
storagePosManager
.
getByPosName
(
targetPosName
);
if
(
targetPos
==
null
)
{
log
.
info
(
"moveBoxPos , 参数:箱子号="
+
boxBarcode
+
", 目标库位号="
+
targetPosName
+
",未找到目标库位"
);
throw
new
Exception
(
"未找到目标库位"
);
}
String
result
=
SpBoxUtil
.
movePos
(
barcode
,
targetPos
);
if
(
ObjectUtil
.
isEmpty
(
result
))
{
return
ResultBean
.
newOkResult
(
"OK"
);
}
else
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
result
);
}
}
catch
(
Exception
exception
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
exception
.
getMessage
());
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
查看文件 @
e187223
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
...
...
@@ -292,6 +293,70 @@ public class SpBoxUtil {
}
public
static
synchronized
String
movePos
(
Barcode
barcode
,
StoragePos
targetPos
)
throws
Exception
{
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
pos
!=
null
)
{
//如果还在库位中,不能移库
if
(
barcode
.
getStatus
()
==
BARCODE_STATUS
.
IN_STORE
)
{
log
.
info
(
"moveBoxPos , 参数:箱子号="
+
barcode
.
getBarcode
()
+
", 目标库位号="
+
targetPos
.
getPosName
()
+
",箱子还在库位["
+
pos
.
getPosName
()
+
"]中,无法移库"
);
throw
new
Exception
(
"箱子["
+
barcode
.
getBarcode
()
+
"]还在库位["
+
pos
.
getPosName
()
+
"]中,无法移库"
);
}
}
//清空原来的库位,新库位中增加信息
if
(
targetPos
.
getBarcode
()
!=
null
||
targetPos
.
isUsed
())
{
log
.
info
(
"moveBoxPos , 参数:箱子号="
+
barcode
.
getBarcode
()
+
", 目标库位号="
+
targetPos
.
getPosName
()
+
",目标库位不为空"
);
throw
new
Exception
(
"目标库位不为空"
);
}
if
(
ReelLockPosUtil
.
posIsLock
(
targetPos
.
getPosName
()))
{
log
.
info
(
"moveBoxPos , 参数:箱子号="
+
barcode
.
getBarcode
()
+
", 目标库位号="
+
targetPos
.
getPosName
()
+
",已被锁定"
);
throw
new
Exception
(
"目标库位已被锁定"
);
}
if
(
pos
!=
null
){
log
.
info
(
"料箱["
+
barcode
.
getBarcode
()
+
"]从库位["
+
pos
.
getPosName
()
+
"]中清空信息"
);
pos
.
setBarcode
(
null
);
pos
.
setUsed
(
false
);
storagePosManager
.
save
(
pos
);
}
//从原有库位清空
log
.
info
(
"料箱["
+
barcode
.
getBarcode
()
+
"]信息移入库位["
+
targetPos
.
getPosName
()
+
"]中"
);
targetPos
.
setBarcode
(
barcode
);
targetPos
.
setUsed
(
true
);
storagePosManager
.
save
(
targetPos
);
barcode
.
setPosName
(
targetPos
.
getPosName
());
barcode
.
setStoragePosName
(
targetPos
.
getPosName
());
List
<
String
>
cidList
=
new
ArrayList
<>();
List
<
Storage
>
storageList
=
new
ArrayList
<>();
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
if
(!
storage
.
isVirtual
())
{
storageList
.
add
(
storage
);
cidList
.
add
(
storage
.
getCid
());
}
}
//3.锁定库位
Storage
storage
=
dataCache
.
getStorageById
(
targetPos
.
getStorageId
());
ReelLockPosInfo
reelLocInfo
=
new
ReelLockPosInfo
();
reelLocInfo
.
setBarcode
(
barcode
.
getBarcode
());
reelLocInfo
.
setCid
(
storage
.
getCid
());
reelLocInfo
.
setLockPosName
(
targetPos
.
getPosName
());
reelLocInfo
.
setLockPosId
(
targetPos
.
getId
());
reelLocInfo
=
ReelLockPosUtil
.
addReelLockPosInfo
(
reelLocInfo
,
cidList
);
if
(
reelLocInfo
==
null
)
{
log
.
info
(
"["
+
barcode
.
getBarcode
()
+
"]库位锁定失败,暂停入库"
);
return
"锁定失败"
;
}
return
""
;
}
public
static
int
GetBoxSubCount
(
String
boxStr
)
{
//返回格口数量
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论