Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
2bd5a004
Commit
2bd5a004
authored
Apr 25, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.代码优化增加抽象类
parent
bb4feabb
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
158 deletions
+138
-158
EquipUsedCheckStrategyContext.java
.../module/jg/biz/context/EquipUsedCheckStrategyContext.java
+1
-1
BaseEquipUsedCheckService.java
...module/jg/biz/service/impl/BaseEquipUsedCheckService.java
+117
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+1
-0
InstallNoticeEquipUsedCheckImpl.java
.../jg/biz/service/impl/InstallNoticeEquipUsedCheckImpl.java
+9
-81
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+1
-0
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+1
-0
UseRegisterEquipUsedCheckImpl.java
...le/jg/biz/service/impl/UseRegisterEquipUsedCheckImpl.java
+8
-76
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/
service/impl
/EquipUsedCheckStrategyContext.java
→
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/
context
/EquipUsedCheckStrategyContext.java
View file @
2bd5a004
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
context
;
import
com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck
;
import
org.springframework.beans.BeansException
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/BaseEquipUsedCheckService.java
0 → 100644
View file @
2bd5a004
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FlowingEquipRedisKeyDTO
;
import
com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.TreeSet
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
/**
* @author Administrator
*/
@Slf4j
public
abstract
class
BaseEquipUsedCheckService
implements
IEquipUsedCheck
{
/**
* 并发校验(页面同时提交或者页面同时打开多个时,某些设备都是为使用状态)校验设备流程在用状态及更新不在用为再使用状态
*
* @param record 设备唯一标识
* @param companyCode 登录人的公司代码
*/
@Override
public
void
equipRepeatUsedCheck
(
String
record
,
String
companyCode
)
{
RLock
lock
=
getRedisClient
().
getLock
(
this
.
getRepeatUsedCheckLockKey
(
companyCode
,
getApplyBizType
(),
record
));
try
{
boolean
isLocked
=
lock
.
tryLock
(
0
,
180
,
TimeUnit
.
SECONDS
);
if
(!
isLocked
)
{
log
.
error
(
"设备:{}在被其他业务使用,加锁失败"
,
record
);
throw
new
BadRequest
(
"存在其他业务在使用设备,请刷新后重试!"
);
}
RBucket
<
Set
<
String
>>
RBucket
=
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()));
Set
<
String
>
equipListOfUsed
=
RBucket
.
get
();
if
(
equipListOfUsed
!=
null
&&
equipListOfUsed
.
contains
(
record
))
{
throw
new
BadRequest
(
"存在设备正在同时被其他流程使用,请刷新后重试!"
);
}
if
(
equipListOfUsed
==
null
||
equipListOfUsed
.
isEmpty
())
{
equipListOfUsed
=
new
TreeSet
<>();
}
equipListOfUsed
.
add
(
record
);
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
())).
set
(
equipListOfUsed
);
FlowingEquipRedisContext
.
setRedisKeyInfo
(
new
FlowingEquipRedisKeyDTO
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()),
Collections
.
singletonList
(
record
)));
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
}
}
}
private
String
getRepeatUsedCheckLockKey
(
String
companyCode
,
String
bizType
,
String
record
)
{
return
String
.
format
(
"%s-%s-%s-%s"
,
"JG_REPEAT_CHECK"
,
companyCode
,
bizType
,
record
);
}
String
getFlowingEquipRedisKey
(
String
companyCode
,
String
type
)
{
return
String
.
format
(
"%s:%s:%s"
,
"EQUIP_IN_FLOWING"
,
companyCode
,
type
);
}
/**
* 删除流程中的数据,释放redis空间(异常处理及驳回到发起节点、撤回到发起节点、完成时时进行)
*
* @param records 设备唯一标识
* @param companyCode 登录人的公司代码
*/
@Override
public
void
delDataForCheckEquipRepeatUsed
(
List
<
String
>
records
,
String
companyCode
)
{
RBucket
<
Set
<
String
>>
rBucket
=
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()));
Set
<
String
>
equipListOfUsed
=
rBucket
.
get
();
equipListOfUsed
=
equipListOfUsed
.
stream
().
filter
(
record
->
!
records
.
contains
(
record
)).
collect
(
Collectors
.
toSet
());
rBucket
.
set
(
equipListOfUsed
);
}
/**
* 删除流程中的数据,释放redis空间(异常处理及驳回到发起节点、撤回到发起节点、完成时时进行)
*
* @param records 设备唯一标识
* @param redisKey key
*/
@Override
public
void
delDataForCheckWithKey
(
List
<
String
>
records
,
String
redisKey
)
{
delRedisData
(
records
,
redisKey
,
getRedisClient
());
}
@Override
public
Set
<
String
>
getEquipInFlow
(
String
companyCode
)
{
RBucket
<
Set
<
String
>>
rBucket
=
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()));
return
rBucket
.
get
();
}
private
void
delRedisData
(
List
<
String
>
records
,
String
redisKey
,
RedissonClient
redissonClient
)
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
redisKey
);
Set
<
String
>
equipListOfUsed
=
rBucket
.
get
();
equipListOfUsed
=
equipListOfUsed
.
stream
().
filter
(
record
->
!
records
.
contains
(
record
)).
collect
(
Collectors
.
toSet
());
rBucket
.
set
(
equipListOfUsed
);
}
public
abstract
RedissonClient
getRedisClient
();
public
abstract
String
getApplyBizType
();
@Override
public
String
applyBizType
()
{
return
getApplyBizType
();
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
View file @
2bd5a004
...
...
@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import
com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.jg.biz.service.*
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/InstallNoticeEquipUsedCheckImpl.java
View file @
2bd5a004
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FlowingEquipRedisKeyDTO
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -21,7 +17,7 @@ import java.util.stream.Collectors;
*/
@Component
@Slf4j
public
class
InstallNoticeEquipUsedCheckImpl
implements
IEquipUsedCheck
{
public
class
InstallNoticeEquipUsedCheckImpl
extends
BaseEquipUsedCheckService
{
private
RedissonClient
redissonClient
;
...
...
@@ -35,90 +31,22 @@ public class InstallNoticeEquipUsedCheckImpl implements IEquipUsedCheck {
}
/**
* 并发校验(页面同时提交或者页面同时打开多个时,某些设备都是为使用状态)校验设备流程在用状态及更新不在用为再使用状态
*
* @param record 设备唯一标识
* @param companyCode 登录人的公司代码
*/
@Override
public
void
equipRepeatUsedCheck
(
String
record
,
String
companyCode
)
{
RLock
lock
=
redissonClient
.
getLock
(
this
.
getRepeatUsedCheckLockKey
(
companyCode
,
bizType
,
record
));
try
{
boolean
isLocked
=
lock
.
tryLock
(
0
,
180
,
TimeUnit
.
SECONDS
);
if
(!
isLocked
)
{
log
.
error
(
"设备:{}在被其他业务使用,加锁失败"
,
record
);
throw
new
BadRequest
(
"存在其他业务在使用设备,请刷新后重试!"
);
}
RBucket
<
Set
<
String
>>
RBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
Set
<
String
>
equipListOfUsed
=
RBucket
.
get
();
if
(
equipListOfUsed
!=
null
&&
equipListOfUsed
.
contains
(
record
))
{
throw
new
BadRequest
(
"存在设备正在同时被其他流程使用,请刷新后重试!"
);
}
if
(
equipListOfUsed
==
null
||
equipListOfUsed
.
isEmpty
())
{
equipListOfUsed
=
new
TreeSet
<>();
}
equipListOfUsed
.
add
(
record
);
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
)).
set
(
equipListOfUsed
);
FlowingEquipRedisContext
.
setRedisKeyInfo
(
new
FlowingEquipRedisKeyDTO
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
),
Collections
.
singletonList
(
record
)));
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
}
}
}
private
String
getRepeatUsedCheckLockKey
(
String
companyCode
,
String
bizType
,
String
record
)
{
return
String
.
format
(
"%s-%s-%s-%s"
,
"JG_REPEAT_CHECK"
,
companyCode
,
bizType
,
record
);
}
private
String
getFlowingEquipRedisKey
(
String
companyCode
,
String
type
)
{
return
String
.
format
(
"%s:%s:%s"
,
"EQUIP_IN_FLOWING"
,
companyCode
,
type
);
}
/**
* 删除流程中的数据,释放redis空间(异常处理及驳回到发起节点、撤回到发起节点、完成时时进行)
*
* @param records 设备唯一标识
* @param companyCode 登录人的公司代码
*/
@Override
public
void
delDataForCheckEquipRepeatUsed
(
List
<
String
>
records
,
String
companyCode
)
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
Set
<
String
>
equipListOfUsed
=
rBucket
.
get
();
equipListOfUsed
=
equipListOfUsed
.
stream
().
filter
(
record
->
!
records
.
contains
(
record
)).
collect
(
Collectors
.
toSet
());
rBucket
.
set
(
equipListOfUsed
);
public
RedissonClient
getRedisClient
()
{
return
redissonClient
;
}
/**
* 删除流程中的数据,释放redis空间(异常处理及驳回到发起节点、撤回到发起节点、完成时时进行)
*
* @param records 设备唯一标识
* @param redisKey key
*/
@Override
public
void
delDataForCheckWithKey
(
List
<
String
>
records
,
String
redisKey
)
{
UseRegisterEquipUsedCheckImpl
.
delRedisData
(
records
,
redisKey
,
redissonClient
);
}
@Override
public
Set
<
String
>
getEquipInFlow
(
String
companyCode
)
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
return
rBucket
.
get
();
}
@Override
public
String
applyBizType
()
{
public
String
getApplyBizType
()
{
return
bizType
;
}
@Override
public
void
init
()
{
List
<
CompanyEquipCountDto
>
companyEquipCountDtos
=
installationNoticeMapper
.
queryForFlowingEquipList
();
companyEquipCountDtos
.
forEach
(
c
->
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
c
.
getCompanyCode
(),
bizType
));
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
getFlowingEquipRedisKey
(
c
.
getCompanyCode
(),
bizType
));
rBucket
.
set
(
Arrays
.
stream
(
c
.
getRecords
().
split
(
","
)).
collect
(
Collectors
.
toSet
()));
});
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
View file @
2bd5a004
...
...
@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
2bd5a004
...
...
@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/UseRegisterEquipUsedCheckImpl.java
View file @
2bd5a004
...
...
@@ -2,16 +2,14 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -19,7 +17,7 @@ import java.util.stream.Collectors;
*/
@Component
@Slf4j
public
class
UseRegisterEquipUsedCheckImpl
implements
IEquipUsedCheck
{
public
class
UseRegisterEquipUsedCheckImpl
extends
BaseEquipUsedCheckService
{
private
RedissonClient
redissonClient
;
...
...
@@ -32,73 +30,18 @@ public class UseRegisterEquipUsedCheckImpl implements IEquipUsedCheck {
this
.
useRegistrationMapper
=
useRegistrationMapper
;
}
/**
* 并发校验(页面同时提交或者页面同时打开多个时,某些设备都是为使用状态)校验设备流程在用状态及更新不在用为再使用状态
*
* @param record 设备唯一标识
* @param companyCode 登录人的公司代码
*/
@Override
public
void
equipRepeatUsedCheck
(
String
record
,
String
companyCode
)
{
RLock
lock
=
redissonClient
.
getLock
(
this
.
getRepeatUsedCheckLockKey
(
companyCode
,
bizType
,
record
));
try
{
boolean
isLocked
=
lock
.
tryLock
(
0
,
180
,
TimeUnit
.
SECONDS
);
if
(!
isLocked
)
{
log
.
error
(
"设备:{}在被其他业务使用,加锁失败"
,
record
);
throw
new
BadRequest
(
"存在其他业务在使用设备,请刷新后重试!"
);
}
RBucket
<
Set
<
String
>>
RBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
Set
<
String
>
equipListOfUsed
=
RBucket
.
get
();
if
(
equipListOfUsed
!=
null
&&
equipListOfUsed
.
contains
(
record
))
{
throw
new
BadRequest
(
"存在设备正在同时被其他流程使用,请刷新后重试!"
);
}
if
(
equipListOfUsed
==
null
||
equipListOfUsed
.
isEmpty
())
{
equipListOfUsed
=
new
TreeSet
<>();
}
equipListOfUsed
.
add
(
record
);
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
)).
set
(
equipListOfUsed
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
}
}
}
private
String
getRepeatUsedCheckLockKey
(
String
companyCode
,
String
bizType
,
String
record
)
{
return
String
.
format
(
"%s-%s-%s-%s"
,
"JG_REPEAT_CHECK"
,
companyCode
,
bizType
,
record
);
}
private
String
getFlowingEquipRedisKey
(
String
companyCode
,
String
type
)
{
return
String
.
format
(
"%s:%s:%s"
,
"EQUIP_IN_FLOWING"
,
companyCode
,
type
);
}
/**
* 删除流程中的数据,释放redis空间(异常处理及驳回到发起节点、撤回到发起节点、完成时时进行)
*
* @param records 设备唯一标识
* @param companyCode 登录人的公司代码
*/
@Override
public
void
delDataForCheckEquipRepeatUsed
(
List
<
String
>
records
,
String
companyCode
)
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
Set
<
String
>
equipListOfUsed
=
rBucket
.
get
();
equipListOfUsed
=
equipListOfUsed
.
stream
().
filter
(
record
->
!
records
.
contains
(
record
)).
collect
(
Collectors
.
toSet
());
rBucket
.
set
(
equipListOfUsed
);
}
@Override
public
Set
<
String
>
getEquipInFlow
(
String
companyCode
)
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
return
rBucket
.
get
();
public
RedissonClient
getRedisClient
()
{
return
redissonClient
;
}
@Override
public
String
a
pplyBizType
()
{
public
String
getA
pplyBizType
()
{
return
bizType
;
}
@Override
public
void
init
()
{
List
<
CompanyEquipCountDto
>
companyEquipCountDtos
=
useRegistrationMapper
.
queryForFlowingEquipList
();
...
...
@@ -108,15 +51,4 @@ public class UseRegisterEquipUsedCheckImpl implements IEquipUsedCheck {
});
}
@Override
public
void
delDataForCheckWithKey
(
List
<
String
>
records
,
String
redisKey
)
{
delRedisData
(
records
,
redisKey
,
redissonClient
);
}
static
void
delRedisData
(
List
<
String
>
records
,
String
redisKey
,
RedissonClient
redissonClient
)
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
redisKey
);
Set
<
String
>
equipListOfUsed
=
rBucket
.
get
();
equipListOfUsed
=
equipListOfUsed
.
stream
().
filter
(
record
->
!
records
.
contains
(
record
)).
collect
(
Collectors
.
toSet
());
rBucket
.
set
(
equipListOfUsed
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment