|
@@ -4,11 +4,13 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.tzld.piaoquan.growth.common.common.enums.FieshuTableColumnDataTypeEnum;
|
|
|
import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
|
|
|
import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
|
|
|
import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
|
|
|
import com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper;
|
|
|
import com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper;
|
|
|
+import com.tzld.piaoquan.growth.common.model.bo.FeishuTableDTO;
|
|
|
import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
|
|
|
import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
|
|
|
import com.tzld.piaoquan.growth.common.model.po.GhDetail;
|
|
@@ -136,9 +138,9 @@ public class AutoReplyVideoDataJob {
|
|
|
if (CollectionUtils.isEmpty(auditFailedVideoIds)) {
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
- String videoMsg = String.format("审核不通过的视频列表:%s", auditFailedVideoIds);
|
|
|
- System.out.println(videoMsg);
|
|
|
- LarkRobotUtil.sendAutoReplyVideoMessage(videoMsg);
|
|
|
+
|
|
|
+ List<FeishuTableDTO.Column> columns = buildCheckPublishPlanAccountColumns();
|
|
|
+ List<JSONObject> rows = new ArrayList<>();
|
|
|
|
|
|
for (Long videoId : auditFailedVideoIds) {
|
|
|
CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
|
|
@@ -149,9 +151,13 @@ public class AutoReplyVideoDataJob {
|
|
|
for (CgiReplyBucketData cgiReplyBucketData : cgiReplyBucketDataList) {
|
|
|
String ghId = cgiReplyBucketData.getGhId();
|
|
|
GhDetailExample ghDetailExample = new GhDetailExample();
|
|
|
- ghDetailExample.createCriteria().andGhIdEqualTo(ghId).andTypeEqualTo(GhTypeEnum.THIRD_PARTY_GH.type);
|
|
|
+ ghDetailExample.createCriteria().andGhIdEqualTo(ghId);
|
|
|
List<GhDetail> ghDetails = ghDetailMapper.selectByExample(ghDetailExample);
|
|
|
+ if (CollectionUtils.isEmpty(ghDetails)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
GhDetail ghDetail = ghDetails.get(0);
|
|
|
+
|
|
|
// if (Objects.equals(cgiReplyBucketData.getStrategy(), "manual")) {
|
|
|
// ghDetail1.setStrategyStatus(StrategyStatusEnum.STRATEGY.status);
|
|
|
// ghDetailMapper.updateByPrimaryKeySelective(ghDetail1);
|
|
@@ -159,18 +165,49 @@ public class AutoReplyVideoDataJob {
|
|
|
// }
|
|
|
|
|
|
// ghIds.add(cgiReplyBucketData.getGhId());
|
|
|
- String msg = String.format("账号名称:%s \n 渠道id:%s \n 审核不通过的视频id:%s \n ghId:%s",
|
|
|
- ghDetail.getGhName(), ghDetail.getChannel(), videoId, ghDetail.getGhId());
|
|
|
- LarkRobotUtil.sendAutoReplyVideoMessage(msg);
|
|
|
- if (auditGhIds.contains(ghId)) {
|
|
|
- String url = REFRESH_GZH_URL + "?ghId=" + cgiReplyBucketData.getGhId();
|
|
|
- String res = httpPoolClient.get(url);
|
|
|
- log.info("refresh ghId={}, res={}", cgiReplyBucketData.getGhId(), res);
|
|
|
+ JSONObject row = new JSONObject();
|
|
|
+ row.put("name", ghDetail.getGhName());
|
|
|
+ row.put("channel", ghDetail.getChannel());
|
|
|
+ row.put("video", videoId);
|
|
|
+ row.put("ghId", ghDetail.getGhId());
|
|
|
+ rows.add(row);
|
|
|
+ try {
|
|
|
+ if (auditGhIds.contains(ghId)) {
|
|
|
+ String url = REFRESH_GZH_URL + "?ghId=" + cgiReplyBucketData.getGhId();
|
|
|
+ String res = httpPoolClient.get(url);
|
|
|
+ log.info("refresh ghId={}, res={}", cgiReplyBucketData.getGhId(), res);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("refresh error", e);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ FeishuTableDTO tableDTO = FeishuTableDTO.createTable("自动回复视频审核失败报警", columns, rows, false);
|
|
|
+ JSONObject content = JSONObject.parseObject(JSONObject.toJSONString(tableDTO));
|
|
|
+ JSONObject bodyParam = new JSONObject();
|
|
|
+ bodyParam.put("msg_type", "interactive");
|
|
|
+ bodyParam.put("card", content);
|
|
|
+ LarkRobotUtil.sendAutoReplyVideoMessage(bodyParam);
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private List<FeishuTableDTO.Column> buildCheckPublishPlanAccountColumns() {
|
|
|
+ List<FeishuTableDTO.Column> columns = new ArrayList<>();
|
|
|
+ FeishuTableDTO.Column nameColumn = FeishuTableDTO.createFeishuColumns(
|
|
|
+ FieshuTableColumnDataTypeEnum.TEXT.getType(), "name", "账号名称", null);
|
|
|
+ columns.add(nameColumn);
|
|
|
+ FeishuTableDTO.Column channelColumn = FeishuTableDTO.createFeishuColumns(
|
|
|
+ FieshuTableColumnDataTypeEnum.TEXT.getType(), "channel", "渠道id", null);
|
|
|
+ columns.add(channelColumn);
|
|
|
+ FeishuTableDTO.Column videoColumn = FeishuTableDTO.createFeishuColumns(
|
|
|
+ FieshuTableColumnDataTypeEnum.TEXT.getType(), "video", "审核不通过的视频id", null);
|
|
|
+ columns.add(videoColumn);
|
|
|
+ FeishuTableDTO.Column ghIdColumn = FeishuTableDTO.createFeishuColumns(
|
|
|
+ FieshuTableColumnDataTypeEnum.TEXT.getType(), "ghId", "ghId", null);
|
|
|
+ columns.add(ghIdColumn);
|
|
|
+ return columns;
|
|
|
+ }
|
|
|
+
|
|
|
}
|