Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit da97b955
由
sunke
编写于
2022-07-25 09:17:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
大陆科技料架
1 个父辈
08f5ce75
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
46 行增加
和
34 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLMShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/SpBoxHandler.java
src/main/java/com/neotel/smfcore/custom/dalu/DaLuApi.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLMShelfHandler.java
查看文件 @
da97b95
...
@@ -242,7 +242,7 @@ public class NLMShelfHandler extends BaseDeviceHandler {
...
@@ -242,7 +242,7 @@ public class NLMShelfHandler extends BaseDeviceHandler {
}
}
if
(
barcode
.
getPlateSize
()
<=
1
)
{
if
(
barcode
.
getPlateSize
()
<=
1
)
{
//长宽为1的需要弹框设置尺寸
//长宽为1的需要弹框设置尺寸
throw
new
ValidateException
(
"smfcore.error.barcode.errorSize"
,
"条码未设置尺寸"
);
return
ResultBean
.
newErrorResult
(
101
,
"smfcore.error.barcode.errorSize"
,
"条码未设置尺寸"
);
}
}
try
{
try
{
StoragePos
inPos
=
storagePosManager
.
getByBarcodeId
(
barcode
.
getId
());
StoragePos
inPos
=
storagePosManager
.
getByBarcodeId
(
barcode
.
getId
());
...
@@ -275,7 +275,7 @@ public class NLMShelfHandler extends BaseDeviceHandler {
...
@@ -275,7 +275,7 @@ public class NLMShelfHandler extends BaseDeviceHandler {
taskService
.
addTaskToFinished
(
inPos
,
null
,
loginUser
);
taskService
.
addTaskToFinished
(
inPos
,
null
,
loginUser
);
opPosLight
(
"close"
,
storage
,
inPos
,
null
);
opPosLight
(
"close"
,
storage
,
inPos
,
null
);
log
.
info
(
barcode
.
getBarcode
()
+
" 出库完成, 库位["
+
inPos
.
getPosName
()
+
"]灭灯"
);
log
.
info
(
barcode
.
getBarcode
()
+
" 出库完成, 库位["
+
inPos
.
getPosName
()
+
"]灭灯"
);
return
ResultBean
.
new
ErrorResult
(
1
,
"smfcore.shelf.msg.outConfirm"
,
"出库完成, 库位[{0}]灭灯"
,
new
String
[]{
inPos
.
getPosName
()});
return
ResultBean
.
new
OkResult
(
"smfcore.shelf.msg.outConfirm"
,
"出库完成, 库位[{0}]灭灯"
,
new
String
[]{
inPos
.
getPosName
()});
}
}
}
}
return
ResultBean
.
newErrorResult
(
99
,
"smfcore.shelf.msg.alreadyInPos"
,
"该物料已在库位["
+
posName
+
"]中"
,
new
String
[]{
posName
});
return
ResultBean
.
newErrorResult
(
99
,
"smfcore.shelf.msg.alreadyInPos"
,
"该物料已在库位["
+
posName
+
"]中"
,
new
String
[]{
posName
});
...
@@ -366,6 +366,15 @@ public class NLMShelfHandler extends BaseDeviceHandler {
...
@@ -366,6 +366,15 @@ public class NLMShelfHandler extends BaseDeviceHandler {
}
}
@RequestMapping
(
"/api/nlmShelf/getSizeData"
)
@ResponseBody
@AnonymousAccess
public
ResultBean
getSizeData
(
HttpServletRequest
request
){
String
cid
=
request
.
getParameter
(
"cid"
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
return
ResultBean
.
newOkResult
(
storage
.
getUsageMap
());
}
/**
/**
* 获取料架的库位占用情况
* 获取料架的库位占用情况
*/
*/
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
查看文件 @
da97b95
...
@@ -87,11 +87,17 @@ public class NLPShelfHandler extends BaseDeviceHandler{
...
@@ -87,11 +87,17 @@ public class NLPShelfHandler extends BaseDeviceHandler{
}
}
}
}
Barcode
barcodeSave
=
resolveBarcodeFromApiForShelf
(
new
CodeValidateParam
(
loginUser
,
groupId
,
storageId
,
code
,
token
));
Barcode
barcodeSave
=
smfApi
.
resolveBarcode
(
new
CodeValidateParam
(
loginUser
,
groupId
,
storageId
,
code
,
token
));
if
(
barcodeSave
==
null
){
barcodeSave
=
smfApi
.
canPutInBeforeResolve
(
code
);
}
if
(
barcodeSave
==
null
){
if
(
barcodeSave
==
null
){
barcodeSave
=
codeResolve
.
resolveOneValideBarcode
(
"=1x1="
+
code
);
barcodeSave
=
codeResolve
.
resolveOneValideBarcode
(
"=1x1="
+
code
);
}
}
Date
expireDate
=
barcodeSave
.
getExpireDate
();
Date
expireDate
=
barcodeSave
.
getExpireDate
();
if
(
expireDate
!=
null
)
{
if
(
expireDate
!=
null
)
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
...
@@ -100,7 +106,7 @@ public class NLPShelfHandler extends BaseDeviceHandler{
...
@@ -100,7 +106,7 @@ public class NLPShelfHandler extends BaseDeviceHandler{
}
}
//从API验证
//从API验证
Barcode
verResult
=
verifyPutInFromApi
(
barcodeSave
);
Barcode
verResult
=
smfApi
.
canPutInAfterResolve
(
barcodeSave
);
if
(
verResult
!=
null
){
if
(
verResult
!=
null
){
barcodeSave
=
verResult
;
barcodeSave
=
verResult
;
...
@@ -160,13 +166,6 @@ public class NLPShelfHandler extends BaseDeviceHandler{
...
@@ -160,13 +166,6 @@ public class NLPShelfHandler extends BaseDeviceHandler{
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
/**
* 从API接口解析条码,通常料架使用(其他设备会有尺寸信息且会有多个条码所以不适用此方法)
*/
protected
Barcode
resolveBarcodeFromApiForShelf
(
CodeValidateParam
param
)
throws
ValidateException
{
return
smfApi
.
resolveBarcode
(
param
);
}
@Override
@Override
public
StatusBean
handleClientRequest
(
StatusBean
statusBean
,
HttpServletRequest
request
)
{
public
StatusBean
handleClientRequest
(
StatusBean
statusBean
,
HttpServletRequest
request
)
{
...
@@ -362,11 +361,12 @@ public class NLPShelfHandler extends BaseDeviceHandler{
...
@@ -362,11 +361,12 @@ public class NLPShelfHandler extends BaseDeviceHandler{
super
.
finishedPutIn
(
cid
,
pos
.
getPosName
());
super
.
finishedPutIn
(
cid
,
pos
.
getPosName
());
inOkList
.
add
(
hasReelPosList
[
0
]);
inOkList
.
add
(
hasReelPosList
[
0
]);
String
msg
=
queueTask
.
getBarcode
()
+
"入库到"
+
pos
.
getPosName
()
+
"成功"
;
String
msg
=
queueTask
.
getBarcode
()
+
"入库到"
+
pos
.
getPosName
()
+
"成功"
;
log
.
error
(
msg
);
log
.
info
(
msg
);
WebSocketServer
.
sendMsg
(
""
,
new
SocketMsg
(
msg
,
MsgType
.
INFO
,
"smfclient.nlp.inputOk"
,
new
String
[]{
queueTask
.
getBarcode
(),
pos
.
getPosName
()}));
WebSocketServer
.
sendMsg
(
""
,
new
SocketMsg
(
msg
,
MsgType
.
INFO
,
"smfclient.nlp.inputOk"
,
new
String
[]{
queueTask
.
getBarcode
(),
pos
.
getPosName
()}));
break
;
break
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"入库出错"
,
e
);
log
.
error
(
"入库出错"
+
e
.
getMessage
());
WebSocketServer
.
sendMsg
(
""
,
new
SocketMsg
(
"入库出错:"
+
e
.
getMessage
(),
MsgType
.
ERROR
,
"smfclient.nlp.inputError"
,
new
String
[]{
e
.
getMessage
()}));
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.inputError"
,
"入库出错:{0}"
,
new
String
[]{
e
.
getMessage
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.inputError"
,
"入库出错:{0}"
,
new
String
[]{
e
.
getMessage
()});
}
}
}
}
...
@@ -416,7 +416,8 @@ public class NLPShelfHandler extends BaseDeviceHandler{
...
@@ -416,7 +416,8 @@ public class NLPShelfHandler extends BaseDeviceHandler{
WebSocketServer
.
sendMsg
(
""
,
new
SocketMsg
(
msg
,
MsgType
.
INFO
,
"smfclient.nlp.outputOk"
,
new
String
[]{
queueTask
.
getBarcode
(),
posName
}));
WebSocketServer
.
sendMsg
(
""
,
new
SocketMsg
(
msg
,
MsgType
.
INFO
,
"smfclient.nlp.outputOk"
,
new
String
[]{
queueTask
.
getBarcode
(),
posName
}));
break
;
break
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"出库出错"
,
e
);
log
.
error
(
"出库出错"
+
e
.
getMessage
());
WebSocketServer
.
sendMsg
(
""
,
new
SocketMsg
(
"出库出错:"
+
e
.
getMessage
(),
MsgType
.
ERROR
,
"smfclient.nlp.outputError"
,
new
String
[]{
e
.
getMessage
()}));
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.checkoutError"
,
"出库出错:{0}"
,
new
String
[]{
e
.
getMessage
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.checkoutError"
,
"出库出错:{0}"
,
new
String
[]{
e
.
getMessage
()});
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/SpBoxHandler.java
查看文件 @
da97b95
...
@@ -114,7 +114,7 @@ public class SpBoxHandler extends BaseDeviceHandler {
...
@@ -114,7 +114,7 @@ public class SpBoxHandler extends BaseDeviceHandler {
verifyBarcodePutIn
(
Lists
.<
Storage
>
newArrayList
(
storage
),
barcodeSave
);
verifyBarcodePutIn
(
Lists
.<
Storage
>
newArrayList
(
storage
),
barcodeSave
);
//从API验证
//从API验证
barcodeSave
=
verifyPutInFromApi
(
barcodeSave
);
barcodeSave
=
smfApi
.
canPutInAfterResolve
(
barcodeSave
);
if
(
barcodeSave
==
null
)
{
if
(
barcodeSave
==
null
)
{
barcodeSave
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
);
barcodeSave
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/dalu/DaLuApi.java
查看文件 @
da97b95
...
@@ -89,8 +89,11 @@ public class DaLuApi extends DefaultSmfApiListener {
...
@@ -89,8 +89,11 @@ public class DaLuApi extends DefaultSmfApiListener {
}
}
String
result
=
HttpHelper
.
postParam
(
inNotifyUrl
,
params
);
String
result
=
HttpHelper
.
postParam
(
inNotifyUrl
,
params
);
log
.
info
(
"收到MES ["
+
inNotifyUrl
+
"] 的关于["
+
barcode
.
getBarcode
()
+
"]入库通知的反馈信息:"
+
result
);
log
.
info
(
"收到MES ["
+
inNotifyUrl
+
"] 的关于["
+
barcode
.
getBarcode
()
+
"]入库通知的反馈信息:"
+
result
);
if
(
result
.
toLowerCase
().
contains
(
"error"
)
||
result
.
toLowerCase
().
contains
(
"ng"
)){
throw
new
ValidateException
(
"smfcore.mes.inNotify.ng"
,
"MES返回:"
+
result
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"向 MES ["
+
inNotifyUrl
+
"]入库通知【"
+
task
.
getBarcode
()
+
"】的信息出错"
,
e
);
throw
new
ValidateException
(
"smfcore.mes.inNotify.error"
,
"入库通知出错,"
+
e
.
getMessage
()
);
}
}
}
}
...
@@ -105,8 +108,14 @@ public class DaLuApi extends DefaultSmfApiListener {
...
@@ -105,8 +108,14 @@ public class DaLuApi extends DefaultSmfApiListener {
params
.
put
(
"RI"
,
task
.
getBarcode
());
params
.
put
(
"RI"
,
task
.
getBarcode
());
String
result
=
HttpHelper
.
postParam
(
outNotifyUrl
,
params
);
String
result
=
HttpHelper
.
postParam
(
outNotifyUrl
,
params
);
log
.
info
(
"收到MES ["
+
outNotifyUrl
+
"]的关于["
+
task
.
getBarcode
()
+
"]出库通知的反馈信息:"
+
result
);
log
.
info
(
"收到MES ["
+
outNotifyUrl
+
"]的关于["
+
task
.
getBarcode
()
+
"]出库通知的反馈信息:"
+
result
);
if
(
result
.
toLowerCase
().
contains
(
"error"
)
||
result
.
toLowerCase
().
contains
(
"ng"
)){
throw
new
ValidateException
(
"smfcore.mes.outNotify.ng"
,
"MES返回:"
+
result
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"向 MES ["
+
outNotifyUrl
+
"]出库通知【"
+
task
.
getBarcode
()
+
"】的信息出错"
,
e
);
String
msg
=
"向 MES发送出库通知【"
+
task
.
getBarcode
()
+
"】的信息出错: "
+
e
.
getMessage
();
log
.
error
(
msg
);
throw
new
ValidateException
(
"smfcore.mes.outNotify.error"
,
"出库通知出错,"
+
e
.
getMessage
());
}
}
}
}
...
...
src/main/resources/config/application.yml
查看文件 @
da97b95
server
:
server
:
port
:
8800
port
:
8800
hella
:
api
:
#host: 127.0.0.1
#name: DaLu
port
:
3333
#inCheckUrl: DaLu
#outNotifyUrl: https://matlabel-tool.com:4434/SMD_BOXAPI/OutBox
siemens
:
#inNotifyUrl: https://matlabel-tool.com:4434/SMD_BOXAPI/InBox
#host: "140.231.193.101"
port
:
#url: "http://cnctu04053:8014/api/JsonC"
#url_checkIn: "http://cnctu04053:8014/api/JsonC"
#url: "http://cnctu041p059:8014/api/JsonC"
#url: "http://cnctu04053:8014/api/JsonC"
action
:
GetMaterialLot
:
"
http://siplace.com/facts/materiallot/2010/01/MaterialLot/GetMaterialLot"
ProcessMaterialLot
:
"
http://siplace.com/facts/materiallot/2010/01/MaterialLot/ProcessMaterialLot"
# 文件存储路径
# 文件存储路径
file
:
file
:
...
@@ -34,7 +26,7 @@ spring:
...
@@ -34,7 +26,7 @@ spring:
mongodb
:
mongodb
:
host
:
localhost
# 主机地址
host
:
localhost
# 主机地址
port
:
27017
# 端口
port
:
27017
# 端口
database
:
smf
-test
# 数据库
database
:
smf
# 数据库
messages
:
messages
:
encoding
:
utf-8
encoding
:
utf-8
main
:
main
:
...
@@ -46,9 +38,10 @@ rsa:
...
@@ -46,9 +38,10 @@ rsa:
app
:
app
:
version
:
'
1.2
5.0517
'
version
:
'
1.2
7.0110
'
type
:
"
"
type
:
"
"
menu
:
menu
:
show
:
show
:
hide
:
hide
:
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论