Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cd12c7eb
由
sunke
编写于
2022-09-22 16:45:35 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
工位缓存
1 个父辈
ffea11d2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
90 行增加
和
0 行删除
src/main/java/com/neotel/smfcore/custom/lizhen/bean/Station.java
src/main/java/com/neotel/smfcore/custom/lizhen/util/StationCacheUtil.java
src/main/java/com/neotel/smfcore/custom/lizhen/bean/Station.java
0 → 100644
查看文件 @
cd12c7e
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
bean
;
import
lombok.Data
;
/**
* @author sunke
* @date 2022/9/22 4:32 PM
*/
@Data
public
class
Station
{
/**
* 工位名称
*/
private
String
name
;
/**
* 当前料箱的RFID
*/
private
String
currentRfid
=
""
;
}
src/main/java/com/neotel/smfcore/custom/lizhen/util/StationCacheUtil.java
0 → 100644
查看文件 @
cd12c7e
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
util
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.inList.bean.ItemReelInfo
;
import
com.neotel.smfcore.core.inList.enums.INLIST_STATUS
;
import
com.neotel.smfcore.core.inList.service.manager.IInListItemManager
;
import
com.neotel.smfcore.core.inList.service.manager.IInListManager
;
import
com.neotel.smfcore.core.inList.service.po.InList
;
import
com.neotel.smfcore.core.inList.service.po.InListItem
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.custom.lizhen.bean.Station
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Service
@Slf4j
public
class
StationCacheUtil
{
@Autowired
private
DataCache
dataCache
;
private
static
final
String
STATION_CACHE_KEY
=
"STATION_CACHE"
;
/**
* 工位缓存信息
*/
private
static
Map
<
String
,
Station
>
stationMap
=
new
ConcurrentHashMap
<>();
public
void
loadMap
()
{
log
.
info
(
"开始工位缓存信息"
);
stationMap
=
dataCache
.
getCache
(
STATION_CACHE_KEY
);
if
(
stationMap
.
isEmpty
()){
for
(
int
i
=
1
;
i
<
5
;
i
++)
{
String
stationName
=
"s"
+
i
;
Station
station
=
new
Station
();
station
.
setName
(
stationName
);
stationMap
.
put
(
stationName
,
station
);
dataCache
.
updateCache
(
STATION_CACHE_KEY
,
stationMap
);
}
}
}
private
synchronized
void
updateStation
(
Station
station
){
stationMap
.
put
(
station
.
getName
(),
station
);
dataCache
.
updateCache
(
STATION_CACHE_KEY
,
stationMap
);
}
/**
* 获取工位信息
* @param stationName 工位名称
* @return
*/
public
Station
getStation
(
String
stationName
){
return
stationMap
.
get
(
stationName
);
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论