Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 364c5e00
由
zshaohui
编写于
2025-03-26 14:27:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加获取mes数量接口
1 个父辈
1523e274
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
49 行增加
和
9 行删除
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenController.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
364c5e0
...
...
@@ -194,21 +194,21 @@ public class LizhenApi extends DefaultSmfApiListener {
if
(
barcodeInfoUrl
==
null
)
{
return
null
;
}
log
.
info
(
"获取MES物料数量入参为:"
+
barcode
.
getBarcode
()
);
log
.
info
(
barcode
.
getBarcode
()+
"获取MES物料数量入参为:"
+
barcode
.
getBarcode
()+
"地址为:"
+
barcodeInfoUrl
);
String
result
=
""
;
try
{
result
=
HttpHelper
.
postJson
(
barcodeInfoUrl
,
barcode
.
getBarcode
());
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
}
log
.
info
(
"获取MES物料数量出参为:"
+
result
);
log
.
info
(
barcode
.
getBarcode
()+
"获取MES物料数量出参为:"
+
result
);
JSONObject
resultJson
=
JsonUtil
.
toObj
(
result
,
JSONObject
.
class
);
Integer
status
=
resultJson
.
getInteger
(
"status"
);
if
(
status
!=
null
)
{
if
(
status
==
200
)
{
JSONObject
dataJson
=
resultJson
.
getJSONObject
(
"data"
);
String
reelID
=
dataJson
.
get
(
"reelID"
)
==
null
?
""
:
dataJson
.
get
(
"reelID"
).
toString
();
//
String partNum = dataJson.get("partNum") == null ? "" : dataJson.get("partNum").toString();
String
partNum
=
dataJson
.
get
(
"partNum"
)
==
null
?
""
:
dataJson
.
get
(
"partNum"
).
toString
();
String
partSpec
=
dataJson
.
get
(
"partSpec"
)
==
null
?
""
:
dataJson
.
get
(
"partSpec"
).
toString
();
int
qty
=
dataJson
.
get
(
"qty"
)
==
null
?
0
:
Integer
.
valueOf
(
dataJson
.
get
(
"qty"
).
toString
());
//String vendor = dataJson.get("vendor") == null ? "" : dataJson.get("vendor").toString();
...
...
@@ -220,10 +220,14 @@ public class LizhenApi extends DefaultSmfApiListener {
}
if (StringUtils.isNotBlank(reelID)){
barcode.setBarcode(reelID);
}
if (StringUtils.isNotBlank(partNum)){
barcode.setPartNumber(partNum);
}*/
if
(
StringUtils
.
isNotBlank
(
partNum
)){
if
(!
partNum
.
equals
(
barcode
.
getPartNumber
())){
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.ng"
,
reelID
+
"对应的料号为:"
+
barcode
.
getPartNumber
()+
"与mes返回的料号:"
+
partNum
+
"不一致,请检查物料的唯一码是否重复"
);
}
//barcode.setPartNumber(partNum);
}
if
(
StringUtils
.
isNotBlank
(
reelID
))
{
if
(
qty
==
0
)
{
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.ng"
,
reelID
+
"mes数量返回为0,不允许进行入库"
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenController.java
查看文件 @
364c5e0
...
...
@@ -194,8 +194,8 @@ public class LizhenController {
@AnonymousAccess
public
ResultBean
machineCallMaterial
(
@RequestBody
Map
<
String
,
String
>
data
)
{
boolean
startJob
=
dataCache
.
getCache
(
Constants
.
CACHE_StartJob
);
if
(!
startJob
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"定时任务未开启"
);
if
(!
startJob
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"定时任务未开启"
);
}
log
.
info
(
"Mes缺料预警---"
+
JSONObject
.
toJSONString
(
data
));
PreWarningItem
item
=
new
PreWarningItem
();
...
...
@@ -215,6 +215,42 @@ public class LizhenController {
}
/**
* 机器人转发缺料预警信息
*
* @param paramList
* @return
*/
@PostMapping
(
"/robotMachineCallMaterial"
)
@AnonymousAccess
public
synchronized
ResultBean
robotMachineCallMaterial
(
@RequestBody
List
<
Map
<
String
,
String
>>
paramList
)
{
boolean
startJob
=
dataCache
.
getCache
(
Constants
.
CACHE_StartJob
);
if
(!
startJob
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"定时任务未开启"
);
}
log
.
info
(
"收到机器人缺料预警---"
+
JSONObject
.
toJSONString
(
paramList
));
List
<
PreWarningItem
>
warningItemList
=
new
ArrayList
<>();
for
(
Map
<
String
,
String
>
data
:
paramList
)
{
PreWarningItem
item
=
new
PreWarningItem
();
item
.
setMachinename
(
data
.
get
(
"MACHINENAME"
));
item
.
setStation
(
data
.
get
(
"STATION"
));
item
.
setSide
(
data
.
get
(
"SIDE"
));
item
.
setSlot
(
data
.
get
(
"SLOT"
));
item
.
setSubslot
(
data
.
get
(
"SUBSLOT"
));
item
.
setPartnumber
(
data
.
get
(
"PARTNUMBER"
));
item
.
setLine
(
data
.
get
(
"LINE"
));
item
.
setItemId
(
data
.
get
(
"ID"
));
item
.
setPriority
(
Integer
.
valueOf
(
data
.
get
(
"PRIORITY"
)));
item
.
setReel
(
data
.
get
(
"REEL"
));
item
.
setBrand
(
data
.
get
(
"VENDOR"
));
warningItemList
.
add
(
item
);
}
//PreWarningItemCache.addItems(Arrays.asList(item));
return
ResultBean
.
newOkResult
(
""
);
}
private
String
getForwardUrl
(
String
line
)
{
String
url
=
""
;
for
(
Map
.
Entry
<
String
,
String
>
lineUrlEntry
:
lineUrlMap
.
entrySet
())
{
...
...
src/main/resources/config/application.yml
查看文件 @
364c5e0
...
...
@@ -9,7 +9,7 @@ api:
outNotifyUrlPK
:
inNotifyUrl
:
1
fetchOrderUrl
:
barcodeInfoUrl
:
barcodeInfoUrl
:
http://10.68.25.42:8001/Sct/GetReelInfo
fetchGRUrl
:
brandQtyUrl
:
importUrl
:
http://10.68.27.83/smf-core/ext/getDatalogs
#虚拟仓从1F导入数据接口
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论