Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e641fc58
由
LN
编写于
2026-04-16 13:54:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加NG按钮,释放料串按钮
1 个父辈
39a100ce
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
171 行增加
和
19 行删除
src/main/java/com/neotel/smfcore/custom/micron1551/controller/ML5ODeviceController.java
src/main/java/com/neotel/smfcore/custom/micron1551/controller/ML5SDeviceController.java
src/main/java/com/neotel/smfcore/custom/micron1551/controller/ML5DeviceController.java → src/main/java/com/neotel/smfcore/custom/micron1551/controller/Micron1551DeviceController.java
src/main/java/com/neotel/smfcore/custom/micron1551/controller/ML5ODeviceController.java
查看文件 @
e641fc5
...
...
@@ -86,13 +86,13 @@ private TaskService taskService;
InOutReelDto
dto
=
new
InOutReelDto
(
dt
.
getPartNumber
(),
dt
.
getBarcode
(),
dt
.
getStatus
(),
""
,
dt
.
getInput
(),
dt
.
getOutput
(),
dt
.
getGantry
());
dtoList
.
add
(
dto
);
}
if
(
dtoList
.
size
()<=
0
&&
MicronApi
.
Debug
)
{
dtoList
.
add
(
new
InOutReelDto
(
"PN1"
,
"RI1"
,
"Wait"
,
"MBR"
,
"LP1"
,
"UP1"
,
"G1"
));
dtoList
.
add
(
new
InOutReelDto
(
"PN2"
,
"RI2"
,
"Wait"
,
"MBR"
,
"LP2"
,
"UP3"
,
"G1"
));
dtoList
.
add
(
new
InOutReelDto
(
"PN3"
,
"RI3"
,
"Wait"
,
"MBR"
,
"LP1"
,
"UP1"
,
"G2"
));
dtoList
.
add
(
new
InOutReelDto
(
"PN4"
,
"RI4"
,
"Wait"
,
"MBR"
,
"LP2"
,
"UP3"
,
"G1"
));
dtoList
.
add
(
new
InOutReelDto
(
"PN5"
,
"RI5"
,
"Wait"
,
"MBR"
,
"LP1"
,
"UP1"
,
"G1"
));
}
//
if(dtoList.size()<=0&& MicronApi.Debug) {
//
dtoList.add(new InOutReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
//
dtoList.add(new InOutReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
//
dtoList.add(new InOutReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
//
dtoList.add(new InOutReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
//
dtoList.add(new InOutReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
//
}
return
dtoList
;
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1551/controller/ML5SDeviceController.java
查看文件 @
e641fc5
...
...
@@ -116,13 +116,13 @@ public class ML5SDeviceController {
dto
.
setGantry
(
item
.
getAppendData
(
"gantry"
));
}
}
if
(
dtoList
.
size
()<=
0
&&
MicronApi
.
Debug
)
{
dtoList
.
add
(
new
InOutReelDto
(
"PN1"
,
"RI1"
,
"Wait"
,
"MBR"
,
"LP1"
,
"UP1"
,
"G1"
));
dtoList
.
add
(
new
InOutReelDto
(
"PN2"
,
"RI2"
,
"Wait"
,
"MBR"
,
"LP2"
,
"UP3"
,
"G1"
));
dtoList
.
add
(
new
InOutReelDto
(
"PN3"
,
"RI3"
,
"Wait"
,
"MBR"
,
"LP1"
,
"UP1"
,
"G2"
));
dtoList
.
add
(
new
InOutReelDto
(
"PN4"
,
"RI4"
,
"Wait"
,
"MBR"
,
"LP2"
,
"UP3"
,
"G1"
));
dtoList
.
add
(
new
InOutReelDto
(
"PN5"
,
"RI5"
,
"Wait"
,
"MBR"
,
"LP1"
,
"UP1"
,
"G1"
));
}
//
if(dtoList.size()<=0&& MicronApi.Debug) {
//
dtoList.add(new InOutReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
//
dtoList.add(new InOutReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
//
dtoList.add(new InOutReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
//
dtoList.add(new InOutReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
//
dtoList.add(new InOutReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
//
}
return
dtoList
;
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1551/controller/M
L5
DeviceController.java
→
src/main/java/com/neotel/smfcore/custom/micron1551/controller/M
icron1551
DeviceController.java
查看文件 @
e641fc5
package
com
.
neotel
.
smfcore
.
custom
.
micron1551
.
controller
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.enlog.EnLog
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
...
...
@@ -18,6 +23,8 @@ import com.neotel.smfcore.core.inList.service.po.InList;
import
com.neotel.smfcore.core.inList.service.po.InListItem
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.message.util.DeviceMessageUtil
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
...
...
@@ -35,9 +42,7 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.session.StoreType
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
...
...
@@ -45,7 +50,7 @@ import java.util.*;
@Api
(
tags
=
"1551 设备接口"
)
@RestController
@Slf4j
public
class
M
L5
DeviceController
{
public
class
M
icron1551
DeviceController
{
@Autowired
DataCache
dataCache
;
...
...
@@ -67,8 +72,12 @@ public class ML5DeviceController {
protected
CodeResolve
codeResolve
;
@Autowired
private
IAlarmInfoDao
alarmInfoDao
;
@Autowired
private
LiteOrderCache
liteOrderCache
;
@ApiOperation
(
"ML5S扫码后获取库位号"
)
@PostMapping
(
value
=
"/
service/ml5s
/emptyPosForPutin"
)
@PostMapping
(
value
=
"/
rest/micron1551
/emptyPosForPutin"
)
@ResponseBody
@AnonymousAccess
public
Map
<
String
,
Object
>
ml5sEmptyPosForPutin
(
HttpServletRequest
request
)
{
...
...
@@ -712,4 +721,147 @@ public class ML5DeviceController {
return
barcode
;
}
// ML5O获取料盘目的地post :
// /rest/micron1551/getTargetLine
//
// 参数:barcode
// 返回:
// code=0时获取目的地成功, data中包含:barcode,plateW,plateH,taskId,line
// taskId是任务ID,line是目的地,手动出料时line为空
// code=1时只有尺寸,没有出库任务料盘需要NG, data中包含:barcode,plateW,plateH
// code=其他值时错误,尺寸也没有
@ApiOperation
(
"ML5O获取料盘目的地"
)
@PostMapping
(
value
=
"/rest/micron1551/getTargetLine"
)
@ResponseBody
@AnonymousAccess
public
ResultBean
getTargetLine
(
HttpServletRequest
request
)
{
try
{
String
barcodeStr
=
request
.
getParameter
(
"barcode"
);
log
.
info
(
" getTargetLine ["
+
barcodeStr
+
"] "
);
EnLog
.
info
(
"Get size info for ["
+
barcodeStr
+
"]"
);
Collection
<
CodeBean
>
codeBeans
=
codeResolve
.
resolveCodeStr
(
barcodeStr
,
COMPONENT_TYPE
.
COMPONENT
);
Barcode
barcode
=
null
;
for
(
CodeBean
codeBean
:
codeBeans
)
{
if
(
codeBean
.
isValid
())
{
if
(
barcode
!=
null
)
{
String
msg
=
"获取尺寸时找到多个有效条码"
;
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getSize.error"
,
"获取"
+
barcodeStr
+
"尺寸失败:有多个条码"
);
}
else
{
barcode
=
codeBean
.
getBarcode
();
}
}
}
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getSize.error"
,
"获取"
+
barcodeStr
+
"尺寸失败:未找到有效条码"
);
}
Map
<
String
,
String
>
returnData
=
new
HashMap
<>();
returnData
.
put
(
"barcode"
,
barcode
.
getBarcode
());
returnData
.
put
(
"plateW"
,
barcode
.
getPlateSize
()
+
""
);
returnData
.
put
(
"plateH"
,
barcode
.
getHeight
()
+
""
);
//查找任务
List
<
DataLog
>
dataLogs
=
taskService
.
getAllTasks
();
DataLog
currTask
=
null
;
for
(
DataLog
dataLog
:
dataLogs
)
{
if
(
dataLog
.
isCheckOutTask
())
{
if
(
dataLog
.
isFinished
()
||
dataLog
.
isCancel
()
||
dataLog
.
isEnd
())
{
}
else
{
currTask
=
dataLog
;
break
;
}
}
}
if
(
currTask
!=
null
)
{
returnData
.
put
(
"taskId"
,
currTask
.
getId
());
String
line
=
""
;
if
(
ObjectUtil
.
isNotEmpty
(
currTask
.
getSourceId
())
&&
ObjectUtil
.
isNotEmpty
(
currTask
.
getSourceName
()))
{
LiteOrder
order
=
liteOrderCache
.
getLiteOrder
(
currTask
.
getSourceName
());
if
(
order
!=
null
)
{
if
(
ObjectUtil
.
isEmpty
(
order
.
getLine
()))
{
line
=
order
.
getOrderNo
();
}
else
{
line
=
order
.
getLine
();
}
}
}
returnData
.
put
(
"line"
,
line
);
return
ResultBean
.
newOkResult
(
returnData
);
}
else
{
log
.
info
(
" getTargetLine ["
+
barcodeStr
+
"],未找到任务信息"
);
ResultBean
result
=
ResultBean
.
newErrorResult
(
1
,
"smfcore.getTargetLine.notask"
,
"未找到出库任务:"
);
result
.
setData
(
returnData
);
return
result
;
}
}
catch
(
ValidateException
e
)
{
log
.
warn
(
" getTargetLine error :"
+
e
.
getMessage
());
EnLog
.
warn
(
"Get size info error: "
+
e
.
getMessage
());
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getTargetLine.error"
,
"获取料盘目的地出错:"
+
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"getTargetLine error"
,
e
);
EnLog
.
error
(
"Get size info error"
,
e
);
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getTargetLine.error"
,
"获取料盘目的地出错:"
+
e
.
getMessage
());
}
}
@ApiOperation
(
"获取条码尺寸"
)
@PostMapping
(
value
=
"/service/micron1551/getSize"
)
@ResponseBody
@AnonymousAccess
public
ResultBean
getSize
(
HttpServletRequest
request
)
{
try
{
String
barcodeStr
=
request
.
getParameter
(
"barcode"
);
log
.
info
(
" 获取["
+
barcodeStr
+
"]的尺寸信息"
);
EnLog
.
info
(
"Get size info for ["
+
barcodeStr
+
"]"
);
Collection
<
CodeBean
>
codeBeans
=
codeResolve
.
resolveCodeStr
(
barcodeStr
,
COMPONENT_TYPE
.
COMPONENT
);
Barcode
barcode
=
null
;
for
(
CodeBean
codeBean
:
codeBeans
)
{
if
(
codeBean
.
isValid
())
{
if
(
barcode
!=
null
)
{
String
msg
=
"获取尺寸时找到多个有效条码"
;
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getSize.error"
,
"获取"
+
barcodeStr
+
"尺寸失败:有多个条码"
);
}
else
{
barcode
=
codeBean
.
getBarcode
();
}
}
}
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getSize.error"
,
"获取"
+
barcodeStr
+
"尺寸失败:未找到有效条码"
);
}
if
(
barcode
.
getPlateSize
()
>
0
&&
barcode
.
getHeight
()
>
0
)
{
Map
<
String
,
String
>
returnData
=
new
HashMap
<>();
returnData
.
put
(
"barcode"
,
barcode
.
getBarcode
());
returnData
.
put
(
"plateW"
,
barcode
.
getPlateSize
()
+
""
);
returnData
.
put
(
"plateH"
,
barcode
.
getHeight
()
+
""
);
return
ResultBean
.
newOkResult
(
returnData
);
}
else
{
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getSize.error"
,
"获取"
+
barcodeStr
+
"尺寸失败:未找到对应尺寸"
);
}
}
catch
(
ValidateException
e
)
{
log
.
warn
(
" 获取尺寸信息出错:"
+
e
.
getMessage
());
EnLog
.
warn
(
"Get size info error: "
+
e
.
getMessage
());
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getSize.error"
,
"获取尺寸信息出错:"
+
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"获取尺寸信息出错"
,
e
);
EnLog
.
error
(
"Get size info error"
,
e
);
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.getSize.error"
,
"获取尺寸信息出错:"
+
e
.
getMessage
());
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论