diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoMapper.xml index e5d78dfa..2a429f0e 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoMapper.xml @@ -23,9 +23,9 @@ list_name, group_concat(s.standard_number order by s.create_by) referenceStandard, (select group_concat(os.country_or_region order by s.create_by) - from laws_custom_compare_info_standard s - left join laws_overseas_standard os on s.standard_id = os.id and s.standard_type = '2' and os.del_flag = 0 - where s.del_flag = 0 + from laws_custom_compare_info_standard s1 + left join laws_overseas_standard os on s1.standard_id = os.id and s1.standard_type = '2' and os.del_flag = 0 + where s1.del_flag = 0 and s1.info_id = i.id ) referenceCountry, is_show, concat(u.realname, '(', u.username, ')') author, @@ -35,8 +35,8 @@ i.update_time, i.del_flag from laws_custom_compare_info i - left join laws_custom_compare_info_standard s on i.id = s.info_id - left join sys_user u on i.create_by = u.username + left join laws_custom_compare_info_standard s on i.id = s.info_id and s.del_flag = 0 + left join sys_user u on i.create_by = u.username and u.del_flag = 0 ${ew.customSqlSegment} group by i.id diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java index 645dcda9..4bb05f55 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java @@ -194,6 +194,7 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl standardVOS = queryStandardList(standardVO); List lawsCustomCompareInfoStandards = BeanCopyUtils.copyBeanList(standardVOS, LawsCustomCompareInfoStandard.class); for (LawsCustomCompareInfoStandard lawsCustomCompareInfoStandard : lawsCustomCompareInfoStandards) { + String standardId = lawsCustomCompareInfoStandard.getId(); String snowflakeId = String.valueOf(SnowflakeUtils.snowflake()); // 自定义对比单元格数据更新 lawsCustomCompareCellService.update( @@ -204,7 +205,7 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl sysDictItemList = getDicItem("country_or_region"); + Map> countryMap = getCountryMap(infoId, standardVOList); + tableDetailVO.setCountryMap(countryMap); + }else { + Map> countryMap = new HashMap<>(); + tableDetailVO.setCountryMap(countryMap); + } + } - // 按国家/地区分组 - Map> countryMap = standardVOList.stream() - .map(v -> { - v.setInfoId(infoId); - // 字典翻译 - String countryOrRegion = v.getCountryOrRegion(); - if (StringUtils.isNotBlank(countryOrRegion)){ - List list = Arrays.asList(countryOrRegion.split(",")); - List sysDictItems = sysDictItemList.stream() - .filter(o -> list - .contains(o.getItemValue())).map(SysDictItem::getItemText).collect(Collectors.toList()); - if (!sysDictItems.isEmpty()){ - v.setCountryOrRegion(String.join(",", sysDictItems)); - } + @NotNull + private Map> getCountryMap(String infoId, List standardVOList) { + // 获取字典 + List sysDictItemList = getDicItem("country_or_region"); + // 按国家/地区分组 + List countryMap = standardVOList.stream() + .map(v -> { + v.setInfoId(infoId); + // 字典翻译 + String countryOrRegion = v.getCountryOrRegion(); + if (StringUtils.isNotBlank(countryOrRegion)) { + List list = Arrays.asList(countryOrRegion.split(",")); + List sysDictItems = sysDictItemList.stream() + .filter(o -> list + .contains(o.getItemValue())).map(SysDictItem::getItemText).collect(Collectors.toList()); + if (!sysDictItems.isEmpty()) { + v.setCountryOrRegion(String.join(",", sysDictItems)); }else { v.setCountryOrRegion(""); } - return v; - }) - .collect(Collectors.groupingBy(StandardVO::getCountryOrRegion)); - tableDetailVO.setCountryMap(countryMap); - } + } else { + v.setCountryOrRegion(""); + } + return v; + }).collect(Collectors.toList()); + return countryMap.stream().collect(Collectors.groupingBy(StandardVO::getCountryOrRegion)); } private List getDicItem(String dicCode) {