1.调整删除历史数据定时任务

busUser
x_z 3 years ago
parent ff28e87abd
commit 561579ce8c

@ -3,10 +3,9 @@ package com.glxp.sale.admin.thread;
import com.glxp.sale.admin.dao.info.ScheduledDao; import com.glxp.sale.admin.dao.info.ScheduledDao;
import com.glxp.sale.admin.entity.info.ScheduledEntity; import com.glxp.sale.admin.entity.info.ScheduledEntity;
import com.glxp.sale.admin.req.udid.ScheduledRequest; import com.glxp.sale.admin.req.udid.ScheduledRequest;
import com.glxp.sale.admin.service.basic.impl.BasicDownloadServiceImpl; import com.glxp.sale.admin.service.basic.BasicDownloadService;
import com.glxp.sale.admin.service.basic.impl.BasicExportServiceImpl; import com.glxp.sale.admin.service.basic.BasicExportService;
import com.glxp.sale.admin.service.thrsys.*;
import com.glxp.sale.admin.service.thrsys.impl.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer; import org.springframework.scheduling.annotation.SchedulingConfigurer;
@ -27,31 +26,31 @@ public class CleanDataTask implements SchedulingConfigurer {
@Resource @Resource
private ScheduledDao scheduledDao; private ScheduledDao scheduledDao;
@Resource @Resource
private BasicExportServiceImpl basicExportServiceImpl; private BasicExportService basicExportService;
@Resource @Resource
private BasicDownloadServiceImpl basicDownloadServiceImpl; private BasicDownloadService basicDownloadService;
@Resource @Resource
private ThrCorpExportLogServiceImpl thrCorpExportLogServiceImpl; private ThrCorpExportLogService thrCorpExportLogService;
@Resource @Resource
private ThrCorpImportDetailServiceImpl thrCorpImportDetailServiceImpl; private ThrCorpImportDetailService thrCorpImportDetailService;
@Resource @Resource
private ThrCorpImportLogServiceImpl thrCorpImportLogServiceImpl; private ThrCorpImportLogService thrCorpImportLogService;
@Resource @Resource
private ThrImportLogServiceImpl thrImportLogServiceImpl; private ThrImportLogService thrImportLogService;
@Resource @Resource
private ThrOrderDetailServiceImpl thrOrderDetailServiceImpl; private ThrOrderDetailService thrOrderDetailService;
@Resource @Resource
private ThrOrderExportLogServiceImpl thrOrderExportLogServiceImpl; private ThrOrderExportLogService thrOrderExportLogService;
@Resource @Resource
private ThrOrderImportDetailServiceImpl thrOrderImportDetailServiceImpl; private ThrOrderImportDetailService thrOrderImportDetailService;
@Resource @Resource
private ThrOrderImportLogServiceImpl thrOrderImportLogServiceImpl; private ThrOrderImportLogService thrOrderImportLogService;
@Resource @Resource
private ThrProductsImportLogServiceImpl thrProductsImportLogServiceImpl; private ThrProductsImportLogService thrProductsImportLogService;
@Resource @Resource
private ThrProductsExportLogServiceImpl thrProductsExportLogServiceImpl; private ThrProductsExportLogService thrProductsExportLogService;
@Resource @Resource
private ThrProductsImportDetailServiceImpl thrProductsImportDetailServiceImpl; private ThrProductsImportDetailService thrProductsImportDetailService;
@Override @Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
@ -72,23 +71,23 @@ public class CleanDataTask implements SchedulingConfigurer {
log.info("开始清理 30 天前的历史数据"); log.info("开始清理 30 天前的历史数据");
//删除同步任务 //删除同步任务
log.info("开始删除同步任务历史记录"); log.info("开始删除同步任务历史记录");
basicExportServiceImpl.deleteByTime(); basicExportService.deleteByTime();
//删除下载记录 //删除下载记录
log.info("开始删除下载记录"); log.info("开始删除下载记录");
basicDownloadServiceImpl.deleteByTime(); basicDownloadService.deleteByTime();
//删除第三方数据 //删除第三方数据
log.info("开始删除第三方数据"); log.info("开始删除第三方数据");
thrCorpExportLogServiceImpl.deleteByTime(); thrCorpExportLogService.deleteByTime();
thrCorpImportDetailServiceImpl.deleteByTime(); thrCorpImportDetailService.deleteByTime();
thrCorpImportLogServiceImpl.deleteByTime(); thrCorpImportLogService.deleteByTime();
thrImportLogServiceImpl.deleteByTime(); thrImportLogService.deleteByTime();
thrOrderDetailServiceImpl.deleteByTime(); thrOrderDetailService.deleteByTime();
thrOrderExportLogServiceImpl.deleteByTime(); thrOrderExportLogService.deleteByTime();
thrOrderImportDetailServiceImpl.deleteByTime(); thrOrderImportDetailService.deleteByTime();
thrOrderImportLogServiceImpl.deleteByTime(); thrOrderImportLogService.deleteByTime();
thrProductsImportLogServiceImpl.deleteByTime(); thrProductsImportLogService.deleteByTime();
thrProductsExportLogServiceImpl.deleteByTime(); thrProductsExportLogService.deleteByTime();
thrProductsImportDetailServiceImpl.deleteByTime(); thrProductsImportDetailService.deleteByTime();
log.info("历史数据清理完成"); log.info("历史数据清理完成");
} }

@ -6,11 +6,11 @@ CALL Pro_Temp_ColumnWork ('io_order','wzUploadResult','varchar(255) ', 1);
CALL Pro_Temp_ColumnWork ('stock_order','noInvOut','tinyint', 1); CALL Pro_Temp_ColumnWork ('stock_order','noInvOut','tinyint', 1);
INSERT ignore INTO spms.scheduled(id, cronName, cron, customerId, remark) INSERT ignore INTO scheduled(id, cronName, cron, customerId, remark)
VALUES VALUES
(16, 'ScheduledDeletion', '0 0 2 1/1 * ? ', NULL, '删除30天数据'); (16, 'ScheduledDeletion', '0 0 2 1/1 * ? ', NULL, '删除30天数据');
INSERT ignore INTO spms.system_param_config ( id, parentId, paramName, paramKey, paramValue, paramStatus, paramType, paramExplain ) INSERT ignore INTO system_param_config ( id, parentId, paramName, paramKey, paramValue, paramStatus, paramType, paramExplain )
VALUES VALUES
( 20009, 0, '删除30天数据', 'ScheduledDeletion', '1', 1, 0, '1:是0' ); ( 20009, 0, '删除30天数据', 'ScheduledDeletion', '1', 1, 0, '1:是0' );

Loading…
Cancel
Save