Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
fef219ce
提交
fef219ce
authored
8月 15, 2021
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[缓存] 更新缓存
上级
812cbe3a
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
7 行增加
和
23 行删除
+7
-23
ObjTransUtil.java
.../com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
+4
-1
DeviceLibraryCacheService.java
...dev/device/library/service/DeviceLibraryCacheService.java
+0
-6
MyInitializer.java
...va/com/tykj/dev/device/library/service/MyInitializer.java
+0
-1
CacheLibraryServiceImpl.java
.../device/library/service/impl/CacheLibraryServiceImpl.java
+0
-13
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+3
-2
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
浏览文件 @
fef219ce
...
@@ -39,9 +39,11 @@ import org.springframework.util.StringUtils;
...
@@ -39,9 +39,11 @@ import org.springframework.util.StringUtils;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toMap
;
/**
/**
* ObjTransUtil.
* ObjTransUtil.
...
@@ -328,7 +330,8 @@ public class ObjTransUtil {
...
@@ -328,7 +330,8 @@ public class ObjTransUtil {
List
<
String
>
devCheckList
=
Lists
.
newArrayList
(
checkDetail
.
split
(
","
));
List
<
String
>
devCheckList
=
Lists
.
newArrayList
(
checkDetail
.
split
(
","
));
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
Map
<
Integer
,
DeviceLibrary
>
map
=
dlcService
.
getDevicesMap
();
Map
<
Integer
,
DeviceLibrary
>
map
=
dlcService
.
getAllDeviceLibraryList
().
stream
()
.
collect
(
toMap
(
DeviceLibrary:
:
getId
,
Function
.
identity
()));
for
(
String
detail
:
devCheckList
)
{
for
(
String
detail
:
devCheckList
)
{
if
(
StringUtils
.
isEmpty
(
detail
))
{
if
(
StringUtils
.
isEmpty
(
detail
))
{
continue
;
continue
;
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryCacheService.java
浏览文件 @
fef219ce
...
@@ -18,10 +18,4 @@ public interface DeviceLibraryCacheService {
...
@@ -18,10 +18,4 @@ public interface DeviceLibraryCacheService {
*/
*/
List
<
DeviceLibrary
>
getAllDeviceLibraryList
();
List
<
DeviceLibrary
>
getAllDeviceLibraryList
();
/**
*
* 以Map的形式获得所有装备列表
* @return key = 装备主键id , Value = {@link DeviceLibrary}
*/
Map
<
Integer
,
DeviceLibrary
>
getDevicesMap
();
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/MyInitializer.java
浏览文件 @
fef219ce
...
@@ -19,6 +19,5 @@ public class MyInitializer implements ApplicationListener<ApplicationReadyEvent>
...
@@ -19,6 +19,5 @@ public class MyInitializer implements ApplicationListener<ApplicationReadyEvent>
public
void
onApplicationEvent
(
ApplicationReadyEvent
event
)
{
public
void
onApplicationEvent
(
ApplicationReadyEvent
event
)
{
log
.
info
(
"[缓存模块] 加载装备缓存模块..."
);
log
.
info
(
"[缓存模块] 加载装备缓存模块..."
);
cacheLibraryService
.
getAllDeviceLibraryList
();
cacheLibraryService
.
getAllDeviceLibraryList
();
cacheLibraryService
.
getDevicesMap
();
}
}
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/CacheLibraryServiceImpl.java
浏览文件 @
fef219ce
...
@@ -35,17 +35,4 @@ public class CacheLibraryServiceImpl implements DeviceLibraryCacheService {
...
@@ -35,17 +35,4 @@ public class CacheLibraryServiceImpl implements DeviceLibraryCacheService {
System
.
out
.
println
(
"缓存时间"
+(
System
.
currentTimeMillis
()-
l
));
System
.
out
.
println
(
"缓存时间"
+(
System
.
currentTimeMillis
()-
l
));
return
all
;
return
all
;
}
}
/**
* 以Map的形式获得所有装备列表
*
* @return key = 装备主键id , Value = {@link DeviceLibrary}
*/
@Override
@Cacheable
(
key
=
"'device'"
)
public
Map
<
Integer
,
DeviceLibrary
>
getDevicesMap
()
{
return
deviceLibraryDao
.
findAll
().
stream
()
.
collect
(
Collectors
.
toMap
(
DeviceLibrary:
:
getId
,
Function
.
identity
()));
}
}
}
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
fef219ce
...
@@ -317,15 +317,16 @@ public class TaskServiceImpl implements TaskService {
...
@@ -317,15 +317,16 @@ public class TaskServiceImpl implements TaskService {
@ExceptionHandler
(
Exception
.
class
)
@ExceptionHandler
(
Exception
.
class
)
@Log
@Log
public
TaskBto
start
(
TaskBto
taskBto
)
{
public
TaskBto
start
(
TaskBto
taskBto
)
{
Task
task
=
taskDao
.
save
(
taskBto
.
toDo
());
Task
t
=
taskBto
.
toDo
();
Task
task
=
taskDao
.
saveAndFlush
(
t
);
myWebSocket
.
sendMessage1
();
myWebSocket
.
sendMessage1
();
Task
task1
=
taskDao
.
findById
(
task
.
getId
()).
get
();
CompletableFuture
.
runAsync
(()
->
{
CompletableFuture
.
runAsync
(()
->
{
try
{
try
{
Thread
.
sleep
(
2000
);
Thread
.
sleep
(
2000
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
Task
task1
=
taskDao
.
findById
(
task
.
getId
()).
get
();
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
task1
));
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
task1
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
String
recordId
=
bcText
.
getData
().
getRecordID
();
task1
.
setRecordId
(
recordId
);
task1
.
setRecordId
(
recordId
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论