Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8c774b2b
由
sunke
编写于
2022-09-22 16:52:46 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
工位缓存
1 个父辈
cd12c7eb
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
9 行删除
src/main/java/com/neotel/smfcore/custom/lizhen/util/StationCacheUtil.java
src/main/java/com/neotel/smfcore/custom/lizhen/util/StationCacheUtil.java
查看文件 @
8c774b2
...
@@ -30,29 +30,28 @@ public class StationCacheUtil {
...
@@ -30,29 +30,28 @@ public class StationCacheUtil {
@Autowired
@Autowired
private
DataCache
dataCache
;
private
DataCache
dataCache
;
private
static
final
String
STATION_CACHE_KEY
=
"STATION_CACHE"
;
/**
/**
* 工位缓存信息
* 工位缓存信息
*/
*/
private
static
Map
<
String
,
Station
>
stationMap
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
Station
>
stationMap
=
new
ConcurrentHashMap
<>();
public
void
loadMap
()
{
public
void
init
()
{
log
.
info
(
"开始工位缓存信息"
);
log
.
info
(
"开始工位缓存信息"
);
stationMap
=
dataCache
.
getCache
(
STATION_CACHE_KEY
);
for
(
int
i
=
1
;
i
<
5
;
i
++)
{
if
(
stationMap
.
isEmpty
()){
String
stationName
=
"s"
+
i
;
for
(
int
i
=
1
;
i
<
5
;
i
++)
{
Station
station
=
dataCache
.
getCache
(
stationName
);
String
stationName
=
"s"
+
i
;
if
(
station
==
null
){
Station
station
=
new
Station
();
station
=
new
Station
();
station
.
setName
(
stationName
);
station
.
setName
(
stationName
);
stationMap
.
put
(
stationName
,
station
);
stationMap
.
put
(
stationName
,
station
);
dataCache
.
updateCache
(
STATION_CACHE_KEY
,
stationMap
);
dataCache
.
updateCache
(
stationName
,
station
);
}
}
}
}
}
}
private
synchronized
void
updateStation
(
Station
station
){
private
synchronized
void
updateStation
(
Station
station
){
stationMap
.
put
(
station
.
getName
(),
station
);
stationMap
.
put
(
station
.
getName
(),
station
);
dataCache
.
updateCache
(
STATION_CACHE_KEY
,
stationMap
);
dataCache
.
updateCache
(
station
.
getName
(),
station
);
}
}
/**
/**
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论