|
@@ -0,0 +1,42 @@
|
|
|
+package org.jeecg.modules.ctop.job;
|
|
|
+
|
|
|
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportHourlyCreativeStatisticService;
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
|
+import org.quartz.Job;
|
|
|
+import org.quartz.JobExecutionContext;
|
|
|
+import org.quartz.JobExecutionException;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+
|
|
|
+import java.text.ParseException;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 出价预警
|
|
|
+ */
|
|
|
+public class DeleteCreativeStaticJob implements Job {
|
|
|
+ @Autowired
|
|
|
+ private IKuaishouReportHourlyCreativeStatisticService reportHourlyCreativeStatisticService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 定时删除数据
|
|
|
+ *
|
|
|
+ * @param jobExecutionContext
|
|
|
+ * @throws JobExecutionException
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void execute(JobExecutionContext jobExecutionContext) {
|
|
|
+ Thread thread = new Thread() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
+ String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
|
|
|
+ reportHourlyCreativeStatisticService.deleteHourlyReportByStatDate(anotherDay);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ thread.start();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|