Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 16f0fc42
由
LN
编写于
2023-03-20 14:12:14 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1053bug修改:1.看板提示有A=。2.NG物料保存到错误日志。3.过期时间出库问题。4.离线料仓不能出库。
1 个父辈
eab52fd3
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
58 行增加
和
24 行删除
src/main/java/com/neotel/smfcore/core/device/bean/StatusBean.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/message/util/DeviceMessageUtil.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/custom/micron1053/util/MicronDataCache.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/core/device/bean/StatusBean.java
查看文件 @
16f0fc4
...
@@ -547,7 +547,8 @@ public class StatusBean {
...
@@ -547,7 +547,8 @@ public class StatusBean {
if
(!
code
.
startsWith
(
MessageUtils
.
smfcore
))
{
if
(!
code
.
startsWith
(
MessageUtils
.
smfcore
))
{
code
=
MessageUtils
.
smfcore
+
"."
+
this
.
msgCode
;
code
=
MessageUtils
.
smfcore
+
"."
+
this
.
msgCode
;
}
}
String
newMsg
=
MessageUtils
.
getText
(
code
,
getMsgParam
(),
locale
,
getMsg
());
String
newMsg
=
this
.
msg
.
replace
(
"A="
,
""
).
replace
(
"I="
,
""
).
replace
(
"W="
,
""
);
newMsg
=
MessageUtils
.
getText
(
code
,
getMsgParam
(),
locale
,
newMsg
);
return
newMsg
;
return
newMsg
;
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
16f0fc4
...
@@ -290,6 +290,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -290,6 +290,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
String
okMsg
=
""
;
String
okMsg
=
""
;
String
errorMsg
=
""
;
String
errorMsg
=
""
;
List
<
Storage
>
storageList
=
Lists
.
newArrayList
();
List
<
Storage
>
storageList
=
Lists
.
newArrayList
();
//急停,报警,调试状态的料仓不可用
List
<
String
>
cidList
=
dataCache
.
getAvailableStorageIds
(
this
.
getDeviceType
());
List
<
String
>
cidList
=
dataCache
.
getAvailableStorageIds
(
this
.
getDeviceType
());
List
<
String
>
thirdList
=
dataCache
.
getAvailableStorageIds
(
DeviceType
.
SMDBOX_THIRD
);
List
<
String
>
thirdList
=
dataCache
.
getAvailableStorageIds
(
DeviceType
.
SMDBOX_THIRD
);
cidList
.
addAll
(
thirdList
);
cidList
.
addAll
(
thirdList
);
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
16f0fc4
...
@@ -108,9 +108,9 @@ public class DataCache {
...
@@ -108,9 +108,9 @@ public class DataCache {
@PostConstruct
@PostConstruct
public
void
initialize
()
{
public
void
initialize
()
{
settings
=
getSettings
();
;
settings
=
getSettings
();
initCacheItem
();
initCacheItem
();
Integer
expireDay
=
getCache
(
Constants
.
CACHE_ExpiresDay
);
Integer
expireDay
=
getCache
(
Constants
.
CACHE_ExpiresDay
);
codeResolve
.
updateExpiresDay
(
expireDay
);
codeResolve
.
updateExpiresDay
(
expireDay
);
}
}
...
@@ -170,8 +170,8 @@ public class DataCache {
...
@@ -170,8 +170,8 @@ public class DataCache {
List
<
String
>
ruleList
=
(
List
<
String
>)
value
;
List
<
String
>
ruleList
=
(
List
<
String
>)
value
;
codeResolve
.
updateBarcodeRuleList
(
ruleList
);
codeResolve
.
updateBarcodeRuleList
(
ruleList
);
}
}
if
(
cacheKey
.
equals
(
Constants
.
CACHE_ExpiresDay
))
{
if
(
cacheKey
.
equals
(
Constants
.
CACHE_ExpiresDay
))
{
codeResolve
.
updateExpiresDay
((
Integer
)
value
);
codeResolve
.
updateExpiresDay
((
Integer
)
value
);
}
}
log
.
info
(
"updateCache ["
+
cacheKey
+
"]=["
+
value
+
"]"
);
log
.
info
(
"updateCache ["
+
cacheKey
+
"]=["
+
value
+
"]"
);
...
@@ -292,7 +292,7 @@ public class DataCache {
...
@@ -292,7 +292,7 @@ public class DataCache {
* 所有的料仓 key 为 cid, value 为 Storage
* 所有的料仓 key 为 cid, value 为 Storage
*/
*/
private
static
Map
<
String
,
Storage
>
allStorage
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
Storage
>
allStorage
=
new
ConcurrentHashMap
<>();
//
//
//
// /**
// /**
// * 某个区域需要进行清理呆滞物料的所有料仓(虚拟仓应该不需要清理的)
// * 某个区域需要进行清理呆滞物料的所有料仓(虚拟仓应该不需要清理的)
...
@@ -773,7 +773,7 @@ public class DataCache {
...
@@ -773,7 +773,7 @@ public class DataCache {
if
(
component
!=
null
&&
component
.
getSluggishDay
()
>
0
)
{
if
(
component
!=
null
&&
component
.
getSluggishDay
()
>
0
)
{
return
component
.
getSluggishDay
();
return
component
.
getSluggishDay
();
}
}
Integer
sluggishDay
=
getCache
(
Constants
.
CACHE_SluggishDay
);
Integer
sluggishDay
=
getCache
(
Constants
.
CACHE_SluggishDay
);
if
(
sluggishDay
==
null
){
if
(
sluggishDay
==
null
){
sluggishDay
=
0
;
sluggishDay
=
0
;
}
}
...
@@ -843,12 +843,12 @@ public class DataCache {
...
@@ -843,12 +843,12 @@ public class DataCache {
return
map
.
get
(
type
);
return
map
.
get
(
type
);
}
}
/**
* key为cid,value为出入库数量
*/
private
static
Map
<
String
,
InOutData
>
inOutDataMap
=
new
ConcurrentHashMap
<>();
private
void
updateInOutData
(
Storage
storage
,
int
count
)
{
public
boolean
StorageIsAvailable
(
Storage
storage
)
{
StatusBean
bean
=
DevicesStatusUtil
.
getStatusBean
(
storage
.
getCid
());
if
(
bean
==
null
||
bean
.
timeOut
()
||
!
bean
.
isAvailable
())
{
return
false
;
}
return
true
;
}
}
}
}
src/main/java/com/neotel/smfcore/core/message/util/DeviceMessageUtil.java
查看文件 @
16f0fc4
...
@@ -7,6 +7,7 @@ import com.neotel.smfcore.core.device.util.EquipmentCache;
...
@@ -7,6 +7,7 @@ import com.neotel.smfcore.core.device.util.EquipmentCache;
import
com.neotel.smfcore.core.equipment.service.po.Equipment
;
import
com.neotel.smfcore.core.equipment.service.po.Equipment
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.message.enums.MessageType
;
import
com.neotel.smfcore.core.message.enums.MessageType
;
import
com.neotel.smfcore.core.message.service.bean.DataContent
;
import
com.neotel.smfcore.core.message.service.manager.IMessageManager
;
import
com.neotel.smfcore.core.message.service.manager.IMessageManager
;
import
com.neotel.smfcore.core.message.service.po.Message
;
import
com.neotel.smfcore.core.message.service.po.Message
;
import
com.neotel.smfcore.core.message.util.bean.DeviceInfo
;
import
com.neotel.smfcore.core.message.util.bean.DeviceInfo
;
...
@@ -23,6 +24,7 @@ import org.springframework.data.mongodb.core.query.Query;
...
@@ -23,6 +24,7 @@ import org.springframework.data.mongodb.core.query.Query;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
@Slf4j
@Slf4j
...
@@ -132,9 +134,10 @@ public class DeviceMessageUtil {
...
@@ -132,9 +134,10 @@ public class DeviceMessageUtil {
messageManager
.
save
(
message
);
messageManager
.
save
(
message
);
}
}
}
}
public
static
void
addMessage
(
String
msgType
,
String
name
,
String
moudle
,
String
msgCode
,
String
msg
,
String
[]
msgParam
)
{
addMessage
(
msgType
,
name
,
moudle
,
msgCode
,
msg
,
msgParam
,
null
);
public
static
void
addMessage
(
String
msgType
,
String
name
,
String
moudle
,
String
msgCode
,
String
msg
,
String
[]
msgParam
)
{
}
public
static
void
addMessage
(
String
msgType
,
String
name
,
String
moudle
,
String
msgCode
,
String
msg
,
String
[]
msgParam
,
List
<
DataContent
>
dataList
)
{
if
(
ObjectUtil
.
isEmpty
(
msgType
)||
ObjectUtil
.
isEmpty
(
msg
)){
if
(
ObjectUtil
.
isEmpty
(
msgType
)||
ObjectUtil
.
isEmpty
(
msg
)){
return
;
return
;
}
try
{
}
try
{
...
@@ -145,6 +148,9 @@ public class DeviceMessageUtil {
...
@@ -145,6 +148,9 @@ public class DeviceMessageUtil {
}
}
}
}
Message
message
=
Message
.
newMsg
(
msgType
,
name
,
""
,
moudle
,
code
,
msg
,
msgParam
);
Message
message
=
Message
.
newMsg
(
msgType
,
name
,
""
,
moudle
,
code
,
msg
,
msgParam
);
if
(
dataList
!=
null
){
message
.
setDataList
(
dataList
);
}
messageManager
.
save
(
message
);
messageManager
.
save
(
message
);
}
catch
(
Exception
ex
){
}
catch
(
Exception
ex
){
log
.
error
(
"addMessage ["
+
msgType
+
"]["
+
name
+
"]["
+
msg
+
"]出错:"
+
ex
.
toString
());
log
.
error
(
"addMessage ["
+
msgType
+
"]["
+
name
+
"]["
+
msg
+
"]出错:"
+
ex
.
toString
());
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
16f0fc4
...
@@ -442,6 +442,11 @@ public class StoragePosController {
...
@@ -442,6 +442,11 @@ public class StoragePosController {
// throw new ValidateException("料仓[" + pos.getStorageId() + "]不存在");
// throw new ValidateException("料仓[" + pos.getStorageId() + "]不存在");
}
}
//如果料仓不可用,不能出库
if
(!
dataCache
.
StorageIsAvailable
(
storage
)){
throw
new
ValidateException
(
"smfcore.storage.notAvailable"
,
"料仓{0}离线或不可用,无法出库"
,
new
String
[]{
storage
.
getName
()});
}
// //西门子接口验证
// //西门子接口验证
// boolean result=SiemensApi.getMaterialLot(2, storage.getId(),storage.getName(),pos.getBarcode().getBarcode());
// boolean result=SiemensApi.getMaterialLot(2, storage.getId(),storage.getName(),pos.getBarcode().getBarcode());
// if(!result) {
// if(!result) {
...
...
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
16f0fc4
...
@@ -720,12 +720,19 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -720,12 +720,19 @@ public class StoragePosManagerImpl implements IStoragePosManager {
//把value转换为时间
//把value转换为时间
try
{
try
{
Date
date
=
DateUtil
.
toDate
(
value
);
Date
date
=
DateUtil
.
toDate
(
value
);
String
[]
patternArray
=
new
String
[]{
"yyyy-MM-dd"
,
"MM-dd-yyyy"
,
"yyyyMMdd"
};
if
(
date
==
null
)
{
date
=
DateUtil
.
toDate
(
value
,
patternArray
);
String
[]
patternArray
=
new
String
[]{
"MM-dd-yyyy"
,
"yyyy-MM-dd"
,
"yyyyMMdd"
};
if
(
key
.
equals
(
"barcode.produceDate"
))
{
patternArray
=
new
String
[]{
"yyyyMMdd"
,
"yyyy-MM-dd"
,
"MM-dd-yyyy"
};
}
date
=
DateUtil
.
toDate
(
value
,
patternArray
);
}
if
(
date
!=
null
)
{
if
(
date
!=
null
)
{
//时间判断为当天
//时间判断为当天
Date
endDate
=
new
Date
(
date
.
getTime
()+
24
*
60
*
60
*
1000
);
Date
endDate
=
new
Date
(
date
.
getTime
()
+
24
*
60
*
60
*
1000
);
// String str = DateUtil.toDateTimeString(date);
// String endStr = DateUtil.toDateTimeString(endDate);
c
.
and
(
key
).
gte
(
date
).
lt
(
endDate
);
c
.
and
(
key
).
gte
(
date
).
lt
(
endDate
);
}
}
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/util/MicronDataCache.java
查看文件 @
16f0fc4
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
.
util
;
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
.
util
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.core.message.enums.MessageType
;
import
com.neotel.smfcore.core.message.service.bean.DataContent
;
import
com.neotel.smfcore.core.message.util.DeviceMessageUtil
;
import
com.neotel.smfcore.core.message.util.DeviceMessageUtil
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.custom.micron1053.bean.EquipMsg
;
import
com.neotel.smfcore.custom.micron1053.bean.EquipMsg
;
...
@@ -182,6 +184,13 @@ public class MicronDataCache {
...
@@ -182,6 +184,13 @@ public class MicronDataCache {
List
<
ML5NgReelInfo
>
list
=
ml5NgMap
.
getOrDefault
(
info
.
getNgPos
(),
new
ArrayList
<>());
List
<
ML5NgReelInfo
>
list
=
ml5NgMap
.
getOrDefault
(
info
.
getNgPos
(),
new
ArrayList
<>());
list
.
add
(
info
);
list
.
add
(
info
);
ml5NgMap
.
put
(
info
.
getNgPos
(),
list
);
ml5NgMap
.
put
(
info
.
getNgPos
(),
list
);
//NG物料保存到错误日志
List
<
DataContent
>
dataList
=
new
ArrayList
<>();
dataList
.
add
(
new
DataContent
(
"barcode"
,
info
.
getBarcode
()));
dataList
.
add
(
new
DataContent
(
"inoutType"
,
info
.
getType
()));
dataList
.
add
(
new
DataContent
(
"MType"
,
info
.
getMType
()));
DeviceMessageUtil
.
addMessage
(
MessageType
.
ERROR
.
name
(),
"ML5"
,
info
.
getPosName
(),
""
,
info
.
getNgMsg
(),
null
,
dataList
);
}
}
public
static
void
clearNgPos
(
Integer
ngPos
)
{
public
static
void
clearNgPos
(
Integer
ngPos
)
{
...
...
src/main/resources/messages.properties
查看文件 @
16f0fc4
...
@@ -328,7 +328,8 @@ smfcore.eventLog=EventLog
...
@@ -328,7 +328,8 @@ smfcore.eventLog=EventLog
smfcore.reports
=
Report
smfcore.reports
=
Report
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
smfcore.storage.notAvailable
=
\u6599\u
4ED3{0}
\u
4E0D
\u
53EF
\u7528\u
FF0C
\u
65E0
\u
6CD5
\u
51FA
\u
5E93
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
...
...
src/main/resources/messages_en_US.properties
查看文件 @
16f0fc4
...
@@ -327,4 +327,5 @@ smfcore.eventLog=EventLog
...
@@ -327,4 +327,5 @@ smfcore.eventLog=EventLog
smfcore.reports
=
Report
smfcore.reports
=
Report
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
\ No newline at end of file
\ No newline at end of file
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
smfcore.storage.notAvailable
=
SMD BOX{0} Offline or Not Avaliable, Can Not Retrieve.
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_ja_JP.properties
查看文件 @
16f0fc4
...
@@ -325,3 +325,4 @@ smfcore.reports=Report
...
@@ -325,3 +325,4 @@ smfcore.reports=Report
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
smfcore.storage.notAvailable
=
\u6599\u
4ED3{0}
\u
4E0D
\u
53EF
\u7528\u
FF0C
\u
65E0
\u
6CD5
\u
51FA
\u
5E93
src/main/resources/messages_zh_CN.properties
查看文件 @
16f0fc4
...
@@ -324,4 +324,5 @@ smfcore.eventLog=EventLog
...
@@ -324,4 +324,5 @@ smfcore.eventLog=EventLog
smfcore.reports
=
Report
smfcore.reports
=
Report
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
\ No newline at end of file
\ No newline at end of file
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
smfcore.storage.notAvailable
=
\u6599\u
4ED3{0}
\u
4E0D
\u
53EF
\u7528\u
FF0C
\u
65E0
\u
6CD5
\u
51FA
\u
5E93
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
16f0fc4
...
@@ -325,4 +325,5 @@ smfcore.eventLog=EventLog
...
@@ -325,4 +325,5 @@ smfcore.eventLog=EventLog
smfcore.reports
=
Report
smfcore.reports
=
Report
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.cannotFind
=
cannot find posName [{0}]
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.posIsEmpty
=
[{0}] is empty
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
\ No newline at end of file
\ No newline at end of file
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
smfcore.storage.notAvailable
=
\u6599\u5009
{0}
\u
96E2
\u
7DDA
\u6216\u
4E0D
\u
53EF
\u7528\u
FF0C
\u7121\u
6CD5
\u
51FA
\u
5EAB
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论