|
@@ -365,6 +365,29 @@ public class ContentPlatformDemandVideoJob {
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 滚动清理 content_platform_demand_video 表数据,仅保留最近 14 天(含今天)。
|
|
|
|
|
+ * 即删除 dt < (今天-14) 的所有记录。param 可传 cutoff dt(yyyyMMdd)覆盖默认值,便于回溯/调试。
|
|
|
|
|
+ */
|
|
|
|
|
+ @XxlJob("cleanContentPlatformDemandVideoJob")
|
|
|
|
|
+ public ReturnT<String> cleanContentPlatformDemandVideoJob(String param) {
|
|
|
|
|
+ String cutoffDt;
|
|
|
|
|
+ if (StringUtils.hasText(param)) {
|
|
|
|
|
+ cutoffDt = param;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cutoffDt = DateUtil.getBeforeDayDateString(14, "yyyyMMdd");
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("cleanContentPlatformDemandVideoJob start, cutoffDt={}", cutoffDt);
|
|
|
|
|
+ try {
|
|
|
|
|
+ int rows = demandVideoMapperExt.deleteByDtLessThan(cutoffDt);
|
|
|
|
|
+ log.info("cleanContentPlatformDemandVideoJob success, cutoffDt={}, deletedRows={}", cutoffDt, rows);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("cleanContentPlatformDemandVideoJob error, cutoffDt={}", cutoffDt, e);
|
|
|
|
|
+ return ReturnT.FAIL;
|
|
|
|
|
+ }
|
|
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@XxlJob("checkContentPlatformDemandVideoStatusJob")
|
|
@XxlJob("checkContentPlatformDemandVideoStatusJob")
|
|
|
public ReturnT<String> checkContentPlatformDemandVideoStatusJob(String param) {
|
|
public ReturnT<String> checkContentPlatformDemandVideoStatusJob(String param) {
|
|
|
String dt = demandVideoMapperExt.getMaxDt(null);
|
|
String dt = demandVideoMapperExt.getMaxDt(null);
|