Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 74b8014d
由
zshaohui
编写于
2023-11-07 10:27:16 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加物料过期配置 是否可以入库
1 个父辈
04be63de
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
75 行增加
和
28 行删除
src/main/java/com/neotel/smfcore/common/utils/Constants.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLMShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/VirtualBoxHandler.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/common/utils/Constants.java
查看文件 @
74b8014
...
@@ -191,4 +191,9 @@ public class Constants {
...
@@ -191,4 +191,9 @@ public class Constants {
*/
*/
public
static
final
String
CACHE_API_XRAY_BYPASSS
=
"CACHE_API_XRAY_BYPASSS"
;
public
static
final
String
CACHE_API_XRAY_BYPASSS
=
"CACHE_API_XRAY_BYPASSS"
;
/**
* 是否启用过期时间验证
*/
public
static
final
String
CACHE_EXPIREDATE_VERIFY
=
"CACHE_EXPIREDATE_VERIFY"
;
}
}
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
74b8014
...
@@ -393,7 +393,10 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -393,7 +393,10 @@ public class BaseDeviceHandler implements IDeviceHandler {
Date
expireDate
=
barcodeSave
.
getExpireDate
();
Date
expireDate
=
barcodeSave
.
getExpireDate
();
if
(
expireDate
!=
null
)
{
if
(
expireDate
!=
null
)
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
boolean
expiredateVerify
=
dataCache
.
getExpiredateVerify
();
if
(!
expiredateVerify
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLMShelfHandler.java
查看文件 @
74b8014
...
@@ -248,7 +248,10 @@ public class NLMShelfHandler extends BaseDeviceHandler {
...
@@ -248,7 +248,10 @@ public class NLMShelfHandler extends BaseDeviceHandler {
Barcode
barcode
=
codeBean
.
getBarcode
();
Barcode
barcode
=
codeBean
.
getBarcode
();
Date
expireDate
=
barcode
.
getExpireDate
();
Date
expireDate
=
barcode
.
getExpireDate
();
if
(
expireDate
!=
null
&&
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
if
(
expireDate
!=
null
&&
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
boolean
expiredateVerify
=
dataCache
.
getExpiredateVerify
();
if
(!
expiredateVerify
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
}
}
}
if
(
barcode
.
getPlateSize
()
<=
1
)
{
if
(
barcode
.
getPlateSize
()
<=
1
)
{
//长宽为1的需要弹框设置尺寸
//长宽为1的需要弹框设置尺寸
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
查看文件 @
74b8014
...
@@ -135,7 +135,10 @@ public class NLPShelfHandler extends BaseDeviceHandler {
...
@@ -135,7 +135,10 @@ public class NLPShelfHandler extends BaseDeviceHandler {
Date
expireDate
=
barcode
.
getExpireDate
();
Date
expireDate
=
barcode
.
getExpireDate
();
if
(
expireDate
!=
null
)
{
if
(
expireDate
!=
null
)
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
boolean
expiredateVerify
=
dataCache
.
getExpiredateVerify
();
if
(!
expiredateVerify
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
查看文件 @
74b8014
...
@@ -381,7 +381,10 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -381,7 +381,10 @@ public class NLShelfHandler extends BaseDeviceHandler {
Date
expireDate
=
barcode
.
getExpireDate
();
Date
expireDate
=
barcode
.
getExpireDate
();
if
(
expireDate
!=
null
)
{
if
(
expireDate
!=
null
)
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
boolean
expiredateVerify
=
dataCache
.
getExpiredateVerify
();
if
(!
expiredateVerify
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
74b8014
...
@@ -410,18 +410,21 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -410,18 +410,21 @@ public class RobotBoxHandler extends BaseDeviceHandler {
}
else
{
}
else
{
try
{
try
{
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
if
(
barcode
.
getExpireDate
()
!=
null
&&
System
.
currentTimeMillis
()
>
barcode
.
getExpireDate
().
getTime
())
{
boolean
expiredateVerify
=
dataCache
.
getExpiredateVerify
();
if
(!
expiredateVerify
)
{
if
(
barcode
.
getExpireDate
()
!=
null
&&
System
.
currentTimeMillis
()
>
barcode
.
getExpireDate
().
getTime
())
{
// throw new ValidateException("smfcore.error.barcode.expired", "物料已过期,无法入库.");
// throw new ValidateException("smfcore.error.barcode.expired", "物料已过期,无法入库.");
//已有入库任务,返回NG,标记原来的入库任务
//已有入库任务,返回NG,标记原来的入库任务
resultMap
.
put
(
"result"
,
"107"
);
resultMap
.
put
(
"result"
,
"107"
);
errorMsg
=
"["
+
barcode
.
getBarcode
()+
"]"
+
MessageUtils
.
getText
(
"smfcore.error.barcode.expired"
,
new
Locale
(
"en"
,
"US"
),
"物料已过期,无法入库"
);
errorMsg
=
"["
+
barcode
.
getBarcode
()
+
"]"
+
MessageUtils
.
getText
(
"smfcore.error.barcode.expired"
,
new
Locale
(
"en"
,
"US"
),
"物料已过期,无法入库"
);
resultMap
.
put
(
"msg"
,
errorMsg
);
resultMap
.
put
(
"msg"
,
errorMsg
);
log
.
error
(
"物料["
+
barcode
.
getBarcode
()+
"]已过期,无法入库"
);
log
.
error
(
"物料["
+
barcode
.
getBarcode
()
+
"]已过期,无法入库"
);
loadingUtil
.
AddInListItem
(
rfid
,
barcode
,
""
,
INITEM_STATUS
.
API001NG
,
errorMsg
);
loadingUtil
.
AddInListItem
(
rfid
,
barcode
,
""
,
INITEM_STATUS
.
API001NG
,
errorMsg
);
return
resultMap
;
return
resultMap
;
}
}
}
try
{
try
{
if
(
ObjectUtil
.
isNotEmpty
(
preCid
))
{
if
(
ObjectUtil
.
isNotEmpty
(
preCid
))
{
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/VirtualBoxHandler.java
查看文件 @
74b8014
...
@@ -121,7 +121,10 @@ public class VirtualBoxHandler extends BaseDeviceHandler{
...
@@ -121,7 +121,10 @@ public class VirtualBoxHandler extends BaseDeviceHandler{
Date
expireDate
=
barcode
.
getExpireDate
();
Date
expireDate
=
barcode
.
getExpireDate
();
if
(
expireDate
!=
null
)
{
if
(
expireDate
!=
null
)
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
if
(
System
.
currentTimeMillis
()
>
expireDate
.
getTime
())
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
boolean
expiredateVerify
=
dataCache
.
getExpiredateVerify
();
if
(!
expiredateVerify
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库."
);
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
74b8014
...
@@ -7,6 +7,7 @@ import com.google.common.collect.Lists;
...
@@ -7,6 +7,7 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.manager.IComponentManager
;
import
com.neotel.smfcore.core.barcode.service.manager.IComponentManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Component
;
import
com.neotel.smfcore.core.barcode.service.po.Component
;
...
@@ -127,7 +128,9 @@ public class DataCache {
...
@@ -127,7 +128,9 @@ public class DataCache {
cacheMap
=
Maps
.
newConcurrentMap
();
cacheMap
=
Maps
.
newConcurrentMap
();
List
<
CacheItem
>
all
=
cacheItemDao
.
findAll
();
List
<
CacheItem
>
all
=
cacheItemDao
.
findAll
();
for
(
CacheItem
cacheItem
:
all
)
{
for
(
CacheItem
cacheItem
:
all
)
{
cacheMap
.
put
(
cacheItem
.
getCacheKey
(),
cacheItem
.
getCacheValue
());
if
(
StringUtils
.
isNotBlank
(
cacheItem
.
getCacheKey
())
&&
cacheItem
.
getCacheValue
()
!=
null
)
{
cacheMap
.
put
(
cacheItem
.
getCacheKey
(),
cacheItem
.
getCacheValue
());
}
}
}
if
(
cacheMap
.
get
(
Constants
.
CACHE_StopOut
)
==
null
)
{
if
(
cacheMap
.
get
(
Constants
.
CACHE_StopOut
)
==
null
)
{
updateCache
(
Constants
.
CACHE_StopOut
,
false
);
updateCache
(
Constants
.
CACHE_StopOut
,
false
);
...
@@ -173,20 +176,22 @@ public class DataCache {
...
@@ -173,20 +176,22 @@ public class DataCache {
* 更新缓存信息
* 更新缓存信息
*/
*/
public
void
updateCache
(
String
cacheKey
,
Object
value
)
{
public
void
updateCache
(
String
cacheKey
,
Object
value
)
{
cacheItemDao
.
updateCacheItem
(
cacheKey
,
value
);
if
(
StringUtils
.
isNotBlank
(
cacheKey
)
&&
value
!=
null
)
{
cacheMap
.
put
(
cacheKey
,
value
);
cacheItemDao
.
updateCacheItem
(
cacheKey
,
value
);
if
(
cacheKey
.
equals
(
Constants
.
CACHE_CodeRule
))
{
cacheMap
.
put
(
cacheKey
,
value
);
List
<
String
>
ruleList
=
(
List
<
String
>)
value
;
if
(
cacheKey
.
equals
(
Constants
.
CACHE_CodeRule
))
{
codeResolve
.
updateBarcodeRuleList
(
ruleList
);
List
<
String
>
ruleList
=
(
List
<
String
>)
value
;
}
codeResolve
.
updateBarcodeRuleList
(
ruleList
);
if
(
cacheKey
.
equals
(
Constants
.
CACHE_ExpiresDay
))
{
}
codeResolve
.
updateExpiresDay
((
Integer
)
value
);
if
(
cacheKey
.
equals
(
Constants
.
CACHE_ExpiresDay
))
{
}
codeResolve
.
updateExpiresDay
((
Integer
)
value
);
if
(
cacheKey
.
equals
(
Constants
.
CHCHE_ExpirationDateConfig
)){
}
codeResolve
.
updateConfigMap
((
Map
<
String
,
Integer
>)
value
);
if
(
cacheKey
.
equals
(
Constants
.
CHCHE_ExpirationDateConfig
))
{
}
codeResolve
.
updateConfigMap
((
Map
<
String
,
Integer
>)
value
);
}
log
.
info
(
"updateCache ["
+
cacheKey
+
"]=["
+
value
+
"]"
);
log
.
info
(
"updateCache ["
+
cacheKey
+
"]=["
+
value
+
"]"
);
}
}
}
/**
/**
...
@@ -949,4 +954,13 @@ public class DataCache {
...
@@ -949,4 +954,13 @@ public class DataCache {
}
}
return
true
;
return
true
;
}
}
public
boolean
getExpiredateVerify
(){
Boolean
cache
=
getCache
(
Constants
.
CACHE_EXPIREDATE_VERIFY
);
if
(
cache
==
null
){
cache
=
false
;
}
return
cache
;
}
}
}
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
查看文件 @
74b8014
...
@@ -80,6 +80,13 @@ public class SettingsController {
...
@@ -80,6 +80,13 @@ public class SettingsController {
dataCache
.
updateCache
(
Constants
.
CACHE_API_XRAY_BYPASSS
,
xrayBypass
);
dataCache
.
updateCache
(
Constants
.
CACHE_API_XRAY_BYPASSS
,
xrayBypass
);
}
}
Boolean
expiredateVerify
=
dataCache
.
getCache
(
Constants
.
CACHE_EXPIREDATE_VERIFY
);
if
(
expiredateVerify
==
null
){
expiredateVerify
=
false
;
dataCache
.
updateCache
(
Constants
.
CACHE_EXPIREDATE_VERIFY
,
expiredateVerify
);
}
SysSettingsDto
dto
=
new
SysSettingsDto
();
SysSettingsDto
dto
=
new
SysSettingsDto
();
dto
.
setStartJob
(
startJob
);
dto
.
setStartJob
(
startJob
);
dto
.
setStopOut
(
stopOut
);
dto
.
setStopOut
(
stopOut
);
...
@@ -90,6 +97,7 @@ public class SettingsController {
...
@@ -90,6 +97,7 @@ public class SettingsController {
dto
.
setSameBarcodeSettings
(
barcodeSet
);
dto
.
setSameBarcodeSettings
(
barcodeSet
);
dto
.
setApiTest
(
useAPi
);
dto
.
setApiTest
(
useAPi
);
dto
.
setXrayBypass
(
xrayBypass
);
dto
.
setXrayBypass
(
xrayBypass
);
dto
.
setExpiredateVerify
(
expiredateVerify
);
return
dto
;
return
dto
;
}
}
...
@@ -106,9 +114,11 @@ public class SettingsController {
...
@@ -106,9 +114,11 @@ public class SettingsController {
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
());
dataCache
.
updateCache
(
Constants
.
CACHE_API_XRAY_BYPASSS
,
sysSettingsDto
.
isXrayBypass
());
dataCache
.
updateCache
(
Constants
.
CACHE_EXPIREDATE_VERIFY
,
sysSettingsDto
.
isExpiredateVerify
());
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
()+
",xrayBypass="
+
sysSettingsDto
.
isXrayBypass
());
" ,sameBarcodeSettings="
+
sysSettingsDto
.
getSameBarcodeSettings
()+
", apiTest="
+
sysSettingsDto
.
isApiTest
()+
",xrayBypass="
+
sysSettingsDto
.
isXrayBypass
()+
",expiredateVerify="
+
sysSettingsDto
.
isExpiredateVerify
());
String
msg
=
MessageUtils
.
getText
(
"smfcore.saveOk"
,
servletRequest
.
getLocale
(),
"保存成功"
);
String
msg
=
MessageUtils
.
getText
(
"smfcore.saveOk"
,
servletRequest
.
getLocale
(),
"保存成功"
);
return
ResultBean
.
newOkResult
(
msg
);
return
ResultBean
.
newOkResult
(
msg
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论