Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
cff49629
提交
cff49629
authored
9月 28, 2021
作者:
zjm
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'dev' 到 'master'
Dev to master 查看合并请求
!64
上级
1856d396
7d1f8491
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
615 行增加
和
39 行删除
+615
-39
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+4
-3
UpdateCache.java
...config/src/main/java/com/tykj/dev/config/UpdateCache.java
+15
-0
CcDataCache.java
.../com/tykj/dev/device/confirmcheck/common/CcDataCache.java
+19
-0
CcInitRunner.java
...com/tykj/dev/device/confirmcheck/common/CcInitRunner.java
+22
-0
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+0
-0
DeviceCheckLink.java
...ev/device/confirmcheck/entity/domain/DeviceCheckLink.java
+59
-0
DeviceCheckLinkVo.java
.../dev/device/confirmcheck/entity/vo/DeviceCheckLinkVo.java
+47
-0
LinkVo.java
...va/com/tykj/dev/device/confirmcheck/entity/vo/LinkVo.java
+23
-0
DeviceCheckLinkDao.java
...ev/device/confirmcheck/repository/DeviceCheckLinkDao.java
+20
-0
ObjTransUtil.java
.../com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
+7
-19
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+30
-7
DeviceLibraryDao.java
.../tykj/dev/device/library/repository/DeviceLibraryDao.java
+17
-0
DeviceLibraryCacheService.java
...dev/device/library/service/DeviceLibraryCacheService.java
+2
-0
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+174
-6
CacheLibraryServiceImpl.java
.../device/library/service/impl/CacheLibraryServiceImpl.java
+20
-2
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+0
-0
BindingDeviceVo.java
...m/tykj/dev/device/library/subject/vo/BindingDeviceVo.java
+20
-0
BaseEntity.java
...misc/src/main/java/com/tykj/dev/misc/base/BaseEntity.java
+3
-0
BaseVo.java
dev-misc/src/main/java/com/tykj/dev/misc/base/BaseVo.java
+56
-0
StatusEnum.java
...misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
+3
-0
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+6
-2
UpdateCacheAspect.java
...n/src/main/java/com/tykj/dev/union/UpdateCacheAspect.java
+48
-0
UnitsDao.java
...n/java/com/tykj/dev/device/user/subject/dao/UnitsDao.java
+2
-0
Units.java
...n/java/com/tykj/dev/device/user/subject/entity/Units.java
+18
-0
没有找到文件。
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
cff49629
...
@@ -112,8 +112,8 @@ public class DeviceApplyController {
...
@@ -112,8 +112,8 @@ public class DeviceApplyController {
@Autowired
@Autowired
private
PackingController
packingController
;
private
PackingController
packingController
;
@Autowired
//
@Autowired
private
DeviceLibraryDao
deviceLibraryDao
;
//
private DeviceLibraryDao deviceLibraryDao;
@ApiOperation
(
value
=
"发起装备申请"
,
notes
=
"可以通过这个接口发起装备申请"
)
@ApiOperation
(
value
=
"发起装备申请"
,
notes
=
"可以通过这个接口发起装备申请"
)
@PostMapping
(
"/addDeviceApplyBill"
)
@PostMapping
(
"/addDeviceApplyBill"
)
...
@@ -500,7 +500,8 @@ public class DeviceApplyController {
...
@@ -500,7 +500,8 @@ public class DeviceApplyController {
seqs
.
addAll
(
DeviceSeqUtil
.
selectDeviceSeqs
(
r
.
getSeqInterval
()));
seqs
.
addAll
(
DeviceSeqUtil
.
selectDeviceSeqs
(
r
.
getSeqInterval
()));
}
}
}
}
deviceLibraryDao
.
upDateSeqNumbersApplyTaskId
(
taskBto
.
getId
(),
seqs
);
// deviceLibraryDao.upDateSeqNumbersApplyTaskId(taskBto.getId(), seqs);
deviceLibraryService
.
upDateSeqNumbersApplyTaskId
(
taskBto
.
getId
(),
seqs
);
}
}
}
}
return
ResponseEntity
.
ok
(
"ok"
);
return
ResponseEntity
.
ok
(
"ok"
);
...
...
dev-config/src/main/java/com/tykj/dev/config/UpdateCache.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
config
;
import
java.lang.annotation.*
;
/**
* UpdateCache注解
*
* @author zsp
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
UpdateCache
{
String
type
()
default
""
;
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/common/CcDataCache.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
common
;
import
com.tykj.dev.device.confirmcheck.entity.vo.LinkVo
;
import
lombok.Data
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* CcDataCache. 核查模块自用缓存
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/23 at 5:32 下午
*/
@Data
public
class
CcDataCache
{
public
static
Map
<
Integer
,
LinkVo
>
linkVoCache
=
new
HashMap
<>();
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/common/CcInitRunner.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
common
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.core.annotation.Order
;
import
java.util.HashMap
;
/**
* CcInitRunner.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/23 at 5:30 下午
*/
@Order
(
99
)
public
class
CcInitRunner
implements
CommandLineRunner
{
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
//初始化Map 从DB里面拿数据
CcDataCache
.
linkVoCache
=
new
HashMap
<>(
32
);
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
cff49629
差异被折叠。
点击展开。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/domain/DeviceCheckLink.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
domain
;
import
com.tykj.dev.device.confirmcheck.entity.vo.DeviceCheckLinkVo
;
import
com.tykj.dev.device.confirmcheck.entity.vo.LinkVo
;
import
com.tykj.dev.device.confirmcheck.utils.MapperHelper
;
import
com.tykj.dev.misc.base.BaseEntity
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.annotations.SQLDelete
;
import
org.modelmapper.ModelMapper
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
java.time.LocalDateTime
;
/**
* DeviceCheckLink.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/23 at 5:40 下午
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@Entity
@SQLDelete
(
sql
=
"update device_check_link set delete_tag = 1 where id = ?"
)
@ApiModel
(
"核查检查列表的缓存表"
)
@NoArgsConstructor
@Table
(
name
=
"device_check_link"
)
public
class
DeviceCheckLink
extends
BaseEntity
{
private
Integer
statId
;
@Column
(
name
=
"link_text"
,
columnDefinition
=
"TEXT"
)
private
String
linkText
;
public
DeviceCheckLinkVo
toVo
()
{
ModelMapper
mapper
=
MapperHelper
.
getMapper
();
DeviceCheckLinkVo
dcLinkVo
=
mapper
.
map
(
this
,
DeviceCheckLinkVo
.
class
);
LinkVo
linkVo
=
JacksonUtil
.
readValue
(
linkText
,
LinkVo
.
class
);
dcLinkVo
.
setLinkVo
(
linkVo
);
return
dcLinkVo
;
}
public
DeviceCheckLink
(
Integer
statId
,
String
linkText
)
{
this
.
statId
=
statId
;
this
.
linkText
=
linkText
;
}
public
DeviceCheckLink
(
Integer
id
,
Integer
createUserId
,
Integer
updateUserId
,
LocalDateTime
createTime
,
LocalDateTime
updateTime
,
Integer
deleteTag
,
Integer
statId
,
String
linkText
)
{
super
(
id
,
createUserId
,
updateUserId
,
createTime
,
updateTime
,
deleteTag
);
this
.
statId
=
statId
;
this
.
linkText
=
linkText
;
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/DeviceCheckLinkVo.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
vo
;
import
com.alibaba.fastjson.JSON
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckLink
;
import
com.tykj.dev.device.confirmcheck.utils.MapperHelper
;
import
com.tykj.dev.misc.base.BaseVo
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.NoArgsConstructor
;
import
org.modelmapper.ModelMapper
;
import
java.time.LocalDateTime
;
/**
* DeviceCheckLinkVo.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/24 at 10:58 上午
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@NoArgsConstructor
public
class
DeviceCheckLinkVo
extends
BaseVo
{
private
Integer
statId
;
private
LinkVo
linkVo
;
public
DeviceCheckLinkVo
(
Integer
statId
,
LinkVo
linkVo
)
{
this
.
statId
=
statId
;
this
.
linkVo
=
linkVo
;
}
public
DeviceCheckLinkVo
(
Integer
id
,
Integer
createUserId
,
Integer
updateUserId
,
LocalDateTime
createTime
,
LocalDateTime
updateTime
,
Integer
deleteTag
,
Integer
statId
,
LinkVo
linkVo
)
{
super
(
id
,
createUserId
,
updateUserId
,
createTime
,
updateTime
,
deleteTag
);
this
.
statId
=
statId
;
this
.
linkVo
=
linkVo
;
}
public
DeviceCheckLink
toDo
()
{
ModelMapper
mapper
=
MapperHelper
.
getMapper
();
DeviceCheckLink
dcLink
=
mapper
.
map
(
this
,
DeviceCheckLink
.
class
);
String
linkText
=
JSON
.
toJSONStringWithDateFormat
(
this
.
linkVo
,
"yyyy-MM-dd HH:mm:ss"
);
dcLink
.
setLinkText
(
linkText
);
return
dcLink
;
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/LinkVo.java
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
vo
;
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer
;
import
com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.List
;
...
@@ -25,11 +31,19 @@ public class LinkVo {
...
@@ -25,11 +31,19 @@ public class LinkVo {
*/
*/
private
int
type
;
private
int
type
;
/**
* 是否终结 true = 已终结 ,false = 未终结
*/
private
boolean
isShutDown
;
/**
/**
* 核查/检查总标题
* 核查/检查总标题
*/
*/
private
String
title
;
private
String
title
;
@JsonDeserialize
(
using
=
LocalDateDeserializer
.
class
)
@JsonSerialize
(
using
=
LocalDateSerializer
.
class
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd"
)
private
LocalDate
endTime
;
private
LocalDate
endTime
;
/**
/**
...
@@ -48,4 +62,13 @@ public class LinkVo {
...
@@ -48,4 +62,13 @@ public class LinkVo {
this
.
type
=
type
;
this
.
type
=
type
;
this
.
endTime
=
endTime
;
this
.
endTime
=
endTime
;
}
}
// public LinkVo(int type, String title, String endTime, List<LinkCheckDetail> lcDetail, List<LinkExamDetail> leDetail, int detailId) {
// this.type = type;
// this.title = title;
// this.endTime = LocalDate.parse(endTime);
// this.lcDetail = lcDetail;
// this.leDetail = leDetail;
// this.detailId = detailId;
// }
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/repository/DeviceCheckLinkDao.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
repository
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckLink
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
import
java.util.Optional
;
/**
* DeviceCheckLinkDao.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/24 at 11:05 上午
*/
@Repository
public
interface
DeviceCheckLinkDao
extends
JpaRepository
<
DeviceCheckLink
,
Integer
>,
JpaSpecificationExecutor
<
DeviceCheckLink
>
{
Optional
<
DeviceCheckLink
>
findByStatId
(
Integer
statId
);
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
浏览文件 @
cff49629
...
@@ -42,6 +42,7 @@ import java.util.*;
...
@@ -42,6 +42,7 @@ import java.util.*;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
tykj
.
dev
.
misc
.
base
.
StatusEnum
.*;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toMap
;
import
static
java
.
util
.
stream
.
Collectors
.
toMap
;
...
@@ -143,16 +144,6 @@ public class ObjTransUtil {
...
@@ -143,16 +144,6 @@ public class ObjTransUtil {
List
<
Task
>
childTask
=
taskDao
.
findAllByParentTaskId
(
fatherTaskId
);
List
<
Task
>
childTask
=
taskDao
.
findAllByParentTaskId
(
fatherTaskId
);
boolean
flag
=
false
;
boolean
flag
=
false
;
boolean
confirmTaskisDone
=
false
;
for
(
Task
task
:
childTask
)
{
if
(
task
.
getTitle
().
contains
(
"统计数据确认任务"
))
{
if
(
task
.
getBillStatus
()
!=
9999
)
{
flag
=
true
;
}
else
{
confirmTaskisDone
=
true
;
}
}
}
// 3/3 -> 统计待确认 -> 省统计任务待完结
// 3/3 -> 统计待确认 -> 省统计任务待完结
...
@@ -164,27 +155,24 @@ public class ObjTransUtil {
...
@@ -164,27 +155,24 @@ public class ObjTransUtil {
long
total
=
childTask
.
size
();
long
total
=
childTask
.
size
();
long
done
=
childTask
.
stream
()
long
done
=
childTask
.
stream
()
.
filter
(
task
->
task
.
getBillStatus
().
equals
(
9999
))
.
filter
(
task
->
task
.
getBillStatus
().
equals
(
END
.
id
)
||
task
.
getBillStatus
().
equals
(
CHECK_SHUT_DOWN
.
id
))
.
count
();
.
count
();
//如果是检查统计的话那么还要看一下他的父节点是不是已经完成了
//如果是检查统计的话那么还要看一下他的父节点是不是已经完成了
String
completion
;
String
completion
;
if
(
done
==
total
)
{
if
(
done
==
total
)
{
if
(
stat
.
getCheckType
()
==
CheckType
.
CT_EXAM
&&
!
fatherTask
.
getBillStatus
().
equals
(
9999
))
{
boolean
examFinish
=
fatherTask
.
getBillStatus
().
equals
(
END
.
id
)
||
fatherTask
.
getBillStatus
().
equals
(
CHECK_SHUT_DOWN
.
id
);
if
(
stat
.
getCheckType
()
==
CheckType
.
CT_EXAM
&&
!
examFinish
)
{
completion
=
"核查完成待办结"
;
completion
=
"核查完成待办结"
;
}
else
{
}
else
{
if
(
flag
)
{
if
(
flag
)
{
completion
=
"核查完成待确认"
;
completion
=
"核查完成待确认"
;
}
else
{
}
else
{
// confirmTaskidDone 为true 代表此时等待最后的father任务 为false代表 flag = false 且isDone为false 代表整个节点里没有确认节点直接完结
// confirmTaskidDone 为true 代表此时等待最后的father任务 为false代表 flag = false 且isDone为false 代表整个节点里没有确认节点直接完结
if
(
confirmTaskisDone
)
{
if
(
fatherTask
.
getBillStatus
().
equals
(
END
.
id
)
||
fatherTask
.
getBillStatus
().
equals
(
CHECK_SHUT_DOWN
.
id
))
{
if
(
fatherTask
.
getBillStatus
()
==
9999
)
{
completion
=
"核查完成"
;
}
else
{
completion
=
"核查完成待办结"
;
}
}
else
{
completion
=
"核查完成"
;
completion
=
"核查完成"
;
}
else
{
completion
=
"核查完成待办结"
;
}
}
}
}
}
}
...
...
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
cff49629
...
@@ -867,7 +867,7 @@ public class DeviceLibraryController {
...
@@ -867,7 +867,7 @@ public class DeviceLibraryController {
@ApiOperation
(
value
=
"修改装备的存放位置"
)
@ApiOperation
(
value
=
"修改装备的存放位置"
)
@PostMapping
(
"/updateDeviceLibraryLocation"
)
@PostMapping
(
"/updateDeviceLibraryLocation"
)
@CacheEvict
(
value
=
"devicesLibraryList"
,
key
=
"'device'"
,
allEntries
=
true
)
//
@CacheEvict(value = "devicesLibraryList",key = "'device'",allEntries = true)
public
void
updateDeviceLibraryLocation
(
@RequestBody
DeviceStorageLocation
deviceStorageLocation
){
public
void
updateDeviceLibraryLocation
(
@RequestBody
DeviceStorageLocation
deviceStorageLocation
){
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
deviceStorageLocation
.
getDevId
());
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
deviceStorageLocation
.
getDevId
());
//添加修改存放装备位置
//添加修改存放装备位置
...
@@ -875,12 +875,12 @@ public class DeviceLibraryController {
...
@@ -875,12 +875,12 @@ public class DeviceLibraryController {
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
deviceStorageLocation
.
getDevId
(),
"将存放位置改为"
+
deviceStorageLocation
.
getStorageLocation
(),
null
,
null
,
null
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
deviceStorageLocation
.
getDevId
(),
"将存放位置改为"
+
deviceStorageLocation
.
getStorageLocation
(),
null
,
null
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibrary
);
deviceLibraryService
.
update
(
deviceLibrary
);
//异步去查询数据库
//
//异步去查询数据库
executor
.
execute
(
//
executor.execute(
()->{
//
()->{
cacheLibraryService
.
getAllDeviceLibraryList
();
//
cacheLibraryService.getAllDeviceLibraryList();
}
//
}
);
//
);
}
}
@ApiOperation
(
"根据装备id修改装备的序列号"
)
@ApiOperation
(
"根据装备id修改装备的序列号"
)
...
@@ -944,6 +944,29 @@ public class DeviceLibraryController {
...
@@ -944,6 +944,29 @@ public class DeviceLibraryController {
return
deviceNewVoList
;
return
deviceNewVoList
;
}
}
@ApiOperation
(
value
=
"查询可进行绑定的装备"
,
notes
=
"查询可进行绑定的装备"
)
@GetMapping
(
"/selectBindingDevice"
)
public
List
<
DeviceLibrary
>
selectBindingDevice
(){
List
<
DeviceLibrary
>
deviceLibraries
=
cacheLibraryService
.
getAllDeviceLibraryList
().
stream
()
.
filter
(
deviceLibrary
->
deviceLibrary
.
getPartParentId
()
==
null
).
collect
(
Collectors
.
toList
());
// cacheLibraryService.asyncUpdateCache();
return
deviceLibraries
;
}
@ApiOperation
(
value
=
"解除装备绑定"
,
notes
=
"解除装备绑定"
)
@GetMapping
(
"/relieveDevice/{deviceId}"
)
public
ResponseEntity
relieveDevice
(
@PathVariable
(
"deviceId"
)
Integer
deviceId
){
deviceLibraryService
.
relieveDevice
(
deviceId
);
return
ResponseEntity
.
ok
(
"解除成功"
);
}
@ApiOperation
(
value
=
"进行装备绑定"
,
notes
=
"进行装备绑定"
)
@PostMapping
(
"/bindingDevice"
)
public
ResponseEntity
bindingDevice
(
BindingDeviceVo
bindingDeviceVo
){
deviceLibraryService
.
bindingDevice
(
bindingDeviceVo
);
return
ResponseEntity
.
ok
(
"绑定成功"
);
}
/**
/**
* 测试
* 测试
*/
*/
...
...
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryDao.java
浏览文件 @
cff49629
...
@@ -191,5 +191,22 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
...
@@ -191,5 +191,22 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
int
updateMatchingRange2
(
Integer
matchingRange
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
int
updateMatchingRange2
(
Integer
matchingRange
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
List
<
DeviceLibrary
>
findByModelAndIsPart
(
String
model
,
Integer
isPart
);
List
<
DeviceLibrary
>
findByModelAndIsPart
(
String
model
,
Integer
isPart
);
List
<
DeviceLibrary
>
findAllByPartParentId
(
Integer
partParentId
);
@Transactional
@Modifying
@Query
(
"update DeviceLibrary o set o.model = :newModel,o.packingId = :packingId where o.id in :deviceIds"
)
int
updateModelAndPackingId
(
@Param
(
"newModel"
)
String
newModel
,
@Param
(
"packingId"
)
Integer
packingId
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
@Transactional
@Modifying
@Query
(
"update DeviceLibrary o set o.packingId = :packingId where o.id in :deviceIds"
)
int
updatePackingId
(
@Param
(
"packingId"
)
Integer
packingId
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryCacheService.java
浏览文件 @
cff49629
...
@@ -26,4 +26,6 @@ public interface DeviceLibraryCacheService {
...
@@ -26,4 +26,6 @@ public interface DeviceLibraryCacheService {
void
deletAllDeviceLibraryList
();
void
deletAllDeviceLibraryList
();
void
asyncUpdateCache
();
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
device
.
library
.
service
;
package
com
.
tykj
.
dev
.
device
.
library
.
service
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.BindingDeviceVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceStatisticsVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceStatisticsVo
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.repository.query.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -206,11 +208,6 @@ public interface DeviceLibraryService {
...
@@ -206,11 +208,6 @@ public interface DeviceLibraryService {
*/
*/
DeviceLibrary
findBySeqNumber
(
String
seqNumber
);
DeviceLibrary
findBySeqNumber
(
String
seqNumber
);
// /**
// *
// */
// List<DeviceLibrary> findByIds2(List<Integer> ids);
/**
/**
* 得到所有的装备
* 得到所有的装备
*/
*/
...
@@ -245,7 +242,8 @@ public interface DeviceLibraryService {
...
@@ -245,7 +242,8 @@ public interface DeviceLibraryService {
void
updateDevicesOwnUnit
(
List
<
Integer
>
deviceIds
);
void
updateDevicesOwnUnit
(
List
<
Integer
>
deviceIds
);
/**
/**
* @param
* @param localUnit 所在单位
* @param deviceIds 装备id的集合
*/
*/
void
updateLocalAndOwn
(
String
localUnit
,
List
<
Integer
>
deviceIds
);
void
updateLocalAndOwn
(
String
localUnit
,
List
<
Integer
>
deviceIds
);
...
@@ -254,6 +252,9 @@ public interface DeviceLibraryService {
...
@@ -254,6 +252,9 @@ public interface DeviceLibraryService {
*/
*/
int
getMaxSeqNumber
(
String
model
);
int
getMaxSeqNumber
(
String
model
);
List
<
DeviceLibrary
>
findAllDeviceLibraryList
();
List
<
String
>
getMaxPartSeqNumber
(
String
model
,
Integer
isPart
);
List
<
String
>
getMaxPartSeqNumber
(
String
model
,
Integer
isPart
);
...
@@ -264,6 +265,173 @@ public interface DeviceLibraryService {
...
@@ -264,6 +265,173 @@ public interface DeviceLibraryService {
*/
*/
List
<
DeviceLibrary
>
findDevicesByPacking
(
Integer
packing
);
List
<
DeviceLibrary
>
findDevicesByPacking
(
Integer
packing
);
/**
* 更新配用范围
* @param libraries 装备的集合
*/
void
updateMatchingRange
(
List
<
DeviceLibrary
>
libraries
);
void
updateMatchingRange
(
List
<
DeviceLibrary
>
libraries
);
/**
* 装备的解除
* @param deviceId 装备id
*/
void
relieveDevice
(
int
deviceId
);
/**
* 装备的绑定
* @param
*/
void
bindingDevice
(
BindingDeviceVo
bindingDeviceVo
);
/**
* 以下接口都为缓存做铺垫
*/
/**
* 更新设备序列号
* @param taskId 任务id
* @param seqNumbers 序列号的集合
*/
void
upDateSeqNumbersApplyTaskId
(
Integer
taskId
,
List
<
String
>
seqNumbers
);
List
<
DeviceLibrary
>
findAllByOwnUnit
(
String
ownUnit
);
List
<
DeviceLibrary
>
getAllByRfidCardId
(
String
rfidCardId
);
/**
* 根据装备id的集合更新装备的生命状态
* @param lifeStatus 生命状态
* @param idList 装备id的集合
* @return
*/
int
upDateLeftStatus
(
Integer
lifeStatus
,
@Param
(
"idList"
)
List
<
Integer
>
idList
);
/**
* 根据装备id的集合更新装备的生命状态
* @param lifeStatus 生命状态
* @param seqNumbers 装备序列号的集合
* @return 影响行数
*/
int
upDateSeqNumbersLeftStatus
(
Integer
lifeStatus
,
@Param
(
"seqNumbers"
)
List
<
String
>
seqNumbers
);
/**
* 根据装备id的集合更新装备的生命状态和lock
* @param lifeStatus 生命状态
* @param lock 是否解锁
* @param idList 装备id的集合
* @return 影响行数
*/
int
upDateLeftStatusAndLockStatus
(
Integer
lifeStatus
,
Integer
lock
,
@Param
(
"idList"
)
List
<
Integer
>
idList
);
/**
* 根据装备id的集合更新lock
* @param lock 解锁
* @param idList 装备id的集合
* @return 影响行数
*/
int
upDateLockStatus
(
Integer
lock
,
@Param
(
"idList"
)
List
<
Integer
>
idList
);
/**
* 根据装备id的集合更新生命状态和单位名称
* @param lifeStatus
* @param unitName
* @param lock
* @param idList
* @return 影响行数
*/
int
upDateLeftStatusAndUnitNameAndLockStatus
(
Integer
lifeStatus
,
String
unitName
,
Integer
lock
,
@Param
(
"idList"
)
List
<
Integer
>
idList
);
/**
* 根据装备的序列号的集合更新生命状态和单位名称和锁
* @param lifeStatus 生命状态
* @param unitName 单位名称
* @param lock 锁
* @param seqNumbers 装备序列号的集合
* @return 影响行数
*/
int
upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus
(
Integer
lifeStatus
,
String
unitName
,
Integer
lock
,
@Param
(
"seqNumbers"
)
List
<
String
>
seqNumbers
);
/**
* 根据装备id的集合更新生命状态和所属单位
* @param lifeStatus 生命状态
* @param unitName 所属单位
* @param idList 装备id的集合
* @return 影响行数
*/
int
upDateLeftStatusAndOwnUnitName
(
Integer
lifeStatus
,
String
unitName
,
@Param
(
"idList"
)
List
<
Integer
>
idList
);
/**
* 根据装备id的集合更新RFID表面号
* @param idList 装备id的集合
* @return 影响行数
*/
int
upDateRfidSurfaceIdAsSeqNumber
(
@Param
(
"idList"
)
List
<
Integer
>
idList
);
/**
* 根据列装id更新名称
* @param name 名称
* @param packingId 列装id
* @return 影响行数
*/
int
upDateName
(
String
name
,
Integer
packingId
);
/**
* 根据列装id更新配用范围
* @param matchingRange 配用范围
* @param packingId 列装id
* @return 影响函数
*/
int
upDateMatchingRange
(
Integer
matchingRange
,
Integer
packingId
);
/**
* 根据装备id更新生命状态
* @param lifeStatus 生命状态
* @param id 装备id
* @return
*/
int
batchUpdate
(
Integer
lifeStatus
,
Integer
id
);
/**
* 根据装备id更新生命状态
* @param lifeStatus 生命状态
* @param ids 装备id的集合
* @return
*/
int
batchUpdate2
(
Integer
lifeStatus
,
List
<
Integer
>
ids
);
/**
* 根据列装id更新配用范围
* @param matchingRange 配用范围
* @param packingId 列装id
* @return 影响行数
*/
int
updateMatchingRange
(
Integer
matchingRange
,
Integer
packingId
);
/**
* 根据列装id更新配用范围
* @param matchingRange 配用范围
* @param deviceIds 装备id的集合
* @return 影响行数
*/
int
updateMatchingRange2
(
Integer
matchingRange
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
/**
* 更新型号和列装id
* @param newModel 新的型号
* @param packingId 列装id
* @param deviceIds 装备id集合
* @return 影响行数
*/
int
updateModelAndPackingId
(
String
newModel
,
Integer
packingId
,
List
<
Integer
>
deviceIds
);
/**
* 根据装备id的集合更新列装id
* @param packingId 列装id
* @param deviceIds 装备id的集合
* @return 影响行数
*/
int
updatePackingId
(
Integer
packingId
,
List
<
Integer
>
deviceIds
);
/**
* 查询所有装备
*/
List
<
DeviceLibrary
>
findAllDevices
();
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/CacheLibraryServiceImpl.java
浏览文件 @
cff49629
...
@@ -3,7 +3,9 @@ package com.tykj.dev.device.library.service.impl;
...
@@ -3,7 +3,9 @@ package com.tykj.dev.device.library.service.impl;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryCacheService
;
import
com.tykj.dev.device.library.service.DeviceLibraryCacheService
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CachePut
;
import
org.springframework.cache.annotation.CachePut
;
...
@@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
...
@@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.Executor
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -22,21 +25,26 @@ import java.util.stream.Collectors;
...
@@ -22,21 +25,26 @@ import java.util.stream.Collectors;
*/
*/
@Service
@Service
@CacheConfig
(
cacheNames
=
"devicesLibraryList"
)
@CacheConfig
(
cacheNames
=
"devicesLibraryList"
)
@Slf4j
public
class
CacheLibraryServiceImpl
implements
DeviceLibraryCacheService
{
public
class
CacheLibraryServiceImpl
implements
DeviceLibraryCacheService
{
@Autowired
@Autowired
private
DeviceLibraryDao
deviceLibraryDao
;
private
DeviceLibraryDao
deviceLibraryDao
;
@Autowired
@Qualifier
(
"taskExecutor"
)
private
Executor
executor
;
// @Autowired
// @Autowired
// private ConcurrentMapCacheManager mapCacheManager;
// private ConcurrentMapCacheManager mapCacheManager;
@Autowired
@Autowired
private
DeviceLibraryCacheService
deviceLibraryCacheService
;
private
DeviceLibraryCacheService
deviceLibraryCacheService
;
@Override
@Override
@Cacheable
(
key
=
"'device'"
)
@Cacheable
(
key
=
"'device'"
)
public
List
<
DeviceLibrary
>
getAllDeviceLibraryList
()
{
public
List
<
DeviceLibrary
>
getAllDeviceLibraryList
()
{
long
l
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
List
<
DeviceLibrary
>
all
=
deviceLibraryDao
.
findAll
();
List
<
DeviceLibrary
>
all
=
deviceLibraryDao
.
findAll
();
System
.
out
.
println
(
"缓存时间"
+(
System
.
currentTimeMillis
()-
l
)
);
log
.
info
(
"缓存时间:{}"
,
System
.
currentTimeMillis
()
-
start
);
return
all
;
return
all
;
}
}
...
@@ -64,4 +72,14 @@ public class CacheLibraryServiceImpl implements DeviceLibraryCacheService {
...
@@ -64,4 +72,14 @@ public class CacheLibraryServiceImpl implements DeviceLibraryCacheService {
// List<DeviceLibrary> all = deviceLibraryDao.findAll();
// List<DeviceLibrary> all = deviceLibraryDao.findAll();
// System.out.println("更新缓存时间"+(System.currentTimeMillis()-l));
// System.out.println("更新缓存时间"+(System.currentTimeMillis()-l));
}
}
@Override
@CacheEvict
(
key
=
"'device'"
,
allEntries
=
true
)
public
void
asyncUpdateCache
()
{
executor
.
execute
(()->{
deviceLibraryCacheService
.
getAllDeviceLibraryList
();
});
}
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
cff49629
差异被折叠。
点击展开。
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/BindingDeviceVo.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"装备绑定的vo"
)
public
class
BindingDeviceVo
{
@ApiModelProperty
(
value
=
"要绑定的装备id"
)
private
Integer
originDeviceId
;
@ApiModelProperty
(
value
=
"需要绑定到的装备id"
)
private
Integer
toDeviceId
;
}
dev-misc/src/main/java/com/tykj/dev/misc/base/BaseEntity.java
浏览文件 @
cff49629
...
@@ -9,6 +9,7 @@ import org.springframework.data.annotation.CreatedDate;
...
@@ -9,6 +9,7 @@ import org.springframework.data.annotation.CreatedDate;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -52,12 +53,14 @@ public class BaseEntity {
...
@@ -52,12 +53,14 @@ public class BaseEntity {
* 创建时间
* 创建时间
*/
*/
@CreatedDate
@CreatedDate
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
/**
/**
* 更新时间
* 更新时间
*/
*/
@LastModifiedDate
@LastModifiedDate
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
/**
/**
...
...
dev-misc/src/main/java/com/tykj/dev/misc/base/BaseVo.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
misc
.
base
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation.CreatedBy
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
java.time.LocalDateTime
;
/**
* BaseVo.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/24 at 11:02 上午
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
BaseVo
{
/**
* 主键id
*/
private
Integer
id
;
/**
* 创建用户id
*/
private
Integer
createUserId
;
/**
* 更新用户id
*/
private
Integer
updateUserId
;
/**
* 创建时间
*/
private
LocalDateTime
createTime
;
/**
* 更新时间
*/
private
LocalDateTime
updateTime
;
/**
* 删除标记(0:未删除,1:已删除)
*/
private
Integer
deleteTag
=
0
;
}
dev-misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
浏览文件 @
cff49629
...
@@ -65,6 +65,9 @@ public enum StatusEnum {
...
@@ -65,6 +65,9 @@ public enum StatusEnum {
CHECK_DETAIL_CITY_0
(
160
,
"等待专管员A处理"
),
CHECK_DETAIL_CITY_0
(
160
,
"等待专管员A处理"
),
CHECK_DETAIL_CITY_1
(
161
,
"等待专管员B处理"
),
CHECK_DETAIL_CITY_1
(
161
,
"等待专管员B处理"
),
// 核查任务终止状态
CHECK_SHUT_DOWN
(
20001
,
"任务终止"
),
/**
/**
* 清退任务
* 清退任务
*/
*/
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
cff49629
...
@@ -1237,7 +1237,10 @@ public class TaskServiceImpl implements TaskService {
...
@@ -1237,7 +1237,10 @@ public class TaskServiceImpl implements TaskService {
// .map(Task::parse2Bto)
// .map(Task::parse2Bto)
// .collect(Collectors.toList());
// .collect(Collectors.toList());
List
<
TaskBto
>
taskBtos
=
taskDao
.
findAll
().
stream
()
List
<
TaskBto
>
taskBtos
=
taskDao
.
findAll
().
stream
()
.
filter
(
task
->
(!
task
.
getBillStatus
().
equals
(
StatusEnum
.
END
.
id
))
&&
(!
task
.
getBillStatus
().
equals
(
StatusEnum
.
ARCHIVE
.
id
))
&&
(!
task
.
getBillStatus
().
equals
(
StatusEnum
.
REVOKEALLOTTASK
.
id
)))
.
filter
(
task
->
(!
task
.
getBillStatus
().
equals
(
StatusEnum
.
END
.
id
))
&&
(!
task
.
getBillStatus
().
equals
(
StatusEnum
.
ARCHIVE
.
id
))
&&
(!
task
.
getBillStatus
().
equals
(
StatusEnum
.
REVOKEALLOTTASK
.
id
))
&&
(!
task
.
getBillStatus
().
equals
(
StatusEnum
.
CHECK_SHUT_DOWN
.
id
)))
.
map
(
Task:
:
parse2Bto
)
.
map
(
Task:
:
parse2Bto
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
//查询待办
//查询待办
...
@@ -1460,7 +1463,8 @@ public class TaskServiceImpl implements TaskService {
...
@@ -1460,7 +1463,8 @@ public class TaskServiceImpl implements TaskService {
predicateBuilder
.
lt
(
"createTime"
,
taskSelectVo
.
getEndTime
());
predicateBuilder
.
lt
(
"createTime"
,
taskSelectVo
.
getEndTime
());
}
}
if
(
taskSelectVo
.
getSelectNum
()
==
4
)
{
if
(
taskSelectVo
.
getSelectNum
()
==
4
)
{
predicateBuilder
.
eq
(
"billStatus"
,
StatusEnum
.
END
.
id
);
// predicateBuilder.eq("billStatus", StatusEnum.END.id);
predicateBuilder
.
in
(
"billStatus"
,
StatusEnum
.
END
.
id
,
StatusEnum
.
CHECK_SHUT_DOWN
.
id
);
}
}
if
(
taskSelectVo
.
getSelectNum
()
==
5
)
{
if
(
taskSelectVo
.
getSelectNum
()
==
5
)
{
predicateBuilder
.
eq
(
"billStatus"
,
StatusEnum
.
ARCHIVE
.
id
);
predicateBuilder
.
eq
(
"billStatus"
,
StatusEnum
.
ARCHIVE
.
id
);
...
...
dev-union/src/main/java/com/tykj/dev/union/UpdateCacheAspect.java
0 → 100644
浏览文件 @
cff49629
package
com
.
tykj
.
dev
.
union
;
import
com.tykj.dev.device.library.service.DeviceLibraryCacheService
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.matching.service.MatchingDeviceBillService
;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill
;
import
lombok.extern.slf4j.Slf4j
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
* 增强更新缓存aop
*
* @author zsp
*/
@Slf4j
@Aspect
@Component
public
class
UpdateCacheAspect
{
/**
* 业务新状态
*/
@Autowired
private
DeviceLibraryCacheService
deviceLibraryCacheService
;
/**
* 更新缓存定义切入点
*/
@Pointcut
(
"@annotation(com.tykj.dev.config.UpdateCache)"
)
public
void
operationLog
()
{
}
/**
* 新增结果返回后触发
*/
@AfterReturning
(
pointcut
=
"operationLog()"
)
public
void
doAfterReturning
(
JoinPoint
point
)
{
log
.
info
(
"开始更新缓存"
);
deviceLibraryCacheService
.
asyncUpdateCache
();
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/dao/UnitsDao.java
浏览文件 @
cff49629
...
@@ -48,4 +48,6 @@ public interface UnitsDao extends JpaRepository<Units, Integer>, JpaSpecificatio
...
@@ -48,4 +48,6 @@ public interface UnitsDao extends JpaRepository<Units, Integer>, JpaSpecificatio
List
<
Units
>
findAllByType
(
Integer
type
);
List
<
Units
>
findAllByType
(
Integer
type
);
List
<
Units
>
findByTypeAndEscrow
(
int
type
,
int
escrow
);
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/entity/Units.java
浏览文件 @
cff49629
...
@@ -95,6 +95,9 @@ public class Units {
...
@@ -95,6 +95,9 @@ public class Units {
@ApiModelProperty
(
value
=
"装备配用范围的指定"
)
@ApiModelProperty
(
value
=
"装备配用范围的指定"
)
private
Integer
packingMatchingRange
;
private
Integer
packingMatchingRange
;
@ApiModelProperty
(
value
=
"是否代管"
)
private
Integer
escrow
;
/**
/**
* 区域对象
* 区域对象
*/
*/
...
@@ -113,6 +116,7 @@ public class Units {
...
@@ -113,6 +116,7 @@ public class Units {
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
null
);
);
}
}
...
@@ -130,4 +134,18 @@ public class Units {
...
@@ -130,4 +134,18 @@ public class Units {
public
LeftNavigation
toLeftNavigation
(){
public
LeftNavigation
toLeftNavigation
(){
return
new
LeftNavigation
(
unitId
,
name
,
null
,
UUID
.
randomUUID
().
toString
(),
2
,
showOrder
,
null
);
return
new
LeftNavigation
(
unitId
,
name
,
null
,
UUID
.
randomUUID
().
toString
(),
2
,
showOrder
,
null
);
}
}
/**
* @return true = 是代管单位,false = 不是代管单位
*/
public
boolean
isEscrow
(){
return
escrow
==
1
;
}
/**
* @return true = 不是代管单位,false = 是代管单位
*/
public
boolean
isNotEscrow
(){
return
escrow
==
0
;
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论