Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f4909f78
由
LN
编写于
2023-03-03 15:04:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1053:客户端上传的消息保存到message表, 数量只统计报警消息数。增加国际化处理。
1 个父辈
0d9247e4
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
190 行增加
和
53 行删除
src/main/java/com/neotel/smfcore/core/message/util/DeviceMessageUtil.java
src/main/java/com/neotel/smfcore/custom/micron1053/bean/EquipMsg.java
src/main/java/com/neotel/smfcore/custom/micron1053/bean/dto/EquipMsgDto.java
src/main/java/com/neotel/smfcore/custom/micron1053/bean/dto/ML5StatusDto.java
src/main/java/com/neotel/smfcore/custom/micron1053/bean/dto/MicronEquipStatusDto.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronML5Controller.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronStatusController.java
src/main/java/com/neotel/smfcore/custom/micron1053/util/MicronDataCache.java
src/main/java/com/neotel/smfcore/core/message/util/DeviceMessageUtil.java
查看文件 @
f4909f7
...
@@ -127,5 +127,21 @@ public class DeviceMessageUtil {
...
@@ -127,5 +127,21 @@ public class DeviceMessageUtil {
}
}
public
static
void
addMessage
(
String
msgType
,
String
name
,
String
moudle
,
String
msgCode
,
String
msg
,
String
[]
msgParam
)
{
if
(
ObjectUtil
.
isEmpty
(
msgType
)||
ObjectUtil
.
isEmpty
(
msg
)){
return
;
}
try
{
String
code
=
msgCode
;
if
(
ObjectUtil
.
isNotEmpty
(
msgCode
))
{
if
(!
msgCode
.
startsWith
(
MessageUtils
.
smfcore
))
{
code
=
MessageUtils
.
smfcore
+
"."
+
msgCode
;
}
}
Message
message
=
Message
.
newMsg
(
msgType
,
name
,
""
,
moudle
,
code
,
msg
,
msgParam
);
messageManager
.
save
(
message
);
}
catch
(
Exception
ex
){
log
.
error
(
"addMessage ["
+
msgType
+
"]["
+
name
+
"]["
+
msg
+
"]出错:"
+
ex
.
toString
());
}
}
}
}
src/main/java/com/neotel/smfcore/custom/micron1053/bean/EquipMsg.java
查看文件 @
f4909f7
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
.
bean
;
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
.
bean
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Locale
;
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
...
@@ -15,4 +18,42 @@ public class EquipMsg implements Serializable {
...
@@ -15,4 +18,42 @@ public class EquipMsg implements Serializable {
private
int
status
;
private
int
status
;
private
String
msg
;
private
String
msg
;
private
Date
time
;
private
Date
time
;
/**
* 消息类型,info,warning,error
*/
private
String
type
;
/**
* 英文提示消息
*/
public
String
msgEn
=
""
;
/**
* 消息字符串Code
*/
private
String
msgCode
;
/**
* 参数
*/
private
String
[]
msgParams
;
public
String
getShowMsg
(
Locale
locale
)
{
if
(
ObjectUtil
.
isEmpty
(
this
.
msg
))
{
return
""
;
}
//从收到数据中查找
String
lan
=
locale
.
toLanguageTag
();
if
(
lan
.
equals
(
MessageUtils
.
EN_US
)
&&
ObjectUtil
.
isNotEmpty
(
getMsgEn
()))
{
return
getMsgEn
();
}
//提示信息国际化
if
(
ObjectUtil
.
isEmpty
(
getMsgCode
()))
{
return
this
.
msg
;
}
else
{
String
code
=
this
.
msgCode
;
if
(!
code
.
startsWith
(
MessageUtils
.
smfcore
))
{
code
=
MessageUtils
.
smfcore
+
"."
+
this
.
msgCode
;
}
String
newMsg
=
MessageUtils
.
getText
(
code
,
msgParams
,
locale
,
getMsg
());
return
newMsg
;
}
}
}
}
src/main/java/com/neotel/smfcore/custom/micron1053/bean/dto/EquipMsgDto.java
0 → 100644
查看文件 @
f4909f7
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
.
bean
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
EquipMsgDto
implements
Serializable
{
private
String
name
;
private
int
status
;
private
String
msg
;
private
Date
time
;
/**
* 消息类型,info,warning,error
*/
private
String
type
;
}
src/main/java/com/neotel/smfcore/custom/micron1053/bean/dto/ML5StatusDto.java
查看文件 @
f4909f7
...
@@ -29,7 +29,7 @@ public class ML5StatusDto implements Serializable {
...
@@ -29,7 +29,7 @@ public class ML5StatusDto implements Serializable {
private
int
ng2Count
=
0
;
private
int
ng2Count
=
0
;
@ApiModelProperty
(
"消息列表"
)
@ApiModelProperty
(
"消息列表"
)
private
List
<
EquipMsg
>
msgList
=
null
;
private
List
<
EquipMsg
Dto
>
msgList
=
null
;
@ApiModelProperty
(
"需要的料架列表"
)
@ApiModelProperty
(
"需要的料架列表"
)
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/bean/dto/MicronEquipStatusDto.java
查看文件 @
f4909f7
...
@@ -21,5 +21,5 @@ public class MicronEquipStatusDto implements Serializable {
...
@@ -21,5 +21,5 @@ public class MicronEquipStatusDto implements Serializable {
private
Map
<
String
,
Integer
>
statusMap
=
new
HashMap
<>();
private
Map
<
String
,
Integer
>
statusMap
=
new
HashMap
<>();
@ApiModelProperty
(
"消息列表"
)
@ApiModelProperty
(
"消息列表"
)
private
List
<
EquipMsg
>
msgList
=
new
ArrayList
<>();
private
List
<
EquipMsg
Dto
>
msgList
=
new
ArrayList
<>();
}
}
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronML5Controller.java
查看文件 @
f4909f7
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
.
controller
;
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
.
controller
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.core.message.enums.MessageType
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.micron1053.bean.EquipMsg
;
import
com.neotel.smfcore.custom.micron1053.bean.EquipMsg
;
import
com.neotel.smfcore.custom.micron1053.bean.ML5NgReelInfo
;
import
com.neotel.smfcore.custom.micron1053.bean.ML5NgReelInfo
;
import
com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus
;
import
com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus
;
import
com.neotel.smfcore.custom.micron1053.bean.dto.EquipMsgDto
;
import
com.neotel.smfcore.custom.micron1053.bean.dto.ML5ShelfDto
;
import
com.neotel.smfcore.custom.micron1053.bean.dto.ML5ShelfDto
;
import
com.neotel.smfcore.custom.micron1053.bean.dto.ML5StatusDto
;
import
com.neotel.smfcore.custom.micron1053.bean.dto.ML5StatusDto
;
import
com.neotel.smfcore.custom.micron1053.util.MicronDataCache
;
import
com.neotel.smfcore.custom.micron1053.util.MicronDataCache
;
...
@@ -31,7 +34,7 @@ public class MicronML5Controller {
...
@@ -31,7 +34,7 @@ public class MicronML5Controller {
@ApiOperation
(
"ML5页面数据获取"
)
@ApiOperation
(
"ML5页面数据获取"
)
@GetMapping
(
"/status"
)
@GetMapping
(
"/status"
)
@AnonymousAccess
@AnonymousAccess
public
ML5StatusDto
ml5Status
(
)
{
public
ML5StatusDto
ml5Status
(
HttpServletRequest
servletRequest
)
{
ML5StatusDto
resultDto
=
new
ML5StatusDto
();
ML5StatusDto
resultDto
=
new
ML5StatusDto
();
MicronEquipStatus
mlL
=
MicronDataCache
.
getStatus
(
"ML5-L"
);
MicronEquipStatus
mlL
=
MicronDataCache
.
getStatus
(
"ML5-L"
);
MicronEquipStatus
mlR
=
MicronDataCache
.
getStatus
(
"ML5-R"
);
MicronEquipStatus
mlR
=
MicronDataCache
.
getStatus
(
"ML5-R"
);
...
@@ -51,7 +54,17 @@ public class MicronML5Controller {
...
@@ -51,7 +54,17 @@ public class MicronML5Controller {
msgs
.
addAll
(
mlR
.
getMsgList
());
msgs
.
addAll
(
mlR
.
getMsgList
());
}
}
if
(
msgs
.
size
()
>
0
)
{
if
(
msgs
.
size
()
>
0
)
{
resultDto
.
setMsgList
(
msgs
);
List
<
EquipMsgDto
>
msgDtos
=
new
ArrayList
<>();
for
(
EquipMsg
msg
:
msgs
)
{
//只显示报警
// if(ObjectUtil.isEmpty(msg.getType())|| msg.getType().equals(MessageType.ERROR)) {
EquipMsgDto
dtoMsg
=
new
EquipMsgDto
(
msg
.
getName
(),
msg
.
getStatus
(),
msg
.
getShowMsg
(
servletRequest
.
getLocale
()),
msg
.
getTime
(),
msg
.
getType
());
msgDtos
.
add
(
dtoMsg
);
// }
}
resultDto
.
setMsgList
(
msgDtos
);
}
}
Map
<
String
,
ML5ShelfDto
>
needShelfs
=
new
HashMap
<>();
Map
<
String
,
ML5ShelfDto
>
needShelfs
=
new
HashMap
<>();
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronStatusController.java
查看文件 @
f4909f7
...
@@ -8,6 +8,7 @@ import com.neotel.smfcore.core.device.bean.BoxStatusBean;
...
@@ -8,6 +8,7 @@ import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.message.enums.MessageType
;
import
com.neotel.smfcore.core.report.bean.ChartItem
;
import
com.neotel.smfcore.core.report.bean.ChartItem
;
import
com.neotel.smfcore.core.storage.bean.UsageItem
;
import
com.neotel.smfcore.core.storage.bean.UsageItem
;
import
com.neotel.smfcore.core.storage.service.manager.IStorageManager
;
import
com.neotel.smfcore.core.storage.service.manager.IStorageManager
;
...
@@ -54,18 +55,20 @@ public class MicronStatusController {
...
@@ -54,18 +55,20 @@ public class MicronStatusController {
@GetMapping
(
"/equipView"
)
@GetMapping
(
"/equipView"
)
@AnonymousAccess
@AnonymousAccess
public
MicronEquipStatusDto
view
(
HttpServletRequest
servletRequest
)
{
public
MicronEquipStatusDto
view
(
HttpServletRequest
servletRequest
)
{
MicronEquipStatusDto
dto
=
new
MicronEquipStatusDto
();
MicronEquipStatusDto
dto
=
new
MicronEquipStatusDto
();
dto
.
setMsgList
(
new
ArrayList
<>());
dto
.
setMsgList
(
new
ArrayList
<>());
dto
.
setStatusMap
(
new
HashMap
<>());
dto
.
setStatusMap
(
new
HashMap
<>());
// ML5,CI,R1,R2,R3
// ML5,CI,R1,R2,R3
String
[]
names
=
new
String
[]{
"ML5-L"
,
"ML5-R"
,
"CI"
,
"R1"
,
"R2"
,
"R3"
};
List
<
EquipMsg
>
allMsgList
=
new
ArrayList
<>();
for
(
String
name
:
names
)
{
String
[]
names
=
new
String
[]{
"ML5-L"
,
"ML5-R"
,
"CI"
,
"R1"
,
"R2"
,
"R3"
};
MicronEquipStatus
s
=
MicronDataCache
.
getStatus
(
name
);
for
(
String
name
:
names
if
(!
s
.
timeOut
()){
)
{
String
newKey
=
s
.
getEquipName
().
replace
(
"-"
,
""
);
MicronEquipStatus
s
=
MicronDataCache
.
getStatus
(
name
);
dto
.
getStatusMap
().
put
(
newKey
,
s
.
getStatus
()
);
if
(!
s
.
timeOut
())
{
String
newKey
=
s
.
getEquipName
().
replace
(
"-"
,
""
);
dto
.
getStatusMap
().
put
(
newKey
,
s
.
getStatus
());
// if(s.getMsgList()!=null&&s.getMsgList().size()>0) {
// if(s.getMsgList()!=null&&s.getMsgList().size()>0) {
// dto.getMsgList().addAll(s.getMsgList());
// dto.getMsgList().addAll(s.getMsgList());
// }
// }
...
@@ -73,23 +76,25 @@ public class MicronStatusController {
...
@@ -73,23 +76,25 @@ public class MicronStatusController {
}
}
//所有设备的报警都加上
//所有设备的报警都加上
List
<
MicronEquipStatus
>
statuses
=
new
ArrayList
<>();
List
<
MicronEquipStatus
>
statuses
=
new
ArrayList
<>();
statuses
.
addAll
(
MicronDataCache
.
equipStatusMap
.
values
());
if
(
MicronDataCache
.
equipStatusMap
!=
null
&&
MicronDataCache
.
equipStatusMap
.
size
()
>
0
)
{
for
(
MicronEquipStatus
s
:
statuses
.
addAll
(
MicronDataCache
.
equipStatusMap
.
values
());
statuses
)
{
for
(
MicronEquipStatus
s
:
if
(!
s
.
timeOut
())
{
statuses
)
{
if
(!
dto
.
getStatusMap
().
containsKey
(
s
.
getEquipName
())){
if
(!
s
.
timeOut
())
{
dto
.
getStatusMap
().
put
(
s
.
getEquipName
(),
s
.
getStatus
());
if
(!
dto
.
getStatusMap
().
containsKey
(
s
.
getEquipName
()))
{
}
dto
.
getStatusMap
().
put
(
s
.
getEquipName
(),
s
.
getStatus
());
if
(
s
.
getMsgList
()
!=
null
&&
s
.
getMsgList
().
size
()
>
0
)
{
}
dto
.
getMsgList
().
addAll
(
s
.
getMsgList
());
if
(
s
.
getMsgList
()
!=
null
&&
s
.
getMsgList
().
size
()
>
0
)
{
allMsgList
.
addAll
(
s
.
getMsgList
());
}
}
}
}
}
}
}
//料仓状态
//料仓状态
List
<
String
>
boxList
=
new
ArrayList
<>();
List
<
String
>
boxList
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<=
8
;
i
++
for
(
int
i
=
1
;
i
<=
8
;
i
++
)
{
)
{
boxList
.
add
(
"M"
+
i
);
boxList
.
add
(
"M"
+
i
);
}
}
// SBDH1, SBDH2, SBDH3, SBSH1, SBSH2
// SBDH1, SBDH2, SBDH3, SBSH1, SBSH2
boxList
.
add
(
"SBDH1"
);
boxList
.
add
(
"SBDH1"
);
...
@@ -104,14 +109,23 @@ public class MicronStatusController {
...
@@ -104,14 +109,23 @@ public class MicronStatusController {
for
(
String
boxName
:
for
(
String
boxName
:
boxList
)
{
boxList
)
{
//查找料仓
//查找料仓
MicronEquipStatus
s
=
getBoxEquip
(
boxName
,
servletRequest
.
getLocale
());
MicronEquipStatus
s
=
getBoxEquip
(
boxName
,
servletRequest
.
getLocale
());
dto
.
getStatusMap
().
put
(
s
.
getEquipName
(),
s
.
getStatus
()
);
dto
.
getStatusMap
().
put
(
s
.
getEquipName
(),
s
.
getStatus
()
);
if
(
s
.
getMsgList
()!=
null
&&
s
.
getMsgList
().
size
()>
0
)
{
if
(
s
.
getMsgList
()
!=
null
&&
s
.
getMsgList
().
size
()
>
0
)
{
dto
.
getMsgList
()
.
addAll
(
s
.
getMsgList
());
allMsgList
.
addAll
(
s
.
getMsgList
());
}
}
}
}
return
dto
;
for
(
EquipMsg
msg
:
allMsgList
)
{
//只显示报警
// if(ObjectUtil.isEmpty(msg.getType())|| msg.getType().equals(MessageType.ERROR)) {
EquipMsgDto
dtoMsg
=
new
EquipMsgDto
(
msg
.
getName
(),
msg
.
getStatus
(),
msg
.
getShowMsg
(
servletRequest
.
getLocale
()),
msg
.
getTime
(),
msg
.
getType
());
dto
.
getMsgList
().
add
(
dtoMsg
);
// }
}
return
dto
;
}
}
private
List
<
String
>
getCidsByBoxName
(
String
boxName
)
{
private
List
<
String
>
getCidsByBoxName
(
String
boxName
)
{
...
@@ -154,7 +168,7 @@ public class MicronStatusController {
...
@@ -154,7 +168,7 @@ public class MicronStatusController {
}
}
String
msg
=
s
.
getShowMsg
(
locale
);
String
msg
=
s
.
getShowMsg
(
locale
);
if
(
ObjectUtil
.
isNotEmpty
(
msg
))
{
if
(
ObjectUtil
.
isNotEmpty
(
msg
))
{
dto
.
getMsgList
().
add
(
new
EquipMsg
(
s
.
getCid
(),
s
.
getStatus
(),
msg
,
new
Date
(
s
.
getTime
())));
dto
.
getMsgList
().
add
(
new
EquipMsg
(
s
.
getCid
(),
s
.
getStatus
(),
msg
,
new
Date
(
s
.
getTime
())
,
""
,
""
,
""
,
new
String
[]{}
));
}
}
}
}
}
}
...
@@ -329,33 +343,44 @@ public class MicronStatusController {
...
@@ -329,33 +343,44 @@ public class MicronStatusController {
@GetMapping
(
"/alarmMsgCount"
)
@GetMapping
(
"/alarmMsgCount"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
alarmMsgCount
(
HttpServletRequest
servletRequest
)
{
public
ResultBean
alarmMsgCount
(
HttpServletRequest
servletRequest
)
{
int
count
=
0
;
int
count
=
0
;
try
{
//先添加设备的
//先添加设备的
List
<
MicronEquipStatus
>
statuses
=
new
ArrayList
<>();
List
<
MicronEquipStatus
>
statuses
=
new
ArrayList
<>();
statuses
.
addAll
(
MicronDataCache
.
equipStatusMap
.
values
());
if
(
MicronDataCache
.
equipStatusMap
!=
null
&&
MicronDataCache
.
equipStatusMap
.
size
()
>
0
)
{
for
(
MicronEquipStatus
s
:
statuses
.
addAll
(
MicronDataCache
.
equipStatusMap
.
values
());
statuses
)
{
for
(
MicronEquipStatus
s
:
if
(!
s
.
timeOut
())
{
statuses
)
{
if
(
s
.
getMsgList
()
!=
null
&&
s
.
getMsgList
().
size
()
>
0
)
{
if
(!
s
.
timeOut
())
{
count
+=
s
.
getMsgList
().
size
();
if
(
s
.
getMsgList
()
!=
null
&&
s
.
getMsgList
().
size
()
>
0
)
{
for
(
EquipMsg
msg
:
s
.
getMsgList
()){
//只累计报警消息
if
(
ObjectUtil
.
isEmpty
(
msg
.
getType
())||
msg
.
getType
().
equals
(
MessageType
.
ERROR
))
{
count
+=
s
.
getMsgList
().
size
();
}
}
}
}
}
}
}
}
}
//添加料仓的
//添加料仓的
List
<
Storage
>
storages
=
new
ArrayList
<>();
Map
<
String
,
Storage
>
allStorages
=
dataCache
.
getAllStorage
();
storages
.
addAll
(
dataCache
.
getAllStorage
().
values
());
if
(
allStorages
!=
null
&&
allStorages
.
size
()
>
0
)
{
for
(
Storage
storage
:
for
(
Storage
storage
:
storages
)
{
allStorages
.
values
())
{
StatusBean
statusBean
=
DevicesStatusUtil
.
getStatusBean
(
storage
.
getCid
());
StatusBean
statusBean
=
DevicesStatusUtil
.
getStatusBean
(
storage
.
getCid
());
if
(
statusBean
!=
null
&&
(!
statusBean
.
timeOut
()))
{
if
(
statusBean
!=
null
&&
(!
statusBean
.
timeOut
()))
{
String
msg
=
statusBean
.
getShowMsg
(
servletRequest
.
getLocale
());
String
msg
=
statusBean
.
getShowMsg
(
servletRequest
.
getLocale
());
if
(
ObjectUtil
.
isNotEmpty
(
msg
))
{
if
(
ObjectUtil
.
isNotEmpty
(
msg
))
{
count
+=
1
;
count
+=
1
;
}
}
}
}
}
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"alarmMsgCount 出错:"
+
ex
.
toString
());
}
}
return
ResultBean
.
newOkResult
(
count
);
return
ResultBean
.
newOkResult
(
count
);
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/util/MicronDataCache.java
查看文件 @
f4909f7
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.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
;
import
com.neotel.smfcore.custom.micron1053.bean.ML5NgReelInfo
;
import
com.neotel.smfcore.custom.micron1053.bean.ML5NgReelInfo
;
...
@@ -23,16 +24,36 @@ public class MicronDataCache {
...
@@ -23,16 +24,36 @@ public class MicronDataCache {
if
(
bean
==
null
)
{
if
(
bean
==
null
)
{
return
;
return
;
}
}
List
<
String
>
oldMsgs
=
new
ArrayList
<>();
MicronEquipStatus
oldS
=
equipStatusMap
.
getOrDefault
(
bean
.
getEquipName
(),
new
MicronEquipStatus
());
if
(
oldS
.
getMsgList
()!=
null
&&
oldS
.
getMsgList
().
size
()>
0
){
for
(
EquipMsg
msg
:
oldS
.
getMsgList
())
{
oldMsgs
.
add
(
msg
.
getMsg
());
}
}
List
<
EquipMsg
>
msgs
=
new
ArrayList
<>();
List
<
EquipMsg
>
msgs
=
new
ArrayList
<>();
if
(
bean
.
getMsgList
()!=
null
&&
bean
.
getMsgList
().
size
()>
0
){
if
(
bean
.
getMsgList
()!=
null
&&
bean
.
getMsgList
().
size
()>
0
){
for
(
EquipMsg
msg
:
for
(
EquipMsg
msg
:
bean
.
getMsgList
())
{
bean
.
getMsgList
())
{
if
(
ObjectUtil
.
isEmpty
(
msg
.
getMsg
())){
continue
;
}
if
(
ObjectUtil
.
isEmpty
(
msg
.
getName
())){
if
(
ObjectUtil
.
isEmpty
(
msg
.
getName
())){
msg
.
setName
(
bean
.
getEquipName
());
msg
.
setName
(
bean
.
getEquipName
());
}
}
if
(
msg
.
getTime
()==
null
){
if
(
msg
.
getTime
()==
null
){
msg
.
setTime
(
new
Date
());
msg
.
setTime
(
new
Date
());
}
}
//判断是否需要保存到数据
if
(!
oldMsgs
.
contains
(
msg
.
getMsg
())){
//保存数据
DeviceMessageUtil
.
addMessage
(
msg
.
getType
(),
bean
.
getEquipName
(),
msg
.
getName
(),
msg
.
getMsgCode
(),
msg
.
getMsg
(),
msg
.
getMsgParams
());
}
msgs
.
add
(
msg
);
msgs
.
add
(
msg
);
}
}
bean
.
setMsgList
(
msgs
);
bean
.
setMsgList
(
msgs
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论