|
@@ -26,6 +26,7 @@ import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseM
|
|
|
import com.tzld.longarticle.recommend.server.model.cgi.AlgFaceRecognizeResult;
|
|
|
import com.tzld.longarticle.recommend.server.model.cgi.PQVideoAuditResult;
|
|
|
import com.tzld.longarticle.recommend.server.model.dto.*;
|
|
|
+import com.tzld.longarticle.recommend.server.model.dto.aigc.PublishAccountRemarkDTO;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
|
|
@@ -762,76 +763,11 @@ public class ArticleAuditService {
|
|
|
List<PublishAccountTypeDTO> accountTypeList = publishContentMapper.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()));
|
|
|
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());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -877,8 +813,11 @@ public class ArticleAuditService {
|
|
|
Map<String, String> pushAccountMap = pushList.stream()
|
|
|
.collect(Collectors.toMap(PublishGzhPushDTO::getPushId, PublishGzhPushDTO::getPublishAccountId));
|
|
|
List<PublishAccount> publishAccountList = publishAccountRepository.getByIdIn(publishAccountIds);
|
|
|
- Map<String, String> publishAccountMap = publishAccountList.stream()
|
|
|
- .collect(Collectors.toMap(PublishAccount::getId, PublishAccount::getGhId));
|
|
|
+ Map<String, PublishAccount> publishAccountMap = publishAccountList.stream()
|
|
|
+ .collect(Collectors.toMap(PublishAccount::getId, Function.identity()));
|
|
|
+ List<PublishAccountRemarkDTO> publishAccountRemarkDTOList = publishContentMapper.getPublishAccountRemarkList(publishAccountIds);
|
|
|
+ Map<String, List<PublishAccountRemarkDTO>> publishAccountRemarkMap = publishAccountRemarkDTOList.stream()
|
|
|
+ .collect(Collectors.groupingBy(PublishAccountRemarkDTO::getPublishAccountId));
|
|
|
List<PublishGzhPushContentRelDTO> groupPushRelList = publishContentMapper.getGroupPushRelByPushIdIn(pushIds);
|
|
|
List<String> publishContentIds = groupPushRelList.stream().map(PublishGzhPushContentRelDTO::getPublishContentId)
|
|
|
.collect(Collectors.toList());
|
|
@@ -890,10 +829,23 @@ public class ArticleAuditService {
|
|
|
List<LongArticleAuditDelete> deleteList = new ArrayList<>();
|
|
|
String groupPushMsgId = pushIdMap.get(push.getPushId());
|
|
|
String publishAccountId = pushAccountMap.get(push.getPushId());
|
|
|
- String ghId = publishAccountMap.get(publishAccountId);
|
|
|
- if (notDeleteArticleAccountGhIds.contains(ghId)) {
|
|
|
+ PublishAccount publishAccount = publishAccountMap.get(publishAccountId);
|
|
|
+ if (notDeleteArticleAccountGhIds.contains(publishAccount.getGhId())) {
|
|
|
continue;
|
|
|
}
|
|
|
+ List<PublishAccountRemarkDTO> remarkList = publishAccountRemarkMap.get(publishAccountId);
|
|
|
+ if (CollectionUtils.isNotEmpty(remarkList)) {
|
|
|
+ boolean isFwh = false;
|
|
|
+ for (PublishAccountRemarkDTO remark : remarkList) {
|
|
|
+ if (remark.getRemark().contains("服务号")) {
|
|
|
+ isFwh = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isFwh) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
List<PublishGzhPushContentRelDTO> relList = groupPushRelMap.get(push.getPushId()).stream()
|
|
|
.sorted(Comparator.comparing(PublishGzhPushContentRelDTO::getId)).collect(Collectors.toList());
|
|
|
Map<String, Integer> articleIndexMap = new HashMap<>();
|
|
@@ -905,7 +857,7 @@ public class ArticleAuditService {
|
|
|
continue;
|
|
|
}
|
|
|
LongArticleAuditDelete delete = new LongArticleAuditDelete();
|
|
|
- delete.setGhId(ghId);
|
|
|
+ delete.setGhId(publishAccount.getGhId());
|
|
|
delete.setMsgId(groupPushMsgId);
|
|
|
delete.setPushId(push.getPushId());
|
|
|
delete.setPushType(push.getPushType());
|