|
@@ -229,16 +229,19 @@ public class ArticleAuditService {
|
|
|
List<PublishGzhPushContentRelDTO> groupPushRelList = aigcBaseMapper.getGroupPushRelByPushIdIn(pushIds);
|
|
|
Map<String, List<PublishGzhPushContentRelDTO>> groupPushRelMap = groupPushRelList.stream()
|
|
|
.collect(Collectors.groupingBy(PublishGzhPushContentRelDTO::getPushId));
|
|
|
+ List<PublishAccountTypeDTO> accountTypeList = aigcBaseMapper.getAccountTypeList();
|
|
|
+ Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
|
|
|
+ .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
|
|
|
// 删除文章
|
|
|
for (String publishContentId : publishContentIds) {
|
|
|
String pushId = publishPushIdMap.get(publishContentId);
|
|
|
if (!StringUtils.hasText(pushId)) {
|
|
|
- deleteFailAlarm(publishContentId, "无推送记录", 0);
|
|
|
+ deleteFailAlarm(publishContentId, "无推送记录", 0, accountTypeMap);
|
|
|
continue;
|
|
|
}
|
|
|
PublishGzhPushDTO publishGzhPushDTO = pushDTOMap.get(pushId);
|
|
|
if (Objects.isNull(publishGzhPushDTO)) {
|
|
|
- deleteFailAlarm(publishContentId, "无推送记录", 0);
|
|
|
+ deleteFailAlarm(publishContentId, "无推送记录", 0, accountTypeMap);
|
|
|
continue;
|
|
|
}
|
|
|
String publishAccountId = pushAccountMap.get(pushId);
|
|
@@ -254,12 +257,12 @@ public class ArticleAuditService {
|
|
|
}
|
|
|
if (!publishGzhPushDTO.getPushType().equals(PushTypeEnum.AUTO_GROUP_PUBLISH.getVal())) {
|
|
|
PushTypeEnum pushTypeEnum = PushTypeEnum.from(publishGzhPushDTO.getPushType());
|
|
|
- deleteFailAlarm(publishContentId, "推送类型为" + pushTypeEnum.getDescription(), index);
|
|
|
+ deleteFailAlarm(publishContentId, "推送类型为" + pushTypeEnum.getDescription(), index, accountTypeMap);
|
|
|
continue;
|
|
|
}
|
|
|
String groupPushMsgId = pushIdMap.get(pushId);
|
|
|
if (!StringUtils.hasText(groupPushMsgId)) {
|
|
|
- deleteFailAlarm(publishContentId, "无推送MsgId", index);
|
|
|
+ deleteFailAlarm(publishContentId, "无推送MsgId", index, accountTypeMap);
|
|
|
continue;
|
|
|
}
|
|
|
LongArticleAuditDelete delete = new LongArticleAuditDelete();
|
|
@@ -281,6 +284,9 @@ public class ArticleAuditService {
|
|
|
@XxlJob("articleVideoDelete")
|
|
|
public ReturnT<String> articleVideoDelete(String param) {
|
|
|
List<LongArticleAuditDelete> dealList = longArticleAuditDeleteRepository.getByStatus(ArticleDeleteStatusEnum.WAITING.getCode());
|
|
|
+ List<PublishAccountTypeDTO> accountTypeList = aigcBaseMapper.getAccountTypeList();
|
|
|
+ Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
|
|
|
+ .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
|
|
|
for (LongArticleAuditDelete delete : dealList) {
|
|
|
try {
|
|
|
if (Objects.equals(delete.getPushType(), PushTypeEnum.AUTO_GROUP_PUBLISH.getVal())) {
|
|
@@ -295,7 +301,7 @@ public class ArticleAuditService {
|
|
|
delete.setFailReason(result.getFailReason());
|
|
|
}
|
|
|
} else {
|
|
|
- deleteFailAlarm(delete.getPublishContentId(), "非自动群发", delete.getIndex());
|
|
|
+ deleteFailAlarm(delete.getPublishContentId(), "非自动群发", delete.getIndex(), accountTypeMap);
|
|
|
delete.setStatus(ArticleDeleteStatusEnum.SUCCESS.getCode());
|
|
|
}
|
|
|
delete.setFinishTimestamp(System.currentTimeMillis());
|
|
@@ -307,19 +313,23 @@ public class ArticleAuditService {
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
- private void deleteFailAlarm(String publishContentId, String typeMsg, Integer index) {
|
|
|
+ private void deleteFailAlarm(String publishContentId, String typeMsg, Integer index,
|
|
|
+ Map<String, PublishAccountTypeDTO> accountTypeMap) {
|
|
|
PublishContentDTO publishContent = aigcBaseMapper.getPublishContentById(publishContentId);
|
|
|
PublishAccount publishAccount = publishAccountRepository.getById(publishContent.getPublishAccountId());
|
|
|
String publishTime = DateUtils.timestampToYMDStr(publishContent.getPublishTimestamp() / 1000, "yyyyMMdd");
|
|
|
+ PublishAccountTypeDTO accountTypeDTO = accountTypeMap.get(publishAccount.getGhId());
|
|
|
+ String accountType = Objects.nonNull(accountTypeDTO) ? accountTypeDTO.getAccountTpe() : "未知";
|
|
|
// 无法自动删除 发送飞书通知 人工删除
|
|
|
FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.ARTICLE_DELETE.getRobotId(),
|
|
|
- "【文章删除失败】\n"
|
|
|
- + "账号名称: " + publishAccount.getName() + "\n"
|
|
|
- + "账号ghId: " + publishAccount.getGhId() + "\n"
|
|
|
- + "发布日期: " + publishTime + "\n"
|
|
|
- + "位置: " + index + "\n"
|
|
|
- + "标题: " + publishContent.getTitle() + "\n"
|
|
|
- + "原因: " + typeMsg);
|
|
|
+ "【文章删除失败】\n" +
|
|
|
+ "账号名称: " + publishAccount.getName() + "\n" +
|
|
|
+ "账号ghId: " + publishAccount.getGhId() + "\n" +
|
|
|
+ "账号来源: " + accountType + "\n" +
|
|
|
+ "发布日期: " + publishTime + "\n" +
|
|
|
+ "位置: " + index + "\n" +
|
|
|
+ "标题: " + publishContent.getTitle() + "\n" +
|
|
|
+ "原因: " + typeMsg);
|
|
|
}
|
|
|
|
|
|
public void titleDangerFindDelete(ArticleDangerFindDeleteParam param) {
|