Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3a1e51a9
由
LN
编写于
2024-03-07 09:20:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
扫码亮灯修改
1 个父辈
9eedf462
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
57 行增加
和
10 行删除
src/main/java/com/neotel/smfcore/core/shelf/util/TaskShelfUtil.java
src/main/java/com/neotel/smfcore/core/storage/rest/StorageController.java
src/main/java/com/neotel/smfcore/custom/gree20242/CodeLightController.java
src/main/java/com/neotel/smfcore/core/shelf/util/TaskShelfUtil.java
查看文件 @
3a1e51a
...
...
@@ -627,7 +627,29 @@ public class TaskShelfUtil {
}
return
true
;
}
public
static
boolean
CloseShelfLed
(
ShelfInfo
shelfInfo
)
{
List
<
ShelfLoc
>
locs
=
shelfInfo
.
getLocList
();
String
shelfLoc
=
getShelfLoc
(
shelfInfo
.
getRealRfid
());
String
cid
=
getCid
(
shelfLoc
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
)
{
log
.
error
(
"CloseShelfLed 料架["
+
shelfInfo
.
getRealRfid
()
+
"] , 位置:["
+
shelfLoc
+
"],cid ["
+
cid
+
" ]未找到对应的亮灯料架"
);
return
false
;
}
for
(
ShelfLoc
loc
:
locs
)
{
String
posname
=
loc
.
getPosName
(
shelfLoc
);
if
(
loc
.
isEmpty
()
||
ObjectUtil
.
isEmpty
(
loc
.
getBarcode
()))
{
continue
;
}
if
(
loc
.
isReelLeave
())
{
DevicesStatusUtil
.
appendOp
(
storage
.
getCid
(),
"close"
,
posname
+
"="
+
""
);
log
.
info
(
"亮灯料架CID:["
+
storage
.
getCid
()
+
"],料架RFID:["
+
shelfInfo
.
getRealRfid
()
+
"] ,关闭库位灯: [clsoe :"
+
posname
+
"=]"
);
}
}
return
true
;
}
/**
* 扫码亮灯,获取库位号
* @param barcode
...
...
@@ -663,13 +685,15 @@ public class TaskShelfUtil {
}
}
shelf
.
NeedLeaveLine
();
if
(
lightEnd
){
shelf
.
NeedLeaveLine
();
}
updateShelfInfo
(
shelf
);
log
.
info
(
"标记料架["
+
shelf
.
getRealRfid
()
+
"]位置["
+
shelfLoc
.
getLoc
()
+
"]条码["
+
shelfLoc
.
getBarcode
()
+
"]已扫码灭灯,料盘已离开,料架是否亮灯完成["
+
lightEnd
+
"]"
);
list
.
add
(
shelf
);
list
.
add
(
shelfLoc
);
// return shelfLoc
;
return
list
;
}
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StorageController.java
查看文件 @
3a1e51a
...
...
@@ -184,6 +184,16 @@ public class StorageController {
storageDtos
=
updateDtos
(
storageDtos
);
return
storageDtos
;
}
@ApiOperation
(
"获取指定类型的料仓列表"
)
@GetMapping
(
value
=
"/listByType"
)
public
List
<
StorageDto
>
listByType
(
String
type
)
{
Criteria
c
=
Criteria
.
where
(
"type"
).
is
(
type
);
List
<
Storage
>
storages
=
storageManager
.
findByQuery
(
new
Query
(
c
));
List
<
StorageDto
>
storageDtos
=
storageMapper
.
toDto
(
storages
);
storageDtos
=
updateDtos
(
storageDtos
);
return
storageDtos
;
}
@ApiOperation
(
"料架设置界面,返回所有的料架列表"
)
@GetMapping
(
value
=
"/allShelf"
)
public
List
<
StorageDto
>
allShelf
()
{
...
...
src/main/java/com/neotel/smfcore/custom/gree20242/CodeLightController.java
查看文件 @
3a1e51a
...
...
@@ -54,8 +54,10 @@ public class CodeLightController {
@GetMapping
(
value
=
"/reelList"
)
@ResponseBody
@AnonymousAccess
public
List
<
ShelfDto
>
reelList
(
HttpServletRequest
servletRequest
)
{
public
List
<
ShelfDto
>
reelList
(
String
cid
)
{
if
(
ObjectUtil
.
isEmpty
(
cid
)){
cid
=
""
;
}
List
<
ShelfDto
>
shelfDtos
=
new
ArrayList
<>();
Map
<
String
,
String
>
lineShelfLocMap
=
TaskShelfUtil
.
lineShelfLocMap
;
for
(
String
rfid
:
...
...
@@ -64,6 +66,10 @@ public class CodeLightController {
ShelfDto
dto
=
new
ShelfDto
();
dto
.
setRfid
(
rfid
);
dto
.
setLoc
(
shelfLoc
);
String
currCid
=
TaskShelfUtil
.
getCid
(
shelfLoc
);
if
(
ObjectUtil
.
isNotEmpty
(
cid
)&&(!
cid
.
equals
(
currCid
))){
continue
;
}
ShelfInfo
shelfInfo
=
TaskShelfUtil
.
findShelfByRealRfid
(
rfid
);
if
(
shelfInfo
!=
null
)
{
...
...
@@ -111,7 +117,7 @@ public class CodeLightController {
dto
.
setLoc
(
"line"
+
i
);
List
<
ShelfReelDto
>
reelDtos
=
new
ArrayList
<>();
for
(
int
j
=
1
;
j
<=
10
;
j
++){
ShelfReelDto
reelDto
=
new
ShelfReelDto
(
"PN"
+
j
,
"BARCODE"
+
j
,
"
PosName"
+
j
);
ShelfReelDto
reelDto
=
new
ShelfReelDto
(
"PN"
+
j
,
"BARCODE"
+
j
,
cid
+
"-
PosName"
+
j
);
reelDtos
.
add
(
reelDto
);
}
dto
.
setReelList
(
reelDtos
);
...
...
@@ -220,15 +226,22 @@ public class CodeLightController {
return
ResultBean
.
newErrorResult
(
99
,
"smfcore.light.error.noStorage"
,
"未找到料架["
+
cid
+
"]"
,
new
String
[]{
cid
});
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posname
);
if
(
pos
==
null
)
{
log
.
error
(
"lightOff code["
+
code
+
"],shelfLoc["
+
shelfLoc
+
"],cid["
+
cid
+
"],posName["
+
posname
+
"]未找到库位"
);
return
ResultBean
.
newErrorResult
(
99
,
"smfcore.light.error.noStoragePos"
,
"未找到料架库位["
+
posname
+
"]"
,
new
String
[]{
posname
});
}
//
StoragePos pos = storagePosManager.getByPosName(posname);
//
if (pos == null) {
//
log.error("lightOff code["+code+"],shelfLoc["+shelfLoc+"],cid["+cid+"],posName["+posname+"]未找到库位");
//
return ResultBean.newErrorResult(99, "smfcore.light.error.noStoragePos", "未找到料架库位[" + posname + "]", new String[]{posname});
//
}
//找到对应的库位,给亮灯料架发送灭灯指令
DevicesStatusUtil
.
appendOp
(
storage
.
getCid
(),
"close"
,
posname
+
"="
);
log
.
error
(
"lightOff code["
+
code
+
"],shelfLoc["
+
shelfLoc
+
"],cid["
+
cid
+
"],posName["
+
posname
+
"] 库位灭灯:close: "
+
posname
+
"="
);
//如果料架可离开,发所有库位灭灯
if
(
shelfInfo
.
getShelfState
()==
3
){
TaskShelfUtil
.
CloseShelfLed
(
shelfInfo
);
}
return
ResultBean
.
newOkResult
(
loc
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论