Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 51dcbdc6
由
zshaohui
编写于
2024-06-25 09:59:28 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/smf-core-21088' into smf-core-21088
2 个父辈
fc7b2b26
26e15dcc
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
16 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/api/LuxsanApi.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/LineController.java
src/main/java/com/neotel/smfcore/custom/luxsan/api/LuxsanApi.java
查看文件 @
51dcbdc
...
@@ -2,6 +2,7 @@ package com.neotel.smfcore.custom.luxsan.api;
...
@@ -2,6 +2,7 @@ package com.neotel.smfcore.custom.luxsan.api;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.NumberUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
...
@@ -21,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -21,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -1010,9 +1012,10 @@ public class LuxsanApi extends DefaultSmfApiListener {
...
@@ -1010,9 +1012,10 @@ public class LuxsanApi extends DefaultSmfApiListener {
}
}
public
static
List
<
GetBoxNGResult
>
getBoxNGsnList
(
GetBoxNGsnListRequest
request
)
{
public
static
List
<
GetBoxNGResult
>
getBoxNGsnList
(
GetBoxNGsnListRequest
request
)
{
try
{
log
.
info
(
"getBoxNGsnList接口请求参数为:"
+
JSON
.
toJSONString
(
request
));
log
.
info
(
"getBoxNGsnList接口请求参数为:"
+
JSON
.
toJSONString
(
request
));
String
resultStr
=
HttpHelper
.
postJson
(
getBoxNGsnListUrl
,
request
);
String
resultStr
=
null
;
try
{
resultStr
=
HttpHelper
.
postJson
(
getBoxNGsnListUrl
,
request
);
log
.
info
(
"getBoxNGsnList接口返回结果为:"
+
resultStr
);
log
.
info
(
"getBoxNGsnList接口返回结果为:"
+
resultStr
);
JSONObject
resultJson
=
JsonUtil
.
toObj
(
resultStr
,
JSONObject
.
class
);
JSONObject
resultJson
=
JsonUtil
.
toObj
(
resultStr
,
JSONObject
.
class
);
if
(
resultJson
!=
null
)
{
if
(
resultJson
!=
null
)
{
...
@@ -1023,9 +1026,12 @@ public class LuxsanApi extends DefaultSmfApiListener {
...
@@ -1023,9 +1026,12 @@ public class LuxsanApi extends DefaultSmfApiListener {
if
(
StringUtils
.
isEmpty
(
errorMessage
))
{
if
(
StringUtils
.
isEmpty
(
errorMessage
))
{
errorMessage
=
""
;
errorMessage
=
""
;
}
}
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}],失败原因[{1}]"
,
new
String
[]{
getBoxNGsnListUrl
,
errorMessage
});
log
.
error
(
String
.
format
(
"接口请求失败[%s],失败原因[%s]"
,
getBoxNGsnListUrl
,
errorMessage
));
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}],失败原因[{1}]"
,
new
String
[]{
"getBoxNGsnList"
,
errorMessage
});
}
else
{
}
else
{
List
<
GetBoxNGResult
>
resultList
=
JSONObject
.
parseArray
(
dataJson
.
getString
(
"data"
),
GetBoxNGResult
.
class
);
JSONArray
arrayData
=
dataJson
.
getJSONArray
(
"data"
);
System
.
out
.
println
(
arrayData
);
List
<
GetBoxNGResult
>
resultList
=
JSONObject
.
parseArray
(
JSONArray
.
toJSONString
(
arrayData
),
GetBoxNGResult
.
class
);
if
(
resultList
!=
null
&&
!
resultList
.
isEmpty
())
{
if
(
resultList
!=
null
&&
!
resultList
.
isEmpty
())
{
return
resultList
;
return
resultList
;
}
}
...
@@ -1033,10 +1039,11 @@ public class LuxsanApi extends DefaultSmfApiListener {
...
@@ -1033,10 +1039,11 @@ public class LuxsanApi extends DefaultSmfApiListener {
}
}
}
}
}
catch
(
ApiException
e
)
{
}
catch
(
ApiException
e
)
{
log
.
error
(
"getBoxNGsnList接口请求失败:"
+
e
.
getMessage
(
));
log
.
error
(
String
.
format
(
"接口返回值格式错误[%s]"
,
getBoxNGsnListUrl
));
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口
请求失败[{0}]"
,
new
String
[]{
e
.
getMessage
()
});
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口
返回值格式错误[{0}]"
,
new
String
[]{
"getBoxNGsnList"
});
}
}
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
"getBoxNGsnListUrl"
});
log
.
error
(
String
.
format
(
"接口请求失败[%s]"
,
getBoxNGsnListUrl
));
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
"getBoxNGsnList"
});
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/LineController.java
查看文件 @
51dcbdc
...
@@ -340,15 +340,6 @@ public class LineController {
...
@@ -340,15 +340,6 @@ public class LineController {
public
ResultBean
getBoxNGsnList
(
@RequestBody
GetBoxNGsnListRequest
result
){
public
ResultBean
getBoxNGsnList
(
@RequestBody
GetBoxNGsnListRequest
result
){
log
.
info
(
"机种["
+
result
.
getModel
()+
"]和CartonId:"
+
result
.
getCarton_id
());
log
.
info
(
"机种["
+
result
.
getModel
()+
"]和CartonId:"
+
result
.
getCarton_id
());
List
<
GetBoxNGResult
>
boxNGsnList
=
LuxsanApi
.
getBoxNGsnList
(
result
);
List
<
GetBoxNGResult
>
boxNGsnList
=
LuxsanApi
.
getBoxNGsnList
(
result
);
// List<GetBoxNGResult> boxNGsnList = new ArrayList<>();
// for (int i = 0; i < 10; i++) {
// GetBoxNGResult getBoxNGResult = new GetBoxNGResult();
// getBoxNGResult.setSN("SN" + i);
// getBoxNGResult.setNGREASON("REASON");
// getBoxNGResult.setROW((int)(Math.random() * 15));
// getBoxNGResult.setCOLUMN((int)(Math.random() * 15));
// boxNGsnList.add(getBoxNGResult);
// }
return
ResultBean
.
newOkResult
(
boxNGsnList
);
return
ResultBean
.
newOkResult
(
boxNGsnList
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论