提交 325ab8a6 authored 作者: ljj's avatar ljj

feat(screen): 新增自核查展示

上级 f0458619
...@@ -2,6 +2,7 @@ package com.tykj.dev.device.confirmcheck; ...@@ -2,6 +2,7 @@ package com.tykj.dev.device.confirmcheck;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/** /**
* ConfirmCheckApp. * ConfirmCheckApp.
...@@ -11,6 +12,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -11,6 +12,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*/ */
@SpringBootApplication(scanBasePackages = {"com.tykj.dev.*"} @SpringBootApplication(scanBasePackages = {"com.tykj.dev.*"}
) )
@EnableScheduling
public class ConfirmCheckApp { public class ConfirmCheckApp {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ConfirmCheckApp.class, args); SpringApplication.run(ConfirmCheckApp.class, args);
......
...@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.*; import java.util.*;
...@@ -85,4 +86,7 @@ public class ConfirmCheckTask implements CommandLineRunner { ...@@ -85,4 +86,7 @@ public class ConfirmCheckTask implements CommandLineRunner {
hisNotInLib.put(deviceCheckDetail.getId(), devNotInLibrary); hisNotInLib.put(deviceCheckDetail.getId(), devNotInLibrary);
} }
} }
} }
...@@ -128,8 +128,8 @@ public class CheckMapTask implements CommandLineRunner { ...@@ -128,8 +128,8 @@ public class CheckMapTask implements CommandLineRunner {
public Map<Integer, List<CheckUnitInfo>> init() { public Map<Integer, List<CheckUnitInfo>> init() {
List<CheckUnitInfo> checkUnitInfos = checkScreenService.statMapData(); List<CheckUnitInfo> checkUnitInfos = checkScreenService.statMapData();
List<CheckUnitInfo> selfExamination = selfCheckBillService.selectNoFinSh2Weeks(); // List<CheckUnitInfo> selfExamination = selfCheckBillService.selectNoFinSh2Weeks();
checkUnitInfos.addAll(selfExamination); // checkUnitInfos.addAll(selfExamination);
collect = checkUnitInfos.stream().collect(Collectors.groupingBy(CheckUnitInfo::getUnitId)); collect = checkUnitInfos.stream().collect(Collectors.groupingBy(CheckUnitInfo::getUnitId));
return collect; return collect;
} }
...@@ -150,12 +150,14 @@ public class CheckMapTask implements CommandLineRunner { ...@@ -150,12 +150,14 @@ public class CheckMapTask implements CommandLineRunner {
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
initShi(); initShi();
}
public void initAll() {
init(); init();
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
log.info("开始计算数据", System.currentTimeMillis() - startTime); log.info("开始计算数据", System.currentTimeMillis() - startTime);
initArea(); initArea();
log.info("计算数据,用时:{}ms", System.currentTimeMillis() - startTime); log.info("计算数据,用时:{}ms", System.currentTimeMillis() - startTime);
log.info("打印{}",rs.toString()); log.info("打印{}",rs.toString());
} }
} }
package com.tykj.dev.device.screen.subject.task;
import com.tykj.dev.device.screen.subject.service.CheckMapTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* @AUTHOR: cnljj1995@gmail.com
* @DATE: 2022/11/28
*/
@Slf4j
@Component
public class CheckScreenTask {
@Autowired
private CheckMapTask checkMapTask;
@Scheduled(cron = "* 15 * * * ? ")
public void checkMap() {
long startTime = System.currentTimeMillis();
log.info("大屏自核查定时任务开始");
checkMapTask.initAll();
log.info("大屏自核查定时任务完成,用时:{}", System.currentTimeMillis() - startTime);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论