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.time.LocalDate;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
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) {
List<SysDictItem> dictItemList = getDictItemList(fieldList);
List<Map<String, Object>> resultMapList = new ArrayList<>();
for (Map<String, Object> map : records) {
List<Map<String, Object>> resultMapList = new CopyOnWriteArrayList<>();
records.parallelStream().forEach(map->{
Map<String, Object> resultMap = new LinkedHashMap<>();
String id = (String) map.get("id");
String standardNumber = (String) map.get(FieldCommon.STANDARD_NUMBER);
@@ -642,7 +643,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
processSpecificFieldValue(resultMap, key, value, id, standardNumber, fieldList);
}
resultMapList.add(resultMap);
}
});
return resultMapList;
}
@@ -2044,12 +2045,19 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 体系
String standardSystem = (String) parameterMap.get(FieldCommon.STANDARD_SYSTEM);
if (StrUtil.isNotBlank(standardSystem)) {
idSearch = true;
LambdaQueryWrapper<LawsNodeRelation> standSystemWrapper = new LambdaQueryWrapper<>();
List<String> standSystemIdList = Arrays.asList(standardSystem.split(","));
standSystemWrapper.in(LawsNodeRelation::getNodeId, standSystemIdList);
List<LawsNodeRelation> systemList = lawsNodeRelationService.list(standSystemWrapper);
idSet.addAll(systemList.stream().map(LawsNodeRelation::getUniqueRelationFlag).collect(Collectors.toSet()));
if (FieldCommon.MY_COLLECTION.equals(standardSystem)) {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
selectCondition.append(" and id in (select distinct standard_id from laws_standard_collection" +
" where collector_id = '" + loginUser.getId() + "')");
} else {
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);
}
Set<String> listIntersection = new HashSet<>();
@@ -1391,6 +1391,11 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
.map(SarFileSplitItemsValEO::getItemContent)
.collect(Collectors.joining("\n\r"));
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<>();
clauseSheet.put(NormalExcelConstants.CLASS, LawsHomeAdvancedSearchClauseExcelVO.class);
ExportParams exportParamss = new ExportParams(null,
lawsHomeAdvancedSearchClauseVO.getStandardNumber().replace("/"," ")
.replace("\\"," ").replace("?"," ")
.replace("*"," ").replace("["," ")
.replace("]"," ").replace(":"," "));
lawsHomeAdvancedSearchClauseVO.getStandardNumber().replace("/","")
.replace("\\","").replace("?","")
.replace("*","").replace("[","")
.replace("]","").replace(":",""));
exportParamss.setType(ExcelType.XSSF);
clauseSheet.put(NormalExcelConstants.PARAMS, exportParamss);
clauseSheet.put(NormalExcelConstants.DATA_LIST, lawsHomeAdvancedSearchClauseExcelVOS);
@@ -48,8 +48,8 @@ public class LawsHomeAdvancedSearchExportExcelVO implements Serializable {
* 实施日期
*/
@ApiModelProperty(value = "实施日期")
@Excel(name = "实施日期", width = 20, format = "yyyy-MM-dd")
private Date implementationDate;
@Excel(name = "实施日期", width = 20)
private String implementationDate;
/**
* 在产车实施日期
* */