Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8e48a9c5
由
LN
编写于
2023-08-30 16:39:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
bug修改
1 个父辈
92dc9d31
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
57 行增加
和
6 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
src/main/java/com/neotel/smfcore/custom/micron1053/api/bean/IdInfo.java
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronPreTaskController.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
8e48a9c
...
...
@@ -566,6 +566,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
if
(
barcode
.
isToXray
()){
log
.
info
(
"物料["
+
barcode
.
getBarcode
()+
"]需要先去点料"
);
resultMap
.
put
(
"result"
,
"110"
);
resultMap
.
put
(
"barcode"
,
barcode
.
getBarcode
());
errorMsg
=
MessageUtils
.
getText
(
"smfcore.api.toXray"
,
new
String
[]{
barcode
.
getBarcode
()},
new
Locale
(
"en"
,
"US"
),
"{0}需要去点料"
);
resultMap
.
put
(
"msg"
,
errorMsg
);
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
查看文件 @
8e48a9c
...
...
@@ -397,8 +397,19 @@ public class MicronApi {
log
.
info
(
"调用MES接口 API006: url="
+
url
+
",body="
+
paramStr
+
""
);
MicronResult
result
=
HttpHelper
.
postMicronJson
(
url
,
paramMap
);
if
(
result
.
isOk
()&&
result
.
statusIsSuccess
())
{
materialList
=
result
.
getResult
(
"materials"
);
if
(
result
.
isOk
())
{
List
<
Object
>
objects
=
result
.
getResult
(
"materials"
,
false
);
if
(
objects
==
null
||
objects
.
size
()<=
0
){
log
.
info
(
"API006 ,接口通信失败"
);
throw
new
ApiException
(
"smfcore.api.fail"
,
"{0} Failed to get data"
,
new
String
[]{
"API006"
});
}
for
(
Object
object
:
objects
)
{
Material
material
=
JsonUtil
.
toObj
(
JsonUtil
.
toJsonStr
(
object
)
,
Material
.
class
);
materialList
.
add
(
material
);
}
return
materialList
;
}
else
{
log
.
info
(
"API006 ,接口通信失败"
);
...
...
@@ -409,7 +420,6 @@ public class MicronApi {
log
.
error
(
url
+
"出错"
,
e
);
return
null
;
}
return
materialList
;
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/api/bean/IdInfo.java
查看文件 @
8e48a9c
...
...
@@ -12,6 +12,6 @@ import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
public
class
IdInfo
implements
Serializable
{
private
String
Id
Str
;
private
String
Id
;
private
List
<
Object
>
Attribute
;
}
\ No newline at end of file
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronPreTaskController.java
查看文件 @
8e48a9c
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
.
task
;
import
com.mks.api.response.APIException
;
import
com.neotel.smfcore.common.bean.ResultBean
;
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.JsonUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.device.enums.OP
;
...
...
@@ -89,8 +91,35 @@ public class MicronPreTaskController {
@ApiOperation
(
"出库页面展示"
)
@AnonymousAccess
@GetMapping
(
"/getTaskId"
)
public
ResultBean
task
(
String
mode
)
throws
ApiException
{
public
ResultBean
task
(
String
mode
)
throws
ApiException
{
//
// MicronResult result = new MicronResult(200,"{\n" +
// " \"trasactionId\": \"00000000-0000-0000-0000-000000000000\",\n" +
// " \"materials\": [\n" +
// " {\n" +
// " \"serialNum\": \"P2SITPCB001\",\n" +
// " \"partNumber\": \"550-502922\"\n" +
// " }\n" +
// " ]\n" +
// "}");
// if (result.isOk()) {
// List<Object> materialList = result.getResult("materials",false);
// if(materialList.size()>0){
// if (materialList != null && !materialList.isEmpty()) {
// //生成工单进行出库
// List<LiteOrderItem> itemList = new ArrayList<>();
// for (Object object : materialList) {
// Material material= JsonUtil.toObj(JsonUtil.toJsonStr( object) ,Material.class);
//
// }
// }
// }
// }else{
//
// log.info("API006 ,接口通信失败");
// throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API006"});
// }
//判断是否验证
if
(!
MicronApi
.
isEnable
())
{
return
ResultBean
.
newErrorResult
(
9
,
"smfcore.micron.apiClose"
,
" Not yet open"
);
...
...
@@ -299,6 +328,17 @@ public class MicronPreTaskController {
log
.
info
(
" abort :mode="
+
mode
);
LiteOrder
order
=
getOrderByMode
(
mode
);
if
(
order
==
null
)
{
//如果dto不是空
if
(
dto
!=
null
){
//清空配置
String
key
=
Constants
.
CACHE_DISPATCH
+
order
.
getMode
();
log
.
info
(
"abort mode="
+
order
.
getMode
()+
" 清空 key="
+
key
+
" 的cache"
);
dataCache
.
updateCache
(
key
,
""
);
return
ResultBean
.
newOkResult
(
""
);
}
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
List
<
LiteOrderItem
>
liteOrderItemList
=
order
.
getOrderItems
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论