From 60da7c7903dbbfe03e1bb741709a5ac6959256dc Mon Sep 17 00:00:00 2001 From: liao Date: Thu, 19 Oct 2023 16:22:12 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=A0=87=E5=87=86=E6=B3=95=E8=A7=84?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=8B=86=E5=88=86id=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/LawsCommonServiceImpl.java | 48 ++++++++----------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java index 1dabcd9d..57b13bbd 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java @@ -169,8 +169,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService { } // 是否收藏判断标识 collectionFlag(infoPage.getRecords()); - // 标准拆分标识 - splitFlag(infoPage.getRecords()); // 待处理 return infoPage; @@ -181,40 +179,30 @@ public class LawsCommonServiceImpl implements ILawsCommonService { * @Date: 2023/10/19 15:36 * @Description: 标准拆分标识 **/ - private void splitFlag(List> records) { - // 获取全部id集合 - List ids = records.stream().map(kv -> - String.valueOf(kv.get("id"))).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(ids)) return; - + private void splitFlag(Map map) { + String id = (String) map.get("id"); // 查询标准拆分表 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.in(SarFileSplitInfoEO::getStandardId, ids); + queryWrapper.eq(SarFileSplitInfoEO::getStandardId, id); queryWrapper.isNotNull(SarFileSplitInfoEO::getPublishBeforeId); queryWrapper.isNotNull(SarFileSplitInfoEO::getFileType); List sarFileSplitInfoEOList = sarFileSplitInfoService.list(queryWrapper); - if (CollectionUtils.isEmpty(sarFileSplitInfoEOList)) { - return; - } - Map flagMap = new HashMap<>(); - sarFileSplitInfoEOList.forEach(e -> flagMap.put(e.getStandardId() + "," + e.getFileType(), e.getId())); - records.forEach(map -> { - String id = (String) map.get("id"); - map.put(FieldCommon.FILE_PUBLISH_OF_ORIGINAL + FieldCommon._STANDARD_SPLIT, - flagMap.get(id + "," + FieldCommon.FILE_PUBLISH_OF_ORIGINAL)); - map.put(FieldCommon.FILE_MODIFICATION_LIST + FieldCommon._STANDARD_SPLIT, - flagMap.get(id + "," + FieldCommon.FILE_MODIFICATION_LIST)); - map.put(FieldCommon.FILE_DRAFT_FOR_REVIEW + FieldCommon._STANDARD_SPLIT, - flagMap.get(id + "," + FieldCommon.FILE_DRAFT_FOR_REVIEW)); - map.put(FieldCommon.FILE_DRAFT_FOR_APPROVAL + FieldCommon._STANDARD_SPLIT, - flagMap.get(id + "," + FieldCommon.FILE_DRAFT_FOR_APPROVAL)); - map.put(FieldCommon.FILE_DRAFT_FOR_COMMENT + FieldCommon._STANDARD_SPLIT, - flagMap.get(id + "," + FieldCommon.FILE_DRAFT_FOR_COMMENT)); - map.put(FieldCommon.FILE_DRAFT + FieldCommon._STANDARD_SPLIT, - flagMap.get(id + "," + FieldCommon.FILE_DRAFT)); - }); + sarFileSplitInfoEOList.forEach(e -> flagMap.put(e.getFileType(), e.getId())); + + map.put(FieldCommon.FILE_PUBLISH_OF_ORIGINAL + FieldCommon._STANDARD_SPLIT, + flagMap.get(FieldCommon.FILE_PUBLISH_OF_ORIGINAL)); + map.put(FieldCommon.FILE_MODIFICATION_LIST + FieldCommon._STANDARD_SPLIT, + flagMap.get(FieldCommon.FILE_MODIFICATION_LIST)); + map.put(FieldCommon.FILE_DRAFT_FOR_REVIEW + FieldCommon._STANDARD_SPLIT, + flagMap.get(FieldCommon.FILE_DRAFT_FOR_REVIEW)); + map.put(FieldCommon.FILE_DRAFT_FOR_APPROVAL + FieldCommon._STANDARD_SPLIT, + flagMap.get(FieldCommon.FILE_DRAFT_FOR_APPROVAL)); + map.put(FieldCommon.FILE_DRAFT_FOR_COMMENT + FieldCommon._STANDARD_SPLIT, + flagMap.get(FieldCommon.FILE_DRAFT_FOR_COMMENT)); + map.put(FieldCommon.FILE_DRAFT + FieldCommon._STANDARD_SPLIT, + flagMap.get(FieldCommon.FILE_DRAFT)); } @Override @@ -1041,6 +1029,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService { stringObjectMap.put("checkList", list); } + // 标准拆分标识 + splitFlag(stringObjectMap); // 对返回的字段做处理 return stringObjectMap; }