Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
fde15867
提交
fde15867
authored
12月 02, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备模块): 去除定时更新缓存的接口
去除定时更新缓存的接口
上级
6173549f
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
52 行增加
和
41 行删除
+52
-41
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+7
-8
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+1
-1
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+0
-3
DeviceLibrary.java
.../tykj/dev/device/library/subject/domin/DeviceLibrary.java
+15
-0
DevideTask.java
...ain/java/com/tykj/dev/device/library/task/DevideTask.java
+29
-29
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
fde15867
...
@@ -258,7 +258,9 @@ public class DeviceLibraryController {
...
@@ -258,7 +258,9 @@ public class DeviceLibraryController {
//形态
//形态
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
).
stream
().
filter
(
deviceLibrary
->
!
deviceLibrary
.
getLifeStatus
().
equals
(
DeviceLifeStatus
.
DESTROYED
.
id
)).
collect
(
Collectors
.
toList
());
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
).
stream
().
filter
(
deviceLibrary
->
!
deviceLibrary
.
getLifeStatus
().
equals
(
DeviceLifeStatus
.
DESTROYED
.
id
))
.
collect
(
Collectors
.
toList
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"resultList"
,
resultList
);
map
.
put
(
"resultList"
,
resultList
);
if
(
hasModelDim
||
hasLifeStatusDim
||
hasLocationUnitDim
||
hasNameDim
||
hasOwnUnitDim
||
hasSeqDim
)
{
if
(
hasModelDim
||
hasLifeStatusDim
||
hasLocationUnitDim
||
hasNameDim
||
hasOwnUnitDim
||
hasSeqDim
)
{
...
@@ -457,14 +459,11 @@ public class DeviceLibraryController {
...
@@ -457,14 +459,11 @@ public class DeviceLibraryController {
Boolean
hasTypeDim
=
deviceLibrarySelectVo
.
getTypeDim
()
!=
null
;
Boolean
hasTypeDim
=
deviceLibrarySelectVo
.
getTypeDim
()
!=
null
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getList
(
deviceLibrarySelectVo
);
map
.
put
(
"resultList"
,
resultList
);
// List<DeviceLibrary> resultList = new ArrayList<>();
// resultList = deviceLibraryService.getAlldevList(deviceLibrarySelectVo);
// List<DeviceLibrary> resultList = deviceLibraryService.getList(deviceLibrarySelectVo);
// List<DeviceLibrary> resultList = deviceLibraryService.getList(deviceLibrarySelectVo);
// map.put("resultList",resultList);
resultList
.
forEach
(
DeviceLibrary:
:
setConfigName
);
List
<
DeviceLibrary
>
resultList
=
new
ArrayList
<>();
resultList
=
deviceLibraryService
.
getAlldevList
(
deviceLibrarySelectVo
);
resultList
.
forEach
(
DeviceLibrary:
:
setConfigNameForCache
);
if
(
hasModelDim
||
hasLifeStatusDim
||
hasLocationUnitDim
||
hasNameDim
||
hasOwnUnitDim
||
hasSeqDim
)
{
if
(
hasModelDim
||
hasLifeStatusDim
||
hasLocationUnitDim
||
hasNameDim
||
hasOwnUnitDim
||
hasSeqDim
)
{
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
{
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
{
Boolean
containModelDim
=
!
hasModelDim
||
deviceLibrary
.
getModel
().
contains
(
deviceLibrarySelectVo
.
getModelDim
());
Boolean
containModelDim
=
!
hasModelDim
||
deviceLibrary
.
getModel
().
contains
(
deviceLibrarySelectVo
.
getModelDim
());
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
fde15867
...
@@ -488,7 +488,7 @@ public interface DeviceLibraryService {
...
@@ -488,7 +488,7 @@ public interface DeviceLibraryService {
/**
/**
* 获取所有装备的集合
* 获取所有装备的集合
* @param deviceLibrarySelectVo 查询装备的vo
* @param deviceLibrarySelectVo 查询装备的vo
* @return 所有装备
* @return 所有装备
做缓存
*/
*/
List
<
DeviceLibrary
>
getAlldevList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
);
List
<
DeviceLibrary
>
getAlldevList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
fde15867
...
@@ -1088,9 +1088,6 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1088,9 +1088,6 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
status
.
contains
(
deviceLibrary
.
getLifeStatus
()))
status
.
contains
(
deviceLibrary
.
getLifeStatus
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
// DeviceLibraryCacheSelectVo deviceLibraryCacheSelectVo = new DeviceLibraryCacheSelectVo();
// BeanUtils.copyProperties(deviceLibrarySelectVo,deviceLibraryCacheSelectVo);
List
<
DeviceLibrary
>
list
=
null
;
List
<
DeviceLibrary
>
list
=
null
;
try
{
try
{
long
l
=
System
.
currentTimeMillis
();
long
l
=
System
.
currentTimeMillis
();
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/domin/DeviceLibrary.java
浏览文件 @
fde15867
...
@@ -336,6 +336,21 @@ public class DeviceLibrary implements Serializable {
...
@@ -336,6 +336,21 @@ public class DeviceLibrary implements Serializable {
return
this
;
return
this
;
}
}
public
DeviceLibrary
setConfigNameForCache
(){
ConfigCache
configCache
=
SpringUtils
.
getBean
(
"initConfigCache"
);
if
(
configCache
!=
null
)
{
setSecretLevelName
(
configCache
.
getSecretLevelMap
().
get
(
this
.
secretLevel
)==
null
?
"-"
:
configCache
.
getSecretLevelMap
().
get
(
this
.
secretLevel
));
setLifeStatusName
(
configCache
.
getLifeStatusMap
().
get
(
this
.
lifeStatus
)==
null
?
"-"
:
configCache
.
getLifeStatusMap
().
get
(
this
.
lifeStatus
));
setMatchingRangeName
(
configCache
.
getMatchingRangeMap
().
get
(
this
.
matchingRange
)==
null
?
"-"
:
configCache
.
getMatchingRangeMap
().
get
(
this
.
matchingRange
));
setInvisibleRangeName
(
configCache
.
getInvisibleRangeMap
().
get
(
this
.
invisibleRange
)==
null
?
"-"
:
configCache
.
getInvisibleRangeMap
().
get
(
this
.
invisibleRange
));
setTypeName
(
configCache
.
getStyleMap
().
get
(
this
.
type
)==
null
?
"-"
:
configCache
.
getStyleMap
().
get
(
this
.
type
));
setStorageTypeName
(
configCache
.
getStorageTypeMap
().
get
(
this
.
storageType
)==
null
?
"-"
:
configCache
.
getStorageTypeMap
().
get
(
this
.
storageType
));
setAllotTypeName
(
configCache
.
getAllotTypeMap
().
get
(
this
.
allotType
)==
null
?
"-"
:
configCache
.
getAllotTypeMap
().
get
(
this
.
allotType
));
childs
.
clear
();
}
return
this
;
}
// public LifeStatusVo getLifeStatusVo(){
// public LifeStatusVo getLifeStatusVo(){
// return new LifeStatusVo(this.lifeStatus,this.lifeStatusName);
// return new LifeStatusVo(this.lifeStatus,this.lifeStatusName);
// }
// }
...
...
dev-library/src/main/java/com/tykj/dev/device/library/task/DevideTask.java
浏览文件 @
fde15867
package
com
.
tykj
.
dev
.
device
.
library
.
task
;
//
package com.tykj.dev.device.library.task;
//
import
com.tykj.dev.device.library.service.DeviceLibraryCacheService
;
//
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.scheduling.annotation.Scheduled
;
//
import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.stereotype.Service
;
//
import org.springframework.stereotype.Service;
//
/**
/
//
**
* @author zjm
//
* @author zjm
* @version 1.0.0
//
* @version 1.0.0
* @ClassName TrainTask.java
//
* @ClassName TrainTask.java
* @Description 培训定时任务 主要是 判断报名截止以及培训开始、培训结束
//
* @Description 培训定时任务 主要是 判断报名截止以及培训开始、培训结束
* @createTime 2020年08月17日 23:20:00
//
* @createTime 2020年08月17日 23:20:00
*/
//
*/
@Service
//
@Service
@Slf4j
//
@Slf4j
public
class
DevideTask
{
//
public class DevideTask {
@Autowired
//
@Autowired
DeviceLibraryCacheService
deviceLibraryCacheService
;
//
DeviceLibraryCacheService deviceLibraryCacheService;
//
@Scheduled
(
cron
=
"30 * * * * ? "
)
//
@Scheduled(cron = "30 * * * * ? ")
private
void
signUpDeadline
()
{
//
private void signUpDeadline() {
log
.
info
(
"定时device更新缓存开始"
);
//
log.info("定时device更新缓存开始");
deviceLibraryCacheService
.
deletAllDeviceLibraryList
();
//
deviceLibraryCacheService.deletAllDeviceLibraryList();
deviceLibraryCacheService
.
getAllDeviceLibraryList
();
//
deviceLibraryCacheService.getAllDeviceLibraryList();
log
.
info
(
"定时device更新缓存结束"
);
//
log.info("定时device更新缓存结束");
}
//
}
}
//
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论