This commit is contained in:
2024-09-20 15:14:04 +08:00
3 changed files with 28 additions and 15 deletions
@@ -92,6 +92,7 @@ import java.nio.file.Path;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
@@ -621,8 +622,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
**/ **/
private List<Map<String, Object>> processResultMapPageList(List<Map<String, Object>> records, List<LawsTag> fieldList) { private List<Map<String, Object>> processResultMapPageList(List<Map<String, Object>> records, List<LawsTag> fieldList) {
List<SysDictItem> dictItemList = getDictItemList(fieldList); List<SysDictItem> dictItemList = getDictItemList(fieldList);
List<Map<String, Object>> resultMapList = new ArrayList<>(); List<Map<String, Object>> resultMapList = new CopyOnWriteArrayList<>();
for (Map<String, Object> map : records) { records.parallelStream().forEach(map->{
Map<String, Object> resultMap = new LinkedHashMap<>(); Map<String, Object> resultMap = new LinkedHashMap<>();
String id = (String) map.get("id"); String id = (String) map.get("id");
String standardNumber = (String) map.get(FieldCommon.STANDARD_NUMBER); String standardNumber = (String) map.get(FieldCommon.STANDARD_NUMBER);
@@ -642,7 +643,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
processSpecificFieldValue(resultMap, key, value, id, standardNumber, fieldList); processSpecificFieldValue(resultMap, key, value, id, standardNumber, fieldList);
} }
resultMapList.add(resultMap); resultMapList.add(resultMap);
} });
return resultMapList; return resultMapList;
} }
@@ -2044,12 +2045,19 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 体系 // 体系
String standardSystem = (String) parameterMap.get(FieldCommon.STANDARD_SYSTEM); String standardSystem = (String) parameterMap.get(FieldCommon.STANDARD_SYSTEM);
if (StrUtil.isNotBlank(standardSystem)) { if (StrUtil.isNotBlank(standardSystem)) {
idSearch = true; if (FieldCommon.MY_COLLECTION.equals(standardSystem)) {
LambdaQueryWrapper<LawsNodeRelation> standSystemWrapper = new LambdaQueryWrapper<>(); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> standSystemIdList = Arrays.asList(standardSystem.split(",")); selectCondition.append(" and id in (select distinct standard_id from laws_standard_collection" +
standSystemWrapper.in(LawsNodeRelation::getNodeId, standSystemIdList); " where collector_id = '" + loginUser.getId() + "')");
List<LawsNodeRelation> systemList = lawsNodeRelationService.list(standSystemWrapper); } else {
idSet.addAll(systemList.stream().map(LawsNodeRelation::getUniqueRelationFlag).collect(Collectors.toSet())); List<String> standardSystemList = Arrays.asList(standardSystem.split(","));
String str = String.join(",",standardSystemList).replace(",","','");
selectCondition.append(" and id in (select distinct l2.unique_relation_flag from " +
" (select node_code from laws_node_relation where node_id in ('")
.append(str).append("') ")
.append(" group by node_code) l1 left join laws_node_relation l2 " +
" on l2.node_code like CONCAT(l1.node_code,'%')) ");
}
parameterMap.remove(FieldCommon.STANDARD_SYSTEM); parameterMap.remove(FieldCommon.STANDARD_SYSTEM);
} }
Set<String> listIntersection = new HashSet<>(); Set<String> listIntersection = new HashSet<>();
@@ -1391,6 +1391,11 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
.map(SarFileSplitItemsValEO::getItemContent) .map(SarFileSplitItemsValEO::getItemContent)
.collect(Collectors.joining("\n\r")); .collect(Collectors.joining("\n\r"));
lawsHomeAdvancedSearchClauseExcelVO.setItemContent(itemContents); lawsHomeAdvancedSearchClauseExcelVO.setItemContent(itemContents);
String translation = sarFileSplitItemsValEOS.stream()
.filter(v -> StringUtils.isNotBlank(v.getTranslation()))
.map(SarFileSplitItemsValEO::getTranslation)
.collect(Collectors.joining("\n\r"));
lawsHomeAdvancedSearchClauseExcelVO.setTranslation(translation);
} }
}); });
@@ -1398,10 +1403,10 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
Map<String, Object> clauseSheet = new HashMap<>(); Map<String, Object> clauseSheet = new HashMap<>();
clauseSheet.put(NormalExcelConstants.CLASS, LawsHomeAdvancedSearchClauseExcelVO.class); clauseSheet.put(NormalExcelConstants.CLASS, LawsHomeAdvancedSearchClauseExcelVO.class);
ExportParams exportParamss = new ExportParams(null, ExportParams exportParamss = new ExportParams(null,
lawsHomeAdvancedSearchClauseVO.getStandardNumber().replace("/"," ") lawsHomeAdvancedSearchClauseVO.getStandardNumber().replace("/","")
.replace("\\"," ").replace("?"," ") .replace("\\","").replace("?","")
.replace("*"," ").replace("["," ") .replace("*","").replace("[","")
.replace("]"," ").replace(":"," ")); .replace("]","").replace(":",""));
exportParamss.setType(ExcelType.XSSF); exportParamss.setType(ExcelType.XSSF);
clauseSheet.put(NormalExcelConstants.PARAMS, exportParamss); clauseSheet.put(NormalExcelConstants.PARAMS, exportParamss);
clauseSheet.put(NormalExcelConstants.DATA_LIST, lawsHomeAdvancedSearchClauseExcelVOS); clauseSheet.put(NormalExcelConstants.DATA_LIST, lawsHomeAdvancedSearchClauseExcelVOS);
@@ -48,8 +48,8 @@ public class LawsHomeAdvancedSearchExportExcelVO implements Serializable {
* 实施日期 * 实施日期
*/ */
@ApiModelProperty(value = "实施日期") @ApiModelProperty(value = "实施日期")
@Excel(name = "实施日期", width = 20, format = "yyyy-MM-dd") @Excel(name = "实施日期", width = 20)
private Date implementationDate; private String implementationDate;
/** /**
* 在产车实施日期 * 在产车实施日期
* */ * */