Commit 1f7048dc by zhangxingmin

push

parent 8408dc4c
......@@ -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);
......
......@@ -41,6 +41,11 @@ public class ApiAttributeSettingDto {
private String valueNames;
/**
* 字段值编码(多个值存在的情况用分号分隔的;)
*/
private String valueCodes;
/**
* 是否自定义 0-否 1-是
*/
private String isCustomize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment