|
@@ -36,11 +36,13 @@ import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
|
|
|
import com.tzld.piaoquan.longarticle.utils.TimeZoneUtil;
|
|
import com.tzld.piaoquan.longarticle.utils.TimeZoneUtil;
|
|
|
import com.tzld.piaoquan.longarticle.utils.VideoUtils;
|
|
import com.tzld.piaoquan.longarticle.utils.VideoUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.commons.codec.digest.DigestUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -112,6 +114,9 @@ public class CoreServiceImpl implements CoreService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private VectorMatchVideoMapper vectorMatchVideoMapper;
|
|
private VectorMatchVideoMapper vectorMatchVideoMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RedisTemplate<String, Object> redisTemplate;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private DemandProduceContentRelationMapper demandProduceContentRelationMapper;
|
|
private DemandProduceContentRelationMapper demandProduceContentRelationMapper;
|
|
|
|
|
|
|
@@ -1541,15 +1546,19 @@ public class CoreServiceImpl implements CoreService {
|
|
|
&& !pushStatusVO.getErrorMsg().contains("50002")
|
|
&& !pushStatusVO.getErrorMsg().contains("50002")
|
|
|
&& !pushStatusVO.getErrorMsg().contains("61003")
|
|
&& !pushStatusVO.getErrorMsg().contains("61003")
|
|
|
&& !pushStatusVO.getErrorMsg().contains("所有分组均发表失败")) {
|
|
&& !pushStatusVO.getErrorMsg().contains("所有分组均发表失败")) {
|
|
|
- log.error("push error pushId={} msg={}", pushId, pushStatusVO.getErrorMsg());
|
|
|
|
|
- String message = String.format("发布失败,请查看\n" +
|
|
|
|
|
- "账号名称:%s \n" +
|
|
|
|
|
- "计划id:%s \n" +
|
|
|
|
|
- "计划名称:%s \n" +
|
|
|
|
|
- "pushId:%s \n" +
|
|
|
|
|
- "失败信息:%s ",
|
|
|
|
|
- planAccount.getAccountName(), planAccount.getPlanId(), planAccount.getPlanName(), pushId, pushStatusVO.getErrorMsg());
|
|
|
|
|
- LarkRobotUtil.sendMessage(message);
|
|
|
|
|
|
|
+ String alertKey = "push_error_alert:" + planAccount.getPlanId() + ":" + planAccount.getAccountName() + ":" + DigestUtils.md5Hex(pushStatusVO.getErrorMsg());
|
|
|
|
|
+ if (redisTemplate.opsForValue().get(alertKey) == null) {
|
|
|
|
|
+ log.error("push error pushId={} msg={}", pushId, pushStatusVO.getErrorMsg());
|
|
|
|
|
+ String message = String.format("发布失败,请查看\n" +
|
|
|
|
|
+ "账号名称:%s \n" +
|
|
|
|
|
+ "计划id:%s \n" +
|
|
|
|
|
+ "计划名称:%s \n" +
|
|
|
|
|
+ "pushId:%s \n" +
|
|
|
|
|
+ "失败信息:%s ",
|
|
|
|
|
+ planAccount.getAccountName(), planAccount.getPlanId(), planAccount.getPlanName(), pushId, pushStatusVO.getErrorMsg());
|
|
|
|
|
+ LarkRobotUtil.sendMessage(message);
|
|
|
|
|
+ redisTemplate.opsForValue().set(alertKey, "1", 30, TimeUnit.MINUTES);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|