Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
f7712daf
提交
f7712daf
authored
8月 12, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改装备缓存名称
上级
7c764173
流水线
#312
已失败 于阶段
变更
11
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
60 行增加
和
60 行删除
+60
-60
CacheLibraryController.java
...dev/device/library/controller/CacheLibraryController.java
+2
-3
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+38
-38
DeviceLibraryCacheService.java
...dev/device/library/service/DeviceLibraryCacheService.java
+2
-1
MyInitializer.java
...va/com/tykj/dev/device/library/service/MyInitializer.java
+1
-1
CacheLibraryServiceImpl.java
.../device/library/service/impl/CacheLibraryServiceImpl.java
+2
-3
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+3
-3
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+6
-5
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+2
-2
MessageBto.java
...com/tykj/dev/device/user/read/subject/bto/MessageBto.java
+2
-2
Message.java
.../com/tykj/dev/device/user/read/subject/domin/Message.java
+1
-1
MessageUserVo.java
...m/tykj/dev/device/user/read/subject/vo/MessageUserVo.java
+1
-1
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/CacheLibraryController.java
浏览文件 @
f7712daf
package
com
.
tykj
.
dev
.
device
.
library
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.library.service.
CacheLibrary
Service
;
import
com.tykj.dev.device.library.service.
DeviceLibraryCache
Service
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -25,7 +24,7 @@ import java.util.List;
public
class
CacheLibraryController
{
@Autowired
private
CacheLibrary
Service
cacheLibraryService
;
private
DeviceLibraryCache
Service
cacheLibraryService
;
@GetMapping
(
"getAll"
)
public
List
<
DeviceLibrary
>
getAll
(){
...
...
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
f7712daf
...
...
@@ -6,7 +6,7 @@ import com.tykj.dev.config.cache.ConfigCache;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.repository.DeviceLogDao
;
import
com.tykj.dev.device.library.service.
CacheLibrary
Service
;
import
com.tykj.dev.device.library.service.
DeviceLibraryCache
Service
;
import
com.tykj.dev.device.library.service.DeviceChangeService
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
...
...
@@ -37,6 +37,7 @@ import javax.validation.constraints.Min;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -76,7 +77,7 @@ public class DeviceLibraryController {
private
Executor
executor
;
@Autowired
private
CacheLibrary
Service
cacheLibraryService
;
private
DeviceLibraryCache
Service
cacheLibraryService
;
...
...
@@ -492,10 +493,7 @@ public class DeviceLibraryController {
public
ResponseEntity
getDeviceStatisticsPage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
List
<
DeviceStatisticsVo
>
deviceStatisticsVoList
=
deviceLibraryService
.
getDeviceStatisticsPage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
(),
deviceLibrarySelectVo
.
getPageable
().
getSort
());
List
<
DeviceStatisticsVo
>
deviceStatisticsVoSorts
=
deviceStatisticsVoList
.
stream
()
.
sorted
(
Comparator
.
comparing
(
DeviceStatisticsVo:
:
getModel
)
// .thenComparing(DeviceStatisticsVo::getName)
.
thenComparing
(
DeviceStatisticsVo:
:
getMatchingRangeName
)
.
thenComparing
(
DeviceStatisticsVo:
:
getIsPart
)).
collect
(
Collectors
.
toList
());
.
sorted
(
Comparator
.
comparing
(
DeviceStatisticsVo:
:
getModel
).
thenComparing
(
DeviceStatisticsVo:
:
getName
)).
collect
(
Collectors
.
toList
());
// Page<DeviceStatisticsVo> deviceStatisticsVos = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceStatisticsVoList, deviceLibrarySelectVo.getPageable());
Page
<
DeviceStatisticsVo
>
deviceStatisticsVos
=
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
deviceStatisticsVoSorts
,
deviceLibrarySelectVo
.
getPageable
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -814,43 +812,45 @@ public class DeviceLibraryController {
v
.
size
(),
k
,
v
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
()));
deviceNewVoList
.
add
(
deviceNewVo
);
});
for
(
DeviceNewVo
deviceNewVo
:
deviceNewVoList
)
{
Integer
unitSort
=
DeviceModelSort
.
toUnitSort
(
deviceNewVo
.
getOwnUnit
());
}
return
deviceNewVoList
;
}
/**
* 测试
*/
// @GetMapping("/setNumber")
// public List<DeviceLibrary> setNumber(){
//
// List<DeviceLibrary> allListAndParent = getAllListAndParent();
// List<DeviceLibrary> deviceLibraries = setOrderNumber(allListAndParent);
// return deviceLibraries;
// }
//
// public List<DeviceLibrary> getAllListAndParent(){
// DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo();
// List<DeviceLibrary> deviceLibraryServiceAllList = deviceLibraryService.getAllList(deviceLibrarySelectVo);
// Map<Integer, DeviceLibrary> collect = deviceLibraryServiceAllList.stream().collect(Collectors.toMap(DeviceLibrary::getId, Function.identity()));
// List<DeviceLibrary> containList = GetTreeUtils.parseTreeFromDown(
// deviceLibraryServiceAllList,
// DeviceLibrary::getId,
// deviceLibraryEntity -> Optional.ofNullable(collect.get(deviceLibraryEntity.getPartParentId())),
// DeviceLibrary::addChildNode
// );
// return containList;
// }
//
// private List<DeviceLibrary> setOrderNumber(List<DeviceLibrary> allListAndParent) {
// for (int i = 0; i < allListAndParent.size(); i++) {
// DeviceLibrary deviceLibrary = allListAndParent.get(i);
// deviceLibrary.setOrderNumber(i+1);
// i++;
// if (deviceLibrary.getChilds().size()>0){
// setOrderNumber(deviceLibrary.getChilds());
// }
// }
// return allListAndParent;
// }
@GetMapping
(
"/setNumber"
)
public
List
<
DeviceLibrary
>
setNumber
(){
List
<
DeviceLibrary
>
allListAndParent
=
getAllListAndParent
();
AtomicInteger
sortNum
=
new
AtomicInteger
();
return
setOrderNumber
(
sortNum
,
allListAndParent
);
}
public
List
<
DeviceLibrary
>
getAllListAndParent
(){
DeviceLibrarySelectVo
deviceLibrarySelectVo
=
new
DeviceLibrarySelectVo
();
List
<
DeviceLibrary
>
deviceLibraryServiceAllList
=
deviceLibraryService
.
getAllList
(
deviceLibrarySelectVo
);
Map
<
Integer
,
DeviceLibrary
>
collect
=
deviceLibraryServiceAllList
.
stream
().
collect
(
Collectors
.
toMap
(
DeviceLibrary:
:
getId
,
Function
.
identity
()));
return
GetTreeUtils
.
parseTreeFromDown
(
deviceLibraryServiceAllList
,
DeviceLibrary:
:
getId
,
deviceLibraryEntity
->
Optional
.
ofNullable
(
collect
.
get
(
deviceLibraryEntity
.
getPartParentId
())),
DeviceLibrary:
:
addChildNode
);
}
private
List
<
DeviceLibrary
>
setOrderNumber
(
AtomicInteger
sortNum
,
List
<
DeviceLibrary
>
allListAndParent
)
{
allListAndParent
.
forEach
(
deviceLibrary
->
{
deviceLibrary
.
setOrderNumber
(
sortNum
.
incrementAndGet
());
if
(
deviceLibrary
.
getChilds
().
size
()>
0
){
setOrderNumber
(
sortNum
,
deviceLibrary
.
getChilds
());
}
}
);
return
allListAndParent
;
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/
CacheLibrary
Service.java
→
dev-library/src/main/java/com/tykj/dev/device/library/service/
DeviceLibraryCache
Service.java
浏览文件 @
f7712daf
...
...
@@ -8,7 +8,8 @@ import java.util.List;
* DATE:2021-8-11
* Author:zsp
*/
public
interface
CacheLibraryService
{
public
interface
DeviceLibraryCacheService
{
/**
* 查询全部
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/MyInitializer.java
浏览文件 @
f7712daf
...
...
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
@Component
public
class
MyInitializer
implements
ApplicationListener
<
ApplicationReadyEvent
>
{
@Autowired
private
CacheLibrary
Service
cacheLibraryService
;
private
DeviceLibraryCache
Service
cacheLibraryService
;
@Override
public
void
onApplicationEvent
(
ApplicationReadyEvent
event
)
{
cacheLibraryService
.
getAllDeviceLibraryList
();
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/CacheLibraryServiceImpl.java
浏览文件 @
f7712daf
package
com
.
tykj
.
dev
.
device
.
library
.
service
.
impl
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.
CacheLibrary
Service
;
import
com.tykj.dev.device.library.service.
DeviceLibraryCache
Service
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.concurrent.ConcurrentMapCacheManager
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -17,7 +16,7 @@ import java.util.List;
*/
@Service
@CacheConfig
(
cacheNames
=
"devicesLibraryList"
)
public
class
CacheLibraryServiceImpl
implements
CacheLibrary
Service
{
public
class
CacheLibraryServiceImpl
implements
DeviceLibraryCache
Service
{
@Autowired
private
DeviceLibraryDao
deviceLibraryDao
;
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
f7712daf
...
...
@@ -7,7 +7,7 @@ import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import
com.tykj.dev.config.TaskBeanConfig
;
import
com.tykj.dev.config.base.DeviceLifeStatus
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.
CacheLibrary
Service
;
import
com.tykj.dev.device.library.service.
DeviceLibraryCache
Service
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
...
...
@@ -57,7 +57,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
private
UnitsService
unitsService
;
@Autowired
private
CacheLibrary
Service
cacheLibraryService
;
private
DeviceLibraryCache
Service
cacheLibraryService
;
@Override
public
DeviceLibrary
addEntity
(
DeviceLibrary
deviceLibraryEntity
)
{
DeviceLibrary
deviceLibrary
=
deviceLibraryDao
.
save
(
deviceLibraryEntity
);
...
...
@@ -791,7 +791,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
predicateBuilder
.
eq
(
"ownUnit"
,
deviceLibrarySelectVo
.
getOwnUnit
());
}
if
(
deviceLibrarySelectVo
.
getRfidCardId
()
!=
null
)
{
predicateBuilder
.
eq
(
"rfidCardId"
,
deviceLibrarySelectVo
.
getRfidCardId
());
predicateBuilder
.
like
(
"rfidCardId"
,
deviceLibrarySelectVo
.
getRfidCardId
());
}
if
(
deviceLibrarySelectVo
.
getPackingId
()
!=
null
)
{
predicateBuilder
.
eq
(
"packingId"
,
deviceLibrarySelectVo
.
getPackingId
());
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
f7712daf
...
...
@@ -1204,7 +1204,7 @@ public class RepairController {
messageService
.
add
(
messageBto
);
}
String
message
=
repairReceiveVo
.
getStatus
()
==
0
?
"业务办结"
:
"接收维修领取装备"
;
MessageBto
messageBto
=
new
MessageBto
(
taskBto2
.
getId
(),
taskBto2
.
getBusinessType
(),
message
,
ids
,
1
,
0
);
MessageBto
messageBto
=
new
MessageBto
(
taskBto2
.
getId
(),
taskBto2
.
getBusinessType
(),
message
,
ids
,
1
,
1
);
messageService
.
add
(
messageBto
);
//遍历map依次发送阅知
messageMap
.
keySet
().
forEach
(
integer
->
{
...
...
@@ -1212,7 +1212,8 @@ public class RepairController {
integerList
.
addAll
(
userDao
.
findAllByUnitsId
(
integer
).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
integerList
);
// MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", integerList);
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
integerList
,
1
,
1
);
//存放详情id集合
messageBto2
.
setRecord
(
StringSplitUtil
.
idListToString
(
messageMap
.
get
(
integer
)));
messageService
.
add
(
messageBto2
);
...
...
@@ -1424,7 +1425,7 @@ public class RepairController {
ids2
.
addAll
(
userDao
.
findAllByUnitsId
(
integer
).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
ids2
);
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
ids2
,
1
,
1
);
messageBto2
.
setRecord
(
StringSplitUtil
.
idListToString
(
messageMap
.
get
(
integer
)));
messageService
.
add
(
messageBto2
);
});
...
...
@@ -1876,7 +1877,7 @@ public class RepairController {
integerList
.
addAll
(
userDao
.
findAllByUnitsId
(
unitId
).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
integerList
);
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
integerList
,
1
,
1
);
messageBto2
.
setRecord
(
String
.
valueOf
(
repairDetail1
.
getId
()));
messageService
.
add
(
messageBto2
);
}
...
...
@@ -2050,7 +2051,7 @@ public class RepairController {
integerList
.
addAll
(
userDao
.
findAllByUnitsId
(
integer
).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
integerList
);
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
integerList
,
1
,
1
);
//阅知记录id拼接
messageBto2
.
setRecord
(
StringSplitUtil
.
idListToString
(
messageMap
.
get
(
integer
)));
messageService
.
add
(
messageBto2
);
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
f7712daf
...
...
@@ -9,7 +9,7 @@ import com.tykj.dev.device.apply.subject.vo.ApplyBillDetailVo;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.
CacheLibrary
Service
;
import
com.tykj.dev.device.library.service.
DeviceLibraryCache
Service
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
...
...
@@ -121,7 +121,7 @@ public class StorageBillController {
private
Executor
executor
;
@Autowired
private
CacheLibrary
Service
cacheLibraryService
;
private
DeviceLibraryCache
Service
cacheLibraryService
;
@ApiOperation
(
value
=
"判断序列号是否存在申请任务中"
,
notes
=
"判断序列号是否存在申请任务中"
)
@PostMapping
(
value
=
"/existApplyTask"
)
...
...
dev-user/src/main/java/com/tykj/dev/device/user/read/subject/bto/MessageBto.java
浏览文件 @
f7712daf
...
...
@@ -74,7 +74,7 @@ public class MessageBto {
private
Integer
isHighLight
=
0
;
@ApiModelProperty
(
value
=
"是否置顶(0:不是,1:是)"
)
private
Integer
isTop
=
0
;
private
Integer
isTop
;
/**
* bto类转化为do类
...
...
@@ -102,7 +102,7 @@ public class MessageBto {
//set vo字段
if
(
userUtils
!=
null
&&
userReadDetailList
.
contains
(
userUtils
.
getCurrentUserId
())){
messageUserVo
.
setIsRead
(
1
);
messageUserVo
.
setIsTop
(
1
);
messageUserVo
.
setIsTop
(
0
);
}
if
(
messageUserVo
.
getCreateUserId
()!=
null
){
messageUserVo
.
setOperator
(
userPublicService
.
getOne
(
messageUserVo
.
getCreateUserId
()).
getName
());
...
...
dev-user/src/main/java/com/tykj/dev/device/user/read/subject/domin/Message.java
浏览文件 @
f7712daf
...
...
@@ -87,7 +87,7 @@ public class Message {
private
Integer
isHighLight
=
0
;
@ApiModelProperty
(
value
=
"是否置顶(0:不是,1:是)"
)
private
Integer
isTop
=
0
;
private
Integer
isTop
;
/**
* do类转化为bto类
...
...
dev-user/src/main/java/com/tykj/dev/device/user/read/subject/vo/MessageUserVo.java
浏览文件 @
f7712daf
...
...
@@ -64,5 +64,5 @@ public class MessageUserVo {
private
String
unit
;
@ApiModelProperty
(
value
=
"是否置顶(0:不是,1:是)"
)
private
Integer
isTop
=
0
;
private
Integer
isTop
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论