Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 00157b9d
由
LN
编写于
2023-08-21 13:12:08 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.增加Xray Bypass,勾选后如果返回需要去xray,忽略继续入库。
2.API001返回的数据与现有数据不一样时使用返回的数据。
1 个父辈
150c636b
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
78 行增加
和
10 行删除
src/main/java/com/neotel/smfcore/common/utils/Constants.java
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.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/AMaterialBean.java
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
src/main/java/com/neotel/smfcore/security/config/ConfigurerAdapter.java
src/main/java/com/neotel/smfcore/common/utils/Constants.java
查看文件 @
00157b9
...
@@ -185,4 +185,10 @@ public class Constants {
...
@@ -185,4 +185,10 @@ public class Constants {
*/
*/
public
static
final
String
CACHE_API_TEST
=
"CACHE_API_TEST"
;
public
static
final
String
CACHE_API_TEST
=
"CACHE_API_TEST"
;
/**
* =true, XRay离线时,忽略xray,继续入库
*/
public
static
final
String
CACHE_API_XRAY_BYPASSS
=
"CACHE_API_XRAY_BYPASSS"
;
}
}
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
查看文件 @
00157b9
...
@@ -876,6 +876,9 @@ public class BarcodeRule {
...
@@ -876,6 +876,9 @@ public class BarcodeRule {
codeStr
=
"P594730|1PMT40A8G4BAF-062E:B|1TDRBRDRL.41|7Q897+EA|SDRBRDRL.41|21PMICRON|2D06-28-2025|||||7E2"
;
codeStr
=
"P594730|1PMT40A8G4BAF-062E:B|1TDRBRDRL.41|7Q897+EA|SDRBRDRL.41|21PMICRON|2D06-28-2025|||||7E2"
;
codeStr
=
"P594730|1PMT40A8G4BAF-062E:B|1TDRBRDRL.41|7Q897+EA|SDRBRDRL.41|21PMICRON||||||7E2"
;
codeStr
=
"P594730|1PMT40A8G4BAF-062E:B|1TDRBRDRL.41|7Q897+EA|SDRBRDRL.41|21PMICRON||||||7E2"
;
codeStr
=
"P721823|1PMT29FB16T08EALAAD6-QC:C|1TBY8GH95.41|7Q282|SBY8GH95.41||2D07-04-2025|||||"
;
codeStr
=
"P721823|1PMT29FB16T08EALAAD6-QC:C|1TBY8GH95.41|7Q282|SBY8GH95.41||2D07-04-2025|||||"
;
rule
=
"PN[1:0:-1]|MPN[2:0:-1]|BATCH[2:0:-1]|QTY[2_7Q:0:-1]|RI[1:0:-1]|SP[3:0:-1]|EXPDATEMM-dd-yyyy[2:0:-1]|PRODATEyyyyMMdd[2:0:-1]|QITEM[1:0:-1]|Q1ITEM[2:0:-1]|xxx|MSL[1:0:-1]"
;
codeStr
=
"P550-502922C|1P3217-10-01-C|1TD116223H|7Q1000+EA|SP2SITPCB001|21PSIMMTECH|2D12-31-2025||Q10|1Q10||7E1"
;
BarcodeRule
br
=
BarcodeRule
.
newRule
(
rule
);
BarcodeRule
br
=
BarcodeRule
.
newRule
(
rule
);
Barcode
b
=
br
.
toCodeBean
(
codeStr
).
getBarcode
();
Barcode
b
=
br
.
toCodeBean
(
codeStr
).
getBarcode
();
if
(
b
!=
null
){
if
(
b
!=
null
){
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
00157b9
...
@@ -682,13 +682,26 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -682,13 +682,26 @@ public class RobotBoxHandler extends BaseDeviceHandler {
if
(
barcode
==
null
)
{
if
(
barcode
==
null
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"未找到有效的条码"
);
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"未找到有效的条码"
);
}
}
//判断是否忽略去Xray
Boolean
xrayBypass
=
dataCache
.
getCache
(
Constants
.
CACHE_API_XRAY_BYPASSS
);
if
(
xrayBypass
==
null
){
xrayBypass
=
false
;
}
if
(
barcode
.
isToXray
())
{
if
(
barcode
.
isToXray
())
{
log
.
info
(
"条码["
+
barcode
.
getBarcode
()
+
"]获取库位号,需要去点料,点料机未连接,直接异常"
);
if
(
xrayBypass
){
throw
new
ApiException
(
"smfcore.micron.xray.offline"
,
"{0}需要点料,点料机不在线"
,
new
String
[]{
barcode
.
getBarcode
()});
log
.
info
(
"条码["
+
barcode
.
getBarcode
()
+
"]获取库位号,需要去点料, 勾选了 Xray Bypass,继续入库 "
);
barcode
.
setInListName
(
inList
.
getName
());
loadingUtil
.
AddInListItem
(
rfid
,
barcode
,
""
,
INITEM_STATUS
.
PutIn
);
}
else
{
log
.
info
(
"条码["
+
barcode
.
getBarcode
()
+
"]获取库位号,需要去点料,点料机未连接,直接异常"
);
throw
new
ApiException
(
"smfcore.micron.xray.offline"
,
"{0}需要点料,点料机不在线"
,
new
String
[]{
barcode
.
getBarcode
()});
// barcode.setToXray(true);
// barcode.setToXray(true);
// barcode.setInListName(inList.getName());
// barcode.setInListName(inList.getName());
// loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.XRay);
// loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.XRay);
}
}
else
{
}
else
{
barcode
.
setInListName
(
inList
.
getName
());
barcode
.
setInListName
(
inList
.
getName
());
loadingUtil
.
AddInListItem
(
rfid
,
barcode
,
""
,
INITEM_STATUS
.
PutIn
);
loadingUtil
.
AddInListItem
(
rfid
,
barcode
,
""
,
INITEM_STATUS
.
PutIn
);
...
...
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
查看文件 @
00157b9
...
@@ -74,6 +74,12 @@ public class SettingsController {
...
@@ -74,6 +74,12 @@ public class SettingsController {
useAPi
=
false
;
useAPi
=
false
;
dataCache
.
updateCache
(
Constants
.
CACHE_API_TEST
,
useAPi
);
dataCache
.
updateCache
(
Constants
.
CACHE_API_TEST
,
useAPi
);
}
}
Boolean
xrayBypass
=
dataCache
.
getCache
(
Constants
.
CACHE_API_XRAY_BYPASSS
);
if
(
xrayBypass
==
null
){
xrayBypass
=
false
;
dataCache
.
updateCache
(
Constants
.
CACHE_API_XRAY_BYPASSS
,
xrayBypass
);
}
SysSettingsDto
dto
=
new
SysSettingsDto
();
SysSettingsDto
dto
=
new
SysSettingsDto
();
dto
.
setStartJob
(
startJob
);
dto
.
setStartJob
(
startJob
);
dto
.
setStopOut
(
stopOut
);
dto
.
setStopOut
(
stopOut
);
...
@@ -83,6 +89,7 @@ public class SettingsController {
...
@@ -83,6 +89,7 @@ public class SettingsController {
dto
.
setBackUpMonth
(
backUpMonth
);
dto
.
setBackUpMonth
(
backUpMonth
);
dto
.
setSameBarcodeSettings
(
barcodeSet
);
dto
.
setSameBarcodeSettings
(
barcodeSet
);
dto
.
setApiTest
(
useAPi
);
dto
.
setApiTest
(
useAPi
);
dto
.
setXrayBypass
(
xrayBypass
);
return
dto
;
return
dto
;
}
}
...
@@ -98,9 +105,10 @@ public class SettingsController {
...
@@ -98,9 +105,10 @@ public class SettingsController {
dataCache
.
updateCache
(
Constants
.
BACKUP_MONTH_KEY
,
sysSettingsDto
.
getBackUpMonth
());
dataCache
.
updateCache
(
Constants
.
BACKUP_MONTH_KEY
,
sysSettingsDto
.
getBackUpMonth
());
dataCache
.
updateCache
(
Constants
.
CACHE_SAME_BARCODE_SETTINGS
,
sysSettingsDto
.
getSameBarcodeSettings
());
dataCache
.
updateCache
(
Constants
.
CACHE_SAME_BARCODE_SETTINGS
,
sysSettingsDto
.
getSameBarcodeSettings
());
dataCache
.
updateCache
(
Constants
.
CACHE_API_TEST
,
sysSettingsDto
.
isApiTest
());
dataCache
.
updateCache
(
Constants
.
CACHE_API_TEST
,
sysSettingsDto
.
isApiTest
());
dataCache
.
updateCache
(
Constants
.
CACHE_API_XRAY_BYPASSS
,
sysSettingsDto
.
isXrayBypass
());
log
.
info
(
"更改系统设置:stopout="
+
sysSettingsDto
.
isStopOut
()
+
",stopjob="
+
sysSettingsDto
.
isStartJob
()
+
",sluggishDay="
+
sysSettingsDto
.
getSluggishDay
()
log
.
info
(
"更改系统设置:stopout="
+
sysSettingsDto
.
isStopOut
()
+
",stopjob="
+
sysSettingsDto
.
isStartJob
()
+
",sluggishDay="
+
sysSettingsDto
.
getSluggishDay
()
+
",expiresDay="
+
sysSettingsDto
.
getExpiresDay
()
+
",capacityWarn="
+
sysSettingsDto
.
getCapacityWarn
()
+
",backUpMonth="
+
sysSettingsDto
.
getBackUpMonth
()
+
+
",expiresDay="
+
sysSettingsDto
.
getExpiresDay
()
+
",capacityWarn="
+
sysSettingsDto
.
getCapacityWarn
()
+
",backUpMonth="
+
sysSettingsDto
.
getBackUpMonth
()
+
" ,sameBarcodeSettings="
+
sysSettingsDto
.
getSameBarcodeSettings
()+
", apiTest="
+
sysSettingsDto
.
isApiTest
());
" ,sameBarcodeSettings="
+
sysSettingsDto
.
getSameBarcodeSettings
()+
", apiTest="
+
sysSettingsDto
.
isApiTest
()
+
",xrayBypass="
+
sysSettingsDto
.
isXrayBypass
()
);
String
msg
=
MessageUtils
.
getText
(
"smfcore.saveOk"
,
servletRequest
.
getLocale
(),
"保存成功"
);
String
msg
=
MessageUtils
.
getText
(
"smfcore.saveOk"
,
servletRequest
.
getLocale
(),
"保存成功"
);
return
ResultBean
.
newOkResult
(
msg
);
return
ResultBean
.
newOkResult
(
msg
);
...
...
src/main/java/com/neotel/smfcore/core/system/rest/bean/dto/SysSettingsDto.java
查看文件 @
00157b9
...
@@ -32,4 +32,8 @@ public class SysSettingsDto implements Serializable {
...
@@ -32,4 +32,8 @@ public class SysSettingsDto implements Serializable {
private
Integer
sameBarcodeSettings
=
1
;
private
Integer
sameBarcodeSettings
=
1
;
@ApiModelProperty
(
"开启api测试"
)
@ApiModelProperty
(
"开启api测试"
)
private
boolean
apiTest
=
false
;
private
boolean
apiTest
=
false
;
@ApiModelProperty
(
"忽略XRay"
)
private
boolean
xrayBypass
=
false
;
}
}
src/main/java/com/neotel/smfcore/custom/micron1053/api/AMaterialBean.java
查看文件 @
00157b9
...
@@ -68,7 +68,7 @@ public class AMaterialBean {
...
@@ -68,7 +68,7 @@ public class AMaterialBean {
try
{
try
{
return
Convert
.
toInt
((
str
));
return
Convert
.
toInt
((
str
));
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
info
(
"转为数字出错:"
+
ex
.
toString
());
//
log.info("转为数字出错:" + ex.toString());
}
}
return
defValue
;
return
defValue
;
}
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
查看文件 @
00157b9
...
@@ -119,18 +119,49 @@ public class MicronApi {
...
@@ -119,18 +119,49 @@ public class MicronApi {
// "message": "Server error exception",
// "message": "Server error exception",
// "detail": "Value cannot be null. (Parameter 'value')"
// "detail": "Value cannot be null. (Parameter 'value')"
// }
// }
if
(
result
.
isOk
()&&
result
.
statusIsSuccess
())
{
// "serialNumber": "P2SITPCB001",
// "partNumber": "550-502922C",
// "mamQty": 2000,
// "xrayReq": false,
// "transactionId": "833ec781-1eba-4860-bb91-f667cd89afd4",
// "status": "Success"
if
(
result
.
isOk
()
&&
result
.
statusIsSuccess
())
{
String
partNumber
=
result
.
getResult
(
"partNumber"
);
String
partNumber
=
result
.
getResult
(
"partNumber"
);
String
serialNum
=
result
.
getResult
(
"serialNum
"
);
String
serialNum
ber
=
result
.
getResult
(
"serialNumber
"
);
Boolean
xrayReq
=
result
.
getResult
(
"xrayReq"
);
Boolean
xrayReq
=
result
.
getResult
(
"xrayReq"
);
Integer
mamQty
=
result
.
getResult
(
"Qty"
);
Integer
mamQty
=
result
.
getResult
(
"mamQty"
);
String
oldBarcode
=
barcode
.
getBarcode
();
log
.
info
(
"API001 ,barcode="
+
barcode
.
getBarcode
()
+
",返回结果:partNumber="
+
partNumber
+
", serialNum="
+
partNumber
+
", xrayReq="
+
xrayReq
+
", Qty="
+
mamQty
);
boolean
needSave
=
false
;
if
(
mamQty
!=
null
&&
mamQty
>
0
&&
mamQty
!=
barcode
.
getAmount
())
{
barcode
.
setAmount
(
mamQty
);
needSave
=
true
;
}
if
(
ObjectUtil
.
isNotEmpty
(
partNumber
)
&&
(!
barcode
.
getPartNumber
().
equals
(
partNumber
)))
{
barcode
.
setPartNumber
(
partNumber
);
needSave
=
true
;
}
if
(
ObjectUtil
.
isNotEmpty
(
serialNumber
)
&&
(!
barcode
.
getBarcode
().
equals
(
serialNumber
)))
{
barcode
.
setBarcode
(
serialNumber
);
needSave
=
true
;
}
if
(
needSave
)
{
log
.
info
(
"API001 更新条码["
+
oldBarcode
+
"]的 partNumber="
+
partNumber
+
",serialNumber="
+
serialNumber
+
",mamQty="
+
mamQty
);
barcodeManager
.
saveBarcode
(
barcode
);
}
if
(
xrayReq
!=
null
&&
xrayReq
==
true
)
{
if
(
xrayReq
!=
null
&&
xrayReq
==
true
)
{
barcode
.
setToXray
(
true
);
barcode
.
setToXray
(
true
);
}
}
log
.
info
(
"API001 ,barcode="
+
barcode
.
getBarcode
()
+
",返回结果:partNumber="
+
partNumber
+
", serialNum="
+
serialNum
+
", xrayReq="
+
xrayReq
+
", Qty="
+
mamQty
);
}
else
{
}
else
{
log
.
info
(
"API001 ,验证失败,获取数据失败"
);
log
.
info
(
"API001 ,验证失败,获取数据失败"
);
throw
new
ApiException
(
"smfcore.api.fail"
,
"{0} Failed to get data"
,
new
String
[]{
"API001"
});
throw
new
ApiException
(
"smfcore.api.fail"
,
"{0} Failed to get data"
,
new
String
[]{
"API001"
});
}
}
...
...
src/main/java/com/neotel/smfcore/security/config/ConfigurerAdapter.java
查看文件 @
00157b9
...
@@ -30,6 +30,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
...
@@ -30,6 +30,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.io.Serializable
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -82,7 +83,9 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
...
@@ -82,7 +83,9 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
supportMediaTypeList
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
supportMediaTypeList
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
FastJsonConfig
config
=
new
FastJsonConfig
();
FastJsonConfig
config
=
new
FastJsonConfig
();
config
.
setDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
config
.
setDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
config
.
setSerializerFeatures
(
SerializerFeature
.
DisableCircularReferenceDetect
);
config
.
setSerializerFeatures
(
SerializerFeature
.
DisableCircularReferenceDetect
,
SerializerFeature
.
WriteMapNullValue
);
converter
.
setFastJsonConfig
(
config
);
converter
.
setFastJsonConfig
(
config
);
converter
.
setSupportedMediaTypes
(
supportMediaTypeList
);
converter
.
setSupportedMediaTypes
(
supportMediaTypeList
);
converter
.
setDefaultCharset
(
StandardCharsets
.
UTF_8
);
converter
.
setDefaultCharset
(
StandardCharsets
.
UTF_8
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论