Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 323044bb
由
LN
编写于
2023-08-16 14:05:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.API003中sapItem改为boolean值。
2.API011中source默认为KTS-0001。 3.系统设置页面增加apitest.
1 个父辈
553f9f9c
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
56 行增加
和
9 行删除
src/main/java/com/neotel/smfcore/common/utils/Constants.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.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/loading/LoadingController.java
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronPreTaskController.java
src/main/java/com/neotel/smfcore/custom/neotel/NeotelController.java
src/main/java/com/neotel/smfcore/common/utils/Constants.java
查看文件 @
323044b
...
...
@@ -180,5 +180,9 @@ public class Constants {
* 当前出库信息:
*/
public
static
final
String
CACHE_DISPATCH
=
"CACHE_DISPATCH_INFO_"
;
/**
* 是否启用接口测试,true=启用
*/
public
static
final
String
CACHE_API_TEST
=
"CACHE_API_TEST"
;
}
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
323044b
...
...
@@ -647,6 +647,13 @@ public class RobotBoxHandler extends BaseDeviceHandler {
}
private
Barcode
ApiCheck
(
String
rfid
,
Barcode
barcode
)
throws
ApiException
{
if
(
ObjectUtil
.
isEmpty
(
rfid
)){
return
barcode
;
}
//是否启用
if
(!
MicronApi
.
isEnable
())
{
return
barcode
;
}
barcode
.
setToXray
(
false
);
barcode
.
setInListName
(
""
);
String
operationId
=
""
;
...
...
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
查看文件 @
323044b
...
...
@@ -69,6 +69,11 @@ public class SettingsController {
Integer
caWarn
=
dataCache
.
getCache
(
Constants
.
CACHE_CapacityWarn
);
Integer
backUpMonth
=
dataCache
.
getCache
(
Constants
.
BACKUP_MONTH_KEY
);
Integer
barcodeSet
=
dataCache
.
getCache
(
Constants
.
CACHE_SAME_BARCODE_SETTINGS
);
Boolean
useAPi
=
dataCache
.
getCache
(
Constants
.
CACHE_API_TEST
);
if
(
useAPi
==
null
){
useAPi
=
false
;
dataCache
.
updateCache
(
Constants
.
CACHE_API_TEST
,
useAPi
);
}
SysSettingsDto
dto
=
new
SysSettingsDto
();
dto
.
setStartJob
(
startJob
);
dto
.
setStopOut
(
stopOut
);
...
...
@@ -77,6 +82,7 @@ public class SettingsController {
dto
.
setCapacityWarn
(
caWarn
);
dto
.
setBackUpMonth
(
backUpMonth
);
dto
.
setSameBarcodeSettings
(
barcodeSet
);
dto
.
setApiTest
(
useAPi
);
return
dto
;
}
...
...
@@ -91,9 +97,10 @@ public class SettingsController {
dataCache
.
updateCache
(
Constants
.
CACHE_CapacityWarn
,
sysSettingsDto
.
getCapacityWarn
());
dataCache
.
updateCache
(
Constants
.
BACKUP_MONTH_KEY
,
sysSettingsDto
.
getBackUpMonth
());
dataCache
.
updateCache
(
Constants
.
CACHE_SAME_BARCODE_SETTINGS
,
sysSettingsDto
.
getSameBarcodeSettings
());
dataCache
.
updateCache
(
Constants
.
CACHE_API_TEST
,
sysSettingsDto
.
isApiTest
());
log
.
info
(
"更改系统设置:stopout="
+
sysSettingsDto
.
isStopOut
()
+
",stopjob="
+
sysSettingsDto
.
isStartJob
()
+
",sluggishDay="
+
sysSettingsDto
.
getSluggishDay
()
+
",expiresDay="
+
sysSettingsDto
.
getExpiresDay
()
+
",capacityWarn="
+
sysSettingsDto
.
getCapacityWarn
()
+
",backUpMonth="
+
sysSettingsDto
.
getBackUpMonth
()
+
" ,sameBarcodeSettings="
+
sysSettingsDto
.
getSameBarcodeSettings
());
" ,sameBarcodeSettings="
+
sysSettingsDto
.
getSameBarcodeSettings
()
+
", apiTest="
+
sysSettingsDto
.
isApiTest
()
);
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
查看文件 @
323044b
...
...
@@ -30,4 +30,6 @@ public class SysSettingsDto implements Serializable {
@ApiModelProperty
(
"同条码入库设置,1=全部NG,2=第二盘NG"
)
private
Integer
sameBarcodeSettings
=
1
;
@ApiModelProperty
(
"开启api测试"
)
private
boolean
apiTest
=
false
;
}
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
查看文件 @
323044b
...
...
@@ -3,6 +3,7 @@ package com.neotel.smfcore.custom.micron1053.api;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.HttpHelper
;
import
com.neotel.smfcore.common.utils.JsonUtil
;
import
com.neotel.smfcore.core.api.listener.BaseSmfApiListener
;
...
...
@@ -54,7 +55,16 @@ public class MicronApi {
public
static
boolean
isEnable
(
)
{
// return apiName != null && apiName.equalsIgnoreCase("Micron");
return
ObjectUtil
.
isNotEmpty
(
config
.
micronAddr
);
Boolean
apiTest
=
dataCache
.
getCache
(
Constants
.
CACHE_API_TEST
);
if
(
apiTest
==
null
)
{
apiTest
=
false
;
dataCache
.
updateCache
(
Constants
.
CACHE_API_TEST
,
apiTest
);
}
if
(
apiTest
)
{
return
ObjectUtil
.
isNotEmpty
(
config
.
micronAddr
);
}
else
{
return
false
;
}
}
...
...
@@ -498,11 +508,13 @@ public class MicronApi {
if
(
ObjectUtil
.
isEmpty
(
source
)){
source
=
config
.
api_011_Source
;
}
source
=
"KTS-0001"
;
if
(
ObjectUtil
.
isEmpty
(
url
)&&
Debug
){
return
mode
+
"_test_operationId"
;
}
url
=
MessageFormat
.
format
(
url
,
mode
,
userName
,
source
);
try
{
log
.
info
(
"调用MES接口 Api011: url=["
+
url
+
"] "
);
MicronResult
result
=
HttpHelper
.
getMicronJson
(
url
);
String
operationId
=
result
.
getResult
(
"operationId"
);
return
operationId
;
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/loading/LoadingController.java
查看文件 @
323044b
...
...
@@ -53,6 +53,11 @@ public class LoadingController {
@AnonymousAccess
public
ResultBean
list
(
HttpServletRequest
servletRequest
)
{
//判断是否验证
if
(!
MicronApi
.
isEnable
()){
return
ResultBean
.
newErrorResult
(
9
,
"smfcore.micron.apiClose"
,
" Not yet open"
);
}
InList
inList
=
loadingUtil
.
getInlist
();
if
(
inList
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.nodata"
,
"未找到信息"
);
...
...
@@ -97,11 +102,17 @@ public class LoadingController {
@ApiOperation
(
"loading->ReturnMaterial 输入RFID后获取数据"
)
@PostMapping
(
"/returnMaterial"
)
@AnonymousAccess
public
ResultBean
returnMaterial
(
@RequestBody
Object
params
)
{
List
<
String
>
rfids
=
(
List
<
String
>)
params
;
if
(
ObjectUtil
.
isEmpty
((
rfids
)))
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"rfids"
});
public
ResultBean
returnMaterial
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
// List<String> rfids = (List<String>) params;
String
numStr
=
params
.
get
(
"num"
).
toString
();
if
(
ObjectUtil
.
isEmpty
((
numStr
)))
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"Num"
});
}
int
num
=
Integer
.
valueOf
(
numStr
);
log
.
info
(
"returnMaterial: num= "
+
num
);
// String[] rfidArray=rfids.split(",");
InList
inList
=
loadingUtil
.
getInlist
();
if
(
inList
==
null
)
{
...
...
@@ -117,12 +128,12 @@ public class LoadingController {
loadingInfo
.
inlistName
=
id
+
"-"
+
DateUtil
.
toDateString
(
loadingInfo
.
startTime
);
dataCache
.
updateCache
(
Constants
.
CACHE_LOADING
,
loadingInfo
);
int
count
=
rfids
.
size
();
//
int count = rfids.size();
// List<String> list = new ArrayList<>(Arrays.asList(rfidArray));
inList
=
new
InList
(
loadingInfo
.
inlistName
,
INLIST_STATUS
.
WAIT
,
new
ArrayList
<>(),
System
.
currentTimeMillis
(),
false
);
inList
.
setMode
(
loadingInfo
.
mode
);
inList
.
setShelfNum
(
count
);
inList
.
setShelfNum
(
num
);
inList
.
setOperationId
(
loadingInfo
.
getOperationId
());
inList
=
inListManager
.
createWithItems
(
inList
);
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/task/MicronPreTaskController.java
查看文件 @
323044b
...
...
@@ -88,6 +88,10 @@ public class MicronPreTaskController {
@AnonymousAccess
@GetMapping
(
"/getTaskId"
)
public
ResultBean
task
(
String
mode
)
{
//判断是否验证
if
(!
MicronApi
.
isEnable
()){
return
ResultBean
.
newErrorResult
(
9
,
"smfcore.micron.apiClose"
,
" Not yet open"
);
}
//判断是否生成,未关闭的工单
TaskDto
dto
=
getTaskDtoByMode
(
mode
);
String
key
=
Constants
.
CACHE_DISPATCH
+
mode
;
...
...
src/main/java/com/neotel/smfcore/custom/neotel/NeotelController.java
查看文件 @
323044b
...
...
@@ -214,7 +214,7 @@ public class NeotelController {
resultMap
.
put
(
"serialNum"
,
barcode
.
getBarcode
());
resultMap
.
put
(
"partNumber"
,
barcode
.
getPartNumber
());
resultMap
.
put
(
"sapItem"
,
"True"
);
resultMap
.
put
(
"sapItem"
,
Boolean
.
TRUE
);
resultMap
.
put
(
"mfgPartNum"
,
barcode
.
getMpn
());
resultMap
.
put
(
"mfgLotNum"
,
barcode
.
getBatch
());
resultMap
.
put
(
"mfgName"
,
barcode
.
getProvider
());
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论