Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1f4d9263
由
zshaohui
编写于
2023-11-23 14:34:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.上架和下架的时候,如果料架有异常料架,提示不能操作
1 个父辈
fe89450a
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
52 行增加
和
20 行删除
src/main/java/com/neotel/smfcore/hikvision_mobile/HikVisionController.java
src/main/java/com/neotel/smfcore/hikvision_mobile/HikVisionController.java
查看文件 @
1f4d926
...
@@ -25,6 +25,8 @@ import com.neotel.smfcore.hikvision_mobile.bean.response.ApiResponse;
...
@@ -25,6 +25,8 @@ import com.neotel.smfcore.hikvision_mobile.bean.response.ApiResponse;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
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.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
import
java.util.*
;
...
@@ -101,6 +103,11 @@ public class HikVisionController {
...
@@ -101,6 +103,11 @@ public class HikVisionController {
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
REQUEST_ERROR
.
getCode
(),
""
,
"smfcore.shelfNotExist"
,
new
String
[]{
shelfCode
},
"{0}对应的料架不存在"
);
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
REQUEST_ERROR
.
getCode
(),
""
,
"smfcore.shelfNotExist"
,
new
String
[]{
shelfCode
},
"{0}对应的料架不存在"
);
}
}
boolean
hasErrorPos
=
hasErrorPos
(
storage
.
getCid
());
if
(
hasErrorPos
){
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
REQUEST_ERROR
.
getCode
(),
""
,
""
,
new
String
[]{},
"当前货架状态异常,无法发起上架任务"
);
}
//判断是否正在执行
//判断是否正在执行
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
for
(
DataLog
queueTask
:
queueTasks
)
{
for
(
DataLog
queueTask
:
queueTasks
)
{
...
@@ -207,17 +214,24 @@ public class HikVisionController {
...
@@ -207,17 +214,24 @@ public class HikVisionController {
}
}
}
}
//判断料架是否存在
Storage
storage
=
dataCache
.
getStorageByName
(
info
.
getShelfCode
());
if
(
storage
==
null
)
{
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
REQUEST_ERROR
.
getCode
(),
""
,
"smfcore.shelfNotExist"
,
new
String
[]{
info
.
getShelfCode
()},
"{0}对应的料架不存在"
);
}
boolean
hasErrorPos
=
hasErrorPos
(
storage
.
getCid
());
if
(
hasErrorPos
){
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
REQUEST_ERROR
.
getCode
(),
""
,
""
,
new
String
[]{},
"当前物料唯一码货位异常,无法发起下架任务"
);
}
//判断是否已经生成任务
//判断是否已经生成任务
int
count
=
dataLogManager
.
countByReqCode
(
reqCode
);
int
count
=
dataLogManager
.
countByReqCode
(
reqCode
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
PROCESSED
.
getCode
(),
""
,
"smfcore.valueAlreadyExist"
,
new
String
[]{
"请求号"
,
reqCode
},
"{0}[{1}]已存在"
);
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
PROCESSED
.
getCode
(),
""
,
"smfcore.valueAlreadyExist"
,
new
String
[]{
"请求号"
,
reqCode
},
"{0}[{1}]已存在"
);
}
}
//判断料架是否存在
Storage
storage
=
dataCache
.
getStorageByName
(
info
.
getShelfCode
());
if
(
storage
==
null
)
{
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
REQUEST_ERROR
.
getCode
(),
""
,
"smfcore.shelfNotExist"
,
new
String
[]{
info
.
getShelfCode
()},
"{0}对应的料架不存在"
);
}
//判断库位中信息是否存在料盘
//判断库位中信息是否存在料盘
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
info
.
getUniqueCode
());
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
info
.
getUniqueCode
());
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
...
@@ -231,7 +245,7 @@ public class HikVisionController {
...
@@ -231,7 +245,7 @@ public class HikVisionController {
if
(
barcode
==
null
)
{
if
(
barcode
==
null
)
{
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
REQUEST_ERROR
.
getCode
(),
""
,
"smfcore.error.barcode.invalid"
,
new
String
[]{
info
.
getUniqueCode
()},
"{0}不是有效的条码"
);
return
ApiResponse
.
apiResponse
(
reqCode
,
ResponseCode
.
REQUEST_ERROR
.
getCode
(),
""
,
"smfcore.error.barcode.invalid"
,
new
String
[]{
info
.
getUniqueCode
()},
"{0}不是有效的条码"
);
}
}
/*
//判断是否有正在下架的任务
//判断是否有正在下架的任务
for (DataLog dataLog : taskService.getAllTasks()) {
for (DataLog dataLog : taskService.getAllTasks()) {
if (!dataLog.isFinished()){
if (!dataLog.isFinished()){
...
@@ -239,7 +253,7 @@ public class HikVisionController {
...
@@ -239,7 +253,7 @@ public class HikVisionController {
return ApiResponse.apiResponse(reqCode, ResponseCode.REQUEST_ERROR.getCode(), "", "", new String[]{info.getShelfCode()}, info.getShelfCode() + "有正在执行中的下架任务,不可发起新的下架任务");
return ApiResponse.apiResponse(reqCode, ResponseCode.REQUEST_ERROR.getCode(), "", "", new String[]{info.getShelfCode()}, info.getShelfCode() + "有正在执行中的下架任务,不可发起新的下架任务");
}
}
}
}
}
}
*/
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
...
@@ -497,21 +511,39 @@ public class HikVisionController {
...
@@ -497,21 +511,39 @@ public class HikVisionController {
}
}
@GetMapping
(
"/test"
)
private
boolean
hasErrorPos
(
String
cid
)
{
@AnonymousAccess
List
<
List
<
String
>>
deviceData
=
DevicesStatusUtil
.
getDeviceData
(
cid
);
public
void
test
(
String
id
){
if
(
deviceData
!=
null
&&
deviceData
.
size
()
==
2
)
{
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
List
<
String
>
hasReelPosErrorList
=
deviceData
.
get
(
0
);
DataLog
task
=
null
;
if
(
hasReelPosErrorList
!=
null
&&
!
hasReelPosErrorList
.
isEmpty
())
{
for
(
DataLog
queueTask
:
queueTasks
)
{
Query
query
=
new
Query
(
Criteria
.
where
(
"posName"
).
in
(
hasReelPosErrorList
.
toArray
()));
if
(
id
.
equals
(
queueTask
.
getId
())){
List
<
StoragePos
>
posList
=
storagePosManager
.
findByQuery
(
query
);
task
=
queueTask
;
for
(
StoragePos
pos
:
posList
)
{
break
;
if
(!
pos
.
isEnabled
())
{
continue
;
}
if
(
pos
.
isUsed
())
{
continue
;
}
return
true
;
}
}
List
<
String
>
noReelPosErrorList
=
deviceData
.
get
(
1
);
if
(
noReelPosErrorList
!=
null
&&
!
noReelPosErrorList
.
isEmpty
())
{
Query
query
=
new
Query
(
Criteria
.
where
(
"posName"
).
in
(
hasReelPosErrorList
.
toArray
()));
List
<
StoragePos
>
posList
=
storagePosManager
.
findByQuery
(
query
);
for
(
StoragePos
pos
:
posList
)
{
if
(!
pos
.
isEnabled
())
{
continue
;
}
}
if
(!
pos
.
isUsed
())
{
continue
;
}
return
true
;
}
}
if
(
task
!=
null
){
task
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
moveTaskToFinished
(
task
);
taskService
.
updateFinishedTask
(
task
);
}
}
}
}
return
false
;
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论