Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 571aded1
由
LN
编写于
2025-08-28 10:43:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
API010 增加重试逻辑. API002超时改为2分钟。api009返回key改为大小写兼容。
1 个父辈
aa69b9a4
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
51 行增加
和
5 行删除
src/main/java/com/neotel/smfcore/common/utils/Constants.java
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
src/main/java/com/neotel/smfcore/core/system/rest/bean/dto/SysSettingsDto.java
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
src/main/java/com/neotel/smfcore/custom/micron1053/api/bean/TrackStatus.java
src/main/java/com/neotel/smfcore/custom/micron1053/bean/MicronResult.java
src/main/java/com/neotel/smfcore/common/utils/Constants.java
查看文件 @
571aded
...
...
@@ -215,4 +215,13 @@ public class Constants {
* 镁光url地址:http://istio-ingressgateway-istio-system.apps.ose-dev45.micron.com/
*/
public
static
final
String
CACHE_Micron_AppAddr
=
"CACHE_Micron_AppAddr"
;
/**
*API010运行自动retry次数
*/
public
static
final
String
CACHE_API_RetryCount
=
"CACHE_API_RetryCount"
;
/**
*API010自动retry的间隔(seconds)
*/
public
static
final
String
CACHE_API_RetryInterval
=
"CACHE_API_RetryInterval"
;
}
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
查看文件 @
571aded
...
...
@@ -356,7 +356,10 @@ public class HttpHelper {
}
public
static
MicronResult
postMicronJson
(
String
url
,
Map
<
String
,
Object
>
params
)
throws
ApiException
{
public
static
MicronResult
postMicronJson
(
String
url
,
Map
<
String
,
Object
>
params
)
throws
ApiException
{
return
postMicronJson
(
url
,
params
,
60000
);
}
public
static
MicronResult
postMicronJson
(
String
url
,
Map
<
String
,
Object
>
params
,
int
timeOutMs
)
throws
ApiException
{
try
{
if
(
ObjectUtil
.
isEmpty
(
url
))
{
return
new
MicronResult
();
...
...
@@ -380,7 +383,7 @@ public class HttpHelper {
}
try
{
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
CONNECTION_TIMEOUT
).
setConnectionRequestTimeout
(
60000
).
setSocketTimeout
(
60000
).
build
();
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
CONNECTION_TIMEOUT
).
setConnectionRequestTimeout
(
timeOutMs
).
setSocketTimeout
(
timeOutMs
).
build
();
httpPost
.
setConfig
(
requestConfig
);
CloseableHttpResponse
response
=
httpClient
.
execute
(
httpPost
);
HttpEntity
entity
=
response
.
getEntity
();
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
571aded
...
...
@@ -175,7 +175,15 @@ public class DataCache {
}
return
null
;
}
public
<
T
>
T
getCache
(
String
cacheKey
,
T
defValue
)
{
Object
value
=
cacheMap
.
get
(
cacheKey
);
if
(
value
!=
null
)
{
return
(
T
)
value
;
}
else
{
updateCache
(
cacheKey
,
defValue
);
return
defValue
;
}
}
public
OrderSetting
getOrderSetting
()
{
OrderSetting
orderSetting
=
getCache
(
Constants
.
CACHE_OrderSetting
);
if
(
orderSetting
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
查看文件 @
571aded
...
...
@@ -100,6 +100,8 @@ public class SettingsController {
xrayTest
=
false
;
dataCache
.
updateCache
(
Constants
.
CACHE_XRAY_TEST
,
xrayTest
);
}
int
retryCount
=
dataCache
.
getCache
(
Constants
.
CACHE_API_RetryCount
,
3
);
int
retryInterval
=
dataCache
.
getCache
(
Constants
.
CACHE_API_RetryInterval
,
30
);
String
micronAppAddr
=
dataCache
.
getCache
(
Constants
.
CACHE_Micron_AppAddr
);
SysSettingsDto
dto
=
new
SysSettingsDto
();
dto
.
setStartJob
(
startJob
);
...
...
@@ -115,6 +117,8 @@ public class SettingsController {
dto
.
setInputCheck
(
inputCheck
);
dto
.
setXRayTest
(
xrayTest
);
dto
.
setMicronAppAddr
(
micronAppAddr
);
dto
.
setRetryCount
(
retryCount
);
dto
.
setRetryInterval
(
retryInterval
);
return
dto
;
}
...
...
@@ -135,12 +139,14 @@ public class SettingsController {
dataCache
.
updateCache
(
Constants
.
CACHE_INPUT_CHECK
,
sysSettingsDto
.
isInputCheck
());
dataCache
.
updateCache
(
Constants
.
CACHE_XRAY_TEST
,
sysSettingsDto
.
isXRayTest
());
dataCache
.
updateCache
(
Constants
.
CACHE_Micron_AppAddr
,
sysSettingsDto
.
getMicronAppAddr
());
dataCache
.
updateCache
(
Constants
.
CACHE_API_RetryInterval
,
sysSettingsDto
.
getRetryInterval
());
dataCache
.
updateCache
(
Constants
.
CACHE_API_RetryCount
,
sysSettingsDto
.
getRetryCount
());
log
.
info
(
"更改系统设置:stopout="
+
sysSettingsDto
.
isStopOut
()
+
",stopjob="
+
sysSettingsDto
.
isStartJob
()
+
",sluggishDay="
+
sysSettingsDto
.
getSluggishDay
()
+
",expiresDay="
+
sysSettingsDto
.
getExpiresDay
()
+
",capacityWarn="
+
sysSettingsDto
.
getCapacityWarn
()
+
",backUpMonth="
+
sysSettingsDto
.
getBackUpMonth
()
+
" ,sameBarcodeSettings="
+
sysSettingsDto
.
getSameBarcodeSettings
()+
", apiTest="
+
sysSettingsDto
.
isApiTest
()+
",xrayBypass="
+
sysSettingsDto
.
isXrayBypass
()+
",expiredateVerify="
+
sysSettingsDto
.
isExpiredateVerify
()+
",inputCheck="
+
sysSettingsDto
.
isInputCheck
()+
",isXRayTest="
+
sysSettingsDto
.
isXRayTest
()
+
",CACHE_Micron_AppAddr="
+
sysSettingsDto
.
getMicronAppAddr
());
+
",CACHE_Micron_AppAddr="
+
sysSettingsDto
.
getMicronAppAddr
()
+
", CACHE_API_RetryCount="
+
sysSettingsDto
.
getRetryCount
()+
", CACHE_API_RetryInterval="
+
sysSettingsDto
.
getRetryInterval
()
);
micronConfig
.
UpdateAddr
(
sysSettingsDto
.
getMicronAppAddr
());
String
msg
=
MessageUtils
.
getText
(
"smfcore.saveOk"
,
servletRequest
.
getLocale
(),
"保存成功"
);
return
ResultBean
.
newOkResult
(
msg
);
...
...
src/main/java/com/neotel/smfcore/core/system/rest/bean/dto/SysSettingsDto.java
查看文件 @
571aded
...
...
@@ -48,4 +48,8 @@ public class SysSettingsDto implements Serializable {
@ApiModelProperty
(
"Xray点料测试功能"
)
private
boolean
xRayTest
=
false
;
@ApiModelProperty
(
"API010retry次数"
)
private
int
retryCount
=
3
;
@ApiModelProperty
(
"API010retry间隔"
)
private
int
retryInterval
=
30
;
}
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
查看文件 @
571aded
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/micron1053/api/bean/TrackStatus.java
查看文件 @
571aded
...
...
@@ -25,6 +25,12 @@ public class TrackStatus implements Serializable {
private
String
serialNum
;
private
String
partNumber
;
private
String
materialStatus
;
private
boolean
Success
;
// private boolean Success;
private
boolean
sapSuccess
;
private
boolean
mesSuccess
;
private
String
description
;
public
boolean
isSuccess
(){
return
isMesSuccess
()&&
isSapSuccess
();
}
}
src/main/java/com/neotel/smfcore/custom/micron1053/bean/MicronResult.java
查看文件 @
571aded
...
...
@@ -207,6 +207,16 @@ public class MicronResult implements Serializable {
public
static
String
GetMapValue
(
Map
<
String
,
Object
>
map
,
String
key
){
Object
obj
=
map
.
get
(
key
);
if
(
obj
==
null
){
for
(
String
mapKey
:
map
.
keySet
())
{
if
(
ObjectUtil
.
isNotEmpty
(
mapKey
)&&
ObjectUtil
.
isNotEmpty
(
key
)&&
mapKey
.
toLowerCase
().
equals
(
key
.
toLowerCase
()))
{
obj
=
map
.
get
(
mapKey
);
if
(
ObjectUtil
.
isNotEmpty
(
obj
))
{
return
obj
.
toString
();
}
}
}
return
""
;
}
return
obj
.
toString
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论