Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 97985999
由
LN
编写于
2025-09-09 16:40:00 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
api010处理过程中不能retry和abort
1 个父辈
5999e85c
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
133 行增加
和
32 行删除
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronDispatchController.java
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronPreTaskController.java
src/main/java/com/neotel/smfcore/custom/micron1053/task/bean/dto/TaskDto.java
src/main/resources/messages.properties
src/main/resources/messages_en_US.properties
src/main/resources/messages_ja_JP.properties
src/main/resources/messages_zh_CN.properties
src/main/resources/messages_zh_TW.properties
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
查看文件 @
9798599
...
...
@@ -851,27 +851,35 @@ public class MicronApi {
// }
// ]
// }
int
retryCount
=
dataCache
.
getCache
(
Constants
.
CACHE_API_RetryCount
,
3
);
int
retryInterval
=
dataCache
.
getCache
(
Constants
.
CACHE_API_RetryInterval
,
30
);
//出库前预扣
List
<
TrackStatus
>
statusList
=
new
ArrayList
<>();
if
(
Debug
)
{
for
(
Material
m
:
materialList
)
{
TrackStatus
trackStatus
=
new
TrackStatus
();
long
v
=
retryCount
*
(
retryInterval
+
60
)
*
1000
;
try
{
Thread
.
sleep
(
v
);
log
.
info
(
"调用MES接口 API010 Debug 模式,sleep="
+
v
);
for
(
Material
m
:
materialList
)
{
TrackStatus
trackStatus
=
new
TrackStatus
();
// trackStatus.setSuccess(false);
trackStatus
.
setSapSuccess
(
false
);
trackStatus
.
setMesSuccess
(
false
);
trackStatus
.
setDescription
(
"api010 fail"
);
trackStatus
.
setMaterialStatus
(
"fail"
);
trackStatus
.
setPartNumber
(
m
.
getPartNumber
());
trackStatus
.
setSerialNum
(
m
.
getSerialNum
());
statusList
.
add
(
trackStatus
);
trackStatus
.
setSapSuccess
(
false
);
trackStatus
.
setMesSuccess
(
false
);
trackStatus
.
setDescription
(
"api010 fail"
);
trackStatus
.
setMaterialStatus
(
"fail"
);
trackStatus
.
setPartNumber
(
m
.
getPartNumber
());
trackStatus
.
setSerialNum
(
m
.
getSerialNum
());
statusList
.
add
(
trackStatus
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"调用MES接口 API010 Debug 模式,sleep="
+
v
+
"出错"
,
e
);
}
return
statusList
;
}
int
retryCount
=
dataCache
.
getCache
(
Constants
.
CACHE_API_RetryCount
,
3
);
int
retryInterval
=
dataCache
.
getCache
(
Constants
.
CACHE_API_RetryInterval
,
30
);
String
url
=
config
.
getUrl
(
config
.
api_name_010
);
try
{
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronDispatchController.java
查看文件 @
9798599
...
...
@@ -106,6 +106,11 @@ public class MicronDispatchController {
}
}
public
TaskDto
UpdateTaskDto
(
TaskDto
taskDto
,
int
apiPro
)
{
taskDto
.
setApiProStatus
(
apiPro
);
dataCache
.
updateCache
(
Constants
.
CACHE_DISPATCH
+
taskDto
.
getMode
(),
taskDto
);
return
taskDto
;
}
private
boolean
NeedInputLineId
(
String
mode
){
if
(
mode
.
equalsIgnoreCase
(
Mode_RACK
)){
return
false
;
...
...
@@ -137,7 +142,7 @@ public class MicronDispatchController {
LiteOrder
order
=
getOrderByMode
(
mode
);
if
(
dto
!=
null
&&
ObjectUtil
.
isNotEmpty
(
dto
.
getOperationId
())
&&
ObjectUtil
.
isNotEmpty
(
dto
.
getLineId
())
&&
order
!=
null
)
{
return
getTaskInfo
(
order
);
return
getTaskInfo
(
dto
,
order
);
}
else
{
if
(
dto
!=
null
&&
ObjectUtil
.
isNotEmpty
(
dto
.
getOperationId
()))
{
...
...
@@ -186,20 +191,30 @@ public class MicronDispatchController {
}
private
ResultBean
getTaskInfo
(
LiteOrder
order
)
{
private
ResultBean
getTaskInfo
(
TaskDto
taskDto
,
LiteOrder
order
)
{
//如果工单还未出库
if
(
order
.
isNew
())
{
//返回可以勾选的物料及已验证成功的物料列表
//3=物料选择,5=物料选择页面,接口正在处理中
List
<
SelReelDetialDto
>
reelDetialDtos
=
getReelDetialList
(
order
);
ResultBean
resultBean
=
ResultBean
.
newErrorResult
(
3
,
""
,
""
,
new
String
[]{},
false
);
resultBean
.
setData
(
reelDetialDtos
);
if
(
taskDto
.
getApiProStatus
()==
1
)
{
resultBean
.
setCode
(
5
);
}
return
resultBean
;
}
else
{
//已出库,4=已出库,6=已出库,接口正在处理中,不能retry和abort
ResultBean
resultBean
=
ResultBean
.
newErrorResult
(
4
,
""
,
""
,
new
String
[]{},
false
);
//返回出库信息
List
<
MaterialDispatchDto
>
materialDispatchDtos
=
getOrderMaterialList
(
order
);
ResultBean
resultBean
=
ResultBean
.
newErrorResult
(
4
,
""
,
""
,
new
String
[]{},
false
);
resultBean
.
setData
(
materialDispatchDtos
);
if
(
taskDto
.
getApiProStatus
()==
1
)
{
resultBean
.
setCode
(
6
);
}
return
resultBean
;
}
}
...
...
@@ -350,7 +365,7 @@ public class MicronDispatchController {
}
String
lineId
=
dto
.
getLineId
();
dataCache
.
updateCache
(
Constants
.
CACHE_DISPATCH
+
mode
,
dto
);
return
NewOrderProcess
(
mode
,
lineId
);
return
NewOrderProcess
(
dto
,
mode
,
lineId
);
}
else
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
...
...
@@ -363,7 +378,7 @@ public class MicronDispatchController {
}
}
private
ResultBean
NewOrderProcess
(
String
mode
,
String
lineId
)
{
private
ResultBean
NewOrderProcess
(
TaskDto
taskDto
,
String
mode
,
String
lineId
)
{
//工单上传成功,开始挑料
LiteOrder
order
=
getOrderByMode
(
mode
);
...
...
@@ -374,9 +389,23 @@ public class MicronDispatchController {
if
(
liteOrderCache
.
dispatchOrderIsCheckOk
(
order
))
{
log
.
info
(
order
.
getOrderNo
()
+
"工单已备料完成,直接出料"
);
//直接开始出库
liteOrderCache
.
dispatchCheckOut
(
order
,
false
,
false
,
new
ArrayList
<>());
// liteOrderCache.dispatchCheckOut(order, false, false,new ArrayList<>());
dispatchCheckOut
(
taskDto
,
order
,
false
,
false
,
new
ArrayList
<>());
}
return
getTaskInfo
(
taskDto
,
order
);
}
public
String
dispatchCheckOut
(
TaskDto
taskDto
,
LiteOrder
order
,
boolean
isRetry
,
boolean
isOver
,
List
<
String
>
selRiList
)
{
String
msg
=
""
;
try
{
taskDto
=
UpdateTaskDto
(
taskDto
,
1
);
msg
=
liteOrderCache
.
dispatchCheckOut
(
order
,
isRetry
,
isOver
,
selRiList
);
log
.
info
(
"dispatchCheckOut 工单:["
+
order
.
getOrderNo
()
+
"]["
+
taskDto
.
getMode
()
+
"]执行结果:"
+
msg
);
}
catch
(
Exception
e
)
{
throw
e
;
}
finally
{
taskDto
=
UpdateTaskDto
(
taskDto
,
0
);
}
return
getTaskInfo
(
order
)
;
return
msg
;
}
...
...
@@ -402,7 +431,7 @@ public class MicronDispatchController {
// //已存在,直接返回列表页面
// List<DispatchItemDto> list = dispatchItemMapper.toDto(itemList);
// return ResultBean.newOkResult(list);
return
getTaskInfo
(
order
);
return
getTaskInfo
(
getTaskDtoByMode
(
mode
),
order
);
}
else
{
...
...
@@ -510,7 +539,7 @@ public class MicronDispatchController {
liteOrder
=
liteOrderManager
.
createWithItems
(
liteOrder
);
liteOrderCache
.
addOrderToMap
(
liteOrder
);
return
NewOrderProcess
(
mode
,
taskDto
.
getLineId
());
return
NewOrderProcess
(
taskDto
,
mode
,
taskDto
.
getLineId
());
}
catch
(
Exception
exception
)
{
log
.
error
(
exception
.
toString
());
return
ResultBean
.
newErrorResult
(-
1
,
exception
.
toString
(),
exception
.
toString
());
...
...
@@ -615,6 +644,10 @@ public class MicronDispatchController {
log
.
info
(
"pnSubmit 操作失败,taskDto数据不完整"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
if
(
taskDto
.
getApiProStatus
()==
1
){
//正在处理中,不能重复提交
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.apiProcess"
,
"正在处理中,请稍后"
);
}
List
<
Barcode
>
allBarcodes
=
new
ArrayList
<>();
//查找到详情,循环RI,生成API009数据
for
(
Object
ri
:
...
...
@@ -711,8 +744,10 @@ public class MicronDispatchController {
log
.
info
(
order
.
getOrderNo
()
+
"已勾选物料完成,直接出料"
);
//直接开始出库
liteOrderCache
.
dispatchCheckOut
(
order
,
false
,
isOver
,
selectRis
);
return
getTaskInfo
(
order
);
// liteOrderCache.dispatchCheckOut(order, false, isOver,selectRis);
dispatchCheckOut
(
taskDto
,
order
,
false
,
isOver
,
selectRis
);
return
getTaskInfo
(
taskDto
,
order
);
//判断是否需要勾选
// return ResultBean.newOkResult("");
...
...
@@ -744,8 +779,19 @@ public class MicronDispatchController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
TaskDto
taskDto
=
getTaskDtoByMode
(
mode
);
if
(
taskDto
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
if
(
taskDto
.
getApiProStatus
()==
1
){
//正在处理中,不能重复提交
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.apiProcess"
,
"正在处理中,请稍后"
);
}
//调用API010扣除库存,扣除成功的才可以出库
String
msg
=
liteOrderCache
.
dispatchCheckOut
(
order
,
false
,
isOver
,
new
ArrayList
<>());
// String msg = liteOrderCache.dispatchCheckOut(order, false, isOver,new ArrayList<>());
String
msg
=
dispatchCheckOut
(
taskDto
,
order
,
false
,
isOver
,
new
ArrayList
<>());
if
(
ObjectUtil
.
isNotEmpty
(
msg
))
{
return
ResultBean
.
newErrorResult
(-
1
,
msg
,
msg
);
}
...
...
@@ -777,8 +823,17 @@ public class MicronDispatchController {
if
(
order
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
TaskDto
taskDto
=
getTaskDtoByMode
(
mode
);
if
(
taskDto
==
null
)
{
String
msg
=
liteOrderCache
.
dispatchCheckOut
(
order
,
true
,
isOver
,
new
ArrayList
<>());
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
if
(
taskDto
.
getApiProStatus
()==
1
){
//正在处理中,不能重复提交
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.apiProcess"
,
"正在处理中,请稍后"
);
}
// String msg = liteOrderCache.dispatchCheckOut(order, true, isOver,new ArrayList<>());
String
msg
=
dispatchCheckOut
(
taskDto
,
order
,
true
,
isOver
,
new
ArrayList
<>());
if
(
ObjectUtil
.
isNotEmpty
(
msg
))
{
return
ResultBean
.
newErrorResult
(-
1
,
msg
,
msg
);
}
...
...
@@ -861,6 +916,10 @@ public class MicronDispatchController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
if
(
taskDto
.
getApiProStatus
()==
1
){
//正在处理中,不能重复提交
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.apiProcess"
,
"正在处理中,请稍后"
);
}
if
(
order
!=
null
)
{
//自动取消任务
List
<
DataLog
>
allTask
=
taskService
.
getAllTasks
();
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronPreTaskController.java
查看文件 @
9798599
...
...
@@ -164,6 +164,11 @@ public class MicronPreTaskController {
}
return
dto
;
}
public
TaskDto
UpdateTaskDto
(
TaskDto
taskDto
,
int
apiPro
)
{
taskDto
.
setApiProStatus
(
apiPro
);
dataCache
.
updateCache
(
Constants
.
CACHE_DISPATCH
+
taskDto
.
getMode
(),
taskDto
);
return
taskDto
;
}
@ApiOperation
(
"根据勾选的ID,提交后 创建工单任务"
)
@AnonymousAccess
@PostMapping
(
"/submit"
)
...
...
@@ -173,6 +178,10 @@ public class MicronPreTaskController {
if
(
dto
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
if
(
dto
.
getApiProStatus
()==
1
){
//正在处理中,不能重复提交
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.apiProcess"
,
"正在处理中,请稍后"
);
}
String
operationId
=
dto
.
getOperationId
();
List
<
String
>
pretasks
=
preTask
.
getPretasks
();
...
...
@@ -244,9 +253,18 @@ public class MicronPreTaskController {
liteOrderCache
.
addOrderToMap
(
liteOrder
);
log
.
info
(
"submit 勾选后,生成工单:["
+
orderNo
+
"]["
+
mode
+
"]"
);
//开始查询是否可以出库
String
msg
=
liteOrderCache
.
preTaskCheckOut
(
liteOrder
,
operationId
,
materialList
,
false
);
log
.
info
(
"submit 工单:["
+
orderNo
+
"]["
+
mode
+
"]执行结果:"
+
msg
);
try
{
UpdateTaskDto
(
dto
,
1
);
String
msg
=
liteOrderCache
.
preTaskCheckOut
(
liteOrder
,
operationId
,
materialList
,
false
);
log
.
info
(
"submit 工单:["
+
orderNo
+
"]["
+
mode
+
"]执行结果:"
+
msg
);
}
catch
(
Exception
e
){
throw
e
;
}
finally
{
UpdateTaskDto
(
dto
,
0
);
}
}
}
catch
(
Exception
ex
)
{
...
...
@@ -289,20 +307,26 @@ public class MicronPreTaskController {
if
(
dto
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
if
(
dto
.
getApiProStatus
()==
1
){
//正在处理中,不能重复提交
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.apiProcess"
,
"正在处理中,请稍后"
);
}
//判断有没有生成任务
LiteOrder
order
=
getOrderByMode
(
mode
);
if
(
order
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
try
{
UpdateTaskDto
(
dto
,
1
);
//开始查询是否可以出库
String
msg
=
liteOrderCache
.
preTaskCheckOut
(
order
,
dto
.
getOperationId
(),
new
ArrayList
<>(),
true
);
if
(
ObjectUtil
.
isNotEmpty
(
msg
))
{
return
ResultBean
.
newErrorResult
(-
1
,
msg
,
"操作失败"
);
}
}
catch
(
Exception
ex
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
finally
{
UpdateTaskDto
(
dto
,
0
);
}
return
ResultBean
.
newOkResult
(
""
);
...
...
@@ -354,6 +378,10 @@ public class MicronPreTaskController {
if
(
dto
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
if
(
dto
.
getApiProStatus
()==
1
){
//正在处理中,不能重复提交
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.apiProcess"
,
"正在处理中,请稍后"
);
}
log
.
info
(
" abort :mode="
+
mode
);
LiteOrder
order
=
getOrderByMode
(
mode
);
if
(
order
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/task/bean/dto/TaskDto.java
查看文件 @
9798599
...
...
@@ -12,6 +12,7 @@ public class TaskDto {
*0=勾选数据还未获取,1=勾选页面勾选数据,2=已开始出库
*/
private
int
type
=
1
;
//
private
int
apiProStatus
=
0
;
//=0不在处理中,=1表示正在接口请求中,不能abort或retry
private
String
mode
;
private
String
operationId
;
private
String
lineId
;
//Controlled Dispatch 按钮中输入的lineID
...
...
src/main/resources/messages.properties
查看文件 @
9798599
...
...
@@ -383,3 +383,4 @@ smfcore.inlist.noJobToEnd=no job or no operation need to perform for END
smfcore.logMonitor
=
\u
65E5
\u
5FD7
\u
76D1
\u
63A7
smfcore.materialTrace
=
\u7269\u6599\u
8FFD
\u
6EAF
smfcore.message.critical
=
\u
4E25
\u
91CD
\u9519\u
8BEF
smfcore.micron.apiProcess
=
\u
6B63
\u5728\u5904\u7406\u
4E2D
\u
FF0C
\u
8BF7
\u
7A0D
\u
540E
src/main/resources/messages_en_US.properties
查看文件 @
9798599
...
...
@@ -371,4 +371,5 @@ smfcore.micron.inlisttaskhasfail=Operation failed: All materials must be success
smfcore.inlist.noJobToEnd
=
no job or no operation need to perform for END
smfcore.logMonitor
=
Log Monitoring
smfcore.materialTrace
=
Material Trace
smfcore.message.critical
=
Critical
\ No newline at end of file
smfcore.message.critical
=
Critical
smfcore.micron.apiProcess
=
Processing, please wait
\ No newline at end of file
src/main/resources/messages_ja_JP.properties
查看文件 @
9798599
...
...
@@ -366,4 +366,5 @@ smfcore.micron.inlisttaskhasfail=\u64CD\u4F5C\u5931\u6557\uFF1A\u3059\u3079\u306
smfcore.inlist.noJobToEnd
=
no job or no operation need to perform for END
smfcore.logMonitor
=
\u
30ED
\u
30B0
\u
76E3
\u8996
smfcore.materialTrace
=
\u
30DE
\u
30C6
\u
30EA
\u
30A2
\u
30EB
\u
30C8
\u
30EC
\u
30FC
\u
30B9
smfcore.message.critical
=
\u
91CD
\u5927\u
30A8
\u
30E9
\u
30FC
\ No newline at end of file
smfcore.message.critical
=
\u
91CD
\u5927\u
30A8
\u
30E9
\u
30FC
smfcore.micron.apiProcess
=
\u
51E6
\u7406\u
4E2D
\u3067\u3059\u3001\u3057\u3070\u3089\u
304F
\u
304A
\u
5F85
\u3061\u
304F
\u3060\u3055\u3044
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
查看文件 @
9798599
...
...
@@ -366,4 +366,5 @@ smfcore.micron.inlisttaskhasfail=\u64CD\u4F5C\u5931\u8D25\uFF1A\u7269\u6599\u516
smfcore.inlist.noJobToEnd
=
no job or no operation need to perform for END
smfcore.logMonitor
=
\u
65E5
\u
5FD7
\u
76D1
\u
63A7
smfcore.materialTrace
=
\u7269\u6599\u
8FFD
\u
6EAF
smfcore.message.critical
=
\u
4E25
\u
91CD
\u9519\u
8BEF
\ No newline at end of file
smfcore.message.critical
=
\u
4E25
\u
91CD
\u9519\u
8BEF
smfcore.micron.apiProcess
=
\u
6B63
\u5728\u5904\u7406\u
4E2D
\u
FF0C
\u
8BF7
\u
7A0D
\u
540E
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
9798599
...
...
@@ -367,4 +367,5 @@ smfcore.micron.inlisttaskhasfail=\u64CD\u4F5C\u5931\u8D25\uFF1A\u7269\u6599\u516
smfcore.inlist.noJobToEnd
=
no job or no operation need to perform for END
smfcore.logMonitor
=
\u
65E5
\u
8A8C
\u
76E3
\u
63A7
smfcore.materialTrace
=
\u7269\u6599\u
8FFD
\u
6EAF
smfcore.message.critical
=
\u
56B4
\u
91CD
\u
932F
\u
8AA4
\ No newline at end of file
smfcore.message.critical
=
\u
56B4
\u
91CD
\u
932F
\u
8AA4
smfcore.micron.apiProcess
=
\u
6B63
\u5728\u8655\u7406\u
4E2D
\u
FF0C
\u
8ACB
\u
7A0D
\u
5F8C
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论