Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3ce699ec
由
zshaohui
编写于
2024-06-24 15:53:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
功能优化提交
1 个父辈
5a8408ac
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
26 行增加
和
13 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/api/LuxsanApi.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BinCacheUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/AgvDeviceController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/LineController.java
src/main/java/com/neotel/smfcore/custom/luxsan/api/LuxsanApi.java
查看文件 @
3ce699e
...
@@ -47,7 +47,7 @@ public class LuxsanApi extends DefaultSmfApiListener {
...
@@ -47,7 +47,7 @@ public class LuxsanApi extends DefaultSmfApiListener {
LuxsanApiResult
apiResult
=
JSONObject
.
parseObject
(
resultStr
,
LuxsanApiResult
.
class
);
LuxsanApiResult
apiResult
=
JSONObject
.
parseObject
(
resultStr
,
LuxsanApiResult
.
class
);
if
(
LuxsanApiEnum
.
ERROR
.
equals
(
apiResult
.
getMSGTY
()))
{
if
(
LuxsanApiEnum
.
ERROR
.
equals
(
apiResult
.
getMSGTY
()))
{
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
apiResult
.
getMSGTX
()})
;
return
null
;
}
}
List
<
QueryBinResult
>
resultList
=
JSONObject
.
parseArray
(
apiResult
.
getDATA
(),
QueryBinResult
.
class
);
List
<
QueryBinResult
>
resultList
=
JSONObject
.
parseArray
(
apiResult
.
getDATA
(),
QueryBinResult
.
class
);
...
@@ -56,7 +56,7 @@ public class LuxsanApi extends DefaultSmfApiListener {
...
@@ -56,7 +56,7 @@ public class LuxsanApi extends DefaultSmfApiListener {
}
}
}
catch
(
ApiException
e
)
{
}
catch
(
ApiException
e
)
{
log
.
error
(
"queryBin请求失败:"
+
e
.
getMessage
());
log
.
info
(
"queryBin请求失败:"
+
e
.
getMessage
());
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
e
.
getMessage
()});
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
e
.
getMessage
()});
}
}
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
"未找到对应的储位信息"
});
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
"未找到对应的储位信息"
});
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BinCacheUtil.java
查看文件 @
3ce699e
...
@@ -78,13 +78,17 @@ public class BinCacheUtil {
...
@@ -78,13 +78,17 @@ public class BinCacheUtil {
public
static
Map
<
String
,
String
>
binCodeCacheMap
(
String
warehouseCode
)
{
public
static
Map
<
String
,
String
>
binCodeCacheMap
(
String
warehouseCode
)
{
Map
<
String
,
String
>
cacheMap
=
new
HashMap
<>();
Map
<
String
,
String
>
cacheMap
=
new
HashMap
<>();
List
<
QueryBinResult
>
resultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_0
,
warehouseCode
));
List
<
QueryBinResult
>
resultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_0
,
warehouseCode
));
for
(
QueryBinResult
result
:
resultList
)
{
if
(
resultList
!=
null
&&
!
resultList
.
isEmpty
())
{
cacheMap
.
put
(
result
.
getBIN_CODE
(),
result
.
getWAREHOUSE_CODE
());
for
(
QueryBinResult
result
:
resultList
)
{
cacheMap
.
put
(
result
.
getBIN_CODE
(),
result
.
getWAREHOUSE_CODE
());
}
}
}
List
<
QueryBinResult
>
useBinResultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_1
,
warehouseCode
));
List
<
QueryBinResult
>
useBinResultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_1
,
warehouseCode
));
for
(
QueryBinResult
result
:
useBinResultList
)
{
if
(
useBinResultList
!=
null
&&
!
useBinResultList
.
isEmpty
())
{
cacheMap
.
put
(
result
.
getBIN_CODE
(),
result
.
getWAREHOUSE_CODE
());
for
(
QueryBinResult
result
:
useBinResultList
)
{
cacheMap
.
put
(
result
.
getBIN_CODE
(),
result
.
getWAREHOUSE_CODE
());
}
}
}
return
cacheMap
;
return
cacheMap
;
}
}
...
@@ -114,7 +118,7 @@ public class BinCacheUtil {
...
@@ -114,7 +118,7 @@ public class BinCacheUtil {
//判断当前工作的料箱能不能放入
//判断当前工作的料箱能不能放入
if
(
StringUtils
.
isNotEmpty
(
binListStr
))
{
if
(
StringUtils
.
isNotEmpty
(
binListStr
))
{
log
.
info
(
"正在工作的料格为:"
+
binListStr
);
log
.
info
(
barcode
+
"正在工作的料格为:"
+
binListStr
);
String
[]
binStr
=
binListStr
.
split
(
","
);
String
[]
binStr
=
binListStr
.
split
(
","
);
List
<
String
>
binCodeList
=
getValidBinList
(
stackerBarcode
,
Arrays
.
asList
(
binStr
));
List
<
String
>
binCodeList
=
getValidBinList
(
stackerBarcode
,
Arrays
.
asList
(
binStr
));
...
@@ -146,7 +150,7 @@ public class BinCacheUtil {
...
@@ -146,7 +150,7 @@ public class BinCacheUtil {
//如果不为空,返回
//如果不为空,返回
if
(
validBinList
!=
null
&&
!
validBinList
.
isEmpty
())
{
if
(
validBinList
!=
null
&&
!
validBinList
.
isEmpty
())
{
log
.
info
(
"获取到可用料格为:"
+
JSON
.
toJSONString
(
validBinList
));
log
.
info
(
barcode
+
"获取到可用料格为:"
+
JSON
.
toJSONString
(
validBinList
));
String
resultStr
=
validBinList
.
get
(
0
);
String
resultStr
=
validBinList
.
get
(
0
);
boxCode
=
BoxHandleUtil
.
getBoxStr
(
resultStr
,
false
);
boxCode
=
BoxHandleUtil
.
getBoxStr
(
resultStr
,
false
);
boxLoc
=
source
;
boxLoc
=
source
;
...
@@ -165,7 +169,7 @@ public class BinCacheUtil {
...
@@ -165,7 +169,7 @@ public class BinCacheUtil {
for
(
DataLog
dataLog
:
allTasks
)
{
for
(
DataLog
dataLog
:
allTasks
)
{
if
(
dataLog
.
isCheckOutTask
()
&&
!
dataLog
.
isCancel
()
&&
!
dataLog
.
isFinished
())
{
if
(
dataLog
.
isCheckOutTask
()
&&
!
dataLog
.
isCancel
()
&&
!
dataLog
.
isFinished
())
{
if
(
source
.
equals
(
dataLog
.
getCurrentLoc
()))
{
if
(
source
.
equals
(
dataLog
.
getCurrentLoc
()))
{
log
.
info
(
"找到当前工位上的料箱为:"
+
dataLog
.
getBarcode
()
+
",位置为:"
+
dataLog
.
getCurrentLoc
());
log
.
info
(
barcode
+
"找到当前工位上的料箱为:"
+
dataLog
.
getBarcode
()
+
",位置为:"
+
dataLog
.
getCurrentLoc
());
emptyBoxList
.
add
(
dataLog
.
getBarcode
());
emptyBoxList
.
add
(
dataLog
.
getBarcode
());
}
}
}
}
...
@@ -205,7 +209,7 @@ public class BinCacheUtil {
...
@@ -205,7 +209,7 @@ public class BinCacheUtil {
//如果不为空,返回
//如果不为空,返回
if
(
validBinList
!=
null
&&
!
validBinList
.
isEmpty
())
{
if
(
validBinList
!=
null
&&
!
validBinList
.
isEmpty
())
{
log
.
info
(
"获取到可用料格为:"
+
JSON
.
toJSONString
(
validBinList
));
log
.
info
(
barcode
+
"获取到可用料格为:"
+
JSON
.
toJSONString
(
validBinList
));
String
resultStr
=
validBinList
.
get
(
0
);
String
resultStr
=
validBinList
.
get
(
0
);
boxCode
=
BoxHandleUtil
.
getBoxStr
(
resultStr
,
false
);
boxCode
=
BoxHandleUtil
.
getBoxStr
(
resultStr
,
false
);
boxLoc
=
source
;
boxLoc
=
source
;
...
@@ -232,7 +236,7 @@ public class BinCacheUtil {
...
@@ -232,7 +236,7 @@ public class BinCacheUtil {
&&
!
TaskCurrentLoc
.
In2_FeedingInlet
.
equals
(
dataLog
.
getCurrentLoc
())
&&
!
TaskCurrentLoc
.
In2_FeedingInlet
.
equals
(
dataLog
.
getCurrentLoc
())
)
{
)
{
if
(
TaskCurrentLoc
.
In_FeedingInlet
.
equals
(
dataLog
.
getLoc
())
||
source
.
equals
(
dataLog
.
getLoc
())
)
{
if
(
TaskCurrentLoc
.
In_FeedingInlet
.
equals
(
dataLog
.
getLoc
())
||
source
.
equals
(
dataLog
.
getLoc
())
)
{
log
.
info
(
"查找出来呼叫空箱的箱子为:"
+
dataLog
.
getBarcode
());
log
.
info
(
barcode
+
"查找出来呼叫空箱的箱子为:"
+
dataLog
.
getBarcode
());
callEmptyBoxList
.
add
(
dataLog
.
getBarcode
());
callEmptyBoxList
.
add
(
dataLog
.
getBarcode
());
}
}
}
}
...
@@ -281,7 +285,7 @@ public class BinCacheUtil {
...
@@ -281,7 +285,7 @@ public class BinCacheUtil {
List
<
DataLog
>
taskList
=
taskService
.
getAllTasks
();
List
<
DataLog
>
taskList
=
taskService
.
getAllTasks
();
for
(
DataLog
dataLog
:
taskList
)
{
for
(
DataLog
dataLog
:
taskList
)
{
if
(
dataLog
.
getBarcode
().
equals
(
boxStr
)
&&
dataLog
.
isCheckOutTask
()
&&
!
dataLog
.
isCancel
())
{
if
(
dataLog
.
getBarcode
().
equals
(
boxStr
)
&&
dataLog
.
isCheckOutTask
()
&&
!
dataLog
.
isCancel
())
{
log
.
info
(
"获取到可用料格为:"
+
JSON
.
toJSONString
(
validBinList
));
log
.
info
(
barcode
+
"获取到可用料格为:"
+
JSON
.
toJSONString
(
validBinList
));
String
loc
=
""
;
String
loc
=
""
;
if
(
StringUtils
.
isEmpty
(
dataLog
.
getLoc
()))
{
if
(
StringUtils
.
isEmpty
(
dataLog
.
getLoc
()))
{
loc
=
source
;
loc
=
source
;
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/AgvDeviceController.java
查看文件 @
3ce699e
...
@@ -107,9 +107,10 @@ public class AgvDeviceController {
...
@@ -107,9 +107,10 @@ public class AgvDeviceController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.taskStatusHasUpdate"
,
"任务{0}已经修改状态"
,
new
String
[]{
task
.
getBarcode
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.taskStatusHasUpdate"
,
"任务{0}已经修改状态"
,
new
String
[]{
task
.
getBarcode
()});
}
}
task
.
setStatus
(
statusStr
);
//3.判断是出库,还是入库任务
//3.判断是出库,还是入库任务
if
(
task
.
isPutInTask
())
{
if
(
task
.
isPutInTask
())
{
task
.
setStatus
(
statusStr
);
if
(
OP_STATUS
.
FINISHED
.
name
().
equals
(
statusStr
))
{
if
(
OP_STATUS
.
FINISHED
.
name
().
equals
(
statusStr
))
{
finishedPutInTask
(
task
);
finishedPutInTask
(
task
);
...
@@ -124,14 +125,20 @@ public class AgvDeviceController {
...
@@ -124,14 +125,20 @@ public class AgvDeviceController {
}
else
{
}
else
{
//4.如果是出库任务
//4.如果是出库任务
if
(
OP_STATUS
.
EXECUTING
.
name
().
equals
(
statusStr
))
{
if
(
OP_STATUS
.
EXECUTING
.
name
().
equals
(
statusStr
))
{
task
.
setStatus
(
statusStr
);
taskService
.
updateQueueTask
(
task
);
taskService
.
updateQueueTask
(
task
);
}
else
{
}
else
{
if
(!
task
.
isOutFromPos
())
{
if
(!
task
.
isOutFromPos
())
{
finishedOutTask
(
task
);
finishedOutTask
(
task
);
//WipBoxHandleUtil.outFromPos(task);
//WipBoxHandleUtil.outFromPos(task);
task
.
setOutFromPos
(
true
);
task
.
setOutFromPos
(
true
);
taskService
.
moveTaskToFinished
(
task
);
taskService
.
updateFinishedTask
(
task
);
}
}
if
(!
OP_STATUS
.
FINISHED
.
name
().
equals
(
statusStr
)){
if
(!
OP_STATUS
.
FINISHED
.
name
().
equals
(
statusStr
)){
task
.
setStatus
(
statusStr
);
taskService
.
updateFinishedTask
(
task
);
taskService
.
updateFinishedTask
(
task
);
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/LineController.java
查看文件 @
3ce699e
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
wipstor
.
controller
;
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
wipstor
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
...
@@ -289,6 +290,7 @@ public class LineController {
...
@@ -289,6 +290,7 @@ public class LineController {
resultMap
.
put
(
"plantCode"
,
orderItem
.
getPlantCode
());
resultMap
.
put
(
"plantCode"
,
orderItem
.
getPlantCode
());
}
}
}
}
log
.
info
(
boxId
+
"返回数据为:"
+
JSON
.
toJSONString
(
resultMap
));
return
ResultBean
.
newOkResult
(
resultMap
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论