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
1f7048dc
Commit
1f7048dc
authored
Jan 23, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
8408dc4c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiAttributeSettingServiceImpl.java
+14
-7
yd-product-feign/src/main/java/com/yd/product/feign/response/productlaunch/ApiAttributeSettingDto.java
+5
-0
No files found.
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiAttributeSettingServiceImpl.java
View file @
1f7048dc
...
...
@@ -91,6 +91,7 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
//批量查询字段值详情
Map
<
String
,
String
>
fieldValueBizIdToNameMap
=
new
HashMap
<>();
Map
<
String
,
String
>
fieldValueBizIdToCodeMap
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
allFieldValueBizIds
))
{
// 去重
List
<
String
>
distinctFieldValueBizIds
=
allFieldValueBizIds
.
stream
()
...
...
@@ -103,13 +104,11 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
try
{
Result
<
List
<
ApiFieldValueDetailResponse
>>
result
=
apiFieldValueFeignClient
.
list
(
request
);
if
(
result
!=
null
&&
result
.
getCode
()
==
200
&&
!
CollectionUtils
.
isEmpty
(
result
.
getData
()))
{
// 构建映射关系:字段值业务ID -> 字段值名称
fieldValueBizIdToNameMap
=
result
.
getData
().
stream
()
.
collect
(
Collectors
.
toMap
(
ApiFieldValueDetailResponse:
:
getFieldValueBizId
,
ApiFieldValueDetailResponse:
:
getValue
,
(
existing
,
replacement
)
->
existing
));
// 构建映射关系:字段值业务ID -> 字段值名称 和 字段值业务ID -> 字段值编码
for
(
ApiFieldValueDetailResponse
response
:
result
.
getData
())
{
fieldValueBizIdToNameMap
.
put
(
response
.
getFieldValueBizId
(),
response
.
getValue
());
fieldValueBizIdToCodeMap
.
put
(
response
.
getFieldValueBizId
(),
response
.
getFieldValueCode
());
}
}
else
{
log
.
warn
(
"查询字段值详情失败,fieldValueBizIdList: {}"
,
distinctFieldValueBizIds
);
}
...
...
@@ -133,6 +132,14 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
StringUtils
.
defaultIfBlank
(
finalFieldValueBizIdToNameMap
.
get
(
fieldValueBizId
),
fieldValueBizId
))
.
collect
(
Collectors
.
toList
());
settingDto
.
setValueNames
(
StringUtils
.
join
(
valueNames
,
";"
));
// 构建字段值编码(多个值用分号分隔)
Map
<
String
,
String
>
finalFieldValueBizIdToCodeMap
=
fieldValueBizIdToCodeMap
;
List
<
String
>
valueCodes
=
valueBizIds
.
stream
()
.
map
(
fieldValueBizId
->
StringUtils
.
defaultIfBlank
(
finalFieldValueBizIdToCodeMap
.
get
(
fieldValueBizId
),
fieldValueBizId
))
.
collect
(
Collectors
.
toList
());
settingDto
.
setValueCodes
(
StringUtils
.
join
(
valueCodes
,
";"
));
}
apiAttributeSettingDtoList
.
add
(
settingDto
);
...
...
yd-product-feign/src/main/java/com/yd/product/feign/response/productlaunch/ApiAttributeSettingDto.java
View file @
1f7048dc
...
...
@@ -41,6 +41,11 @@ public class ApiAttributeSettingDto {
private
String
valueNames
;
/**
* 字段值编码(多个值存在的情况用分号分隔的;)
*/
private
String
valueCodes
;
/**
* 是否自定义 0-否 1-是
*/
private
String
isCustomize
;
...
...
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