Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 86fd2dcd
由
LN
编写于
2023-08-16 14:25:39 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.增加日志和提示
1 个父辈
323044bb
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
27 行增加
和
8 行删除
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
src/main/java/com/neotel/smfcore/custom/micron1053/loading/LoadingController.java
src/main/java/com/neotel/smfcore/custom/micron1053/loading/util/LoadingUtil.java
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronPreTaskController.java
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
查看文件 @
86fd2dc
...
...
@@ -211,6 +211,8 @@ public class MicronApi {
// ]
// "status": "Success"
// }
String
paramStr
=
JsonUtil
.
toJsonStr
(
paramsMap
);
log
.
info
(
"调用MES接口 API002: url=["
+
url
+
"],body=["
+
paramStr
+
"]"
);
MicronResult
result
=
HttpHelper
.
postMicronJson
(
url
,
paramsMap
);
List
<
MaterialStatus
>
resultList
=
result
.
getResult
(
"materialStatusList"
);
...
...
@@ -334,6 +336,7 @@ public class MicronApi {
materialList
=
result
.
getResult
(
"materials"
);
}
catch
(
Exception
e
)
{
log
.
error
(
url
+
"出错"
,
e
);
return
null
;
}
return
materialList
;
}
...
...
@@ -374,6 +377,7 @@ public class MicronApi {
}
catch
(
Exception
e
)
{
log
.
error
(
url
+
"出错"
,
e
);
return
null
;
}
return
materialList
;
}
...
...
@@ -519,7 +523,6 @@ public class MicronApi {
String
operationId
=
result
.
getResult
(
"operationId"
);
return
operationId
;
}
catch
(
Exception
e
)
{
log
.
error
(
url
+
"出错"
,
e
);
}
...
...
@@ -532,6 +535,7 @@ public class MicronApi {
url
=
MessageFormat
.
format
(
url
,
id
,
operationId
,
skipSap
);
try
{
log
.
info
(
"调用MES接口 API101: url=["
+
url
+
"] "
);
MicronResult
result
=
HttpHelper
.
getMicronJson
(
url
);
return
true
;
}
catch
(
ApiException
e
)
{
...
...
@@ -546,6 +550,7 @@ public class MicronApi {
url
=
MessageFormat
.
format
(
url
,
id
,
operationId
);
try
{
log
.
info
(
"调用MES接口 API102: url=["
+
url
+
"] "
);
MicronResult
result
=
HttpHelper
.
getMicronJson
(
url
);
return
true
;
}
catch
(
ApiException
e
)
{
...
...
@@ -560,6 +565,7 @@ public class MicronApi {
url
=
MessageFormat
.
format
(
url
,
purchaseOrder
,
packagingSlip
,
operationId
,
skipSap
);
try
{
log
.
info
(
"调用MES接口 API103: url=["
+
url
+
"] "
);
MicronResult
result
=
HttpHelper
.
getMicronJson
(
url
);
return
true
;
}
catch
(
ApiException
e
)
{
...
...
@@ -574,6 +580,7 @@ public class MicronApi {
url
=
MessageFormat
.
format
(
url
,
linePrepOrderId
,
operationId
);
try
{
log
.
info
(
"调用MES接口 API201: url=["
+
url
+
"] "
);
MicronResult
result
=
HttpHelper
.
postMicronJson
(
url
,
null
);
return
true
;
}
catch
(
ApiException
e
)
{
...
...
@@ -589,6 +596,7 @@ public class MicronApi {
url
=
MessageFormat
.
format
(
url
,
badgeId
);
try
{
log
.
info
(
"调用MES接口 API202: url=["
+
url
+
"] "
);
MicronResult
result
=
HttpHelper
.
getMicronJson
(
url
);
return
true
;
}
catch
(
ApiException
e
)
{
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/loading/LoadingController.java
查看文件 @
86fd2dc
...
...
@@ -120,8 +120,7 @@ public class LoadingController {
// 接口获取
String
id
=
MicronApi
.
Api011
(
APIMODE
.
MATRET
,
SecurityUtils
.
getCurrentUsername
(),
""
);
if
(
ObjectUtil
.
isEmpty
(
id
))
{
throw
new
ValidateException
(
"smfcore.api011.fail"
,
"Api011获取数据失败"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.api.fail"
,
"Api011获取数据失败"
,
new
String
[]{
"Api011"
});
}
LoadingInfo
loadingInfo
=
new
LoadingInfo
(
APIMODE
.
MATRET
,
id
,
""
,
DateTime
.
now
());
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/loading/util/LoadingUtil.java
查看文件 @
86fd2dc
...
...
@@ -151,6 +151,7 @@ public class LoadingUtil {
private
boolean
PushToMes
(
InList
inList
,
List
<
StoragePos
>
posList
)
{
Map
<
String
,
Boolean
>
resultMap
=
MicronApi
.
API002
(
""
,
inList
.
getOperationId
(),
posList
);
List
<
InListItem
>
inListItems
=
new
ArrayList
<>();
boolean
isEnd
=
true
;
if
(
inList
.
getRfidList
().
size
()
<=
inList
.
getShelfNum
())
{
...
...
@@ -161,6 +162,9 @@ public class LoadingUtil {
if
(
resultMap
.
containsKey
(
item
.
getRi
()))
{
Boolean
result
=
resultMap
.
get
(
item
.
getRi
());
if
(
result
==
null
){
result
=
false
;
}
int
newS
;
if
(
result
)
{
newS
=
INITEM_STATUS
.
Fail
;
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronPreTaskController.java
查看文件 @
86fd2dc
...
...
@@ -89,8 +89,8 @@ public class MicronPreTaskController {
@GetMapping
(
"/getTaskId"
)
public
ResultBean
task
(
String
mode
)
{
//判断是否验证
if
(!
MicronApi
.
isEnable
())
{
return
ResultBean
.
newErrorResult
(
9
,
"smfcore.micron.apiClose"
,
" Not yet open"
);
if
(!
MicronApi
.
isEnable
())
{
return
ResultBean
.
newErrorResult
(
9
,
"smfcore.micron.apiClose"
,
" Not yet open"
);
}
//判断是否生成,未关闭的工单
TaskDto
dto
=
getTaskDtoByMode
(
mode
);
...
...
@@ -102,7 +102,7 @@ public class MicronPreTaskController {
dto
.
setItemList
(
itemList
);
List
<
MaterialDispatchStatus
>
statusList
=
getStatusList
(
itemList
);
dto
.
setStatusList
(
statusList
);
}
else
if
(
dto
!=
null
)
{
}
else
if
(
dto
!=
null
)
{
return
ResultBean
.
newOkResult
(
dto
);
}
else
{
dto
=
new
TaskDto
();
...
...
@@ -121,11 +121,12 @@ public class MicronPreTaskController {
dataCache
.
updateCache
(
key
,
dto
);
log
.
info
(
"mode="
+
mode
+
",获取到数据:operationId="
+
operationId
+
",保存数据到cache "
+
key
);
}
else
{
throw
new
ValidateException
(
"smfcore.api.fail"
,
"{0} Failed to get data"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.api.fail"
,
"{0} Failed to get data"
,
new
String
[]{
"API004"
}
);
}
}
else
{
throw
new
ValidateException
(
"smfcore.api011.fail"
,
"Api011 获取数据失败"
);
// throw new ValidateException("smfcore.api011.fail", "Api011 获取数据失败");
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.api.fail"
,
"Api011 获取数据失败"
,
new
String
[]{
"API011"
});
}
}
...
...
@@ -157,8 +158,15 @@ public class MicronPreTaskController {
List
<
Material
>
materialList
=
new
ArrayList
<>();
if
(
APIMODE
.
LINEPREP
.
equals
(
mode
))
{
materialList
=
MicronApi
.
Api005
(
operationId
,
pretasks
.
get
(
0
));
if
(
materialList
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.api.fail"
,
"{0} Failed to get data"
,
new
String
[]{
"API005"
});
}
}
else
{
materialList
=
MicronApi
.
Api006
(
operationId
,
pretasks
);
if
(
materialList
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.api.fail"
,
"{0} Failed to get data"
,
new
String
[]{
"API006"
});
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论