Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 76aea466
authored
Jun 20, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[fix] 修复存入 Redis 字典项类型错误的 bug
1 parent
df7adda4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
src/main/java/vion/config/FaultTypeConverter.java
src/main/java/vion/constant/RedisKeyEnum.java
src/main/java/vion/service/impl/DictionaryServiceImpl.java
src/main/java/vion/config/FaultTypeConverter.java
View file @
76aea46
...
...
@@ -20,7 +20,7 @@ public class FaultTypeConverter implements CustomWriteConverter<Integer, Object>
@Override
public
Object
convert
(
Integer
originalData
,
CustomWriteContext
customWriteContext
)
{
RMap
<
String
,
String
>
faultTypeMap
=
redissonClient
.
getMap
(
RedisKeyEnum
.
DICT_PREFIX
.
getVal
()
+
RedisKeyEnum
.
FAULT_TYPE
.
getVal
());
return
faultTypeMap
.
getOrDefault
(
originalData
.
toString
()
,
"故障类型不存在"
);
RMap
<
Integer
,
String
>
faultTypeMap
=
redissonClient
.
getMap
(
RedisKeyEnum
.
DICT_PREFIX
.
getVal
()
+
RedisKeyEnum
.
FAULT_TYPE
.
getVal
());
return
faultTypeMap
.
getOrDefault
(
originalData
,
"故障类型不存在"
);
}
}
src/main/java/vion/constant/RedisKeyEnum.java
View file @
76aea46
...
...
@@ -38,7 +38,7 @@ public enum RedisKeyEnum {
PRODUCT_LINE
(
"productLine"
),
CONSTRUCTION_STATUS
(
"constructionStatus"
),
DIFF_TYPE
(
"diffType"
),
OFFSET_ITEM
(
"offset
_i
tem"
),
OFFSET_ITEM
(
"offset
I
tem"
),
POINT_STATUS
(
"pointStatus"
),
REPAIR_STATUS
(
"repairStatus"
),
PROJECT_SIZE
(
"projectSize"
),
...
...
src/main/java/vion/service/impl/DictionaryServiceImpl.java
View file @
76aea46
...
...
@@ -21,7 +21,7 @@ public class DictionaryServiceImpl extends MPJBaseServiceImpl<DictionaryMapper,
@Override
public
void
syncDict
()
{
Opt
.
ofEmptyAble
(
this
.
list
())
.
map
(
l
->
l
.
stream
().
collect
(
Collectors
.
groupingBy
(
Dictionary:
:
getType
,
Collectors
.
toMap
(
d
->
d
.
getKey
().
toString
()
,
Dictionary:
:
getValue
))))
.
map
(
l
->
l
.
stream
().
collect
(
Collectors
.
groupingBy
(
Dictionary:
:
getType
,
Collectors
.
toMap
(
Dictionary:
:
getKey
,
Dictionary:
:
getValue
))))
.
ifPresent
(
m
->
m
.
forEach
((
type
,
map
)
->
redissonClient
.
getMap
(
RedisKeyEnum
.
DICT_PREFIX
.
getVal
()
+
RedisKeyEnum
.
getValByKey
(
type
)).
putAll
(
map
)));
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment