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
Show 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>
...
@@ -20,7 +20,7 @@ public class FaultTypeConverter implements CustomWriteConverter<Integer, Object>
@Override
@Override
public
Object
convert
(
Integer
originalData
,
CustomWriteContext
customWriteContext
)
{
public
Object
convert
(
Integer
originalData
,
CustomWriteContext
customWriteContext
)
{
RMap
<
String
,
String
>
faultTypeMap
=
redissonClient
.
getMap
(
RedisKeyEnum
.
DICT_PREFIX
.
getVal
()
+
RedisKeyEnum
.
FAULT_TYPE
.
getVal
());
RMap
<
Integer
,
String
>
faultTypeMap
=
redissonClient
.
getMap
(
RedisKeyEnum
.
DICT_PREFIX
.
getVal
()
+
RedisKeyEnum
.
FAULT_TYPE
.
getVal
());
return
faultTypeMap
.
getOrDefault
(
originalData
.
toString
()
,
"故障类型不存在"
);
return
faultTypeMap
.
getOrDefault
(
originalData
,
"故障类型不存在"
);
}
}
}
}
src/main/java/vion/constant/RedisKeyEnum.java
View file @
76aea46
...
@@ -38,7 +38,7 @@ public enum RedisKeyEnum {
...
@@ -38,7 +38,7 @@ public enum RedisKeyEnum {
PRODUCT_LINE
(
"productLine"
),
PRODUCT_LINE
(
"productLine"
),
CONSTRUCTION_STATUS
(
"constructionStatus"
),
CONSTRUCTION_STATUS
(
"constructionStatus"
),
DIFF_TYPE
(
"diffType"
),
DIFF_TYPE
(
"diffType"
),
OFFSET_ITEM
(
"offset
_i
tem"
),
OFFSET_ITEM
(
"offset
I
tem"
),
POINT_STATUS
(
"pointStatus"
),
POINT_STATUS
(
"pointStatus"
),
REPAIR_STATUS
(
"repairStatus"
),
REPAIR_STATUS
(
"repairStatus"
),
PROJECT_SIZE
(
"projectSize"
),
PROJECT_SIZE
(
"projectSize"
),
...
...
src/main/java/vion/service/impl/DictionaryServiceImpl.java
View file @
76aea46
...
@@ -21,7 +21,7 @@ public class DictionaryServiceImpl extends MPJBaseServiceImpl<DictionaryMapper,
...
@@ -21,7 +21,7 @@ public class DictionaryServiceImpl extends MPJBaseServiceImpl<DictionaryMapper,
@Override
@Override
public
void
syncDict
()
{
public
void
syncDict
()
{
Opt
.
ofEmptyAble
(
this
.
list
())
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
)));
.
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