Explorar el Código

Merge branch 'wyp/0103-articleDeleteHtml' of Server/long-article-recommend into master

wangyunpeng hace 6 meses
padre
commit
36a52ec950

+ 65 - 65
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleAuditService.java

@@ -672,76 +672,76 @@ public class ArticleAuditService {
         List<PublishAccountTypeDTO> accountTypeList = aigcBaseMapper.getAccountTypeList(ghIds);
         Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
                 .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
-        List<PublishAccount> publishAccountList = publishAccountRepository.getAllByGhIdIn(ghIds);
-        Map<String, PublishAccount> publishAccountMap = publishAccountList.stream().collect(Collectors.toMap(PublishAccount::getGhId, o -> o));
-        // 获取发布内容
-        List<PublishContentParam> publishContentParamList = list.stream().map(article -> {
-            PublishContentParam item = new PublishContentParam();
-            item.setTitle(article.getTitle());
-            PublishAccount account = publishAccountMap.get(article.getGhId());
-            if (Objects.nonNull(account)) {
-                item.setPublishAccountId(account.getId());
-                return item;
-            }
-            return null;
-        }).filter(Objects::nonNull).collect(Collectors.toList());
-        List<PublishContentDTO> publishContents = new ArrayList<>();
-        for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 100)) {
-            publishContents.addAll(aigcBaseMapper.getPublishContentByTitle(partitions));
-        }
-        Map<String, Map<String, Map<Long, PublishContentDTO>>> publishContentMap = publishContents.stream()
-                .filter(o -> Objects.nonNull(o.getPublishTimestamp()))
-                .sorted(Comparator.comparingLong(PublishContentDTO::getPublishTimestamp))
-                .collect(Collectors.groupingBy(PublishContentDTO::getPublishAccountId,
-                        Collectors.groupingBy(PublishContentDTO::getTitle,
-                                Collectors.toMap(PublishContentDTO::getPublishTimestamp, o -> o,
-                                        (existing, replacement) -> replacement))));
-        List<String> publishContentIds = publishContents.stream().map(PublishContentDTO::getId).collect(Collectors.toList());
-        List<PublishGzhPushContentRelDTO> pushContentRelList = aigcBaseMapper.getPushContentRelByPublishContentIdIn(publishContentIds);
-        Map<String, String> publishPushIdMap = pushContentRelList.stream()
-                .collect(Collectors.toMap(PublishGzhPushContentRelDTO::getPublishContentId,
-                        PublishGzhPushContentRelDTO::getPushId,
-                        (o1, o2) -> o2));
-        List<String> pushIds = pushContentRelList.stream().map(PublishGzhPushContentRelDTO::getPushId).collect(Collectors.toList());
-        List<PublishGzhPushDTO> pushList = aigcBaseMapper.getPushByPushIdIn(pushIds);
-        Map<String, PublishGzhPushDTO> pushDTOMap = pushList.stream()
-                .collect(Collectors.toMap(PublishGzhPushDTO::getPushId, Function.identity()));
+//        List<PublishAccount> publishAccountList = publishAccountRepository.getAllByGhIdIn(ghIds);
+//        Map<String, PublishAccount> publishAccountMap = publishAccountList.stream().collect(Collectors.toMap(PublishAccount::getGhId, o -> o));
+//        // 获取发布内容
+//        List<PublishContentParam> publishContentParamList = list.stream().map(article -> {
+//            PublishContentParam item = new PublishContentParam();
+//            item.setTitle(article.getTitle());
+//            PublishAccount account = publishAccountMap.get(article.getGhId());
+//            if (Objects.nonNull(account)) {
+//                item.setPublishAccountId(account.getId());
+//                return item;
+//            }
+//            return null;
+//        }).filter(Objects::nonNull).collect(Collectors.toList());
+//        List<PublishContentDTO> publishContents = new ArrayList<>();
+//        for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 100)) {
+//            publishContents.addAll(aigcBaseMapper.getPublishContentByTitle(partitions));
+//        }
+//        Map<String, Map<String, Map<Long, PublishContentDTO>>> publishContentMap = publishContents.stream()
+//                .filter(o -> Objects.nonNull(o.getPublishTimestamp()))
+//                .sorted(Comparator.comparingLong(PublishContentDTO::getPublishTimestamp))
+//                .collect(Collectors.groupingBy(PublishContentDTO::getPublishAccountId,
+//                        Collectors.groupingBy(PublishContentDTO::getTitle,
+//                                Collectors.toMap(PublishContentDTO::getPublishTimestamp, o -> o,
+//                                        (existing, replacement) -> replacement))));
+//        List<String> publishContentIds = publishContents.stream().map(PublishContentDTO::getId).collect(Collectors.toList());
+//        List<PublishGzhPushContentRelDTO> pushContentRelList = aigcBaseMapper.getPushContentRelByPublishContentIdIn(publishContentIds);
+//        Map<String, String> publishPushIdMap = pushContentRelList.stream()
+//                .collect(Collectors.toMap(PublishGzhPushContentRelDTO::getPublishContentId,
+//                        PublishGzhPushContentRelDTO::getPushId,
+//                        (o1, o2) -> o2));
+//        List<String> pushIds = pushContentRelList.stream().map(PublishGzhPushContentRelDTO::getPushId).collect(Collectors.toList());
+//        List<PublishGzhPushDTO> pushList = aigcBaseMapper.getPushByPushIdIn(pushIds);
+//        Map<String, PublishGzhPushDTO> pushDTOMap = pushList.stream()
+//                .collect(Collectors.toMap(PublishGzhPushDTO::getPushId, Function.identity()));
         for (ArticleDeleteListVO item : list) {
             PublishAccountTypeDTO accountTypeDTO = accountTypeMap.get(item.getGhId());
             if (Objects.nonNull(accountTypeDTO)) {
                 item.setAccountSourceType(accountTypeDTO.getAccountSourceName());
             }
-            PublishAccount account = publishAccountMap.get(item.getGhId());
-            if (Objects.isNull(account)) {
-                continue;
-            }
-            Map<String, Map<Long, PublishContentDTO>> titleMap = publishContentMap.get(account.getId());
-            if (Objects.isNull(titleMap)) {
-                continue;
-            }
-            Map<Long, PublishContentDTO> publishTimeContentMap = titleMap.get(item.getTitle());
-            if (Objects.isNull(publishTimeContentMap)) {
-                continue;
-            }
-            PublishContentDTO publishContent = null;
-            List<String> hisPublishTimeStrList = publishTimeContentMap.keySet().stream()
-                    .map(o -> DateUtils.timestampToYMDStr(o / 1000, "yyyyMMdd")).collect(Collectors.toList());
-            String publishTime = DateUtils.findNearestDate(hisPublishTimeStrList, item.getDateStr(), "yyyyMMdd");
-            for (Map.Entry<Long, PublishContentDTO> entry : publishTimeContentMap.entrySet()) {
-                String str = DateUtils.timestampToYMDStr(entry.getKey() / 1000, "yyyyMMdd");
-                if (publishTime.equals(str)) {
-                    publishContent = entry.getValue();
-                }
-            }
-            if (Objects.isNull(publishContent)) {
-                continue;
-            }
-            String pushId = publishPushIdMap.get(publishContent.getId());
-            PublishGzhPushDTO pushDTO = pushDTOMap.get(pushId);
-            if (Objects.isNull(pushDTO)) {
-                continue;
-            }
-            item.setPlanType(PushTypeEnum.from(pushDTO.getPushType()).getDescription());
+//            PublishAccount account = publishAccountMap.get(item.getGhId());
+//            if (Objects.isNull(account)) {
+//                continue;
+//            }
+//            Map<String, Map<Long, PublishContentDTO>> titleMap = publishContentMap.get(account.getId());
+//            if (Objects.isNull(titleMap)) {
+//                continue;
+//            }
+//            Map<Long, PublishContentDTO> publishTimeContentMap = titleMap.get(item.getTitle());
+//            if (Objects.isNull(publishTimeContentMap)) {
+//                continue;
+//            }
+//            PublishContentDTO publishContent = null;
+//            List<String> hisPublishTimeStrList = publishTimeContentMap.keySet().stream()
+//                    .map(o -> DateUtils.timestampToYMDStr(o / 1000, "yyyyMMdd")).collect(Collectors.toList());
+//            String publishTime = DateUtils.findNearestDate(hisPublishTimeStrList, item.getDateStr(), "yyyyMMdd");
+//            for (Map.Entry<Long, PublishContentDTO> entry : publishTimeContentMap.entrySet()) {
+//                String str = DateUtils.timestampToYMDStr(entry.getKey() / 1000, "yyyyMMdd");
+//                if (publishTime.equals(str)) {
+//                    publishContent = entry.getValue();
+//                }
+//            }
+//            if (Objects.isNull(publishContent)) {
+//                continue;
+//            }
+//            String pushId = publishPushIdMap.get(publishContent.getId());
+//            PublishGzhPushDTO pushDTO = pushDTOMap.get(pushId);
+//            if (Objects.isNull(pushDTO)) {
+//                continue;
+//            }
+//            item.setPlanType(PushTypeEnum.from(pushDTO.getPushType()).getDescription());
         }
     }
 

+ 1 - 2
long-article-recommend-service/src/main/resources/static/internal/articleDelete.html

@@ -80,7 +80,7 @@
                     <th style="width: 20%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">标题</th>
                     <th style="width: 10%; white-space: nowrap;">账号名称</th>
                     <th style="width: 17%; white-space: nowrap;">账号来源</th>
-                    <th style="width: 10%; white-space: nowrap;">操作计划类型</th>
+<!--                    <th style="width: 10%; white-space: nowrap;">操作计划类型</th>-->
                     <th style="width: 5%; white-space: nowrap;">位置</th>
                     <th style="width: 18%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">链接</th>
                     <th style="width: 10%; white-space: nowrap;">操作</th>
@@ -154,7 +154,6 @@
                         </td>
                         <td>${item.accountName}</td>
                         <td>${item.accountSourceType}</td>
-                        <td>${item.planType}</td>
                         <td>${item.index}</td>
                         <td>
                             <div class="ellipsis-container">