update 零部件字典翻译

This commit is contained in:
liao
2023-09-27 11:05:27 +08:00
parent b2cadd8134
commit 39c600bbff
3 changed files with 11 additions and 5 deletions
@@ -73,6 +73,8 @@ public class FieldCommon {
public static final String STANDARD_SYSTEM = "standard_system";
// 标准类别
public static final String STANDARD_CLASS = "standard_class";
// 零部件名称
public static final String PART_NAME = "part_name";
// 代替标准号
public static final String REPLACED_STANDARD = "substitute_standard_number";
@@ -47,8 +47,6 @@ public interface ILawsCommonService {
*/
List<LawsTag> getExportHeaderWithFile(Map<String, Object> parameterMap);
/**
* @Author: liao
* @Date: 2023/8/24 9:09
@@ -303,7 +303,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 对返回的字段值做处理
processResultFieldValue(key, value, fieldList, resultMap, dictItemList);
}
processSpecificFieldValue(resultMap, key, id, standardNumber, fieldList);
processSpecificFieldValue(resultMap, key, value, id, standardNumber, fieldList);
}
return resultMap;
}
@@ -313,7 +313,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
* @Date: 2023/9/19 13:43
* @Description: 查询返回特殊值处理
**/
private void processSpecificFieldValue(Map<String, Object> resultMap, String key,
private void processSpecificFieldValue(Map<String, Object> resultMap, String key, String value,
String id, String standardNumber, List<LawsTag> fieldList) {
List<LawsTag> lawsTagList = fieldList.stream().filter(lawsTag ->
key.equals(lawsTag.getDbFieldName())).collect(Collectors.toList());
@@ -359,6 +359,12 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
resultMap.put(key + FieldCommon._DICT_TEXT, StringUtils.join(fileList.stream()
.map(OSSFile::getFileName).collect(Collectors.toList()), ","));
}
} else if (FieldCommon.PART_NAME.equals(key)) {
// 如果是零部件名称(存的是id,数据源为其他系统,目前用字典做代替)
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysDictItem::getId, value);
SysDictItem dictItem = sysDictItemService.getOne(queryWrapper);
resultMap.put(key + FieldCommon._DICT_TEXT, dictItem.getItemText());
}
}
@@ -388,7 +394,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 对返回的字段值做处理
processResultFieldValue(key, value, fieldList, resultMap, dictItemList);
}
processSpecificFieldValue(resultMap, key, id, standardNumber, fieldList);
processSpecificFieldValue(resultMap, key, value, id, standardNumber, fieldList);
}
resultMapList.add(resultMap);
}