需求背景:目前智能刊登属性问题较多,而部分类目失败率非常高,严重影响成功率,浪费刊登资源,需要针对这类数据暂停刊登一周,待业务修复后继续刊登;根据上周的数据统计,停止这部分类目刊登,仅会减少13万刊登量(上周总刊登成功790万),但是可以节约160万listing提交量用于其他类目刊登。
需求实现:
1.实现一个定时服务,周一0点执行,统计上周站点+末节点维度失败率,将提交量超过100条,失败率超过50%的类目记录下来,写入时需要清理上周数据,查询参考
SELECT a.SiteCode,bb.CategoryNamePath,COUNT(DISTINCT a.OrderSourceSKUID)'提交量',COUNT(DISTINCT case when a.`Status`=2 then a.OrderSourceSKUID else null end) as '刊登成功数量',COUNT(DISTINCT case when a.`Status`=3 and a.ErrorCode not like '%8571%' and a.ErrorCode not LIKE '%8560%' then a.OrderSourceSKUID else null end) as '刊登失败数量',COUNT(DISTINCT case when a.`Status`=2 then a.OrderSourceSKUID else null end)/COUNT(DISTINCT a.OrderSourceSKUID) as '成功率'
from Bi_Aq_AutoPublishUploadProduct a
INNER JOIN Bi_Aq_AutoPublishUploadResult bb ON a.QueueID = bb.QueueID
WHERE a.OrderSourceSKUID>0 and a.AddTime>'2024-03-18' and a.AddTime<'2024-03-25'
GROUP BY a.SiteCode,bb.CategoryNamePath
ORDER BY COUNT(DISTINCT a.OrderSourceSKUID) desc
2.修改刊登服务,在获取到刊登类目时(美国站取平台类目,其他站点取映射类目)之后,判断该类目是否在禁止刊登列表,如果是则禁止刊登。

2.新增定时服务统计 ,修改刊登消费
3.核心代码