add 分标委翻译

This commit is contained in:
liao
2023-11-16 10:28:18 +08:00
parent 44036df8b6
commit d474aef1af
3 changed files with 29 additions and 6 deletions
@@ -291,11 +291,21 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl<LawsAsmsOpenApiMappe
// 如果是分标委
List<Map<String, String>> mapList = asmsPostUtil.sendGetReq(lawsAsmsOpenApi.getApiUrl(), map);
List<LawsStandardization> lawsStandardizationList = new ArrayList();
LawsStandardization parent = lawsStandardizationService.getById("0");
LambdaQueryWrapper<LawsStandardization> parentQueryWrapper = new LambdaQueryWrapper<>();
parentQueryWrapper.eq(LawsStandardization::getPid, "0");
List<LawsStandardization> parentList = lawsStandardizationService.list(parentQueryWrapper);
String parentId;
if (CollectionUtils.isEmpty(parentList)) {
parentId = "0";
} else {
parentId = parentList.get(0).getId();
}
mapList.forEach(eMap -> {
LawsStandardization lawsStandardization = new LawsStandardization();
lawsStandardization.setStandardizationType("分标委");
lawsStandardization.setPid(parent.getId());
lawsStandardization.setPid(parentId);
eMap.forEach((k,v) -> {
if ("code".equals(k)) {
lawsStandardization.setNum(v);
@@ -96,8 +96,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 BIDDING_COMMITTEE = "bidding_committee";
// 代替标准号
public static final String REPLACED_STANDARD = "substitute_standard_number";
@@ -437,6 +437,11 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
resultMap.put(key + FieldCommon._DICT_TEXT, StringUtils.join(fileList.stream()
.map(OSSFile::getFileName).collect(Collectors.toList()), ","));
}
} else if (FieldCommon.BIDDING_COMMITTEE.equals(key) && StringUtils.isNotBlank(value)) {
// 如果是分标委
LawsStandardization lawsStandardization = lawsStandardizationService.getById(value);
resultMap.put(key, value);
resultMap.put(key + FieldCommon._DICT_TEXT, lawsStandardization.getName());
}
}
@@ -2111,10 +2116,18 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
**/
@Override
public List<LawsDictModel> getBiddingCommittee() {
LawsStandardization parent = lawsStandardizationService.getById("0");
LambdaQueryWrapper<LawsStandardization> parentQueryWrapper = new LambdaQueryWrapper<>();
parentQueryWrapper.eq(LawsStandardization::getPid, "0");
List<LawsStandardization> parentList = lawsStandardizationService.list(parentQueryWrapper);
if (CollectionUtils.isEmpty(parentList)) {
return new ArrayList<>();
}
List<String> parentIds = parentList.stream().map(LawsStandardization::getId).collect(Collectors.toList());
LambdaQueryWrapper<LawsStandardization> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(LawsStandardization::getPid, parent.getId());
queryWrapper.in(LawsStandardization::getPid, parentIds);
List<LawsStandardization> standardizationList = lawsStandardizationService.list(queryWrapper);
List<LawsDictModel> lawsDictModelList = new ArrayList<>();
standardizationList.forEach(standardization -> {
LawsDictModel lawsDictModel = new LawsDictModel();