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
03e6d767
Commit
03e6d767
authored
Jan 23, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
e218feb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
6 deletions
+37
-6
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiAttributeSettingServiceImpl.java
+37
-6
No files found.
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiAttributeSettingServiceImpl.java
View file @
03e6d767
...
...
@@ -75,16 +75,43 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
for
(
int
i
=
0
;
i
<
attributeSettingList
.
size
();
i
++)
{
AttributeSetting
dto
=
attributeSettingList
.
get
(
i
);
if
(
StringUtils
.
isNotBlank
(
dto
.
getValue
()))
{
if
(
dto
.
getValue
().
contains
(
";"
))
{
// 首先尝试使用fieldValueBizId字段
String
fieldValueBizId
=
dto
.
getFieldValueBizId
();
if
(
StringUtils
.
isNotBlank
(
fieldValueBizId
))
{
// 如果fieldValueBizId不为空,使用它
if
(
fieldValueBizId
.
contains
(
";"
))
{
// 多选情况
List
<
String
>
fieldValueBizIdList
=
Arrays
.
asList
(
dto
.
getValue
()
.
split
(
";"
));
List
<
String
>
fieldValueBizIdList
=
Arrays
.
asList
(
fieldValueBizId
.
split
(
";"
));
allFieldValueBizIds
.
addAll
(
fieldValueBizIdList
);
settingDtoToValueBizIdsMap
.
put
(
String
.
valueOf
(
i
),
fieldValueBizIdList
);
}
else
{
// 单选情况,也需要查询,因为可能需要获取字段值名称
allFieldValueBizIds
.
add
(
dto
.
getValue
());
settingDtoToValueBizIdsMap
.
put
(
String
.
valueOf
(
i
),
Collections
.
singletonList
(
dto
.
getValue
()));
// 单选情况
allFieldValueBizIds
.
add
(
fieldValueBizId
);
settingDtoToValueBizIdsMap
.
put
(
String
.
valueOf
(
i
),
Collections
.
singletonList
(
fieldValueBizId
));
}
}
else
if
(
StringUtils
.
isNotBlank
(
dto
.
getValue
()))
{
// 如果fieldValueBizId为空,但value不为空,检查value是否可能是字段值业务ID
// 这里需要根据业务规则判断,比如字段值业务ID的格式通常是"field_value_"开头
String
value
=
dto
.
getValue
();
if
(
value
.
contains
(
";"
))
{
// 多选情况
List
<
String
>
fieldValueBizIdList
=
Arrays
.
asList
(
value
.
split
(
";"
));
// 过滤出可能是字段值业务ID的值
List
<
String
>
validFieldValueBizIds
=
fieldValueBizIdList
.
stream
()
.
filter
(
v
->
v
.
startsWith
(
"field_value_"
)
||
v
.
startsWith
(
"insurance_company_"
)
||
v
.
startsWith
(
"reconciliation_company_"
))
.
collect
(
Collectors
.
toList
());
if
(!
validFieldValueBizIds
.
isEmpty
())
{
allFieldValueBizIds
.
addAll
(
validFieldValueBizIds
);
settingDtoToValueBizIdsMap
.
put
(
String
.
valueOf
(
i
),
validFieldValueBizIds
);
}
}
else
if
(
value
.
startsWith
(
"field_value_"
)
||
value
.
startsWith
(
"insurance_company_"
)
||
value
.
startsWith
(
"reconciliation_company_"
))
{
// 单选情况,且看起来像是字段值业务ID
allFieldValueBizIds
.
add
(
value
);
settingDtoToValueBizIdsMap
.
put
(
String
.
valueOf
(
i
),
Collections
.
singletonList
(
value
));
}
}
}
...
...
@@ -156,6 +183,10 @@ public class ApiAttributeSettingServiceImpl implements ApiAttributeSettingServic
})
.
collect
(
Collectors
.
toList
());
settingDto
.
setValueCodes
(
StringUtils
.
join
(
valueCodes
,
";"
));
}
else
{
// 如果没有字段值业务ID,则使用原始值
settingDto
.
setValueNames
(
dto
.
getValue
());
settingDto
.
setValueCodes
(
dto
.
getValue
());
}
apiAttributeSettingDtoList
.
add
(
settingDto
);
...
...
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