Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1f74955b
由
zshaohui
编写于
2024-11-12 14:56:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.解析库位坐标修改
2.入库是调用save和退料接口
1 个父辈
da0b61c3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
65 行增加
和
38 行删除
src/main/java/com/neotel/smfcore/common/utils/PointUtil.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/java/com/neotel/smfcore/common/utils/PointUtil.java
查看文件 @
1f74955
...
@@ -10,65 +10,92 @@ public class PointUtil {
...
@@ -10,65 +10,92 @@ public class PointUtil {
return
getPosPoint
(
posId
,
true
);
return
getPosPoint
(
posId
,
true
);
}
}
public
static
void
main
(
String
[]
args
)
{
//Point posPoint = getPosPoint("DUO1-R_04_112_05",false);
Point
posPoint
=
getPosPoint
(
"05AA03040102"
,
false
);
System
.
out
.
println
(
JsonUtil
.
toJsonStr
(
posPoint
));
}
/**
/**
* 获取坐标
* 获取坐标
* @param posId 库位号
*
* @param posId 库位号
* @param isUpdatePos true=更新库位坐标。false=查询使用
* @param isUpdatePos true=更新库位坐标。false=查询使用
* @return
* @return
*/
*/
public
static
Point
getPosPoint
(
String
posId
,
boolean
isUpdatePos
)
{
public
static
Point
getPosPoint
(
String
posId
,
boolean
isUpdatePos
)
{
// 库位号格式:
// 例:05AA03040102
// 05:表示料仓编号,01-08
// AA:存储机构A面或B面,AA或者BB
// 03:表示抽屉在第几行
// 04:表示抽屉在第几列
// 01:表示在抽屉中的第几行
// 02:表示在抽屉中的第几列
Point
p
=
new
Point
(
0
,
0
);
Point
p
=
new
Point
(
0
,
0
);
try
{
try
{
if
(
posId
.
length
()
==
12
&&((
posId
.
contains
(
"AA"
)||
posId
.
contains
(
"BB
"
))))
{
if
(
posId
.
contains
(
"DUO"
)
&&
((
posId
.
contains
(
"-L"
)
||
posId
.
contains
(
"-R
"
))))
{
double
storageNum
=
0
;
double
storageNum
=
0
;
int
storage
=
Integer
.
parseInt
(
posId
.
substring
(
0
,
2
));
String
typeStr
=
posId
.
substring
(
2
,
4
);
//获取到第一个-,获取到设备的id
if
(
typeStr
.
equals
(
"AA"
))
{
int
firstIndex
=
posId
.
indexOf
(
"-"
);
if
(
isUpdatePos
){
String
cidStr
=
posId
.
substring
(
0
,
firstIndex
);
storageNum
=
storage
*
10
+
1
;
cidStr
=
cidStr
.
replace
(
"DUO"
,
""
);
}
else
{
int
storage
=
Integer
.
parseInt
(
cidStr
);
//判断是1面,还是2面
int
endIndex
=
posId
.
lastIndexOf
(
"_"
);
String
sideStr
=
posId
.
substring
(
0
,
endIndex
);
//String typeStr = posId.substring(2, 4);
if
(
sideStr
.
endsWith
(
"1"
))
{
if
(
isUpdatePos
)
{
storageNum
=
storage
*
10
+
1
;
}
else
{
storageNum
=
storage
*
10
+
2
;
storageNum
=
storage
*
10
+
2
;
}
}
}
else
{
}
else
{
if
(
isUpdatePos
)
{
if
(
isUpdatePos
)
{
storageNum
=
storage
*
10
+
2
;
storageNum
=
storage
*
10
+
2
;
}
else
{
}
else
{
storageNum
=
storage
*
10
+
1
;
storageNum
=
storage
*
10
+
1
;
}
}
}
}
double
row
=
Integer
.
parseInt
(
posId
.
substring
(
4
,
6
));
double
column
=
Integer
.
parseInt
(
posId
.
substring
(
6
,
8
));
//获取行列表
int
rowIndex
=
posId
.
lastIndexOf
(
"_"
);
String
rowStr
=
posId
.
substring
(
0
,
rowIndex
);
rowIndex
=
rowStr
.
lastIndexOf
(
"_"
);
rowStr
=
rowStr
.
substring
(
rowIndex
+
1
);
rowStr
=
rowStr
.
substring
(
0
,
rowStr
.
length
()
-
1
);
//获取列
int
columnIndex
=
posId
.
indexOf
(
"_"
);
String
columnStr
=
posId
.
substring
(
columnIndex
+
1
);
columnIndex
=
columnStr
.
indexOf
(
"_"
);
columnStr
=
columnStr
.
substring
(
0
,
columnIndex
);
double
row
=
Integer
.
parseInt
(
rowStr
);
double
column
=
Integer
.
parseInt
(
columnStr
);
double
x
=
storageNum
+
column
/
100
;
double
x
=
storageNum
+
column
/
100
;
double
y
=
storageNum
+
row
/
1000
;
double
y
=
storageNum
+
row
/
1000
;
double
drawerRow
=
1
;
double
drawerColumn
=
1
;
//获取对应抽屉的,行和列
if
(
isUpdatePos
)
{
int
drawerRowIndex
=
posId
.
lastIndexOf
(
"_"
);
drawerRow
=
Integer
.
parseInt
(
posId
.
substring
(
8
,
10
));
String
drawerRowStr
=
posId
.
substring
(
drawerRowIndex
+
1
);
drawerColumn
=
Integer
.
parseInt
(
posId
.
substring
(
10
,
12
));
double
drawerRow
=
Double
.
valueOf
(
drawerRowStr
);
//获取到对应的列
double
drawerColumn
=
1
;
if
(
sideStr
.
endsWith
(
"2"
))
{
drawerColumn
=
2
;
}
}
x
+=
drawerColumn
/
100
/
1000
;
x
+=
drawerColumn
/
100
/
1000
;
y
+=
+
drawerRow
/
1000
/
100
;
y
+=
drawerRow
/
1000
/
100
;
p
=
new
Point
(
x
,
y
);
p
=
new
Point
(
x
,
y
);
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"解析库位["
+
posId
+
"]的坐标出错:"
+
ex
);
log
.
error
(
"解析库位["
+
posId
+
"]的坐标出错:"
+
ex
);
}
}
// log.info("解析库位[" + posId + "]的坐标结果:" + p.toString());
return
p
;
return
p
;
}
}
}
}
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
1f74955
...
@@ -723,7 +723,7 @@ public class DeviceController {
...
@@ -723,7 +723,7 @@ public class DeviceController {
}
}
}
}
if
(
dataLog
==
null
){
if
(
dataLog
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"
"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
code
+
"未找到对应的入库任务
"
);
}
}
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
1f74955
...
@@ -328,15 +328,15 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -328,15 +328,15 @@ public class LizhenApi extends DefaultSmfApiListener {
}
}
}
}
if
(
task
.
isFinished
()){
if
(
task
.
isFinished
()){
DataLog
oldTask
=
dataLogManager
.
findOne
(
new
Query
(
Criteria
.
where
(
"barcode"
).
is
(
task
.
getBarcode
()).
and
(
"type"
).
is
(
OP
.
CHECKOUT
)
//
DataLog oldTask = dataLogManager.findOne(new Query(Criteria.where("barcode").is(task.getBarcode()).and("type").is(OP.CHECKOUT)
.
and
(
"status"
).
is
(
OP_STATUS
.
FINISHED
.
name
()).
and
(
"createDate"
).
lte
(
new
Date
())).
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createDate"
)));
//
.and("status").is(OP_STATUS.FINISHED.name()).and("createDate").lte(new Date())).with(Sort.by(Sort.Direction.DESC, "createDate")));
if
(
oldTask
==
null
)
{
//
if (oldTask == null) {
log
.
info
(
task
.
getBarcode
()+
"为新料,调用save2ReelInfo接口"
);
//
log.info(task.getBarcode()+"为新料,调用save2ReelInfo接口");
reelInToTower
(
task
);
reelInToTower
(
task
);
}
else
{
//
} else {
log
.
info
(
task
.
getBarcode
()+
"为旧料,调用RMRecord接口"
);
//
log.info(task.getBarcode()+"为旧料,调用RMRecord接口");
reelReturnTower
(
oldT
ask
);
reelReturnTower
(
t
ask
);
}
//
}
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论