|
|
@@ -8,9 +8,12 @@ import com.sckw.core.utils.IdWorker;
|
|
|
import com.sckw.excel.annotation.ExcelContext;
|
|
|
import com.sckw.excel.utils.ExcelUtil;
|
|
|
import com.sckw.slope.detection.dao.mysql.KwsDeviceIntegrationMapper;
|
|
|
+import com.sckw.slope.detection.dao.mysql.KwsProjectMapper;
|
|
|
import com.sckw.slope.detection.dao.mysql.KwsReportDataMapper;
|
|
|
import com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper;
|
|
|
import com.sckw.slope.detection.dao.tdengine.SlopeDataMapper;
|
|
|
+import com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference;
|
|
|
+import com.sckw.slope.detection.model.dos.mysql.KwsProject;
|
|
|
import com.sckw.slope.detection.model.dos.mysql.KwsReportData;
|
|
|
import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
|
|
|
import com.sckw.slope.detection.model.dos.tdengine.SlopeData;
|
|
|
@@ -22,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
@@ -63,6 +67,9 @@ public class ReportTemplateTaskService {
|
|
|
@Autowired
|
|
|
KwsDeviceIntegrationMapper deviceIntegrationMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ KwsProjectMapper kwsProjectMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
CommonService commonService;
|
|
|
|
|
|
@@ -72,7 +79,7 @@ public class ReportTemplateTaskService {
|
|
|
String[] part = kwsReportTemplate.getPartNames().split(",");
|
|
|
String[] intergrationName = kwsReportTemplate.getIntergrationNames().split(",");
|
|
|
|
|
|
- List<String> intergration = DictItemEnum.getAll();//获取系统中的全部基础要素
|
|
|
+ //List<Map<String,String>> intergration = DictItemEnum.getAll();//获取系统中的全部基础要素
|
|
|
List<String> list = new ArrayList<>();
|
|
|
list.addAll(Arrays.asList(title));
|
|
|
list.addAll(Arrays.asList(part));
|
|
|
@@ -138,7 +145,11 @@ public class ReportTemplateTaskService {
|
|
|
report.setMountainId(kwsReportTemplate.getCompanyId());
|
|
|
report.setCompanyId(kwsReportTemplate.getCompanyId());
|
|
|
report.setTemplateId(kwsReportTemplate.getId());
|
|
|
+ KwsProject project = kwsProjectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
|
|
|
+ .eq(KwsProject::getId, kwsReportTemplate.getProjectId())
|
|
|
+ );
|
|
|
report.setProjectId(Long.parseLong(kwsReportTemplate.getProjectId()));
|
|
|
+ report.setProjectName(project.getName());
|
|
|
report.setFileSize(new BigDecimal(fileSize));
|
|
|
report.setFileUrl(filePath);
|
|
|
report.setId(id);
|
|
|
@@ -151,7 +162,7 @@ public class ReportTemplateTaskService {
|
|
|
/**
|
|
|
* 报表生成定时任务-天
|
|
|
*/
|
|
|
- //@Scheduled(cron = "* * * * * *")
|
|
|
+ @Scheduled(cron = "0 0 * * * *")
|
|
|
public void templateTaskDay() throws IOException, NoSuchAlgorithmException {
|
|
|
List<KwsReportTemplate> kwsReportTemplates = reportTemplateMapper.selectList(new LambdaQueryWrapper<KwsReportTemplate>()
|
|
|
.eq(KwsReportTemplate::getStatus, 0)
|