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
bb4feabb
Commit
bb4feabb
authored
Apr 24, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.使用登记(台套、单位)增加过滤流程中的设备
2.安装告知、使用登记(台套、单位)在提交时增加异常回滚机制,在异常时清除掉写入的redis数据
parent
1a79b09d
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
241 additions
and
19 deletions
+241
-19
FlowingEquipRedisKeyDTO.java
.../amos/boot/module/jg/api/dto/FlowingEquipRedisKeyDTO.java
+20
-0
JgUseRegistrationMapper.java
...os/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
+3
-2
IEquipUsedCheck.java
...join/amos/boot/module/jg/api/service/IEquipUsedCheck.java
+8
-0
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+22
-2
WebConfig.java
...com/yeejoin/amos/boot/module/jg/biz/config/WebConfig.java
+26
-0
FlowingEquipRedisContext.java
.../boot/module/jg/biz/context/FlowingEquipRedisContext.java
+37
-0
ClearThreadLocalInterceptor.java
...odule/jg/biz/interceptor/ClearThreadLocalInterceptor.java
+24
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+3
-2
InstallNoticeEquipUsedCheckImpl.java
.../jg/biz/service/impl/InstallNoticeEquipUsedCheckImpl.java
+14
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+19
-1
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+53
-12
UseRegisterEquipUsedCheckImpl.java
...le/jg/biz/service/impl/UseRegisterEquipUsedCheckImpl.java
+12
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/FlowingEquipRedisKeyDTO.java
0 → 100644
View file @
bb4feabb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author Administrator
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
FlowingEquipRedisKeyDTO
{
private
String
redisKey
;
private
List
<
String
>
data
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
View file @
bb4feabb
...
@@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.MapKey;
...
@@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.MapKey;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
/**
/**
* Mapper 接口
* Mapper 接口
...
@@ -49,14 +50,14 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
...
@@ -49,14 +50,14 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Map
<
String
,
Object
>
getUseRegistrationDetail
(
@Param
(
"id"
)
String
id
);
Map
<
String
,
Object
>
getUseRegistrationDetail
(
@Param
(
"id"
)
String
id
);
Page
<
JSONObject
>
queryForUnitVesselEquipmentPage
(
@Param
(
"page"
)
Page
<
JSONObject
>
page
,
@Param
(
"jsonObject"
)
JSONObject
jsonObject
);
Page
<
JSONObject
>
queryForUnitVesselEquipmentPage
(
@Param
(
"page"
)
Page
<
JSONObject
>
page
,
@Param
(
"jsonObject"
)
JSONObject
jsonObject
,
@Param
(
"records"
)
Set
<
String
>
records
);
Page
<
JSONObject
>
queryForEquipUsedByVehiclePage
(
@Param
(
"page"
)
Page
<
JSONObject
>
page
,
@Param
(
"jsonObject"
)
JSONObject
jsonObject
);
Page
<
JSONObject
>
queryForEquipUsedByVehiclePage
(
@Param
(
"page"
)
Page
<
JSONObject
>
page
,
@Param
(
"jsonObject"
)
JSONObject
jsonObject
);
@MapKey
(
"records"
)
@MapKey
(
"records"
)
List
<
Map
<
String
,
Object
>>
queryForUnitVesselEquipment
(
@Param
(
"records"
)
List
<
String
>
records
);
List
<
Map
<
String
,
Object
>>
queryForUnitVesselEquipment
(
@Param
(
"records"
)
List
<
String
>
records
);
Page
<
JSONObject
>
queryForUnitPipelineEquipmentPage
(
@Param
(
"page"
)
Page
<
JSONObject
>
page
,
@Param
(
"jsonObject"
)
JSONObject
jsonObject
);
Page
<
JSONObject
>
queryForUnitPipelineEquipmentPage
(
@Param
(
"page"
)
Page
<
JSONObject
>
page
,
@Param
(
"jsonObject"
)
JSONObject
jsonObject
,
@Param
(
"records"
)
Set
<
String
>
records
);
@MapKey
(
"records"
)
@MapKey
(
"records"
)
List
<
Map
<
String
,
Object
>>
queryForUnitPipelineEquipment
(
@Param
(
"records"
)
List
<
String
>
records
);
List
<
Map
<
String
,
Object
>>
queryForUnitPipelineEquipment
(
@Param
(
"records"
)
List
<
String
>
records
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IEquipUsedCheck.java
View file @
bb4feabb
...
@@ -39,4 +39,12 @@ public interface IEquipUsedCheck {
...
@@ -39,4 +39,12 @@ public interface IEquipUsedCheck {
* 数据初始化方法
* 数据初始化方法
*/
*/
void
init
();
void
init
();
/**
* 删除流程中的数据,释放redis空间(异常处理及驳回到发起节点、撤回到发起节点、完成时时进行)
*
* @param records 设备唯一标识
* @param redisKey key
*/
void
delDataForCheckWithKey
(
List
<
String
>
records
,
String
redisKey
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
bb4feabb
...
@@ -451,9 +451,19 @@
...
@@ -451,9 +451,19 @@
<if
test=
"jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''"
>
<if
test=
"jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''"
>
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
</if>
<if
test=
"jsonObject.record != null and jsonObject.record != ''"
>
<choose>
<when
test=
"jsonObject.record != null and jsonObject.record != ''"
>
and ui."RECORD" = #{jsonObject.record}
and ui."RECORD" = #{jsonObject.record}
</when>
<otherwise>
<if
test=
"records != null and records.size() > 0"
>
and ui."RECORD" not in
<foreach
collection=
"records"
item=
"record"
separator=
","
open=
"("
close=
")"
>
#{record}
</foreach>
</if>
</if>
</otherwise>
</choose>
ORDER BY ui.REC_DATE DESC
ORDER BY ui.REC_DATE DESC
</select>
</select>
...
@@ -510,9 +520,19 @@
...
@@ -510,9 +520,19 @@
<if
test=
"jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''"
>
<if
test=
"jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''"
>
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
</if>
<if
test=
"jsonObject.record != null and jsonObject.record != ''"
>
<choose>
<when
test=
"jsonObject.record != null and jsonObject.record != ''"
>
and ui."RECORD" = #{jsonObject.record}
and ui."RECORD" = #{jsonObject.record}
</when>
<otherwise>
<if
test=
"records != null and records.size() > 0"
>
and ui."RECORD" not in
<foreach
collection=
"records"
item=
"record"
separator=
","
open=
"("
close=
")"
>
#{record}
</foreach>
</if>
</if>
</otherwise>
</choose>
ORDER BY ui.REC_DATE DESC
ORDER BY ui.REC_DATE DESC
</select>
</select>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/config/WebConfig.java
0 → 100644
View file @
bb4feabb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
config
;
import
com.yeejoin.amos.boot.module.jg.biz.interceptor.ClearThreadLocalInterceptor
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
/**
* @author Administrator
*/
@Configuration
public
class
WebConfig
implements
WebMvcConfigurer
{
@Bean
public
ClearThreadLocalInterceptor
clearThreadLocalInterceptor
()
{
return
new
ClearThreadLocalInterceptor
();
}
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
clearThreadLocalInterceptor
());
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/context/FlowingEquipRedisContext.java
0 → 100644
View file @
bb4feabb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
context
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FlowingEquipRedisKeyDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author Administrator
*/
@Slf4j
public
class
FlowingEquipRedisContext
{
private
static
ThreadLocal
<
List
<
FlowingEquipRedisKeyDTO
>>
threadLocal
=
new
ThreadLocal
<>();
public
static
List
<
FlowingEquipRedisKeyDTO
>
getContext
()
{
if
(
threadLocal
.
get
()
==
null
)
{
threadLocal
.
set
(
new
ArrayList
<>());
}
return
threadLocal
.
get
();
}
public
static
void
setRedisKeyInfo
(
FlowingEquipRedisKeyDTO
redisKeyInfo
)
{
getContext
().
add
(
redisKeyInfo
);
}
public
static
void
clean
()
{
log
.
info
(
"FlowingEquipRedisContext clean begin"
);
if
(
threadLocal
!=
null
)
{
threadLocal
.
remove
();
}
log
.
info
(
"FlowingEquipRedisContext clean end"
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/interceptor/ClearThreadLocalInterceptor.java
0 → 100644
View file @
bb4feabb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
interceptor
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
* @author Administrator
*/
public
class
ClearThreadLocalInterceptor
implements
HandlerInterceptor
{
@Override
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
{
// 清除ThreadLocal变量
FlowingEquipRedisContext
.
clean
();
}
}
\ No newline at end of file
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 @
bb4feabb
...
@@ -1840,12 +1840,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -1840,12 +1840,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
jsonObject
.
put
(
"useUnitCreditCode"
,
useUnitCreditCode
);
jsonObject
.
put
(
"useUnitCreditCode"
,
useUnitCreditCode
);
Page
<
JSONObject
>
page
=
new
Page
<>(
jsonObject
.
getLong
(
"number"
),
jsonObject
.
getLong
(
"size"
));
Page
<
JSONObject
>
page
=
new
Page
<>(
jsonObject
.
getLong
(
"number"
),
jsonObject
.
getLong
(
"size"
));
Set
<
String
>
records
=
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
getEquipInFlow
(
useUnitCreditCode
);
if
(
"8300"
.
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
if
(
"8300"
.
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
return
jgUseRegistrationMapper
.
queryForUnitPipelineEquipmentPage
(
page
,
jsonObject
);
return
jgUseRegistrationMapper
.
queryForUnitPipelineEquipmentPage
(
page
,
jsonObject
,
records
);
}
else
if
(
"2300"
.
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
}
else
if
(
"2300"
.
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
List
<
DictionarieValueModel
>
fillingMedium
=
Systemctl
.
dictionarieClient
.
dictValues
(
"FILLING_MEDIUM"
).
getResult
();
List
<
DictionarieValueModel
>
fillingMedium
=
Systemctl
.
dictionarieClient
.
dictValues
(
"FILLING_MEDIUM"
).
getResult
();
Map
<
String
,
Object
>
fillingMediumMap
=
fillingMedium
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
Map
<
String
,
Object
>
fillingMediumMap
=
fillingMedium
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
Page
<
JSONObject
>
result
=
jgUseRegistrationMapper
.
queryForUnitVesselEquipmentPage
(
page
,
jsonObject
);
Page
<
JSONObject
>
result
=
jgUseRegistrationMapper
.
queryForUnitVesselEquipmentPage
(
page
,
jsonObject
,
records
);
result
.
getRecords
().
forEach
(
i
->
{
result
.
getRecords
().
forEach
(
i
->
{
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
});
});
...
...
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 @
bb4feabb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
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.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.mapper.JgInstallationNoticeMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck
;
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
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RLock
;
...
@@ -58,6 +60,7 @@ public class InstallNoticeEquipUsedCheckImpl implements IEquipUsedCheck {
...
@@ -58,6 +60,7 @@ public class InstallNoticeEquipUsedCheckImpl implements IEquipUsedCheck {
}
}
equipListOfUsed
.
add
(
record
);
equipListOfUsed
.
add
(
record
);
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
)).
set
(
equipListOfUsed
);
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
)).
set
(
equipListOfUsed
);
FlowingEquipRedisContext
.
setRedisKeyInfo
(
new
FlowingEquipRedisKeyDTO
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
),
Collections
.
singletonList
(
record
)));
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
finally
{
}
finally
{
...
@@ -89,6 +92,17 @@ public class InstallNoticeEquipUsedCheckImpl implements IEquipUsedCheck {
...
@@ -89,6 +92,17 @@ public class InstallNoticeEquipUsedCheckImpl implements IEquipUsedCheck {
rBucket
.
set
(
equipListOfUsed
);
rBucket
.
set
(
equipListOfUsed
);
}
}
/**
* 删除流程中的数据,释放redis空间(异常处理及驳回到发起节点、撤回到发起节点、完成时时进行)
*
* @param records 设备唯一标识
* @param redisKey key
*/
@Override
public
void
delDataForCheckWithKey
(
List
<
String
>
records
,
String
redisKey
)
{
UseRegisterEquipUsedCheckImpl
.
delRedisData
(
records
,
redisKey
,
redissonClient
);
}
@Override
@Override
public
Set
<
String
>
getEquipInFlow
(
String
companyCode
)
{
public
Set
<
String
>
getEquipInFlow
(
String
companyCode
)
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
...
...
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 @
bb4feabb
...
@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
...
@@ -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.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
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.api.vo.SortVo
;
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.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService
;
...
@@ -509,7 +510,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -509,7 +510,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgInstallationNotice
>
saveNotice
(
String
submitType
,
JSONObject
jgInstallationNoticeDtoMap
,
ReginParams
reginParams
)
{
public
List
<
JgInstallationNotice
>
saveNotice
(
String
submitType
,
JSONObject
jgInstallationNoticeDtoMap
,
ReginParams
reginParams
)
{
try
{
JgInstallationNoticeDto
model
=
JSON
.
parseObject
(
jgInstallationNoticeDtoMap
.
get
(
TABLE_PAGE_ID
).
toString
(),
JgInstallationNoticeDto
.
class
);
JgInstallationNoticeDto
model
=
JSON
.
parseObject
(
jgInstallationNoticeDtoMap
.
get
(
TABLE_PAGE_ID
).
toString
(),
JgInstallationNoticeDto
.
class
);
// 字段转换
// 字段转换
this
.
convertField
(
model
);
this
.
convertField
(
model
);
...
@@ -559,6 +560,23 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -559,6 +560,23 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgInstallationNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
jgInstallationNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
this
.
updateRedisBatch
(
list
);
this
.
updateRedisBatch
(
list
);
return
list
;
return
list
;
}
catch
(
BadRequest
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
throw
e
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
throw
new
BadRequest
(
"安装告知保存失败!"
);
}
finally
{
FlowingEquipRedisContext
.
clean
();
}
}
private
void
rollBackForDelRedisData
()
{
FlowingEquipRedisContext
.
getContext
().
forEach
(
e
->
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"installNotice"
).
delDataForCheckWithKey
(
e
.
getData
(),
e
.
getRedisKey
());
});
}
}
private
void
repeatUsedEquipCheck
(
List
<
Map
<
String
,
Object
>>
equipList
,
String
companyCode
)
{
private
void
repeatUsedEquipCheck
(
List
<
Map
<
String
,
Object
>>
equipList
,
String
companyCode
)
{
...
...
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 @
bb4feabb
...
@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
...
@@ -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.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationService
;
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.api.vo.SortVo
;
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.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
...
@@ -142,7 +143,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -142,7 +143,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
@Autowired
private
JgUseRegistrationMapper
jgUseRegistrationMapper
;
private
JgUseRegistrationMapper
jgUseRegistrationMapper
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已完成"
);
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已完成"
);
/**
/**
* @param auditPassDate 通过时间
* @param auditPassDate 通过时间
...
@@ -161,9 +162,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -161,9 +162,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
exportParamsMap
.
put
(
"giveOutDay"
,
today
.
getDayOfMonth
());
exportParamsMap
.
put
(
"giveOutDay"
,
today
.
getDayOfMonth
());
}
}
public
Page
<
Map
<
String
,
Object
>>
getList
(
JgUseRegistrationDto
dto
,
String
sort
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
public
Page
<
Map
<
String
,
Object
>>
getList
(
JgUseRegistrationDto
dto
,
String
sort
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
SortVo
sortMap
=
commonServiceImpl
.
sortFieldConversion
(
sort
);
SortVo
sortMap
=
commonServiceImpl
.
sortFieldConversion
(
sort
);
return
this
.
baseMapper
.
getListPage
(
page
,
sortMap
,
dto
,
roleIds
);
return
this
.
baseMapper
.
getListPage
(
page
,
sortMap
,
dto
,
roleIds
);
}
}
public
Page
<
Map
<
String
,
Object
>>
getEquipList
(
Page
<
Map
<
String
,
Object
>>
page
,
String
factoryNum
,
String
equList
,
String
equCategory
)
{
public
Page
<
Map
<
String
,
Object
>>
getEquipList
(
Page
<
Map
<
String
,
Object
>>
page
,
String
factoryNum
,
String
equList
,
String
equCategory
)
{
...
@@ -323,7 +324,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -323,7 +324,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @param map map
* @param map map
* @return list
* @return list
*/
*/
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Map
<
String
,
Object
>>
save
(
JSONObject
map
)
{
public
List
<
Map
<
String
,
Object
>>
save
(
JSONObject
map
)
{
Map
<
String
,
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>>
functionMap
=
MapBuilder
.<
String
,
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>>
create
()
Map
<
String
,
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>>
functionMap
=
MapBuilder
.<
String
,
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>>
create
()
.
put
(
"unit"
,
this
::
handleUnitUseRegistration
).
build
();
.
put
(
"unit"
,
this
::
handleUnitUseRegistration
).
build
();
...
@@ -338,6 +339,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -338,6 +339,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @return list
* @return list
*/
*/
private
List
<
Map
<
String
,
Object
>>
handleUseRegistration
(
JSONObject
map
)
{
private
List
<
Map
<
String
,
Object
>>
handleUseRegistration
(
JSONObject
map
)
{
try
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
// 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况)
// 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况)
checkForRepeatUsedEquip
(
map
,
reginParams
);
checkForRepeatUsedEquip
(
map
,
reginParams
);
...
@@ -429,9 +431,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -429,9 +431,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 业务管理设备信息保存
// 业务管理设备信息保存
JgUseRegistrationEq
jgRelationEquip
=
new
JgUseRegistrationEq
();
JgUseRegistrationEq
jgRelationEquip
=
new
JgUseRegistrationEq
();
jgRelationEquip
.
setEquId
(
map
.
get
(
"equipId"
).
toString
());
jgRelationEquip
.
setEquId
(
map
.
get
(
"equipId"
).
toString
());
// List<String> applicationFormCode = iCreateCodeServicevice.createApplicationFormCode(ApplicationFormTypeEnum.SYDJ.getCode(), 1);
// List<String> applicationFormCode = iCreateCodeServicevice.createApplicationFormCode(ApplicationFormTypeEnum.SYDJ.getCode(), 1);
// jgUseRegistration.setApplyNo(applicationFormCode.get(0));
// jgUseRegistration.setApplyNo(applicationFormCode.get(0));
// ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.SYDJ.getCode(), 1);
// ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.SYDJ.getCode(), 1);
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
getCode
.
get
(
String
.
valueOf
(
map
.
get
(
"businessCode"
))),
1
);
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
getCode
.
get
(
String
.
valueOf
(
map
.
get
(
"businessCode"
))),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
jgUseRegistration
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
jgUseRegistration
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
...
@@ -452,7 +454,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -452,7 +454,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
instanceId
=
map
.
get
(
"instanceId"
).
toString
();
instanceId
=
map
.
get
(
"instanceId"
).
toString
();
}
else
{
}
else
{
// 启动并执行流程
// 启动并执行流程
// instanceId = startByVariable();
// instanceId = startByVariable();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
ArrayList
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ArrayList
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
...
@@ -497,6 +499,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -497,6 +499,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
commonServiceImpl
.
buildTaskModel
(
list
);
commonServiceImpl
.
buildTaskModel
(
list
);
}
}
return
this
.
baseMapper
.
getDetailById
(
jgUseRegistration
.
getSequenceNbr
());
return
this
.
baseMapper
.
getDetailById
(
jgUseRegistration
.
getSequenceNbr
());
}
catch
(
BadRequest
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
throw
e
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
throw
new
BadRequest
(
"使用登记保存失败!"
);
}
finally
{
FlowingEquipRedisContext
.
clean
();
}
}
private
void
rollBackForDelRedisData
()
{
FlowingEquipRedisContext
.
getContext
().
forEach
(
e
->
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
delDataForCheckWithKey
(
e
.
getData
(),
e
.
getRedisKey
());
});
}
}
private
void
checkForRepeatUsedEquip
(
JSONObject
map
,
ReginParams
reginParams
)
{
private
void
checkForRepeatUsedEquip
(
JSONObject
map
,
ReginParams
reginParams
)
{
...
@@ -505,6 +524,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -505,6 +524,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
}
}
private
void
checkForRepeatUsedEquip
(
JSONObject
map
,
List
<
Map
<
String
,
Object
>>
equList
,
ReginParams
reginParams
)
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
equList
.
forEach
(
equip
->
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
equipRepeatUsedCheck
(
equip
.
get
(
"record"
).
toString
(),
reginParams
.
getCompany
().
getCompanyCode
());
});
}
}
/**
/**
* 按单位办理
* 按单位办理
*
*
...
@@ -512,6 +539,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -512,6 +539,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @return list
* @return list
*/
*/
private
List
<
Map
<
String
,
Object
>>
handleUnitUseRegistration
(
JSONObject
map
)
{
private
List
<
Map
<
String
,
Object
>>
handleUnitUseRegistration
(
JSONObject
map
)
{
try
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
CompanyBo
company
=
reginParams
.
getCompany
();
CompanyBo
company
=
reginParams
.
getCompany
();
...
@@ -522,6 +550,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -522,6 +550,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
count
()
!=
1
)
{
.
count
()
!=
1
)
{
throw
new
BadRequest
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
?
"请选择设备信息!"
:
"请选择相同设备种类!"
);
throw
new
BadRequest
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
?
"请选择设备信息!"
:
"请选择相同设备种类!"
);
}
}
// 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况)
checkForRepeatUsedEquip
(
map
,
equipmentLists
,
reginParams
);
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
idxBizJgInspectionDetectionInfoService
.
checkInspectionInfo
(
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
idxBizJgInspectionDetectionInfoService
.
checkInspectionInfo
(
equipmentLists
.
stream
()
equipmentLists
.
stream
()
.
map
(
v
->
(
String
)
v
.
get
(
"record"
))
.
map
(
v
->
(
String
)
v
.
get
(
"record"
))
...
@@ -659,6 +689,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -659,6 +689,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 设备数据存历史数据,在流程完成时使用
// 设备数据存历史数据,在流程完成时使用
updateHistory
(
map
,
null
,
String
.
valueOf
(
useRegistration
.
getSequenceNbr
()),
useRegistration
.
getSupervisoryCode
());
updateHistory
(
map
,
null
,
String
.
valueOf
(
useRegistration
.
getSequenceNbr
()),
useRegistration
.
getSupervisoryCode
());
return
this
.
baseMapper
.
getDetailById
(
useRegistration
.
getSequenceNbr
());
return
this
.
baseMapper
.
getDetailById
(
useRegistration
.
getSequenceNbr
());
}
catch
(
BadRequest
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
throw
e
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
throw
new
BadRequest
(
"使用登记保存失败!"
);
}
finally
{
FlowingEquipRedisContext
.
clean
();
}
}
}
/**
/**
...
@@ -1142,7 +1183,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1142,7 +1183,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
}
}
private
void
clearDataForCheckEquipRepeatUsed
(
JgUseRegistration
useRegistration
){
private
void
clearDataForCheckEquipRepeatUsed
(
JgUseRegistration
useRegistration
)
{
// 新查询原因 useRegistration 数据状态是旧的
// 新查询原因 useRegistration 数据状态是旧的
JgUseRegistration
useRegistrationDb
=
this
.
getById
(
useRegistration
.
getSequenceNbr
());
JgUseRegistration
useRegistrationDb
=
this
.
getById
(
useRegistration
.
getSequenceNbr
());
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
...
@@ -1150,9 +1191,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1150,9 +1191,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
lambda
.
select
(
JgUseRegistrationEq:
:
getEquId
);
lambda
.
select
(
JgUseRegistrationEq:
:
getEquId
);
List
<
JgUseRegistrationEq
>
eqList
=
jgRelationEquipMapper
.
selectList
(
lambda
);
List
<
JgUseRegistrationEq
>
eqList
=
jgRelationEquipMapper
.
selectList
(
lambda
);
// 在使用单位待提交、一级受理已驳回、使用单位已撤回后清除关联的设备,保证可以再次新提单子选择相同的设备进行提交及原有单子的提交校验数据准备
// 在使用单位待提交、一级受理已驳回、使用单位已撤回后清除关联的设备,保证可以再次新提单子选择相同的设备进行提交及原有单子的提交校验数据准备
if
(
NOT_FLOWING_STATE
.
contains
(
useRegistrationDb
.
getStatus
()))
{
if
(
NOT_FLOWING_STATE
.
contains
(
useRegistrationDb
.
getStatus
()))
{
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
delDataForCheckEquipRepeatUsed
(
records
,
useRegistration
.
getUseUnitCreditCode
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
delDataForCheckEquipRepeatUsed
(
records
,
useRegistration
.
getUseUnitCreditCode
());
}
}
}
}
...
@@ -1192,7 +1233,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1192,7 +1233,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jsonObject
.
remove
(
"equipmentLists"
);
jsonObject
.
remove
(
"equipmentLists"
);
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
List
<
DictionarieValueModel
>
fillingMedium
=
Systemctl
.
dictionarieClient
.
dictValues
(
"FILLING_MEDIUM"
).
getResult
();
List
<
DictionarieValueModel
>
fillingMedium
=
Systemctl
.
dictionarieClient
.
dictValues
(
"FILLING_MEDIUM"
).
getResult
();
Map
<
String
,
Object
>
fillingMediumMap
=
fillingMedium
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
Map
<
String
,
Object
>
fillingMediumMap
=
fillingMedium
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
List
<
Map
<
String
,
Object
>>
result
=
jgUseRegistrationMapper
.
queryForUnitVesselEquipment
(
records
);
List
<
Map
<
String
,
Object
>>
result
=
jgUseRegistrationMapper
.
queryForUnitVesselEquipment
(
records
);
result
.
forEach
(
i
->
{
result
.
forEach
(
i
->
{
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
...
...
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 @
bb4feabb
...
@@ -107,4 +107,16 @@ public class UseRegisterEquipUsedCheckImpl implements IEquipUsedCheck {
...
@@ -107,4 +107,16 @@ public class UseRegisterEquipUsedCheckImpl implements IEquipUsedCheck {
rBucket
.
set
(
Arrays
.
stream
(
c
.
getRecords
().
split
(
","
)).
collect
(
Collectors
.
toSet
()));
rBucket
.
set
(
Arrays
.
stream
(
c
.
getRecords
().
split
(
","
)).
collect
(
Collectors
.
toSet
()));
});
});
}
}
@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