Ver Fonte

task修改

lengfaqiang há 2 anos atrás
pai
commit
4e521e1f98

+ 5 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/Task/ReportTemplateTaskService.java

@@ -1,8 +1,9 @@
-package com.sckw.slope.detection.service.Task;
+package com.sckw.slope.detection.service.task;
 
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.sckw.core.model.enums.ReportTypeEnum;
+import com.sckw.core.utils.StringUtils;
 import com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper;
 import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
 import jakarta.annotation.Resource;
@@ -43,6 +44,9 @@ public class ReportTemplateTaskService {
                     LocalDateTime localDateTime = LocalDateTime.now().minusDays(1);
                     LocalDateTime dateEnd = com.sckw.excel.utils.DateUtil.localDateToLocalDateTimeEnd(localDateTime.toLocalDate());
                     LocalDateTime dateStart = com.sckw.excel.utils.DateUtil.localDateToLocalDateTimeStart(localDateTime.toLocalDate());
+                    String partNames = kwsReportTemplate.getPartNames();
+                    String intergrationNames = kwsReportTemplate.getIntergrationNames();
+                    List<String> stringList = StringUtils.splitStrToList(partNames, String.class);
 
                 }
                 if (ReportTypeEnum.WEEK.getCode() == type) {

+ 0 - 64
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/task/ReportTemplateTaskService.java

@@ -1,64 +0,0 @@
-package com.sckw.slope.detection.service.task;
-
-import cn.hutool.core.date.DateUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.sckw.core.model.enums.ReportTypeEnum;
-import com.sckw.core.utils.StringUtils;
-import com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper;
-import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
-import jakarta.annotation.Resource;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.stereotype.Component;
-import org.springframework.util.CollectionUtils;
-
-import java.time.LocalDateTime;
-import java.util.List;
-
-/**
- * @author lfdc
- * @description 报表任务
- * @date 2023-11-10 11:11:25
- */
-
-@Slf4j
-@Component
-@EnableScheduling
-public class ReportTemplateTaskService {
-
-    @Resource
-    KwsReportTemplateMapper reportTemplateMapper;
-
-    /**
-     * 报表生成定时任务
-     */
-    //    @Scheduled(cron = "0 0 0 ? * *")
-    public void templateTask() {
-        List<KwsReportTemplate> kwsReportTemplates = reportTemplateMapper.selectList(new LambdaQueryWrapper<KwsReportTemplate>()
-                .eq(KwsReportTemplate::getStatus, 0)
-                .eq(KwsReportTemplate::getDelFlag, 0));
-        if (!CollectionUtils.isEmpty(kwsReportTemplates)) {
-            for (KwsReportTemplate kwsReportTemplate : kwsReportTemplates) {
-                Integer type = kwsReportTemplate.getType();
-                if (ReportTypeEnum.DAY.getCode() == type) {
-                    LocalDateTime localDateTime = LocalDateTime.now().minusDays(1);
-                    LocalDateTime dateEnd = com.sckw.excel.utils.DateUtil.localDateToLocalDateTimeEnd(localDateTime.toLocalDate());
-                    LocalDateTime dateStart = com.sckw.excel.utils.DateUtil.localDateToLocalDateTimeStart(localDateTime.toLocalDate());
-                    String partNames = kwsReportTemplate.getPartNames();
-                    String intergrationNames = kwsReportTemplate.getIntergrationNames();
-                    List<String> stringList = StringUtils.splitStrToList(partNames, String.class);
-
-                }
-                if (ReportTypeEnum.WEEK.getCode() == type) {
-                    if (2 != DateUtil.thisDayOfWeekEnum().getValue()) {
-                        continue;
-                    }
-                }
-                if (ReportTypeEnum.MONTH.getCode() == type) {
-
-                }
-            }
-        }
-
-    }
-}