Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-product
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-product
Commits
e218feb6
Commit
e218feb6
authored
Jan 23, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
1f7048dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiAttributeSettingServiceImpl.java
+21
-5
No files found.
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiAttributeSettingServiceImpl.java
View file @
e218feb6
...
@@ -104,11 +104,23 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
...
@@ -104,11 +104,23 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
try
{
try
{
Result
<
List
<
ApiFieldValueDetailResponse
>>
result
=
apiFieldValueFeignClient
.
list
(
request
);
Result
<
List
<
ApiFieldValueDetailResponse
>>
result
=
apiFieldValueFeignClient
.
list
(
request
);
if
(
result
!=
null
&&
result
.
getCode
()
==
200
&&
!
CollectionUtils
.
isEmpty
(
result
.
getData
()))
{
if
(
result
!=
null
&&
result
.
getCode
()
==
200
&&
!
CollectionUtils
.
isEmpty
(
result
.
getData
()))
{
log
.
info
(
"查询到字段值详情数量: {}"
,
result
.
getData
().
size
());
// 构建映射关系:字段值业务ID -> 字段值名称 和 字段值业务ID -> 字段值编码
// 构建映射关系:字段值业务ID -> 字段值名称 和 字段值业务ID -> 字段值编码
for
(
ApiFieldValueDetailResponse
response
:
result
.
getData
())
{
for
(
ApiFieldValueDetailResponse
response
:
result
.
getData
())
{
log
.
debug
(
"字段值详情 - fieldValueBizId: {}, fieldValueCode: {}, value: {}"
,
response
.
getFieldValueBizId
(),
response
.
getFieldValueCode
(),
response
.
getValue
());
fieldValueBizIdToNameMap
.
put
(
response
.
getFieldValueBizId
(),
response
.
getValue
());
fieldValueBizIdToNameMap
.
put
(
response
.
getFieldValueBizId
(),
response
.
getValue
());
fieldValueBizIdToCodeMap
.
put
(
response
.
getFieldValueBizId
(),
response
.
getFieldValueCode
());
// 如果fieldValueCode为空,则使用fieldValueBizId作为备用值
String
fieldValueCode
=
StringUtils
.
isNotBlank
(
response
.
getFieldValueCode
())
?
response
.
getFieldValueCode
()
:
response
.
getFieldValueBizId
();
fieldValueBizIdToCodeMap
.
put
(
response
.
getFieldValueBizId
(),
fieldValueCode
);
}
}
log
.
info
(
"字段值编码映射表: {}"
,
fieldValueBizIdToCodeMap
);
}
else
{
}
else
{
log
.
warn
(
"查询字段值详情失败,fieldValueBizIdList: {}"
,
distinctFieldValueBizIds
);
log
.
warn
(
"查询字段值详情失败,fieldValueBizIdList: {}"
,
distinctFieldValueBizIds
);
}
}
...
@@ -128,16 +140,20 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
...
@@ -128,16 +140,20 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
// 构建字段值名称(多个值用分号分隔)
// 构建字段值名称(多个值用分号分隔)
Map
<
String
,
String
>
finalFieldValueBizIdToNameMap
=
fieldValueBizIdToNameMap
;
Map
<
String
,
String
>
finalFieldValueBizIdToNameMap
=
fieldValueBizIdToNameMap
;
List
<
String
>
valueNames
=
valueBizIds
.
stream
()
List
<
String
>
valueNames
=
valueBizIds
.
stream
()
.
map
(
fieldValueBizId
->
.
map
(
fieldValueBizId
->
{
StringUtils
.
defaultIfBlank
(
finalFieldValueBizIdToNameMap
.
get
(
fieldValueBizId
),
fieldValueBizId
))
String
name
=
finalFieldValueBizIdToNameMap
.
get
(
fieldValueBizId
);
return
StringUtils
.
defaultIfBlank
(
name
,
fieldValueBizId
);
})
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
settingDto
.
setValueNames
(
StringUtils
.
join
(
valueNames
,
";"
));
settingDto
.
setValueNames
(
StringUtils
.
join
(
valueNames
,
";"
));
// 构建字段值编码(多个值用分号分隔)
// 构建字段值编码(多个值用分号分隔)
Map
<
String
,
String
>
finalFieldValueBizIdToCodeMap
=
fieldValueBizIdToCodeMap
;
Map
<
String
,
String
>
finalFieldValueBizIdToCodeMap
=
fieldValueBizIdToCodeMap
;
List
<
String
>
valueCodes
=
valueBizIds
.
stream
()
List
<
String
>
valueCodes
=
valueBizIds
.
stream
()
.
map
(
fieldValueBizId
->
.
map
(
fieldValueBizId
->
{
StringUtils
.
defaultIfBlank
(
finalFieldValueBizIdToCodeMap
.
get
(
fieldValueBizId
),
fieldValueBizId
))
String
code
=
finalFieldValueBizIdToCodeMap
.
get
(
fieldValueBizId
);
return
StringUtils
.
defaultIfBlank
(
code
,
fieldValueBizId
);
})
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
settingDto
.
setValueCodes
(
StringUtils
.
join
(
valueCodes
,
";"
));
settingDto
.
setValueCodes
(
StringUtils
.
join
(
valueCodes
,
";"
));
}
}
...
...
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